X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=www%2Fquery.egw;h=74ad296851e55ec8458970dee32f9af055eedf9c;hb=8bafbc608e1ffba9ee87f4856e586dffa57901b8;hp=ba6672f7bf9c96464ae192c5f75dd0d617e1dcd0;hpb=150d836eb46d0dde8fedeb77fc7fd4ef6eafba4f;p=egate.git
diff --git a/www/query.egw b/www/query.egw
index ba6672f..74ad296 100644
--- a/www/query.egw
+++ b/www/query.egw
@@ -1,10 +1,15 @@
-
- WWW/Z39.50 Gateway Query Form
-
-
{
-# $Id: query.egw,v 1.8 1995/11/02 16:35:36 adam Exp $
+# $Id: query.egw,v 1.39 1996/03/14 11:50:47 adam Exp $
+
+ if {[info commands saveState] == ""} {
+ source z39util.tcl
+ if {![info exists debug]} {
+ session-lost
+ egw_abort
+ }
+ }
+
proc fail-response {} {
global sessionWait
set sessionWait -1
@@ -19,55 +24,101 @@ proc ok-response {} {
global nextSetNo
global hist
- set host [lindex $sessionParms 0]
+ html { WWW/Z39.50 Gateway Query Form}
+
+ set initSet [lindex $sessionParms 0]
+ set host [lindex $sessionParms 1]
+ set scanLine [lindex $sessionParms 2]
+ set scanTerm [lrange $sessionParms 3 end]
- if {[info exists setNo]} {
- set oldHost $hist($setNo,host)
- } else {
- set oldHost ""
- }
if {[catch {set setNo $nextSetNo}]} {
set nextSetNo 1
set setNo 1
}
- set hist($setNo,host) $host
-
- if {[catch {z39 failback fail-response}]} {
- ir z39
+ if {[catch {set oldHost [z390 connect]}]} {
+ set oldHost ""
}
- z39 callback ok-response
- z39 failback fail-response
- if {$host != $oldHost} {
- catch {z39 disconnect}
- html "Connecting to target " $host "
\n"
+ set hist($setNo,0,host) $host
+ set hist($setNo,0,idAuthentication) [lindex $targets($host) 3]
+
+ mkAssoc z390 $host
+
+ z390 callback ok-response
+ z390 failback fail-response
+ set thisHost [splitHostSpec $host]
+ if {[string compare $thisHost $oldHost]} {
+ catch {z390 disconnect}
+
set sessionWait 0
- if {[catch {z39 connect $host}]} {
- html "Cannot connect to target ${host}
\n"
+ if {[catch {z390 connect $thisHost}]} {
+ displayError "Cannot connect to target ${thisHost}" {}
html "\n"
- wabort
+ z390 disconnect
+ egw_abort
} elseif {$sessionWait == 0} {
- zwait sessionWait
+ if {[catch {egw_wait sessionWait 35}]} {
+ displayError "Cannot connect to target ${thisHost}" {}
+ html "