From: Adam Dickmeiss Date: Tue, 14 Nov 1995 16:01:50 +0000 (+0000) Subject: Bug fix: didn't use correct database(s) when 'all' checkbox was selected. X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=a6e5ecf2a6d6dedf266c5f9d6bc2447a528b199e;p=egate.git Bug fix: didn't use correct database(s) when 'all' checkbox was selected. --- diff --git a/www/Makefile b/www/Makefile index 4c97ecb..c8af615 100644 --- a/www/Makefile +++ b/www/Makefile @@ -2,7 +2,10 @@ # Europagate, 1995 # # $Log: Makefile,v $ -# Revision 1.15 1995/11/13 18:17:46 adam +# Revision 1.16 1995/11/14 16:01:50 adam +# Bug fix: didn't use correct database(s) when 'all' checkbox was selected. +# +# Revision 1.15 1995/11/13 18:17:46 adam # Better error handling. # # Revision 1.14 1995/11/13 15:41:40 adam @@ -61,11 +64,12 @@ SHELL=/bin/sh 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) +#NETLIB=-lnsl -lsocket # OLIB=../lib/util.a ../lib/libres+log.a -TCLLIB=/usr/local/lib/libtcl7.4.a +TCLLIB=/usr/local/lib/libtcl.a # WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \ mtargets.egw mquery.egw msearch.egw diff --git a/www/query.egw b/www/query.egw index 4d3d365..88b7cf2 100644 --- a/www/query.egw +++ b/www/query.egw @@ -4,7 +4,7 @@ { -# $Id: query.egw,v 1.16 1995/11/13 18:17:47 adam Exp $ +# $Id: query.egw,v 1.17 1995/11/14 16:01:50 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -123,7 +123,7 @@ proc ok-response {} { } html "
\n" if {$nodb > 2} { - html { All
} \n } } diff --git a/www/search.egw b/www/search.egw index dd7162d..a249f6c 100644 --- a/www/search.egw +++ b/www/search.egw @@ -1,6 +1,6 @@ { -# $Id: search.egw,v 1.16 1995/11/13 18:17:48 adam Exp $ +# $Id: search.egw,v 1.17 1995/11/14 16:01:51 adam Exp $ proc buttons {setNo setMax startPos after} { global sessionId @@ -87,8 +87,14 @@ proc buttons {setNo setMax startPos after} { set hist($setNo,form,logic2) [wform logic2] incr nextSetNo + + set host $hist($setNo,host) + set databases [lindex $targets($host) 1] + set b [wform base] - if {$b == ""} { + if {[wform baseall] != ""} { + set hist($setNo,database) $databases + } elseif {$b == ""} { set hist($setNo,database) $databases } else { set hist($setNo,database) $b diff --git a/www/z39util.tcl b/www/z39util.tcl index 23fabd6..216784c 100644 --- a/www/z39util.tcl +++ b/www/z39util.tcl @@ -1,5 +1,5 @@ # -# $Id: z39util.tcl,v 1.10 1995/11/14 09:53:16 adam Exp $ +# $Id: z39util.tcl,v 1.11 1995/11/14 16:01:52 adam Exp $ # proc saveState {} { uplevel #0 { @@ -412,7 +412,11 @@ proc z39search {setNo piggy tno elements} { displayError "Cannot connect to target" $host return 0 } elseif {$sessionWait == 0} { - zwait sessionWait + if {[catch {zwait sessionWait 300}]} { + $zz disconnect + displayError "Cannot connect to target" $host + return 0 + } if {$sessionWait != 1} { displayError "Cannot connect to target" $host return 0 @@ -422,6 +426,7 @@ proc z39search {setNo piggy tno elements} { set sessionWait 0 if {[catch {$zz init}]} { displayError "Cannot initialize target" $host + $zz disconnect return 0 } if {[catch {zwait sessionWait 60}]} { @@ -454,6 +459,7 @@ proc z39search {setNo piggy tno elements} { $zz.$setNo mediumSetElementSetNames $elements $zz.$setNo recordElements $elements + wlog debug "database=$database" eval $zz.$setNo databaseNames $database $zz.$setNo preferredRecordSyntax USMARC @@ -472,27 +478,20 @@ proc z39search {setNo piggy tno elements} { $zz.$setNo search $query if {[catch {zwait sessionWait 600}]} { - wlog debug "timeout/cancel in present" + wlog debug "timeout/cancel in search" displayError "Timeout in search" {} html "\n" $zz disconnect return 0 } - if {$sessionWait != 1} { + if {$sessionWait == -1} { displayError "Search fail" "Connection closed" html "\n" $zz disconnect - return 0 } - set status [$zz.$setNo responseStatus] - if {[lindex $status 0] == "NSD"} { - set code [lindex $status 1] - set msg [lindex $status 2] - set addinfo [lindex $status 3] - displayError "Diagnostic message" \ - "$msg: $addinfo\n
(error code $code)" - return 0 + if {$sessionWait != 1} { + return 0 } set hist($setNo,hits) [$zz.$setNo resultCount] return 1 diff --git a/www/ztargets.conf b/www/ztargets.conf index cda4a19..263f81e 100644 --- a/www/ztargets.conf +++ b/www/ztargets.conf @@ -1,4 +1,4 @@ -# $Id: ztargets.conf,v 1.11 1995/11/14 09:53:17 adam Exp $ +# $Id: ztargets.conf,v 1.12 1995/11/14 16:01:53 adam Exp $ set commonFields { { Title {@attr 1=4} } { Author {@attr 1=1003} } @@ -74,7 +74,7 @@ set targets(localhost:9999) [list \ set targets(dtbsun.dtv.dk:9999) { Zserver - {usgs esdd cd_rom iah unknown} + {usgs esdd cd_rom iah} { { Title {@attr 1=4} } { Author {@attr 1=1003} }