-$Id: CHANGELOG.email,v 1.1 1996/09/03 14:06:37 adam Exp $
+$Id: CHANGELOG.email,v 1.2 2001/02/26 14:32:36 adam Exp $
09/03/96 Release: 1.0.
---------------------------------------------------------------------
+
+02/26/01 Updated gateway for YAZ version 1.7.
-$Id: CHANGELOG.web,v 1.6 1997/12/15 15:05:14 adam Exp $
+$Id: CHANGELOG.web,v 1.7 2001/02/26 14:32:36 adam Exp $
09/03/96 Release: 1.0.
---------------------------------------------------------------------
12/15/97 Limit of form variables set to 4K instead of 512 bytes, and the
code truncates larger buffers.
+
+02/26/01 Updated for YAZ version 1.7.
# Top level Makefile for the Email - Z39.50 gateway
# Europagate, 1995-1996.
#
-# $Id: Makefile.email,v 1.7 1997/02/19 16:47:03 adam Exp $
+# $Id: Makefile.email,v 1.8 2001/02/26 14:32:36 adam Exp $
#
SHELL=/bin/sh
MAKE=make
#CC=cc
CPP=$(CC) -E
-VERSION=1.1
+VERSION=1.2
# Email gateway settings --------------------------------------
# If you are using YAZ uncomment these lines
ZACC=zlayer-yaz
ZINC=-I../../yaz/include
-ZLIB=../../yaz/lib/libyaz.a
+ZLIB=../../yaz/lib/.libs/libyaz.a
ZDEFS=
# If you are using Zdist uncomment these lines
cd tmp/email-z39-$(VERSION)/doc; rm web.sgml; make egate
cd tmp; tar zcf ../email-z39-$(VERSION).tar.gz email-z39-$(VERSION)
rm -fr tmp
-
+
# Top level Makefile for the Web - Z39.50 gateway
# Europagate, 1995-1996.
#
-# $Id: Makefile.web,v 1.9 2001/02/26 10:35:39 adam Exp $
+# $Id: Makefile.web,v 1.10 2001/02/26 14:32:36 adam Exp $
#
SHELL=/bin/sh
MAKE=make
#CC=cc
CPP=$(CC) -E
-VERSION=1.1
+VERSION=1.2
# Install directories
-HTTPDDIR=/var/lib/httpd
+HTTPDDIR=/home/adam/proj/apache
CGIDIR=$(HTTPDDIR)/cgi-bin
HTDOCS=$(HTTPDDIR)/htdocs
EGWDIR=$(HTTPDDIR)/egw
GIFDIR=$(HTDOCS)/egwgif
-EGWUSER=nobody
+EGWUSER=adam
# Location of Tcl
TCLLIB=-ltcl8.3 -lm
cd tmp/web-z39-$(VERSION)/doc; rm egate.sgml; make web
cd tmp; tar zcf ../web-z39-$(VERSION).tar.gz web-z39-$(VERSION)
rm -fr tmp
-
-# $Id: Makefile,v 1.5 1996/08/28 08:23:26 adam Exp $
+# $Id: Makefile,v 1.6 2001/02/26 14:32:36 adam Exp $
all: egate.ps egate.txt egate.html
egate: egate.txt egate.ps egate.html
sgml2txt egate.sgml
egate.dvi: egate.sgml
- sgml2ps -d egate.sgml
+ sgml2latex egate
-egate.ps: egate.sgml
- sgml2ps egate.sgml
+egate.ps: egate.dvi
+ dvips -t a4 egate -o egate.ps
egate.html: egate.sgml
sgml2html egate.sgml
sgml2txt web.sgml
web.dvi: web.sgml
- sgml2ps -d web.sgml
+ sgml2latex web.sgml
web.ps: web.sgml
- sgml2ps web.sgml
+ dvips -t a4 web -o web.ps
web.html: web.sgml
sgml2html web.sgml
<!doctype linuxdoc system>
<!--
- $Id: egate.sgml,v 1.13 1996/08/28 09:35:53 adam Exp $
+ $Id: egate.sgml,v 1.14 2001/02/26 14:32:36 adam Exp $
-->
<article>
<title>Email - Z39.50 gateway guide
<author>Europagate, 1996 <htmlurl url="http://europagate.dtv.dk"
name="http://europagate.dtv.dk">
-<date>$Revision: 1.13 $
+<date>$Revision: 1.14 $
<abstract>
This document describes a Email server that provides access to the
Z39.50 protocol.
YAZ can be found at the FTP host:
-<htmlurl url="ftp://ftp.indexdata.dk/index/yaz"
- name="ftp://ftp.indexdata.dk/index/yaz">
+<htmlurl url="ftp://ftp.indexdata.dk/pub/yaz/"
+ name="ftp://ftp.indexdata.dk/pub/yaz/">
The ES also uses GNU's regex package to parse regular expressions.
The ES has been tested with regex-0.12. Some systems, such as Linux,
as the ES user and edit <tt/aliases/ used by your mail system (usually
<tt>usr/lib/aliases</tt>). Now add the following line:
-<tt>es:"|/usr/local/lib/es/eti </tt><em>options</em><tt>"</tt>
+<tt>es:"|/usr/local/lib/emailgw/eti </tt><em>options</em><tt>"</tt>
In this example the mail user name is <tt/es/ and the EMAILLIBDIR is
-<tt>/usr/local/lib/es</tt>.
+<tt>/usr/local/lib/emailgw</tt>.
The ES system can operate with or without the monitor. When using
the monitor the number of simultanous running kernels can be
might be put in a boot script:
<tscreen><verb>
-(cd /usr/local/lib/es; ./monitor -d -l mon.log -- -d -l kernel.log &)
+(cd /usr/local/lib/emailgw; ./monitor -d -l mon.log -- -d -l kernel.log &)
</verb></tscreen>
Here the monitor is started with the options <tt>-d -l mon.log</tt>
the kernel), so the following might be put in the aliases file:
<tscreen><verb>
-es:"|/usr/local/lib/es/eti -c /usr/local/lib/es"
+es:"|/usr/local/lib/emailgw/eti -c /usr/local/lib/emailgw"
</verb></tscreen>
The eti sets current directory to the path specified by option <tt>-c</tt>.
be put in your aliases file:
<tscreen><verb>
-es:"|/usr/local/lib/es/eti -c /usr/local/lib/es -- -d -l kernel.log"
+es:"|/usr/local/lib/emailgw/eti -c /usr/local/lib/emailgw -- -d -l kernel.log"
</verb></tscreen>
<sect1>eti
<!doctype linuxdoc system>
<!--
- $Id: web.sgml,v 1.5 1997/02/19 16:47:07 adam Exp $
+ $Id: web.sgml,v 1.6 2001/02/26 14:32:36 adam Exp $
-->
<article>
<title>Web/Z39.50 gateway guide
<author>Europagate, 1996 <htmlurl url="http://europagate.dtv.dk"
name="http://europagate.dtv.dk">
-<date>$Revision: 1.5 $
+<date>$Revision: 1.6 $
<abstract>
This document describes a Web server that provides access to the
Z39.50 protocol.
YAZ and IrTcl can be found at the FTP host:
-<htmlurl url="ftp://ftp.indexdata.dk/index/yaz"
- name="ftp://ftp.indexdata.dk/index/yaz">
+<htmlurl url="ftp://ftp.indexdata.dk/pub/yaz/"
+ name="ftp://ftp.indexdata.dk/pub/yaz/">
+
+or via HTTP at:
+
+<htmlurl url="http://ftp.indexdata.dk/pub/yaz/"
+ name="http://ftp.indexdata.dk/pub/yaz/">
You also need the Tcl package which can be found at:
<htmlurl url="ftp://ftp.sunlabs.com/pub/tcl"
- name="ftp://ftp.sunlabs.com/pub/tcl">
+ name="http://dev.scriptics.com/">
Unpack <tt>web-z39-...tar.gz</tt> and edit the top level
<tt/Makefile/. Specify where the YAZ package can be found by setting
* FML interpreter. Europagate, 1995
*
* $Log: fmlmarc.c,v $
+ * Revision 1.7 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.6 1995/05/16 09:39:33 adam
* LICENSE.
*
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <fmlmarc.h>
#include <iso2709.h>
* FML interpreter. Europagate, 1995
*
* $Log: fmlstr.c,v $
+ * Revision 1.8 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.7 1995/05/16 09:39:34 adam
* LICENSE.
*
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "fmlp.h"
* FML interpreter. Europagate, 1995
*
* $Log: fmlsym.c,v $
+ * Revision 1.6 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.5 1995/05/16 09:39:34 adam
* LICENSE.
*
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
+#include <string.h>
#include "fmlp.h"
* Europagate, 1995
*
* $Log: zaccess.h,v $
+ * Revision 1.14 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.13 1995/05/16 09:39:40 adam
* LICENSE.
*
{
ZASS_REC_UNKNOWN=-1,
ZASS_REC_DIAG=0,
- ZASS_REC_USMARC=10
+ ZASS_REC_USMARC=10,
+ ZASS_REC_DANMARC=11
} which; /* 0 = diagnostic, others according to z3950v3 */
char *record; /* marc or other */
--- /dev/null
+# Email gateway - resource for a specific target
+# $Id: bagel.res,v 1.1 2001/02/26 14:32:36 adam Exp $
+gw.portno: 210
+gw.hostname: bagel.indexdata.dk
+gw.description: Index Data Z39.50 server
+gw.databases: gils marc
+
# Email gateway - general kernel resources
-# $Id: default.res,v 1.31 1996/02/12 10:04:51 adam Exp $
+# $Id: default.res,v 1.32 2001/02/26 14:32:36 adam Exp $
#
# Important directories, programs, etc.
gw.reply.mta: /usr/lib/sendmail
gw.bibset: default.bib
gw.target.loc: loc.res
gw.target.drewdb: drewdb.res
-gw.target.dimitris: dimitris.res
-gw.target.danbib: dimitris.res
+gw.target.bagel: bagel.res
gw.databases:
# Language definitions
+++ /dev/null
-# Email gateway - resource for a specific target
-# $Id: dimitris.res,v 1.1 1995/04/19 16:03:24 adam Exp $
-gw.portno: 210
-gw.hostname: dagwood.ucd.ie
-gw.account: <<denmark>>
-gw.description: Z39.50/SR Gateway to Danbib
-gw.databases: danbib
-
# Subset of bib-1 attributes map to CCL qualifiers for a target
-# $Id: loc.bib,v 1.4 1995/02/23 08:32:16 adam Exp $
+# $Id: loc.bib,v 1.5 2001/02/26 14:32:36 adam Exp $
#
-term s=pw
+term s=pw u=1016
au u=1 s=pw
pn u=1 s=pw
cn u=2 s=pw
# Email gateway - resource for a specific target
-# $Id: loc.res,v 1.4 1995/02/23 08:32:17 adam Exp $
+# $Id: loc.res,v 1.5 2001/02/26 14:32:36 adam Exp $
# See p. 40-43 in Europagate, Background Study, Part II
-gw.portno: 210
-gw.hostname: IBM2.LOC.gov
+gw.portno: 7090
+gw.hostname: z3950.loc.gov
gw.description: LC Z39.50 Test Server Information, Library of Congress
gw.bibset: loc.bib
-gw.databases: BOOKS NAMES
+gw.databases: voyager
* Europagate, 1995
*
* $Log: main.c,v $
+ * Revision 1.31 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.30 1996/02/12 10:04:54 adam
* The gateway doesn't try to reconnect if it is already known that
* it will fail (connect_fail flag introduced).
#include <strqueue.h>
#include "kernel.h"
-FILE *reply_fd = stdout;
+FILE *reply_fd;
struct gw_kernel_info info;
int persist_flag;
int stop_flag = 0;
+ reply_fd = stdout;
+
persist_flag = gw_res_bool (info.kernel_res, "gw.persist", 0);
timeout = gw_res_int (info.kernel_res, "gw.timeout", 600);
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "event loop");
* Europagate, 1995
*
* $Log: urp.c,v $
+ * Revision 1.51 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.50 1996/03/01 16:09:30 adam
* New setting: gw.msg.replyto that sets Reply-To in user response.
*
continue;
}
}
- if (record_log_fd != -1)
- write (record_log_fd, pp->record, strlen(pp->record));
- rec = iso2709_cvt (pp->record);
- if (rec)
- {
+ if (pp->record)
+ {
+ if (record_log_fd != -1)
+ write (record_log_fd, pp->record, strlen(pp->record));
+ rec = iso2709_cvt (pp->record);
+ if (rec)
+ {
#if USE_FML
- strcpy (format_str,
- gw_res_get (info.kernel_res,
- "gw.display.format", ""));
- if (format_token)
- {
- len = format_token->len;
- if (len >= sizeof(format_str))
- len = sizeof(format_str)-1;
- memcpy (format_str, format_token->name, len);
- format_str[len] = '\0';
- }
- if (info.fml && *format_str &&
- (!strcmp (format_str, "0") || !strcmp (format_str, "1")
- || !strcmp(format_str, "2")))
- {
- arg_ar[0] = "\\f";
- arg_ar[1] = format_str;
- arg_ar[2] = " \\list";
- arg_ar[3] = marc_to_str (info.fml, rec);
- arg_ar[4] = NULL;
- fml_exec_call_argv (info.fml, arg_ar);
- }
- else
- iso2709_display (rec, reply_fd);
+ strcpy (format_str,
+ gw_res_get (info.kernel_res,
+ "gw.display.format", ""));
+ if (format_token)
+ {
+ len = format_token->len;
+ if (len >= sizeof(format_str))
+ len = sizeof(format_str)-1;
+ memcpy (format_str, format_token->name, len);
+ format_str[len] = '\0';
+ }
+ if (info.fml && *format_str &&
+ (!strcmp (format_str, "0") || !strcmp (format_str, "1")
+ || !strcmp(format_str, "2")))
+ {
+ arg_ar[0] = "\\f";
+ arg_ar[1] = format_str;
+ arg_ar[2] = " \\list";
+ arg_ar[3] = marc_to_str (info.fml, rec);
+ arg_ar[4] = NULL;
+ fml_exec_call_argv (info.fml, arg_ar);
+ }
+ else
+ iso2709_display (rec, reply_fd);
#else
- iso2709_display (rec, reply_fd);
+ iso2709_display (rec, reply_fd);
#endif
- iso2709_rm (rec);
+ iso2709_rm (rec);
+ }
+ else
+ fprintf (reply_fd, "Record type not supported\n");
}
else
fprintf (reply_fd, "Not a MARC record\n");
<title>Europagate WWW index test page</title>
</head>
<body>
-<h2>Europagate WWW index test page, $Revision: 1.14 $</h2>
+<h2>Europagate WWW index test page, $Revision: 1.15 $</h2>
<p>
<ul>
<li>
- <a href="http:/cgi-bin/egwcgi/egwirtcl/targets.egw">
+ <a href="/cgi-bin/egwcgi/egwirtcl/targets.egw">
single target</a>
<li>
- <a href="http:/cgi-bin/egwcgi/egwirtcl/targets.egw/1+1">
+ <a href="/cgi-bin/egwcgi/egwirtcl/targets.egw/1+1">
single target with debug and html3</a>
<li>
- <a href="http:/cgi-bin/egwcgi/egwirtcl/targets.egw/0+1">
+ <a href="/cgi-bin/egwcgi/egwirtcl/targets.egw/0+1">
single target with debug and html2</a>
</ul>
<ul>
<li>
- <a href="http:/cgi-bin/egwcgi/egwirtcl/mtargets.egw">
+ <a href="/cgi-bin/egwcgi/egwirtcl/mtargets.egw">
multiple targets</a>
<li>
- <a href="http:/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
+ <a href="/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
multiple targets with debug and html3</a>
<li>
- <a href="http:/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
+ <a href="/cgi-bin/egwcgi/egwirtcl/mtargets.egw/1+1">
multiple targets with debug and html2</a>
</ul>
</body>
<html>
-<head><title>Europgate WWW gateway test script $Id: egwscript,v 1.2 1995/10/23 16:55:35 adam Exp $</title></head>
+<head><title>Europgate WWW gateway test script $Id: egwscript,v 1.3 2001/02/26 14:32:36 adam Exp $</title></head>
<body>
Test script with embedded Tcl. <p>
{
session Id: {html $sessionId}<br>
session Parms: {html $sessionParms}<br>
Click
-<a href="http:/cgi-bin/egwcgi/{html $sessionId}/egwscript/{html $count}">
+<a href="/cgi-bin/egwcgi/{html $sessionId}/egwscript/{html $count}">
here</a> to go to this page again. <br>
Number of times this page has been referenced: {html $count} <p>
</body>
<html>
{
-# $Id: mquery.egw,v 1.17 1996/10/11 13:16:34 adam Exp $
+# $Id: mquery.egw,v 1.18 2001/02/26 14:32:36 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
button-main
button-new-target
- html {<form action="http:} $env(SCRIPT_NAME)
+ html {<form action="} $env(SCRIPT_NAME)
html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
set phost {}
<html>
{
-# $Id: mtargets.egw,v 1.23 1996/08/28 09:36:02 adam Exp $
+# $Id: mtargets.egw,v 1.24 2001/02/26 14:32:36 adam Exp $
set setNo 1
source ztargets.conf
if {![info exists debug]} {
button-define-target
html "<h2>Choose one or more targets</h2>\n"
- html {<form action="http:} $env(SCRIPT_NAME)
+ html {<form action="} $env(SCRIPT_NAME)
html / $sessionId / $scriptQuery {;/} -1 {" method=get><br>} \n
html "<dl>\n"
<html>
{
-# $Id: nwi.egw,v 1.7 1996/05/22 16:50:26 adam Exp $
+# $Id: nwi.egw,v 1.8 2001/02/26 14:32:36 adam Exp $
source ztargets.conf
set scriptQuery nwi.egw
set curEntry $hist($initSet,form,entry1)
}
}
- html {<form action="http:} $env(SCRIPT_NAME)
+ html {<form action="} $env(SCRIPT_NAME)
html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
html "<dl>"
html "\n<br><p><hr>\n"
if {0} {
- html {<form action="http:} $env(SCRIPT_NAME)
+ html {<form action="} $env(SCRIPT_NAME)
html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
}
<html>
{
-# $Id: query.egw,v 1.40 1996/05/24 11:16:01 adam Exp $
+# $Id: query.egw,v 1.41 2001/02/26 14:32:36 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
set databaseDefault $hist($oSetNo,0,database)
}
- html {<form action="http:} $env(SCRIPT_NAME)
+ html {<form action="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + 0 {" method=get>} \n
set nodb [llength $databases]
if {$nodb > 1} {
<html>
{
-# $Id: search.egw,v 1.40 1996/05/15 18:43:38 adam Exp $
+# $Id: search.egw,v 1.41 2001/02/26 14:32:36 adam Exp $
proc start-scan {scanNo targetNo cache dir initSet} {
global sessionId
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo +
html [expr $scanNo - 1] + b {">}
if {$useIcons} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo +
html [expr $scanNo + 1] + f {">}
if {$useIcons} {
set databaseDefault $hist($oSetNo,$targetNo,database)
}
- html {<form action="http:} $env(SCRIPT_NAME)
+ html {<form action="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo {+1" method=get>} \n
set nodb [llength $databases]
if {$nodb > 1} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo +
html [expr $scanNo - 1] + b {">}
if {$useIcons} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo +
html [expr $scanNo + 1] + f {">}
if {$useIcons} {
<html>
{
-# $Id: showfull.egw,v 1.24 1996/03/14 11:50:49 adam Exp $
+# $Id: showfull.egw,v 1.25 2001/02/26 14:32:36 adam Exp $
proc buttons {setNo tno no format count host after} {
global sessionId
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/showfull.egw/} $setNo + $tno +
html [expr $no + 1] + $format
if {$useIcons} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/showfull.egw/} $setNo + $tno +
html [expr $no - 1] + $format
if {$useIcons} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/showfull.egw/} $setNo + $tno + $no +
if {$format == "full"} {
html raw
<html>
{
-# $Id: targets.egw,v 1.27 1996/08/28 09:36:02 adam Exp $
+# $Id: targets.egw,v 1.28 2001/02/26 14:32:36 adam Exp $
source ztargets.conf
if {![info exists debug]} {
if {[lindex $sessionParms 1] == "1"} {
global env
global sessionId
- html {<dt><b><a href="http:} $env(SCRIPT_NAME) /
+ html {<dt><b><a href="} $env(SCRIPT_NAME) /
html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0]
html {</a></b>}
<html>
{
-# $Id: tform.egw,v 1.7 1996/08/28 09:36:03 adam Exp $
+# $Id: tform.egw,v 1.8 2001/02/26 14:32:36 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
button-new-target
html "<h2>Target definition form</h2><br>\n"
- html {<form action="http:} $env(SCRIPT_NAME)
+ html {<form action="} $env(SCRIPT_NAME)
html / $sessionId {/tdefine.egw} {" method=post>} \n
html "<dl>"
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wcgi.c,v $
+ * Revision 1.20 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.19 1997/01/24 13:13:10 adam
* Implemnted egw_source and added a "raw" option to the URL.
* Fixed a bug in the buffering system of wproto; the macro wo_putc could
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wsh.c,v $
+ * Revision 1.14 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.13 1996/02/29 15:36:34 adam
* Main shell loop implemented as a separate function called wshmain.
*
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "whtml.h"
#include "wtcl.h"
#include "wirtcl.h"
#
-# $Id: z39util.tcl,v 1.49 1997/11/19 13:29:13 adam Exp $
+# $Id: z39util.tcl,v 1.50 2001/02/26 14:32:36 adam Exp $
#
proc saveState {} {
uplevel #0 {
set rtype [$zset recordType $no]
switch $rtype {
SUTRS {
- html { <a href="http:} $env(SCRIPT_NAME) / $sessionId
+ html { <a href="} $env(SCRIPT_NAME) / $sessionId
html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
html [join [$zset getSutrs $no]]
html "</a><br>\n"
set year [$zset getMarc $no field 260 * c]
set score [$zset getMarc $no field 999 * r]
} dispError ] } {
- html { <a href="http:} $env(SCRIPT_NAME) /
+ html { <a href="} $env(SCRIPT_NAME) /
html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
set p 0
foreach a $author {
html "; Score " $nscore
}
} else {
- html { <a href="http:} $env(SCRIPT_NAME) /
+ html { <a href="} $env(SCRIPT_NAME) /
html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
html {No Title}
html {</a> }
set rtype [$zset recordType $no]
switch $rtype {
SUTRS {
- html { <a href="http:} $env(SCRIPT_NAME) / $sessionId
+ html { <a href="} $env(SCRIPT_NAME) / $sessionId
html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
html [string range [join [$zset getSutrs $no]] 0 70]
html "</a><br>\n"
set publisher [$zset getMarc $no field 260 * b]
set year [$zset getMarc $no field 260 * c]
} dispError ] } {
- html { <a href="http:} $env(SCRIPT_NAME) /
+ html { <a href="} $env(SCRIPT_NAME) /
html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
set p 0
foreach a $author {
}
html {</a> }
} else {
- html { <a href="http:} $env(SCRIPT_NAME) /
+ html { <a href="} $env(SCRIPT_NAME) /
html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
html {No Title}
html {</a> }
html {<td align=left>}
if {0} {
regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,host) +
html $hist($setNo,scan) + $tterm {">}
} else {
regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $tno +
html hyper + $tterm {">}
}
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo +
html [expr $setMax + 1] + [expr $setMax + $hist($setNo,maxPresent)]
if {$useIcons} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo
html + [expr $startPos - $hist($setNo,maxPresent)]
html + [expr $startPos - 1]
set addinfo [lindex $status 3]
html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
} else {
- html {<dt><a href="http:} $env(SCRIPT_NAME)
+ html {<dt><a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $i + 1
html + $hist($setNo,maxPresent) {">}
html "<h3>" [lindex $targets($hist($setNo,$i,host)) 0] "</a>: "
html {<td align=right>}
}
if {[info exists hist($setNo,$i,hits)]} {
- html { <a href="http:} $env(SCRIPT_NAME)
+ html { <a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $i + 1
html + $hist($setNo,maxPresent)
html {">} $hist($setNo,$i,hits) {</a>}
} else {
html "<dd>\n"
}
- html { <a href="http:} $env(SCRIPT_NAME)
+ html { <a href="} $env(SCRIPT_NAME)
html / $sessionId / $scriptQuery {;/} $setNo + $host
if {$html3} {
html {">}
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/tform.egw}
if {$useIcons} {
html {"><img src="/egwgif/button-define-target.gif" }
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId / $scriptTarget
if {$useIcons} {
html {"><img src="/egwgif/button-new-target.gif" }
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/history.egw;}
catch { html "/" $nextSetNo}
if {$useIcons} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,0,host) {">}
if {$useIcons} {
if {!$useIcons} {
html "\n | "
}
- html {<a href="http:} $env(SCRIPT_NAME) / $sessionId
+ html {<a href="} $env(SCRIPT_NAME) / $sessionId
if {$tno > 0} {
html {/msearch.egw/} $setNo
} else {
html "\n | "
}
set targetNo 0
- html {<a href="http:} $env(SCRIPT_NAME)
+ html {<a href="} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + $targetNo + {scan} {">}
if {$useIcons} {
html {<img src="/egwgif/button-scan-window.gif" }
-# $Id: ztargets.conf,v 1.38 1997/02/24 10:05:23 adam Exp $
+# $Id: ztargets.conf,v 1.39 2001/02/26 14:32:36 adam Exp $
#
# This file contains the predefined targets in the WWW-Z39.50 gateway
# Each target is an entry in the associative array "targets". The
union
}
-set targets(dtbsun.dtv.dk:9999/usgs-esdd-iah) {
+set targets(bagel.indexdata.dk:210/marc-gils) {
Zebra
USMARC
{
{ Title {@attr 1=4} }
{ Author {@attr 1=1003} }
{ Abstract {@attr 1=62} }
- { Date {@attr 1=30} }
{ {Doc ID} {@attr 1=1032} }
{ All {@attr 1=1016} }
{ Free-text {@attr 1=1016 @attr 4=105} }
}
{}
- {Zebra Z39.50 test server with GILS records. Databases: <br>
- usgs: sample of USGS data directory <br>
- esdd: additional Earch Science Data Directory records <br>
- iah: data directory for the International Association of Hydrologists
- }
+ {Zebra Z39.50 test server with GILS and MARC records <br>}
1
gils
}
assorted \
]
-set targets(IBM2.LOC.GOV:2210/BOOKS) [ list \
- LOC,BOOKS \
+set targets(z3950.loc.gov:7090/voyager) [ list \
+ LOCS \
{} \
$locFields \
{} \
union \
]
-set targets(IBM2.LOC.GOV:2210/NAMES) [ list \
- LOC,NAMES \
- USMARC \
- $locFields \
- {} \
- {Library of Congress: Production file of name authority records} \
- 1 \
- union \
-]
-
set targets(199.92.147.99/Baystate) [list \
Baystate \
USMARC \
* Z39.50 API for the Email gateway - YAZ version
*
* $Log: zaccess.c,v $
+ * Revision 1.6 2001/02/26 14:32:36 adam
+ * Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
+ *
* Revision 1.5 1996/01/03 08:58:12 adam
* Updated to use new version of Yaz (some names changed to avoid C++ conflict).
*
#include <ctype.h>
#include <gw-log.h>
-#include <proto.h>
-#include <comstack.h>
-#include <tcpip.h>
+#include <yaz/proto.h>
+#include <yaz/comstack.h>
+#include <yaz/tcpip.h>
#ifdef USE_XTIMOSI
#include <xmosi.h>
#endif
-#include <oid.h>
+#include <yaz/oid.h>
#include <ccl.h>
#include <zaccess.h>
}
odr_reset(z->decode);
odr_setbuf(z->decode, z->inbuf, res, 0);
- if (!z_APDU(z->decode, &ap, 0))
+ if (!z_APDU(z->decode, &ap, 0, 0))
{
gw_log(GW_LOG_WARN, ZASS_TYPE, "decode: %s",
odr_errlist[odr_geterror(z->decode)]);
char *buf;
int len;
- if (!z_APDU(z->encode, &a, 0))
+ if (!z_APDU(z->encode, &a, 0, 0))
{
gw_log(GW_LOG_FATAL, ZASS_TYPE, "encoding initreq");
return -1;
struct ccl_rpn_attr *i;
int len;
static int op[] = { Z_Operator_and, Z_Operator_or, Z_Operator_and_not };
+ Z_AttributeElement **elements;
+ int num_attributes = 0;
switch (q->kind)
{
- case CCL_RPN_TERM:
- r->which = Z_RPNStructure_simple;
- r->u.simple = odr_malloc(o, sizeof(Z_Operand));
- r->u.simple->which = Z_Operand_APT;
- r->u.simple->u.attributesPlusTerm = t = odr_malloc(o, sizeof(*t));
- t->term = odr_malloc(o, sizeof(Z_Term));
- t->term->which = Z_Term_general;
- t->term->u.general = odr_malloc(o, sizeof(Odr_oct));
- t->term->u.general->len = t->term->u.general->size =
- strlen(q->u.t.term);
- t->term->u.general->buf = odr_malloc(o, t->term->u.general->size);
- memcpy(t->term->u.general->buf, q->u.t.term,
- t->term->u.general->len);
- t->num_attributes = 0;
- t->attributeList = odr_malloc(o, sizeof(Z_AttributeElement*) * 100);
- for (i = q->u.t.attr_list; i && t->num_attributes < 100;
- i = i->next)
- {
- Z_AttributeElement *a;
-
- t->attributeList[t->num_attributes++] = a =
- odr_malloc(o, sizeof(*a));
- a->attributeType = odr_malloc(o, sizeof(int));
- *a->attributeType = i->type;
-#ifdef Z_95
- a->attributeSet = 0;
- a->which = Z_AttributeValue_numeric;
- a->value.numeric = odr_malloc(o, sizeof(*a->value.numeric));
- *a->value.numeric = i->value;
+ case CCL_RPN_TERM:
+ r->which = Z_RPNStructure_simple;
+ r->u.simple = odr_malloc(o, sizeof(Z_Operand));
+ r->u.simple->which = Z_Operand_APT;
+ r->u.simple->u.attributesPlusTerm = t = odr_malloc(o, sizeof(*t));
+ t->term = odr_malloc(o, sizeof(Z_Term));
+ t->term->which = Z_Term_general;
+ t->term->u.general = odr_malloc(o, sizeof(Odr_oct));
+ t->term->u.general->len = t->term->u.general->size =
+ strlen(q->u.t.term);
+ t->term->u.general->buf = odr_malloc(o, t->term->u.general->size);
+ memcpy(t->term->u.general->buf, q->u.t.term,
+ t->term->u.general->len);
+ elements = odr_malloc(o, sizeof(Z_AttributeElement*) * 100);
+#ifdef ASN_COMPILED
+ t->attributes = (Z_AttributeList *)
+ odr_malloc (o, sizeof(*t->attributes));
+ t->attributes->attributes = elements;
#else
- a->attributeValue = odr_malloc(o, sizeof(*a->attributeValue));
- *a->attributeValue = i->value;
+ t->attributeList = elements;
#endif
- }
- return r;
- case CCL_RPN_SET:
- r->which = Z_RPNStructure_simple;
- r->u.simple = odr_malloc(o, sizeof(Z_Operand));
- r->u.simple->which = Z_Operand_resultSetId;
- r->u.simple->u.resultSetId = odr_malloc(o, len =
- strlen(q->u.setname) + 1);
- memcpy(r->u.simple->u.resultSetId, q->u.setname, len);
- return r;
- case CCL_RPN_AND: case CCL_RPN_OR: case CCL_RPN_NOT:
- r->which = Z_RPNStructure_complex;
- r->u.complex = odr_malloc(o, sizeof(Z_Complex));
- if (!(r->u.complex->s1 = rpn2rpn(o, q->u.p[0])) ||
- !(r->u.complex->s2 = rpn2rpn(o, q->u.p[1])))
- return 0;
- r->u.complex->roperator = odr_malloc(o, sizeof(Z_Operator));
- r->u.complex->roperator->which = op[q->kind];
- r->u.complex->roperator->u.and = "";
- return r;
- default:
- gw_log(GW_LOG_FATAL, ZASS_TYPE, "Bad operator in RPN");
+ for (i = q->u.t.attr_list; i && num_attributes < 100; i = i->next)
+ {
+ Z_AttributeElement *a;
+
+ elements[num_attributes++] = a =
+ odr_malloc(o, sizeof(*a));
+ a->attributeType = odr_malloc(o, sizeof(int));
+ *a->attributeType = i->type;
+ a->attributeSet = 0;
+ a->which = Z_AttributeValue_numeric;
+ a->value.numeric = odr_malloc(o, sizeof(*a->value.numeric));
+ *a->value.numeric = i->value;
+ }
+#ifdef ASN_COMPILED
+ t->attributes->num_attributes = num_attributes;
+#else
+ t->num_attributes = num_attributes;
+#endif
+ return r;
+ case CCL_RPN_SET:
+ r->which = Z_RPNStructure_simple;
+ r->u.simple = odr_malloc(o, sizeof(Z_Operand));
+ r->u.simple->which = Z_Operand_resultSetId;
+ r->u.simple->u.resultSetId = odr_malloc(o, len =
+ strlen(q->u.setname) + 1);
+ memcpy(r->u.simple->u.resultSetId, q->u.setname, len);
+ return r;
+ case CCL_RPN_AND: case CCL_RPN_OR: case CCL_RPN_NOT:
+ r->which = Z_RPNStructure_complex;
+ r->u.complex = odr_malloc(o, sizeof(Z_Complex));
+ if (!(r->u.complex->s1 = rpn2rpn(o, q->u.p[0])) ||
+ !(r->u.complex->s2 = rpn2rpn(o, q->u.p[1])))
return 0;
+ r->u.complex->roperator = odr_malloc(o, sizeof(Z_Operator));
+ r->u.complex->roperator->which = op[q->kind];
+ r->u.complex->roperator->u.op_and = "";
+ return r;
+ default:
+ gw_log(GW_LOG_FATAL, ZASS_TYPE, "Bad operator in RPN");
+ return 0;
}
}
else
{
oident *id;
+#ifdef ASN_COMPILED
+ Z_DiagRec dr_info;
+ Z_DiagRec *dr = &dr_info;
+ dr_info.which = Z_DiagRec_defaultFormat;
+ dr_info.u.defaultFormat = res->records->u.nonSurrogateDiagnostic;
+#else
Z_DiagRec *dr = res->records->u.nonSurrogateDiagnostic;
-
-#ifdef Z_95
+#endif
if (dr->which != Z_DiagRec_defaultFormat ||
!(id = oid_getentbyoid
(dr->u.defaultFormat->diagnosticSetId)) ||
else
{
r.errcode = *dr->u.defaultFormat->condition;
- if (dr->u.defaultFormat->addinfo)
+#ifdef ASN_COMPILED
+ switch (dr->u.defaultFormat->which)
{
- strncpy(r.errstring, dr->u.defaultFormat->addinfo, 512);
+ case Z_DefaultDiagFormat_v2Addinfo:
+ strncpy(r.errstring, dr->u.defaultFormat->u.v2Addinfo,
+ 512);
r.errstring[511] = '\0';
+ break;
+ case Z_DefaultDiagFormat_v3Addinfo:
+ strncpy(r.errstring, dr->u.defaultFormat->u.v3Addinfo,
+ 512);
+ r.errstring[511] = '\0';
+ break;
}
- }
#else
- if (!(id = oid_getentbyoid(dr->diagnosticSetId)) ||
- id->class != CLASS_DIAGSET || id->value != VAL_BIB1)
- gw_log(GW_LOG_WARN, ZASS_TYPE,
- "Missing or unknown diagset - ignoring error!");
- else
- {
- r.errcode = *dr->condition;
- if (dr->addinfo)
+ if (dr->u.defaultFormat->addinfo)
{
- strncpy(r.errstring, dr->addinfo, 512);
+ strncpy(r.errstring, dr->u.defaultFormat->addinfo, 512);
r.errstring[511] = '\0';
}
- }
#endif
+ }
}
}
return &r;
* Triple indirection - that's kinda heavy. We'll fix it later.
* There are worse things around, though. Like ZDist.
*/
-void get_diagrec(zass_record ***p, Z_DiagRec *r)
+void get_diagrecs(zass_record ***p, Z_DiagRec **r, int num)
{
**p = malloc(sizeof(***p));
(**p)->next = 0;
-#ifdef Z_95
+
(**p)->errstring[0] = '\0';
- if (r->which == Z_DiagRec_defaultFormat)
+ if ((*r)->which == Z_DiagRec_defaultFormat)
{
- (**p)->errcode = *r->u.defaultFormat->condition;
- if (r->u.defaultFormat->addinfo)
+ (**p)->errcode = *(*r)->u.defaultFormat->condition;
+#ifdef ASN_COMPILED
+ switch ((*r)->u.defaultFormat->which)
+ {
+ case Z_DefaultDiagFormat_v2Addinfo:
+ strncpy((**p)->errstring, (*r)->u.defaultFormat->u.v2Addinfo, 200);
+ (**p)->errstring[200] = 0;
+ break;
+ case Z_DefaultDiagFormat_v3Addinfo:
+ strncpy((**p)->errstring, (*r)->u.defaultFormat->u.v3Addinfo, 200);
+ (**p)->errstring[200] = 0;
+ break;
+ }
+#else
+ if ((*r)->u.defaultFormat->addinfo)
{
- strncpy((**p)->errstring, r->u.defaultFormat->addinfo, 200);
+ strncpy((**p)->errstring, (*r)->u.defaultFormat->addinfo, 200);
(**p)->errstring[200] = 0;
}
+#endif
}
else
(**p)->errcode = -1;
-#else
- (**p)->errcode = *r->condition;
- if (r->addinfo)
- {
- strncpy((**p)->errstring, r->addinfo, 200);
- (**p)->errstring[200] = 0;
- }
- else
- (**p)->errstring[0] = '\0';
-#endif
(**p)->which = ZASS_REC_DIAG;
*p = &(**p)->next;
}
record = recs->records[i];
if (record->which == Z_NamePlusRecord_surrogateDiagnostic)
- get_diagrec(p, record->u.surrogateDiagnostic);
+ get_diagrecs(p, &record->u.surrogateDiagnostic, 1);
else
{
Z_DatabaseRecord *r = record->u.databaseRecord;
else
switch (recform->value)
{
- case VAL_USMARC: (**p)->which = ZASS_REC_USMARC; break;
- default:
- gw_log(GW_LOG_WARN, ZASS_TYPE, "Unknown recsyn");
- (**p)->which = ZASS_REC_UNKNOWN;
+ case VAL_USMARC: (**p)->which = ZASS_REC_USMARC; break;
+ case VAL_DANMARC: (**p)->which = ZASS_REC_DANMARC; break;
+ default:
+ gw_log(GW_LOG_WARN, ZASS_TYPE, "Unknown recsyn");
+ (**p)->which = ZASS_REC_UNKNOWN;
}
if (r->which != ODR_EXTERNAL_octet)
{
{
Z_APDU *apdu;
Z_PresentRequest *req;
-#if 0
+#if 1
oident recsyn;
#endif
req->resultSetId = name;
req->resultSetStartPoint = &start;
req->numberOfRecordsRequested = #
-#if 0
+#if 1
recsyn.proto = PROTO_Z3950;
- recsyn.class = CLASS_RECSYN;
+ recsyn.oclass = CLASS_RECSYN;
recsyn.value = form;
req->preferredRecordSyntax = oid_getoidbyent(&recsyn);
#else
{
Z_APDU *apdu;
Z_PresentResponse *res;
+#ifdef ASN_COMPILED
+ Z_DiagRec dr, *dr_p = &dr;
+#endif
gw_log(ZASS_DEBUG, ZASS_TYPE,
"Fetching %d records from # %d", num - r.num, start);
start = r.nextpos;
switch (res->records->which)
{
- case Z_Records_DBOSD:
- get_responserecords(&rec,
- res->records->u.databaseOrSurDiagnostics);
- break;
- case Z_Records_NSD:
- get_diagrec(&rec, res->records->u.nonSurrogateDiagnostic);
- break;
- default:
- gw_log(GW_LOG_WARN, ZASS_TYPE, "Bad tag in response rec.");
- return 0;
+ case Z_Records_DBOSD:
+ get_responserecords(&rec,
+ res->records->u.databaseOrSurDiagnostics);
+ break;
+ case Z_Records_NSD:
+#ifdef ASN_COMPILED
+ dr.which = Z_DiagRec_defaultFormat;
+ dr.u.defaultFormat = res->records->u.nonSurrogateDiagnostic;
+ get_diagrecs(&rec, &dr_p, 1);
+#else
+ get_diagrecs(&rec, &res->records->u.nonSurrogateDiagnostic, 1);
+#endif
+ break;
+ default:
+ gw_log(GW_LOG_WARN, ZASS_TYPE, "Bad tag in response rec.");
+ return 0;
}
}
while (num - r.num && start);