Work on WAIS protocol.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 12 Mar 1996 16:30:26 +0000 (16:30 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 12 Mar 1996 16:30:26 +0000 (16:30 +0000)
17 files changed:
www/Makefile
www/gif/button-nwi.gif [new file with mode: 0644]
www/gif/button-raw-marc.gif
www/history.egw
www/mquery.egw
www/msearch.egw
www/mtargets.egw
www/nwi.egw
www/nwiutil.tcl [new file with mode: 0644]
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 f201b75..8744ac0 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile for www gateway utility
 # Europagate, 1995
 #
-# $Id: Makefile,v 1.36 1996/03/11 17:40:47 adam Exp $
+# $Id: Makefile,v 1.37 1996/03/12 16:30:26 adam Exp $
 #
 SHELL=/bin/sh
 
@@ -21,7 +21,7 @@ TCLINC=
 
 WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \
  mtargets.egw mquery.egw msearch.egw history.egw tform.egw tdefine.egw \
- sameas.egw nwi.egw
+ sameas.egw nwi.egw nwiutil.tcl
 HSCRIPTS=egwindex.html
 CONFFILES=egw.res ztargets.conf
 TPROG1=egwcgi
diff --git a/www/gif/button-nwi.gif b/www/gif/button-nwi.gif
new file mode 100644 (file)
index 0000000..fe77fdb
Binary files /dev/null and b/www/gif/button-nwi.gif differ
index 38b4052..c1ce36f 100644 (file)
Binary files a/www/gif/button-raw-marc.gif and b/www/gif/button-raw-marc.gif differ
index 90ce2ce..fe8e872 100644 (file)
@@ -4,20 +4,20 @@
 </head>
 <body>
 {
-# $Id: history.egw,v 1.5 1996/01/26 15:50:06 adam Exp $
+# $Id: history.egw,v 1.6 1996/03/12 16:30:26 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
     }
 
     set useIcons 1
-    button-europagate
+    button-main
     button-new-target 0
 
     z39history
 
     set useIcons 0
-    button-europagate
+    button-main
     button-new-target 0
 }
 {
index 69dcd19..fa2c809 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: mquery.egw,v 1.13 1996/03/08 16:47:04 adam Exp $
+# $Id: mquery.egw,v 1.14 1996/03/12 16:30:26 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -21,7 +21,7 @@
     }
 
     set useIcons 1
-    button-europagate
+    button-main
     button-new-target 0
 
     html {<form action="http:} $env(SCRIPT_NAME)
@@ -86,7 +86,7 @@
     html "</select><br>\n"
 
     set useIcons 0
-    button-europagate
+    button-main
     button-new-target 0
 }
 {
index e31fff3..6959878 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: msearch.egw,v 1.18 1996/03/11 17:40:47 adam Exp $
+# $Id: msearch.egw,v 1.19 1996/03/12 16:30:26 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -16,7 +16,7 @@
 
     set setNo [lindex $sessionParms 0]
 
-    if {[string length [egw_form entry1]] > 0} {
+    if {[llength [egw_form]] > 0} {
         if {[string length [egw_form host]] > 0} {
             set hist($setNo,0,host) [llength [egw_form host]]
             set i 1
                 incr i
             }
         }
+        if {![info exists hist($setNo,0,host)]} {
+            displayError {No servers selected} {}
+            egw_abort
+        }
         set hist($nextSetNo,0,host) $hist($setNo,0,host)
         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
             set hist($nextSetNo,$i,host) $hist($setNo,$i,host)
         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
             set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 3]
         }
