From 077cc4d735856a5e9c31e16ee75d28e85c67ac62 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 5 Mar 1996 18:50:24 +0000 Subject: [PATCH] Work on WAIS part of gateway. --- www/Makefile | 10 ++++-- www/egwindex.html | 12 ++++++- www/mtargets.egw | 8 +++-- www/showfull.egw | 10 +++--- www/targets.egw | 8 +++-- www/z39util.tcl | 104 ++++++++++++++++++++++++----------------------------- 6 files changed, 81 insertions(+), 71 deletions(-) diff --git a/www/Makefile b/www/Makefile index 11d3b94..0017069 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1,7 +1,7 @@ # Makefile for www gateway utility # Europagate, 1995 # -# $Id: Makefile,v 1.32 1996/02/29 15:41:38 adam Exp $ +# $Id: Makefile,v 1.33 1996/03/05 18:50:24 adam Exp $ # SHELL=/bin/sh @@ -66,7 +66,8 @@ WAISDIR=../../freeWAIS-sf-2.0 WAISLIB=$(IRTCLDIR)/wais-tcl.o $(WAISDIR)/ir/libwais.a $(TPROG4): $(P4) $(OLIB) - $(CC) $(CFLAGS) -o $(TPROG4) $(P4) $(OLIB) $(IRTCLLIB) \ + $(CC) $(CFLAGS) -o $(TPROG4) $(P4) \ + $(OLIB) $(IRTCLLIB) \ $(WAISLIB) $(ZLIB) $(MOSILIB) $(NETLIB) $(TCLLIB) -lm install: install.prog install.script install.gif @@ -94,6 +95,11 @@ install.prog: $(TPROG1) $(TPROG2) rm -f $(EGWDIR)/$$p; \ ln $(EGWDIR)/$(TPROG2) $(EGWDIR)/$$p; \ done + @if [ -x $(TPROG4) ]; then \ + echo Installing $(TPROG4); \ + cp $(TPROG4) $(EGWDIR)/$(TPROG4); \ + chmod a+x $(EGWDIR)/$(TPROG4); \ + fi install.script: @if [ ! -d $(EGWDIR) ]; then \ diff --git a/www/egwindex.html b/www/egwindex.html index f8dfb75..240fd92 100644 --- a/www/egwindex.html +++ b/www/egwindex.html @@ -3,7 +3,7 @@ Europagate WWW index -

Europagate WWW index, $Id: egwindex.html,v 1.9 1996/01/29 17:31:45 adam Exp $

+

Europagate WWW index, $Id: egwindex.html,v 1.10 1996/03/05 18:50:24 adam Exp $

