First version that ran on dtbsun.
# Europagate, 1995
#
# $Log: Makefile,v $
-# Revision 1.11 1995/11/07 14:56:58 adam
+# Revision 1.12 1995/11/08 16:14:32 adam
+# Many improvements and bug fixes.
+# First version that ran on dtbsun.
+#
+# Revision 1.11 1995/11/07 14:56:58 adam
# Work on search in multiple targets.
# New wtcl command: wlog.
# Optional timeout parameter to zwait.
ZDEFS=
ZINC=-I../../yaz/include
ZLIB=../../yaz/lib/libyaz.a
-MOSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a
+#MOSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a
LIBIRTCL=/usr/local/lib/libirtcl.a $(ZLIB) $(MOSILIB)
#
OLIB=../lib/util.a ../lib/libres+log.a
$(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB)
$(TPROG2): $(P2)
- $(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(LIBIRTCL) $(TCLLIB) -lm
+ $(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(LIBIRTCL) \
+ $(NETLIB) $(TCLLIB) -lm
$(TPROG3): $(P3)
$(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB)
cp $$x $(CGIBIN); \
chmod +x $(CGIBIN)/$$x; \
done; \
- ln -f $(CGIBIN)/$(TPROG2) $(CGIBIN)/egwtcl; \
- ln -f $(CGIBIN)/$(TPROG2) $(CGIBIN)/egwirtcl; \
- ln -f $(CGIBIN)/$(TPROG2) $(CGIBIN)/egwhtml
+ for p in egwtcl egwirtcl egwhtml; do \
+ rm -f $(CGIBIN)/$$p; \
+ ln $(CGIBIN)/$(TPROG2) $(CGIBIN)/$$p; \
+ done
install.script:
@for x in $(WSCRIPTS); do \
</head>
<body>
{
-# $Id: mquery.egw,v 1.1 1995/11/07 14:56:58 adam Exp $
+# $Id: mquery.egw,v 1.2 1995/11/08 16:14:32 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
global nextSetNo
global hist
- html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<form action="http:} $env(SCRIPT_NAME)
html / $sessionId {/msearch.egw/} $setNo {" method=post>} \n
if {[catch {set setNo $nextSetNo}]} {
<hr>
{
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/mtargets.egw"> New target </a>}
}
{
<html>
{
-# $Id: msearch.egw,v 1.1 1995/11/07 14:56:58 adam Exp $
+# $Id: msearch.egw,v 1.2 1995/11/08 16:14:33 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
<hr>
{
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/mtargets.egw"> New target </a>} " | \n"
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/mquery.egw/} $host + $setNo {"> New query </a>}
}
<html>
{
-# $Id: mtargets.egw,v 1.2 1995/11/07 14:56:58 adam Exp $
+# $Id: mtargets.egw,v 1.3 1995/11/08 16:14:33 adam Exp $
set setNo 1
source /usr/local/etc/httpd/conf/ztargets.conf
if {[info commands saveState] == ""} {
<hr>
<h3>Choose one or more Z39.50 targets:</h3>
{
- html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<form action="http:} $env(SCRIPT_NAME)
html / $sessionId {/mquery.egw/} $setNo {" method=post><br>} \n
foreach t [array names targets] {
html {<input type="checkbox" name="target" value="} $t
</head>
<body>
{
-# $Id: query.egw,v 1.10 1995/11/08 12:42:17 adam Exp $
+# $Id: query.egw,v 1.11 1995/11/08 16:14:33 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
html "</body></html>\n"
wabort
} elseif {$sessionWait == 0} {
- zwait sessionWait
+ if {[catch {zwait sessionWait 30}]} {
+ html "Cannot connect to target ${host} <br>\n"
+ html "</body></html>\n"
+ z39 disconnect
+ wabort
+ }
if {$sessionWait != 1} {
html "Cannot connect to target ${host} <br>\n"
html "</body></html>\n"
+ z39 disconnect
wabort
}
}
htmlr "</body></html>"
wabort
}
- zwait sessionWait
+ if {[catch {zwait sessionWait 60}]} {
+ htmlr "Cannot initialize with target ${host} <br>"
+ htmlr "</body></html>"
+ wabort
+ }
if {$sessionWait != "1"} {
htmlr "Cannot initialize with target ${host} <br>"
htmlr "</body></html>"
}
set databases [lindex $targets($host) 1]
- html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<form action="http:} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo {" method=post>} \n
set nodb [llength $databases]
if {$nodb > 1} {
}
<hr><p>
Alternatively you can enter your query in
-<a href="ccl.html"> CCL </a> here: <br>
+<a href="http://www.dtv.dk/ccl.html"> CCL </a> here: <br>
<input type=text name="cclentry" size=52> <br>
<hr>
<h3> Various technical parameters: </h3> <br>
<hr>
{
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/targets.egw"> New target </a>}
}
{
<html>
{
-# $Id: search.egw,v 1.10 1995/11/08 12:42:17 adam Exp $
+# $Id: search.egw,v 1.11 1995/11/08 16:14:33 adam Exp $
proc buttons {setNo setMax startPos} {
global sessionId
html "<p>\n"
if {$setMax < [z39.$setNo resultCount]} {
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + [expr $setMax + 1]
html + [expr $setMax + $hist($setNo,maxPresent)] {"> Next </a>} "| \n"
}
if {$startPos != "" && $startPos != "1"} {
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo
if {[expr $startPos - $hist($setNo,maxPresent)] > 1} {
html + [expr $startPos - $hist($setNo,maxPresent)]
}
html {"> Prev </a>} "| \n"
}
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/targets.egw"> New target </a>} " | \n"
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo
html {"> New query </a>} "<p>\n"
}
global setNo
global hist
- set oldHost $hist($setNo,host)
-
if {[wform menu1] == ""} {
set setNo [lindex $sessionParms 0]
} else {
if {![info exists hist($nextSetNo,host)]} {
- set hist($nextSetNo,host) $oldHost
+ set hist($nextSetNo,idAuthentication) $hist($setNo,idAuthentication)
+ set hist($nextSetNo,host) $hist($setNo,host)
}
set setNo $nextSetNo
html "using host " $hist($setNo,host) " <br\n"
<html>
{
-# $Id: showfull.egw,v 1.5 1995/11/08 12:42:17 adam Exp $
+# $Id: showfull.egw,v 1.6 1995/11/08 16:14:34 adam Exp $
proc buttons {setNo no} {
global sessionId
html "<p>\n"
if {$no < [z39.$setNo resultCount]} {
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/showfull.egw/} $setNo + [expr $no + 1]
html {"> Next </a>} "| \n"
}
if {$no > 1} {
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/showfull.egw/} $setNo + [expr $no - 1]
html {"> Prev </a>} "| \n"
}
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + 1
html + [expr $hist($setNo,maxPresent) - 1]
html {"> Result </a>} "| \n"
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/targets.egw"> New target </a>} " | \n"
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo
html {"> New query </a>} "<p>\n"
}
<html>
{
-# $Id: targets.egw,v 1.6 1995/11/08 12:42:17 adam Exp $
+# $Id: targets.egw,v 1.7 1995/11/08 16:14:34 adam Exp $
source /usr/local/etc/httpd/conf/ztargets.conf
if {[info commands saveState] == ""} {
source z39util.tcl
<dl>
{
foreach t [array names targets] {
- html {<dt><a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME) /
+ html {<dt><a href="http:} $env(SCRIPT_NAME) /
html "$sessionId/query.egw/$t" {"> } [lindex $targets($t) 0] " </a>\n"
set desc [lindex $targets($t) 4]
if {$desc != ""} {
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wcgi.c,v $
- * Revision 1.7 1995/11/08 12:42:18 adam
+ * Revision 1.8 1995/11/08 16:14:35 adam
+ * Many improvements and bug fixes.
+ * First version that ran on dtbsun.
+ *
+ * Revision 1.7 1995/11/08 12:42:18 adam
* Added descriptive text field in target info.
* Added authentication field in target info.
*
case 0:
close (0);
close (1);
+ close (2);
gw_log (GW_LOG_DEBUG, prog, "execl %s", path);
execl (path, sprog, 0);
gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, prog, "execl %s", path);
char combuf[COMBUF];
int linein = -1, lineout, data, gw_id;
+ chdir ("/usr/local/etc/httpd/cgi-bin");
gw_log_init ("egw");
gw_log_file (GW_LOG_ALL, "/usr/local/etc/httpd/logs/egwcgi_log");
gw_log_level (GW_LOG_ALL);
*(p++) = '\0'; /* no envvars tranferred at present */
if ((t = getenv("CONTENT_LENGTH")) && (data = atoi(t)) > 0)
{
- if (read(0, p, data) < data)
- {
- gw_log (GW_LOG_FATAL, prog, "Failed to read input");
- fatal("Internal error in server");
+ int j, i = 0;
+ while (i < data)
+ {
+ j = read(0, p + i, data - i);
+ if (j == -1)
+ {
+ gw_log (GW_LOG_ERRNO|GW_LOG_FATAL, prog,
+ "Failed to read input");
+ fatal("Internal error in server");
+ }
+ else if (j == 0)
+ {
+ gw_log (GW_LOG_ERRNO, prog, "Failed to read input");
+ fatal("Internal error in server");
+ }
+ i += j;
}
}
p += data;
}
gw_log (GW_LOG_DEBUG, prog, "Reading response");
-#if 0
+#if 1
while ((data = read(linein, combuf, COMBUF)) > 0)
{
gw_log (GW_LOG_DEBUG, prog, "Got %d bytes", data);
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wtcl.c,v $
- * Revision 1.9 1995/11/07 14:57:00 adam
+ * Revision 1.10 1995/11/08 16:14:35 adam
+ * Many improvements and bug fixes.
+ * First version that ran on dtbsun.
+ *
+ * Revision 1.9 1995/11/07 14:57:00 adam
* Work on search in multiple targets.
* New wtcl command: wlog.
* Optional timeout parameter to zwait.
static void report_error (struct tcl_info *p, int errorLine,
const char *pre, const char *msg)
{
+ if (!msg)
+ msg = "";
gw_log (GW_LOG_WARN, mod, "%s %d %s", pre, errorLine, msg);
wo_printf (p->wcl, "\n<br><hr>\n<strong>"
"%s %d</strong><br>\n", pre, errorLine);
#
-# $Id: z39util.tcl,v 1.3 1995/11/08 12:42:18 adam Exp $
+# $Id: z39util.tcl,v 1.4 1995/11/08 16:14:36 adam Exp $
#
proc saveState {} {
uplevel #0 {
if {$var == "f"} continue
if {$var == "sessionId"} continue
if {$var == "errorInfo"} continue
- set names [array names $var]
- if {$names != ""} {
+ if {[catch {set names [array names $var]}]} {
+ eval "set v \$${var}"
+ puts $f "set ${var} \{$v\}"
+ } else {
foreach n $names {
eval "set v \$${var}(\$n)"
puts $f "set ${var}($n) \{$v\}"
}
- } else {
- eval "set v \$${var}"
- puts $f "set ${var} \{$v\}"
}
}
close $f
set title [lindex [$zset getMarc $no field 245 * a] 0]
set year [lindex [$zset getMarc $no field 260 * c] 0]
} ] } {
- html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME) /
+ html {<a href="http:} $env(SCRIPT_NAME) /
html $sessionId {/showfull.egw/} $setNo + $no {"> } $title {</a>}
html " <i> ${year} </i>"
}
html "Cannot initialize with target ${host} <br>\n"
return 0
}
- zwait sessionWait
+ if {[catch {zwait sessionWait 60}]} {
+ html "Cannot initialize with target ${host} <br>\n"
+ z39 disconnect
+ return 0
+ }
if {$sessionWait != "1"} {
html "Cannot initialize with target ${host} <br>\n"
+ z39 disconnect
return 0
}
}
set sessionWait 0
z39.$setNo search $hist($setNo,query)
- zwait sessionWait
+ if {[catch {zwait sessionWait 600}]} {
+ html "</body></html>\n"
+ z39 disconnect
+ return 0
+ }
+
if {$sessionWait != 1} {
html "</body></html>\n"
+ z39 disconnect
return 0
}
set status [z39.$setNo responseStatus]
if {$got < $toGet} {
set sessionWait 0
z39.$setNo present $setOffset $toGet
- zwait sessionWait
+ if {[catch {zwait sessionWait 300}]} {
+ z39 disconnect
+ break
+ }
if {$sessionWait != "1"} {
break
}
}
html "<hr><h3>History</h3><dl>\n"
for {set setNo 1} {$setNo < $nextSetNo} {incr setNo} {
- html {<dt> <a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+ html {<dt> <a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + 1
html + [expr $hist($setNo,maxPresent) - 1]
html {"> } [lindex $targets($hist($setNo,host)) 0]
html "\n"
}
html "</dl>\n"
-}
\ No newline at end of file
+}
-# $Id: ztargets.conf,v 1.6 1995/11/08 12:42:18 adam Exp $
+# $Id: ztargets.conf,v 1.7 1995/11/08 16:14:36 adam Exp $
set commonFields {
{ Title {@attr 1=4} }
{ Author {@attr 1=1003} }
}
set targets(myriad.middlebury.edu) {
- Myriad
- Default
+ Midcat
+ MIDCAT
{ { Title {@attr 1=4} }
{ Author {@attr 1=1003} }
{ Abstract {@attr 1=62} }