+
+        set hist($setNo,form,menu1) [egw_form menu1]
+        set hist($setNo,form,menu2) [egw_form menu2]
+        set hist($setNo,form,menu3) [egw_form menu3]
+
+        set hist($setNo,form,entry1) [egw_form entry1]
+        set hist($setNo,form,entry2) [egw_form entry2]
+        set hist($setNo,form,entry3) [egw_form entry3]
+
+        set hist($setNo,form,logic1) [egw_form logic1]
+        set hist($setNo,form,logic2) [egw_form logic2]
+        set hist($setNo,form,logic3) {}
+        
         set hist($setNo,maxPresent) [egw_form hits]
         if {$hist($setNo,maxPresent) == ""} {
             set hist($setNo,maxPresent) 20
@@ -55,7 +72,7 @@
     }
 
     set useIcons 1
-    button-europagate
+    button-main
     button-new-query 1 $setNo
     button-new-target 0
 
@@ -65,7 +82,7 @@
     display-result-set-m $setNo
 
     set useIcons 0
-    button-europagate
+    button-main
     button-new-query 1 $setNo
     button-new-target 0
 }
index 46cd770..4ac743e 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: mtargets.egw,v 1.17 1996/03/08 16:47:05 adam Exp $
+# $Id: mtargets.egw,v 1.18 1996/03/12 16:30:27 adam Exp $
     set setNo 1
     source ztargets.conf
     if {[info commands saveState] == ""} {
 </head>
 <body>
 {
+    set scriptQuery mquery.egw
+    set scriptTarget mtargets.egw
+
     set useIcons 1
-    button-europagate
+    button-main
     button-define-target 0
 
     html "<h2>Choose one or more targets</h2>\n"
@@ -42,8 +45,6 @@
     html / $sessionId {/mquery.egw/} $setNo {" method=get><br>} \n
     html "<dl>\n"
 
-
-
     proc targetsCmp {l r} {
         global targets
         return [string compare [string tolower [lindex $targets($l) 0]] \
@@ -71,7 +72,7 @@
 
     html "<p>\n"
     set useIcons 0
-    button-europagate
+    button-main
     button-define-target 0
 }
 
index b2b7d22..ef66aec 100644 (file)
@@ -1,7 +1,12 @@
 <html>
 {
-# $Id: nwi.egw,v 1.1 1996/03/11 17:41:16 adam Exp $
+# $Id: nwi.egw,v 1.2 1996/03/12 16:30:27 adam Exp $
     source ztargets.conf
+
+    set scriptQuery nwi.egw
+    set scriptTarget {}
+    set utilExtension nwiutil.tcl
+
     if {[info commands saveState] == ""} {
         source z39util.tcl
     }
     }
 
     set useIcons 1
-    button-europagate
-    button-new-target 0
+    button-main
 
+    set initSet [lindex $sessionParms 0]
+    set curSort score
+    set curFormat brief
+    set curEntry {}
+    catch {
+        if {$initSet > 0} {
+            for {set i 1} {$i <= $hist($initSet,0,host)} {incr i} {
+                lappend curTargets $hist($initSet,$i,host)
+            }
+            set curSort $hist($initSet,sort)
+            set curFormat $hist($initSet,format)
+            set curEntry $hist($initSet,form,entry1)
+        }
+    }
     html {<form action="http:} $env(SCRIPT_NAME)
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
 
-    html "Enter your query:<br>\n"
+    html "<dl>"
+    html {<dt><b>Enter your query</b><dd>}
 
-    html {<input type="text" name="entry1" size=50>}
+    html {<input type="text" name="entry1" size=50 value="}
+    html [join $curEntry] {">}
     html {<input type=submit value="Search"><br>}
 
-    html {and search the following servers:<br>}
+    html {<dt><b>and search the following servers</b><dd>}
 
-    html {<input type="checkbox" name="host"}
-    html { value="nwi.ub2.lu.se/sverige"> Sweden}
-    html {<input type="checkbox" name="host" }
-    html { value="nwi.ub2.lu.se/new_nor_lib"> Norway}
-
-    html "<br>\n"
-
-    html {Display each record in <select name="format">}
-    html "<option>brief\n"
-    html "<option>medium\n"
+    foreach t {
+            {nwi.ub2.lu.se/sverige}
+            {nwi.ub2.lu.se/new_nor_lib} 
+            {localhost:9999/test}
+            {localhost:210/Default}
+        } {
+        html {<input type="checkbox" name="host" }
+        if {[info exists curTargets]} {
+            if {[lsearch -exact $curTargets $t] != -1} {
+                html {checked }
+            }
+        }
+        html {value="} $t {"> } [lindex $targets($t) 0]
+    }
+    catch {unset curTargets}
+    html {<p><dt><b>Display each record in <select name="format"><dd>}
+    if {![string compare $curFormat brief]} {
+        html "<option>brief\n"
+        html "<option>medium\n"
+    } else {
+        html "<option>medium\n"
+        html "<option>brief\n"
+    }
     html "</select> notation"
     html { and sort by <select name="sort">}
-    html "<option>score\n"
-    html "<option>server\n"
-    html "</select><br>\n"
-}
\ No newline at end of file
+    if {![string compare $curSort score]} {
+        html "<option>score\n"
+        html "<option>server\n"
+    } else {
+        html "<option>server\n"
+        html "<option>score\n"
+    }
+    html "</select></b><br></dl>\n"
+
+    set useIcons 0
+    button-main
+
+    catch maintenance
+}
+
+
diff --git a/www/nwiutil.tcl b/www/nwiutil.tcl
new file mode 100644 (file)
index 0000000..a3aa8ba
--- /dev/null
@@ -0,0 +1,20 @@
+#
+# $Id: nwiutil.tcl,v 1.1 1996/03/12 16:30:27 adam Exp $
+#
+
+proc button-main {} {
+    global useIcons
+    html {<a href="http://europagate.dtv.dk/">}
+    if {$useIcons} {
+        html {<img src="/egwgif/button-nwi.gif" alt="NWI" border=0></a>}
+    } else {
+        html {NWI</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>}
+}
+
index 3e11570..5c5e033 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: query.egw,v 1.36 1996/03/08 16:47:05 adam Exp $
+# $Id: query.egw,v 1.37 1996/03/12 16:30:27 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -24,8 +24,8 @@ proc ok-response {} {
     global nextSetNo
     global hist
 
-    set host [lindex $sessionParms 0]
-    set initSet [lindex $sessionParms 1]
+    set initSet [lindex $sessionParms 0]
+    set host [lindex $sessionParms 1]
     set scanLine [lindex $sessionParms 2]
     set scanTerm [lrange $sessionParms 3 end]
 
@@ -95,7 +95,7 @@ proc ok-response {} {
     }
 
     set useIcons 1
-    button-europagate
+    button-main
     button-new-target 1
     if {[lsearch [z390 options] scan] >= 0} {
         button-scan-window 1 $setNo
@@ -107,7 +107,7 @@ proc ok-response {} {
     html [lindex $targets($host) 4] "<br>\n"
 
     set databases [splitDatabaseSpec $host]
-    if {$initSet == ""} {
+    if {$initSet == -1} {
         set databaseDefault [lindex $databases 0]
         set oSetNo 0
     } else {
@@ -166,7 +166,7 @@ proc ok-response {} {
         if {[string length $template] > 0} {
             html { value="} $template {"}
         }
-        html { size=43> }
+        html { size=35> }
         if {0 && [lsearch [z390 options] scan] >= 0} {
             html {<input type="checkbox" name="scan} $no {" value="1" scan>}
         }
@@ -205,7 +205,7 @@ proc ok-response {} {
     html "<p>\n"
 
     set useIcons 0
-    button-europagate
+    button-main
     button-new-target 1
     if {[lsearch [z390 options] scan] >= 0} {
         button-scan-window 1 $setNo
index 5c90170..3e66629 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: search.egw,v 1.36 1996/03/11 17:40:48 adam Exp $
+# $Id: search.egw,v 1.37 1996/03/12 16:30:28 adam Exp $
 
 proc start-scan {scanNo targetNo cache dir initSet} {
     global sessionId
@@ -21,7 +21,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
     html "</head><body>\n"
 
     set useIcons 1
-    button-europagate
+    button-main
 
     if {$dir == "b"} {
         set lines 20
@@ -120,7 +120,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
 
     set useIcons 0
     if {$hist($setNo,$scanNo,scanTerm) == ""} {
-        button-europagate
+        button-main
         button-new-query 0 $setNo        
         return
     }
@@ -129,7 +129,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
     display-scan $setNo $scanNo 0
     html "<p>\n"
 
-    button-europagate
+    button-main
 
     html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo +
index 9953ccd..194e2a8 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: showfull.egw,v 1.21 1996/03/11 17:40:48 adam Exp $
+# $Id: showfull.egw,v 1.22 1996/03/12 16:30:28 adam Exp $
 
 proc buttons {setNo tno no format count host after} {
     global sessionId
@@ -9,8 +9,11 @@ proc buttons {setNo tno no format count host after} {
     global hist
 
     html "<p>\n"
-    button-europagate
+    button-main
     if {$no < $count} {
+        if {!$useIcons} {
+            html "\n | "
+        }
         html {<a href="http:} $env(SCRIPT_NAME)
         html / $sessionId {/showfull.egw/} $setNo + $tno + 
         html [expr $no + 1] + $format
@@ -18,10 +21,13 @@ proc buttons {setNo tno no format count host after} {
             html {"><img src="/egwgif/button-next-record.gif" }
            html {alt="Next Record" border=0></a>}
         } else {
-            html {">Next</a>} " | \n"
+            html {">Next</a>}
         }
     }
     if {$no > 1} {
+        if {!$useIcons} {
+            html "\n | "
+        }
         html {<a href="http:} $env(SCRIPT_NAME)
         html / $sessionId {/showfull.egw/} $setNo + $tno +
         html [expr $no - 1] + $format
@@ -29,10 +35,13 @@ proc buttons {setNo tno no format count host after} {
             html {"><img src="/egwgif/button-previous-record.gif" }
            html {alt="Previous Record" border=0></a>}
         } else {
-            html {">Previous</a>} " | \n"
+            html {">Previous</a>}
         }
     }
 
+    if {!$useIcons} {
+        html "\n | "
+    }
     html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/showfull.egw/} $setNo + $tno + $no +
     if {$format == "full"} {
@@ -41,7 +50,7 @@ proc buttons {setNo tno no format count host after} {
             html {"><img src="/egwgif/button-raw-marc.gif" }
            html {alt="Raw Format" border=0></a>}
         } else {
-            html {">Raw Format</a>} " | \n"
+            html {">Raw Format</a>}
         }
     } else {
         html full
@@ -49,10 +58,13 @@ proc buttons {setNo tno no format count host after} {
             html {"><img src="/egwgif/button-full-format.gif" }
            html {alt="Full Format" border=0></a>}
         } else {
-            html {">Full Format</a>} " | \n"
+            html {">Full Format</a>}
         }
     }
 
+    if {!$useIcons} {
+        html "\n | "
+    }
     html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
     if {$tno > 0} {
         html {/msearch.egw/} $setNo
@@ -64,7 +76,7 @@ proc buttons {setNo tno no format count host after} {
         html {"><img src="/egwgif/button-result-set.gif" }
        html {alt="Result Set" border=0></a>}
     } else {
-        html {">Result Set</a>} " | \n"
+        html {">Result Set</a>}
     }
 
     button-new-query 1 $setNo
index 975631d..b597347 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: targets.egw,v 1.21 1996/03/08 16:47:06 adam Exp $
+# $Id: targets.egw,v 1.22 1996/03/12 16:30:29 adam Exp $
     source ztargets.conf
     if {[info commands saveState] == ""} {
         source z39util.tcl
 </head>
 <body>
 {
+    set scriptQuery query.egw
+    set scriptTarget targets.egw
+
     set useIcons 1
 
-    button-europagate
+    button-main
     if {[info exists nextSetNo]} {
         button-view-history 1
     }
@@ -51,7 +54,8 @@
     set tn [lsort -command targetsCmp $tt]
     foreach t $tn {
         html {<dt><a href="http:} $env(SCRIPT_NAME) /
-        html "$sessionId/query.egw;/$t" {"> } [lindex $targets($t) 0] " </a>\n"
+        html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0]
+        html " </a>\n"
         set desc [lindex $targets($t) 4]
         if {$desc != ""} {
             html "<dd>$desc\n"
@@ -59,7 +63,7 @@
     }
     html "</dl><br>\n"
     set useIcons 0
-    button-europagate 
+    button-main 
     if {[info exists nextSetNo]} {
         button-view-history 1
     }
index 1db4d89..268f9f8 100644 (file)
@@ -4,13 +4,13 @@
 </head>
 <body>
 {
-# $Id: tdefine.egw,v 1.3 1996/01/26 15:50:11 adam Exp $
+# $Id: tdefine.egw,v 1.4 1996/03/12 16:30:29 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
     }
     set useIcons 1
-    button-europagate
+    button-main
     button-define-target 1
     button-new-target 0
 
@@ -72,7 +72,7 @@
         global targets
         set targets($hostSpec) [list \
             [join $name] \
-            $databases \
+            USMARC \
             $attrList \
             $authentication \
             $description \
@@ -81,7 +81,7 @@
     }
     html "<p>\n"
     set useIcons 0
-    button-europagate
+    button-main
     button-define-target 1
     button-new-target 0
 }
index 368c2c9..14b34e3 100644 (file)
@@ -4,13 +4,13 @@
 </head>
 <body>
 {
-# $Id: tform.egw,v 1.3 1996/01/26 15:50:11 adam Exp $
+# $Id: tform.egw,v 1.4 1996/03/12 16:30:29 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
     }
     set useIcons 1
-    button-europagate
+    button-main
     button-new-target 0
 
     html "<h2>Target definition form</h2><br>\n"
@@ -63,7 +63,7 @@
     html "\n<br>\n"
 
     set useIcons 0
-    button-europagate
+    button-main
     button-new-target 0
 }
 </body></html>
\ No newline at end of file
index 9efda0b..e50db2b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.38 1996/03/11 17:40:49 adam Exp $
+# $Id: z39util.tcl,v 1.39 1996/03/12 16:30:30 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -175,6 +175,7 @@ proc display-brief {zset no setNo targetNo} {
     global env
     global sessionId
 
+    html {<li>}
     set type [$zset type $no]
     if {$type == "SD"} {
         set err [lindex [$zset diag $no] 1]
@@ -581,41 +582,45 @@ proc display-full-wais {zset no setNo targetNo} {
     } else {
         set nwi 1
     }
+    html "<dl>\n"
+    html {<dt><b>Title</b>}
     if {$nwi} {
-        html {Title: <a href="} $data(linkage) {">} $data(title) "</a><br>\n"
-        html {URL: } $data(linkage) "<br>\n"
+        html {<dd><a href="} $data(linkage) {">} $data(title) "</a>"
+        html {<dt><b>URL</b>}
+        html {<dd>} $data(linkage) "<br>\n"
     } else {
-        html {Title: } [join [$zset getWAIS $no headline]] "<br>\n"
+        html {<dd>} [join [$zset getWAIS $no headline]]
     }
-    html {Score: } [$zset getWAIS $no score] "<br>\n"
+    html {<dt><b>Score</b><dd>} [$zset getWAIS $no score]
     set lines [$zset getWAIS $no lines]
     if {$lines > 0} {
-        html {Lines: } $lines "<br>\n"
+        html {<dt><b>Lines</b><dd>} $lines "<br>\n"
     }
     if {!$nwi} {
-        html "<pre>\n" [join [$zset getWAIS $no text]] "\n</pre>\n"
+        html "</dl><pre>\n" [join [$zset getWAIS $no text]] "\n</pre>\n"
         return
     }
     if {[info exists data(bytes)]} {
-        html {Bytes: } $data(bytes) "<br>\n"
+        html {<dt><b>Bytes</b><dd>} $data(bytes)
     }
     if {[info exists data(dateOfLastModification)]} {
-        html {Last modified: } $data(dateOfLastModification) "<br>\n"
+        html {<dt><b>Last modified</b><dd>} $data(dateOfLastModification)
     }
     if {[info exists data(lastChecked)]} {
-        html {Last checked: } $data(lastChecked) "<br>\n"
+        html {<dt><b>Last checked</b><dd>} $data(lastChecked) "<br>\n"
     }
     if {[info exists data(ip)]} {
-        html {<dl><dt>Initial text<dd>} $data(ip) "</dl><br>\n"
+        html {<dt><b>Initial text</b><dd>} $data(ip) "</dl><br>\n"
     }
-
-    html {<a href="} $env(SCRIPT_NAME) / $sessionId {/sameas.egw/}
-    html $setNo + $targetNo + 1 + $hist($setNo,maxPresent) +
-    html [egw_enc [$zset getWAIS $no documentID]] {">}
-    html {Similar WAIS record</a><br>}
-    html "<dl><dt>References\n<dd>\n"
+    if {0} {
+        html {<a href="} $env(SCRIPT_NAME) / $sessionId {/sameas.egw/}
+        html $setNo + $targetNo + 1 + $hist($setNo,maxPresent) +
+        html [egw_enc [$zset getWAIS $no documentID]] {">}
+        html {Similar WAIS record</a><br>}
+    }
+    html "<dt><b>References</b>\n"
     for {set i 1} {[info exists data($i,linkage)]} {incr i} {
-        html {<a href="} $data($i,linkage) {">}
+        html {<dd><a href="} $data($i,linkage) {">}
         if {[info exists data($i,title)]} {
             html $data($i,title)
         } else {
@@ -694,16 +699,16 @@ proc build-query {t ilines} {
     set q {}
     for {set i 1} {$i <= $ilines} {incr i} {
         set term [join [egw_form entry$i]]
+        if {[string length $term] == 0} continue
         if {![string compare [lindex $targets($t) 1] WAIS]} {
-            if {[string length $op] == 0} {
+            if {[string length $q] == 0} {
                 set q $term
             } else {
                 set q "$term $q"
             }
             set op [egw_form logic$i]
             continue
-        }                
-        if {[string length $term] > 0} {
+        } else {
             set field [join [egw_form menu$i]]
             catch {unset attr}
             foreach x [lindex $targets($t) 2] {
@@ -716,13 +721,13 @@ proc build-query {t ilines} {
                 set attr [lindex [lindex [lindex $targets($t) 2] 0] 1]
             }
             switch $op {
-            And
+                And
                 { set q "@and $q ${attr} \"${term}\"" }
-            Or
+                Or
                 { set q "@or $q ${attr} \"${term}\"" }
-            {And not}
+                {And not}
                 { set q "@not $q ${attr} \"${term}\"" }
-            {}
+                {}
                 { set q "${attr} \"${term}\"" }
             }
             set op [egw_form logic$i]
@@ -833,6 +838,7 @@ proc display-scan {setNo scanNo tno} {
     global targets
     global env
     global sessionId
+    global scriptQuery
 
     set zz z39$tno
     set zs $zz.s$scanNo.$setNo
@@ -862,7 +868,7 @@ proc display-scan {setNo scanNo tno} {
         if {0} {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
             html {<a href="http:} $env(SCRIPT_NAME)
-            html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo +
+            html / $sessionId / $scriptQuery / $setNo + $hist($setNo,host) +
             html $hist($setNo,scan) +  $tterm {">}
         } else {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
@@ -1307,19 +1313,25 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} {
 
     set zz z39$targetNo
     html "<p>\n"
-    button-europagate
+    button-main
     if {$setMax > 0 && $setMax < [$zz.$setNo resultCount]} {
+        if {!$useIcons} {
+            html "\n | "
+        }
         html {<a href="http:} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo + 
         html [expr $setMax + 1] + [expr $setMax + $hist($setNo,maxPresent)]
         if {$useIcons} {
-            html {"><img src="/egwgif/button-next-records.gif" alt="Next Records"}
-           html { border=0></a>}
+            html {"><img src="/egwgif/button-next-records.gif" }
+            html {alt="Next Records" border=0></a>}
         } else {
-            html {">Next Records</a>} " | \n"
+            html {">Next Records</a>}
         }
     }
     if {$setMax > 0 && $startPos != "" && $startPos != "1"} {
+        if {!$useIcons} {
+            html "\n | "
+        }
         html {<a href="http:} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo
         html + [expr $startPos - $hist($setNo,maxPresent)]
@@ -1328,7 +1340,7 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} {
             html {"><img src="/egwgif/button-previous-records.gif" }
            html {alt="Previous Records" border=0></a>}
         } else {
-            html {">Previous Records</a>} " | \n"
+            html {">Previous Records</a>} 
         }
     }
     button-new-query 1 $setNo
@@ -1504,6 +1516,7 @@ proc z39history {} {
     global sessionId
     global targets
     global html3
+    global scriptQuery
 
     set targetNo 0
     if {![info exists nextSetNo]} {
@@ -1565,7 +1578,7 @@ proc z39history {} {
             html "<dd>\n"
         }
         html { <a href="http:} $env(SCRIPT_NAME)
-        html / $sessionId {/query.egw/} $host + $setNo
+        html / $sessionId / $scriptQuery / $setNo + $host
         if {$html3} {
             html {">}
         } else {
@@ -1596,19 +1609,19 @@ proc displayError {msga msgb} {
     html "<p><center>\n"
     html {<img src="/egwgif/noway.gif" alt="Error">}
     html "<h2>" $msga "</h2>\n"
-    if {$msgb != ""} {
+    if {[string length $msgb] > 0} {
         html "<h3>" $msgb "</h3>\n"
     }
     html "</center><p>\n"
 }
 
-proc button-europagate {} {
+proc button-main {} {
     global useIcons
     html {<a href="http://europagate.dtv.dk/">}
     if {$useIcons} {
         html {<img src="/egwgif/button-egw.gif" alt="Europagate" border=0></a>}
     } else {
-        html {Europagate</a> | }
+        html {Europagate</a>}
     }
 }
 
@@ -1617,6 +1630,9 @@ proc button-define-target {more} {
     global env
     global sessionId
 
+    if {!$useIcons} {
+        html "\n | "
+    }
     html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/tform.egw}
     if {$useIcons} {
@@ -1624,11 +1640,6 @@ proc button-define-target {more} {
        html {alt="Define Target" border=0></a>}
     } else {
         html {">Define Target</a>}
-        if {$more} {
-            html " | \n"
-        } else {
-            html "\n"
-        }
     }
 }
 
@@ -1637,24 +1648,20 @@ proc button-new-target {more} {
     global env
     global sessionId
     global mMode
+    global scriptTarget
 
-    html {<a href="http:} $env(SCRIPT_NAME)
-    html / $sessionId 
-    if {$mMode} {
-        html {/mtargets.egw}
-    } else {
-        html {/targets.egw}
+    if {[string length $scriptTarget] == 0} return
+
+    if {!$useIcons} {
+        html "\n | "
     }
+    html {<a href="http:} $env(SCRIPT_NAME)
+    html / $sessionId / $scriptTarget
     if {$useIcons} {
         html {"><img src="/egwgif/button-new-target.gif" }
        html {alt="New Target" border=0></a>}
     } else {
         html {">New Target</a>}
-        if {$more} {
-            html " | \n"
-        } else {
-            html "\n"
-        }
     }
 }
 
@@ -1664,6 +1671,9 @@ proc button-view-history {more} {
     global sessionId
     global nextSetNo
 
+    if {!$useIcons} {
+        html "\n | "
+    }
     html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/history.egw;}
     catch { html "/" $nextSetNo}
@@ -1672,11 +1682,6 @@ proc button-view-history {more} {
         html {border=0></a>}
     } else {
         html {">View History</a>}
-        if {$more} {
-            html " | \n"
-        } else {
-            html "\n"
-        }
     }
 }
 
@@ -1686,25 +1691,19 @@ proc button-new-query {more setNo} {
     global sessionId
     global hist
     global mMode
+    global scriptQuery
 
-    html {<a href="http:} $env(SCRIPT_NAME)
-    html / $sessionId 
-    if {$mMode} {
-        html {/mquery.egw/} $setNo
-    } else {
-        html {/query.egw/} $hist($setNo,0,host) + $setNo
+    if {!$useIcons} {
+        html "\n | "
     }
-    html {">}
+    html {<a href="http:} $env(SCRIPT_NAME)
+    html / $sessionId / $scriptQuery / $setNo + $hist($setNo,0,host) {">}
+
     if {$useIcons} {
         html {<img src="/egwgif/button-new-query.gif" }
        html {alt="New Query" border=0></a>}
     } else {
         html {New Query</a>}
-        if {$more} {
-            html " | \n"
-        } else {
-            html "\n"
-        }
     }
 }
 
@@ -1714,6 +1713,9 @@ proc button-scan-window {more setNo} {
     global sessionId
     global hist
 
+    if {!$useIcons} {
+        html "\n | "
+    }
     set targetNo 0
     html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo + {scan} {">}
@@ -1722,11 +1724,6 @@ proc button-scan-window {more setNo} {
        html {alt="Scan" border=0></a>}
     } else {
         html {Scan</a>}
-        if {$more} {
-            html " | \n"
-        } else {
-            html "\n"
-        }
     }
 }
 
@@ -1759,7 +1756,7 @@ proc splitDatabaseSpec {host} {
 }
 
 proc mergeHostSpec {host databases} {
-    return ${host}.[join $databases -]
+    return ${host}/[join $databases -]
 }
 
 proc mkAssoc {assoc host} {
@@ -1780,4 +1777,8 @@ proc mkAssoc {assoc host} {
             ir $assoc
         }
     }
+}
+
+if {[info exists utilExtension]} {
+    source $utilExtension
 }
\ No newline at end of file
index 0fdadb5..d1515fb 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: ztargets.conf,v 1.29 1996/03/11 17:40:49 adam Exp $
+# $Id: ztargets.conf,v 1.30 1996/03/12 16:30:30 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
@@ -194,6 +194,16 @@ set targets(nwi.ub2.lu.se/sverige) {
     1
 }
 
+
+set targets(nwi.ub2.lu.se/new_nor_lib) {
+    NWI-Norway
+    WAIS
+    { { Ranked {@attr 1=4} } }
+    {}
+    {Nordic Web Index - Norway}
+    1
+}
+
 set targets(netsrv.casi.sti.nasa.gov:10210/GILS) {
     NASA
     WAIS
@@ -203,16 +213,16 @@ set targets(netsrv.casi.sti.nasa.gov:10210/GILS) {
     1
 }
 
-
-set targets(nwi.ub2.lu.se/new_nor_lib) {
-    NWI-Norway
+set targets(localhost:9999/test) {
+    localwais
     WAIS
     { { Ranked {@attr 1=4} } }
     {}
-    {Nordic Web Index - Norway}
+    {Localhost test base}
     1
 }
 
+
 set targets(z3950.research.att.com/z39dbs) {
     Z39DB 
     SUTRS