Attempt to inform user if session has really terminated.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 14 Mar 1996 11:50:44 +0000 (11:50 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 14 Mar 1996 11:50:44 +0000 (11:50 +0000)
14 files changed:
www/history.egw
www/mquery.egw
www/msearch.egw
www/mtargets.egw
www/nwi.egw
www/nwiutil.tcl
www/query.egw
www/search.egw
www/showfull.egw
www/targets.egw
www/tdefine.egw
www/tform.egw
www/z39util.tcl
www/ztargets.conf

index 4c18e79..f9360d3 100644 (file)
@@ -1,15 +1,17 @@
 <html>
 <html>
-<head>
-<title> WWW/Z39.50 Gateway History</title>
-</head>
-<body>
 {
 {
-# $Id: history.egw,v 1.7 1996/03/13 14:07:29 adam Exp $
+# $Id: history.egw,v 1.8 1996/03/14 11:50:44 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
 
     }
 
+    html {<head><title> WWW/Z39.50 Gateway History</title></head><body>}
+
     set useIcons 1
     button-main
     button-new-target
     set useIcons 1
     button-main
     button-new-target
@@ -19,8 +21,7 @@
     set useIcons 0
     button-main
     button-new-target
     set useIcons 0
     button-main
     button-new-target
-}
-{
+
     catch maintenance
     if {!$debug} return
     html "<hr>\n"
     catch maintenance
     if {!$debug} return
     html "<hr>\n"
index 364a8cd..b694786 100644 (file)
@@ -1,13 +1,13 @@
 <html>
 <html>
-<head>
-<title> WWW/Z39.50 Gateway Query Form</title>
-</head>
-<body>
 {
 {
-# $Id: mquery.egw,v 1.15 1996/03/13 14:07:29 adam Exp $
+# $Id: mquery.egw,v 1.16 1996/03/14 11:50:45 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
 
     global setNo
     }
 
     global setNo
@@ -20,6 +20,8 @@
         set setNo 1
     }
 
         set setNo 1
     }
 
+    html {<head><title> WWW/Z39.50 Gateway Query Form</title></head><body>}
+
     set useIcons 1
     button-main
     button-new-target
     set useIcons 1
     button-main
     button-new-target
index ef43804..5544a3c 100644 (file)
@@ -1,9 +1,13 @@
 <html>
 {
 <html>
 {
-# $Id: msearch.egw,v 1.20 1996/03/13 14:07:29 adam Exp $
+# $Id: msearch.egw,v 1.21 1996/03/14 11:50:45 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
     global sessionWait
     global nextSetNo
     }
     global sessionWait
     global nextSetNo
index e3bb9dd..0d23dc9 100644 (file)
@@ -1,11 +1,8 @@
 <html>
 {
 <html>
 {
-# $Id: mtargets.egw,v 1.19 1996/03/13 14:07:30 adam Exp $
+# $Id: mtargets.egw,v 1.20 1996/03/14 11:50:46 adam Exp $
     set setNo 1
     source ztargets.conf
     set setNo 1
     source ztargets.conf
-    if {[info commands saveState] == ""} {
-        source z39util.tcl
-    }
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
             set debug 1
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
             set debug 1
@@ -13,6 +10,9 @@
             set debug 0
         }
     }
             set debug 0
         }
     }