+ + diff --git a/www/mtargets.egw b/www/mtargets.egw index 1f81bfa..fbcd44d 100644 --- a/www/mtargets.egw +++ b/www/mtargets.egw @@ -1,6 +1,6 @@ { -# $Id: mtargets.egw,v 1.15 1996/02/19 15:44:59 adam Exp $ +# $Id: mtargets.egw,v 1.16 1996/03/05 18:50:25 adam Exp $ set setNo 1 source ztargets.conf if {[info commands saveState] == ""} { @@ -16,8 +16,10 @@ } } set html3 [lindex $sessionParms 0] - if {$html3 == ""} { - if {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} { + if {[string length $html3] == 0} { + if {![info exists env(HTTP_USER_AGENT)]} { + set html3 1 + } elseif {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} { set html3 1 egw_log debug "New user using Netscape" } else { diff --git a/www/showfull.egw b/www/showfull.egw index 0afbc4e..85c2194 100644 --- a/www/showfull.egw +++ b/www/showfull.egw @@ -1,6 +1,6 @@ { -# $Id: showfull.egw,v 1.18 1996/01/29 17:31:48 adam Exp $ +# $Id: showfull.egw,v 1.19 1996/03/05 18:50:25 adam Exp $ proc buttons {setNo tno no format count host after} { global sessionId @@ -77,10 +77,6 @@ proc buttons {setNo tno no format count host after} { source z39util.tcl } - html " WWW/Z39.50 Gateway Record " [splitHostSpec $host] - html " \n" - html "\n" - global setNo global hist @@ -99,6 +95,10 @@ proc buttons {setNo tno no format count host after} { set host $hist($setNo,host) } + html " WWW/Z39.50 Gateway Record " [splitHostSpec $host] + html " \n" + html "\n" + if {[z39search $setNo 0 $tno F] != "1"} { return } diff --git a/www/targets.egw b/www/targets.egw index 55d8189..f9c15f1 100644 --- a/www/targets.egw +++ b/www/targets.egw @@ -1,6 +1,6 @@ { -# $Id: targets.egw,v 1.19 1996/01/26 17:41:26 adam Exp $ +# $Id: targets.egw,v 1.20 1996/03/05 18:50:25 adam Exp $ source ztargets.conf if {[info commands saveState] == ""} { source z39util.tcl @@ -15,8 +15,10 @@ } } set html3 [lindex $sessionParms 0] - if {$html3 == ""} { - if {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} { + if {[string length $html3] == 0} { + if {![info exists env(HTTP_USER_AGENT)]} { + set html3 1 + } elseif {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} { set html3 1 egw_log debug "New user using Netscape" } else { diff --git a/www/z39util.tcl b/www/z39util.tcl index aa53782..d78e5d6 100644 --- a/www/z39util.tcl +++ b/www/z39util.tcl @@ -1,5 +1,5 @@ # -# $Id: z39util.tcl,v 1.34 1996/02/29 15:41:40 adam Exp $ +# $Id: z39util.tcl,v 1.35 1996/03/05 18:50:26 adam Exp $ # proc saveState {} { uplevel #0 { @@ -305,79 +305,64 @@ proc dl-marc-field-rec {zset no tag lead start stop startid sep} { } proc display-full-wais {zset no} { - set i0 0 - set i1 0 - set refNo 0 - set body [$zset getWAIS $no text] - - while {[string length [set c [string index $body $i1]]]} { - if {[string compare $c \n]} { - incr i1 - continue - } - set l [string trim [string range $body $i0 $i1]] - egw_log debug "line=$l" - incr i1 - set i0 $i1 + set i 0 + set element junk + htmlToken l [join [$zset getWAIS $no text]] { if {[string compare [string index $l 0] {<}]} { - egw_log "xxxxxxxxxxxxxxxx" + set data($element) $l continue } - if {[set mark [string first > $l ]] < 1} { - egw_log "yyyyyyyyyyyyyyyy" - continue - } - set data [string trim [string range $l [expr $mark +1] end]] - incr mark -1 - set sw [string range $l 1 $mark] - egw_log debug "sw=$sw" - egw_log debug "data=$data" - switch -exact $sw { - ti { - set title $data + switch -exact $l { + { + set element title + } + { + set element dateOfLastModification } - dm { - set dateOfLastModification $data + { + set element controlIdentifier } - ci { - set controlIdentifier $data + { + set element lastChecked } - lc { - set lastChecked $data + { + set element bytes } - by { - set bytes $data + { + set element linkage } - avli { - set linkage $data + { + incr i } - cr { - incr refNo +
  • { + set element "$i,linkage" } - li { - set crossRef($refNo,linkage) $data + { + set element "$i,title" } - cp { - set crossRef($refNo,title) $data + default { + set element junk } } } - html {Title: } {} $title "
    \n" - html {URL: } $linkage "
    \n" - if {[info exists bytes]} { - html {Bytes: } $bytes "
    \n" + html {Title: } {} $data(title) "
    \n" + html {URL: } $data(linkage) "
    \n" + html {Score: } [$zset getWAIS $no score] "
    \n" + html {Lines: } [$zset getWAIS $no lines] "
    \n" + if {[info exists data(bytes)]} { + html {Bytes: } $data(bytes) "
    \n" } - if {[info exists dateOfLastModification]} { - html {Last modified: } $dateOfLastModification "
    \n" + if {[info exists data(dateOfLastModification)]} { + html {Last modified: } $data(dateOfLastModification) "
    \n" } - if {[info exists lastChecked]} { - html {Last checked: } $lastChecked "
    \n" + if {[info exists data(lastChecked)]} { + html {Last checked: } $data(lastChecked) "
    \n" } html "\n" } @@ -841,7 +826,12 @@ proc z39search {setNo piggy tno elements} { } set sessionWait 0 egw_log debug "search: $query" - $zz.$setNo search $query + if {[catch {$zz.$setNo search $query}]} { + displayError "Search fail" "Connection closed" + html "\n" + $zz disconnect + return 0 + } if {[catch {egw_wait sessionWait 60}]} { egw_log debug "timeout/cancel in search" -- 1.7.10.4