From 949f8c4efedfe6d191264853690c84f527e1790b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 1 Nov 1995 16:15:44 +0000 Subject: [PATCH] Better presentation of records. Query/set number persistent. --- www/query.egw | 126 +++++++++++++++++++------------- www/search.egw | 207 ++++++++++++++++++++++++++++++++++++++--------------- www/showfull.egw | 8 ++- www/targets.egw | 16 +++-- www/wirtcl.c | 7 +- www/wsh.c | 14 +++- www/ztargets.conf | 4 +- 7 files changed, 261 insertions(+), 121 deletions(-) diff --git a/www/query.egw b/www/query.egw index 8450154..d07e2c3 100644 --- a/www/query.egw +++ b/www/query.egw @@ -4,7 +4,7 @@ { -# $Id: query.egw,v 1.6 1995/10/31 16:56:23 adam Exp $ +# $Id: query.egw,v 1.7 1995/11/01 16:15:44 adam Exp $ proc fail-response {} { global sessionWait set sessionWait -1 @@ -15,57 +15,76 @@ proc ok-response {} { set sessionWait 1 } - global host + global setNo + global nextSetNo + global hist + set host $sessionParms - set databases [lindex $targets($host) 1] - catch {z39 disconnect} - set sessionWait 0 - ir z39 - z39 failback fail-response + + if {[info exists setNo]} { + set oldHost $hist($setNo,host) + } else { + set oldHost "" + } + set setNo $nextSetNo + set hist($setNo,host) $host + + if {[catch {z39 failback fail-response}]} { + ir z39 + } z39 callback ok-response - if {[catch {z39 connect $host}]} { - htmlr "Cannot connect to target ${host}
" - htmlr "" - wabort - } elseif {$sessionWait == 0} { + z39 failback fail-response + if {$host != $oldHost} { + catch {z39 disconnect} + + html "Connecting to target " $host "
\n" + set sessionWait 0 + if {[catch {z39 connect $host}]} { + html "Cannot connect to target ${host}
\n" + html "\n" + wabort + } elseif {$sessionWait == 0} { + zwait sessionWait + if {$sessionWait != 1} { + html "Cannot connect to target ${host}
\n" + html "\n" + wabort + } + } + set sessionWait 0 + z39 init zwait sessionWait - if {$sessionWait != 1} { - htmlr "Cannot connect to target ${host}
" + if {$sessionWait != "1"} { + htmlr "Cannot initialize with target ${host}
" htmlr "" wabort } } - set sessionWait 0 - z39 init - zwait sessionWait - if {$sessionWait == -1} { - htmlr "Cannot initialize with target ${host}
" - htmlr "" - wabort - } - htmlr {

Search in databases

} + set databases [lindex $targets($host) 1] + + html "

Search in databases

\n" html {
} + html / $sessionId {/search.egw/} $setNo {" method=post>} \n set nodb [llength $databases] if {$nodb > 1} { if {$nodb > 2} { - html {The chosen target supports searching in } - htmlr {several databases.
} - htmlr {Choose the bases you want to search:
} + html "The chosen target supports searching in " + html "several databases.
\n" + html "Choose the bases you want to search:
\n" } set i 0 foreach d $databases { html { } $d + html {"> } $d \n } else { - htmlr {" checked> } $d + html {" checked> } $d \n } } - htmlr {
} + html "
\n" if {$nodb > 2} { html { All
} + html [concat $databases] {"> All
} \n } } } @@ -74,26 +93,26 @@ proc ok-response {} { { set fields [lindex $targets($host) 2] for {set no 1} {$no < 4} {incr no} { - htmlr {} \n foreach f $fields { - htmlr {