+    if {[info commands saveState] == ""} {
+        source z39util.tcl
+    }
     set html3 [lindex $sessionParms 0]
     if {[string length $html3] == 0} {
         if {![info exists env(HTTP_USER_AGENT)]} {
     set html3 [lindex $sessionParms 0]
     if {[string length $html3] == 0} {
         if {![info exists env(HTTP_USER_AGENT)]} {
index a42ac74..75209c3 100644 (file)
@@ -1,15 +1,12 @@
 <html>
 {
 <html>
 {
-# $Id: nwi.egw,v 1.3 1996/03/13 14:07:30 adam Exp $
+# $Id: nwi.egw,v 1.4 1996/03/14 11:50:46 adam Exp $
     source ztargets.conf
 
     set scriptQuery nwi.egw
     set scriptTarget {}
     set utilExtension nwiutil.tcl
 
     source ztargets.conf
 
     set scriptQuery nwi.egw
     set scriptTarget {}
     set utilExtension nwiutil.tcl
 
-    if {[info commands saveState] == ""} {
-        source z39util.tcl
-    }
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
             set debug 1
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
             set debug 1
@@ -17,6 +14,9 @@
             set debug 0
         }
     }
             set debug 0
         }
     }
+    if {[info commands saveState] == ""} {
+        source z39util.tcl
+    }
     set html3 [lindex $sessionParms 0]
     if {[string length $html3] == 0} {
         if {![info exists env(HTTP_USER_AGENT)]} {
     set html3 [lindex $sessionParms 0]
     if {[string length $html3] == 0} {
         if {![info exists env(HTTP_USER_AGENT)]} {
index a3aa8ba..85b824d 100644 (file)
@@ -1,5 +1,5 @@
 #
 #
-# $Id: nwiutil.tcl,v 1.1 1996/03/12 16:30:27 adam Exp $
+# $Id: nwiutil.tcl,v 1.2 1996/03/14 11:50:46 adam Exp $
 #
 
 proc button-main {} {
 #
 
 proc button-main {} {
@@ -15,6 +15,6 @@ proc button-main {} {
 proc maintenance {} {
     html {<hr>This page is maintained by }
     html {<a href="mailto:adam@index.ping.dk"> Adam Dickmeiss </a>.}
 proc maintenance {} {
     html {<hr>This page is maintained by }
     html {<a href="mailto:adam@index.ping.dk"> Adam Dickmeiss </a>.}
-    html {Last modified March 12, 1996. <br>}
+    html {Last modified March 14, 1996. <br>}
 }
 
 }
 
index f17cc58..74ad296 100644 (file)
@@ -1,13 +1,13 @@
 <html>
 <html>
-<head>
-<title> WWW/Z39.50 Gateway Query Form</title>
-</head>
-<body>
 {
 {
-# $Id: query.egw,v 1.38 1996/03/13 14:07:30 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 commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
 
 proc fail-response {} {
     }
 
 proc fail-response {} {
@@ -24,6 +24,8 @@ proc ok-response {} {
     global nextSetNo
     global hist
 
     global nextSetNo
     global hist
 
+    html {<head><title> WWW/Z39.50 Gateway Query Form</title></head><body>}
+
     set initSet [lindex $sessionParms 0]
     set host [lindex $sessionParms 1]
     set scanLine [lindex $sessionParms 2]
     set initSet [lindex $sessionParms 0]
     set host [lindex $sessionParms 1]
     set scanLine [lindex $sessionParms 2]
index fd25d08..88969cd 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: search.egw,v 1.38 1996/03/13 14:07:31 adam Exp $
+# $Id: search.egw,v 1.39 1996/03/14 11:50:48 adam Exp $
 
 proc start-scan {scanNo targetNo cache dir initSet} {
     global sessionId
 
 proc start-scan {scanNo targetNo cache dir initSet} {
     global sessionId
@@ -170,6 +170,10 @@ proc start-scan {scanNo targetNo cache dir initSet} {
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
     global sessionWait
     global nextSetNo
     }
     global sessionWait
     global nextSetNo
index 8b33a18..abd1277 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
 <html>
 {
-# $Id: showfull.egw,v 1.23 1996/03/13 14:07:31 adam Exp $
+# $Id: showfull.egw,v 1.24 1996/03/14 11:50:49 adam Exp $
 
 proc buttons {setNo tno no format count host after} {
     global sessionId
 
 proc buttons {setNo tno no format count host after} {
     global sessionId
@@ -70,6 +70,10 @@ proc buttons {setNo tno no format count host after} {
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
 
     global setNo
     }
 
     global setNo
index 04b5ec0..bd4838b 100644 (file)
@@ -1,10 +1,7 @@
 <html>
 {
 <html>
 {
-# $Id: targets.egw,v 1.23 1996/03/13 14:07:31 adam Exp $
+# $Id: targets.egw,v 1.24 1996/03/14 11:50:49 adam Exp $
     source ztargets.conf
     source ztargets.conf
-    if {[info commands saveState] == ""} {
-        source z39util.tcl
-    }
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
             set debug 1
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
             set debug 1
@@ -12,6 +9,9 @@
             set debug 0
         }
     }
             set debug 0
         }
     }
+    if {[info commands saveState] == ""} {
+        source z39util.tcl
+    }
     set html3 [lindex $sessionParms 0]
     if {[string length $html3] == 0} {
         if {![info exists env(HTTP_USER_AGENT)]} {
     set html3 [lindex $sessionParms 0]
     if {[string length $html3] == 0} {
         if {![info exists env(HTTP_USER_AGENT)]} {
         button-view-history
     }
     button-define-target
         button-view-history
     }
     button-define-target
-    html "<h2>Choose a target</h2><br>\n"
+    html "<h2>Select a target</h2><br>\n"
     html "<dl>\n"
 
     html "<dl>\n"
 
+    if {1} {
+    proc headlineC {h} {
+        html {<dt><h2>} $h \n {</h2>}
+    }
+    proc targetC {t} {
+        global targets
+        global env
+        global sessionId
+
+        html {<dt><b><a href="http:} $env(SCRIPT_NAME) /
+        html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0]
+        html {</a></b>}
+
+        html {<dd>}
+        set desc [lindex $targets($t) 4]
+        if {[string length $desc] > 0} {
+            html "$desc<br>\n"
+        }
+        html "<br>\n"
+    }
+    serverList headlineC targetC
+
+    } else {
     proc targetsCmp {l r} {
         global targets
         return [string compare [string tolower [lindex $targets($l) 0]] \
     proc targetsCmp {l r} {
         global targets
         return [string compare [string tolower [lindex $targets($l) 0]] \
@@ -59,6 +82,7 @@
             html "<dd>$desc\n"
         }
     }
             html "<dd>$desc\n"
         }
     }
+    }
     html "</dl><br>\n"
     set useIcons 0
     button-main 
     html "</dl><br>\n"
     set useIcons 0
     button-main 
index ca5f862..28f27c8 100644 (file)
@@ -1,14 +1,18 @@
 <html>
 <html>
-<head>
-<title> WWW/Z39.50 Gateway Target Definition Response</title>
-</head>
-<body>
 {
 {
-# $Id: tdefine.egw,v 1.5 1996/03/13 14:07:31 adam Exp $
+# $Id: tdefine.egw,v 1.6 1996/03/14 11:50:49 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
     }
+
+    html {<head><title> WWW/Z39.50 Gateway Target Definition Response</title>}
+    html {</head><body>}
+
     set useIcons 1
     button-main
     button-define-target
     set useIcons 1
     button-main
     button-define-target
@@ -22,6 +26,7 @@
     set databases [lindex [egw_form databases] 0]
     set authentication [egw_form authentication]
     set fields [lindex [egw_form fields] 0]
     set databases [lindex [egw_form databases] 0]
     set authentication [egw_form authentication]
     set fields [lindex [egw_form fields] 0]
+    set recordType [lindex [egw_form recordtype] 0]
 
     set ok 1
     if {[string length $name] == 0} {
 
     set ok 1
     if {[string length $name] == 0} {
         html "<em>must</em> be specified.<br>\n"
         set ok 0
     }
         html "<em>must</em> be specified.<br>\n"
         set ok 0
     }
+    if {[string length $recordType] == 0} {
+        html "You didn't specify any record type. One record type "
+        html "<em>must</em> be specified.<br>\n"
+        set ok 0
+    }
     catch {unset item}
     catch {unset attrList}
     set fname {}
     catch {unset item}
     catch {unset attrList}
     set fname {}
         html " search fields must be present<br>\n"
         set ok 0
     }
         html " search fields must be present<br>\n"
         set ok 0
     }
+    if {![string compare recordType WAIS]} {
+        set attrList { {Free-text} {} }
+    }
     set hostSpec [mergeHostSpec $host $databases]
     if {$ok} {
         global targets
         set targets($hostSpec) [list \
             [join $name] \
     set hostSpec [mergeHostSpec $host $databases]
     if {$ok} {
         global targets
         set targets($hostSpec) [list \
             [join $name] \
-            USMARC \
+            $recordType \
             $attrList \
             $authentication \
             $description \
             $attrList \
             $authentication \
             $description \
-            1 ]
+            1 \
+            user ]
         html "Target successfully defined<br>\n"
     }
     html "<p>\n"
         html "Target successfully defined<br>\n"
     }
     html "<p>\n"
 
     if {!$debug} return
 
 
     if {!$debug} return
 
-    html "name=" $name "<br>\n"
+    html "\n<br>name=" $name "<br>\n"
     html "description=" $description "<br>\n"
     html "host=" $host "<br>\n"
     html "databases=" $databases "<br>\n"
     html "description=" $description "<br>\n"
     html "host=" $host "<br>\n"
     html "databases=" $databases "<br>\n"
index ce34990..5c6f060 100644 (file)
@@ -1,14 +1,17 @@
 <html>
 <html>
-<head>
-<title> WWW/Z39.50 Gateway Target Definition</title>
-</head>
-<body>
 {
 {
-# $Id: tform.egw,v 1.5 1996/03/13 14:07:32 adam Exp $
+# $Id: tform.egw,v 1.6 1996/03/14 11:50:50 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
     }
+    html {<head><title>WWW/Z39.50 Gateway Target Definition</title>}
+    html {</head><body>}
+
     set useIcons 1
     button-main
     button-new-target
     set useIcons 1
     button-main
     button-new-target
     html "i.e. passwords. Leave this field empty if no authentication "
     html "string is required.</font>"
 
     html "i.e. passwords. Leave this field empty if no authentication "
     html "string is required.</font>"
 
+    html "\n<dt>Record type:\n"
+    html {<dd><select name="recordtype">}
+    html {<option> USmarc} \n
+    html {<option> WAIS} \n
+    html {<option> SUTRS} \n
+    html {<option> UNImarc} \n
+    html {<option> UKmarc} \n
+    html {<option> Danmarc} \n
+    html {<option> Normarc} \n
+    html {<option> Librismarc} \n
+    html {</select>}
+    html "\n<br><font size=2>Select WAIS for a WAIS server. The "
+    html "other formats apply to Z39.50 servers</font>"
+
     html "\n<dt>Databases\n"
     html {<dd><textarea rows=3 cols=55 name="databases"></textarea>}
     html "\n<br><font size=2>Separate each database by blanks</font>"
     html "\n<dt>Databases\n"
     html {<dd><textarea rows=3 cols=55 name="databases"></textarea>}
     html "\n<br><font size=2>Separate each database by blanks</font>"
index ba0b55e..36a28a1 100644 (file)
@@ -1,5 +1,5 @@
 #
 #
-# $Id: z39util.tcl,v 1.40 1996/03/13 14:07:32 adam Exp $
+# $Id: z39util.tcl,v 1.41 1996/03/14 11:50:51 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
 #
 proc saveState {} {
     uplevel #0 {
@@ -1872,6 +1872,22 @@ proc serverList {headlineProc targetProc} {
     rename targetsCmp {}
 }
 
     rename targetsCmp {}
 }
 
+proc session-lost {} {
+    global useIcons
+
+    html {<head><title>WWW/Z39.50 Gateway: Session Expired</title></head>}
+    html \n {<body>}
+    set useIcons 1
+    button-main
+    html {<h1>Session Expired</h1>}
+    html {Your session has expired. Please reload the gateways' }
+    html {front page.<br><br>} \n
+    set useIcons 0
+    button-main
+    html {</body></html>}
+}
+
 if {[info exists utilExtension]} {
     source $utilExtension
 if {[info exists utilExtension]} {
     source $utilExtension
-}
\ No newline at end of file
+}
+
index b7d2dfd..504e64f 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: ztargets.conf,v 1.31 1996/03/13 14:07:33 adam Exp $
+# $Id: ztargets.conf,v 1.32 1996/03/14 11:50:53 adam Exp $
 #
 # This file contains the predefined targets in the WWW-Z39.50 gateway
 # Each target is an entry in the associative array "targets". The
 #
 # This file contains the predefined targets in the WWW-Z39.50 gateway
 # Each target is an entry in the associative array "targets". The
@@ -200,7 +200,7 @@ set targets(Tikal.dev.oclc.org/AGRICOLA) [list \
 ]
 
 set targets(nwi.ub2.lu.se/sverige) {
 ]
 
 set targets(nwi.ub2.lu.se/sverige) {
-    NWI-Sweden
+    Sweden
     WAIS \
     { { Free-text {@attr 1=4} } }
     {}
     WAIS \
     { { Free-text {@attr 1=4} } }
     {}
@@ -211,7 +211,7 @@ set targets(nwi.ub2.lu.se/sverige) {
 
 
 set targets(nwi.ub2.lu.se/new_nor_lib) {
 
 
 set targets(nwi.ub2.lu.se/new_nor_lib) {
-    NWI-Norway
+    Norway
     WAIS
     { { Free-text {@attr 1=4} } }
     {}
     WAIS
     { { Free-text {@attr 1=4} } }
     {}
@@ -301,3 +301,6 @@ set groupsOrder(z39sample)          99
 set groupsDescription(test)         {Test servers}
 set groupsOrder(test)               100
 
 set groupsDescription(test)         {Test servers}
 set groupsOrder(test)               100
 
+set groupsDescription(user)         {User defined servers}
+set groupsOrder(user)               101
+