Arrow gifs.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 13 Nov 1995 15:41:40 +0000 (15:41 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 13 Nov 1995 15:41:40 +0000 (15:41 +0000)
Gateway uses record element set names B(rief) and F(ull).
Bug fix. Didn't save idAuthentication correctly.

www/Makefile
www/darrw.gif [new file with mode: 0644]
www/mquery.egw
www/msearch.egw
www/query.egw
www/search.egw
www/showfull.egw
www/uarrw.gif [new file with mode: 0644]
www/wproto.c
www/z39util.tcl

index 4274f14..a00542d 100644 (file)
@@ -2,7 +2,12 @@
 # Europagate, 1995
 #
 # $Log: Makefile,v $
-# Revision 1.13  1995/11/08 18:07:22  adam
+# Revision 1.14  1995/11/13 15:41:40  adam
+# Arrow gifs.
+# Gateway uses record element set names B(rief) and F(ull).
+# Bug fix. Didn't save idAuthentication correctly.
+#
+# Revision 1.13  1995/11/08  18:07:22  adam
 # Minor changes.
 #
 # Revision 1.12  1995/11/08  16:14:32  adam
@@ -63,7 +68,7 @@ WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \
  mtargets.egw mquery.egw msearch.egw
 HSCRIPTS=egwindex.html
 CONFFILES=ztargets.conf
-GIFFILES=webgate.gif
+GIFFILES=webgate.gif darrw.gif uarrw.gif
 TPROG1=egwcgi
 TPROG2=egwsh
 TPROG3=wtest
diff --git a/www/darrw.gif b/www/darrw.gif
new file mode 100644 (file)
index 0000000..c6eec5c
Binary files /dev/null and b/www/darrw.gif differ
index de4b307..eaae83e 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: mquery.egw,v 1.4 1995/11/10 14:47:31 adam Exp $
+# $Id: mquery.egw,v 1.5 1995/11/13 15:41:41 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -13,6 +13,7 @@
     global setNo
     global nextSetNo
     global hist
+    global targets
 
     if {[catch {set setNo $nextSetNo}]} {
         set nextSetNo 1
index ee40776..efe43b9 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: msearch.egw,v 1.4 1995/11/10 14:47:31 adam Exp $
+# $Id: msearch.egw,v 1.5 1995/11/13 15:41:42 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -21,7 +21,7 @@
             set hist($nextSetNo,$i,host) $hist($setNo,$i,host)
             set hist($nextSetNo,$i,database) $hist($setNo,$i,database)
             set hist($nextSetNo,$i,idAuthentication) \
-                hist($setNo,$i,idAuthentication) 
+                $hist($setNo,$i,idAuthentication) 
         }
         set setNo $nextSetNo
         incr nextSetNo
             set hist($setNo,maxPresent) 30
         }
     }
-    z39msearch $setNo 1
+    z39msearch $setNo 1 B
 
     html "<dl>\n"
     set not $hist($setNo,0,host)
     for {set i 1} {$i <= $not} {incr i} {
         if {$zstatus($i) != 2} continue
-        html "<dt> " $hist($setNo,$i,host) ": "
+        html "<dt> " [lindex $targets($hist($setNo,$i,host)) 0] ": "
         set status [z39$i.$setNo responseStatus]
         if {[lindex $status 0] == "NSD"} {
             z39$i.$setNo nextResultSetPosition 0
index e180d1e..48a03ba 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: query.egw,v 1.14 1995/11/10 14:47:31 adam Exp $
+# $Id: query.egw,v 1.15 1995/11/13 15:41:42 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -141,7 +141,7 @@ Alternatively you can enter your query in
 <hr>
 <input type=submit value="Search"><input type=reset value="Reset">
 <h3> Various technical parameters: </h3> <br>
-Max hits: <input type="text" name="hits" value="10" size=3>
+Max hits: <input type="text" name="hits" value="20" size=3>
 Records are shown in:
 <select name="format">
 <option> Long format
index d1046ba..13333ed 100644 (file)
@@ -1,12 +1,22 @@
 <html>
 {
-# $Id: search.egw,v 1.14 1995/11/10 14:47:32 adam Exp $
+# $Id: search.egw,v 1.15 1995/11/13 15:41:44 adam Exp $
 
-proc buttons {setNo setMax startPos} {
+proc buttons {setNo setMax startPos after} {
     global sessionId
     global env
     global hist
 
+    if {$after && $setMax < [z39.$setNo resultCount]} {
+        html "<p>\n"
+        html "<center>\n"
+        html {<a href="http:} $env(SCRIPT_NAME)
+        html / $sessionId {/search.egw/} $setNo + [expr $setMax + 1]
+        html + [expr $setMax + $hist($setNo,maxPresent)]
+        html {"><img src="/gif/darrw.gif"></a>}
+        html "</center>\n"
+    }
+
     html "<p>\n"
     if {$setMax < [z39.$setNo resultCount]} {
         html {<a href="http:} $env(SCRIPT_NAME)
@@ -17,17 +27,27 @@ proc buttons {setNo setMax startPos} {
     if {$startPos != "" && $startPos != "1"} {
         html {<a href="http:} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo 
-        if {[expr $startPos - $hist($setNo,maxPresent)] > 1} {
-            html + [expr $startPos - $hist($setNo,maxPresent)]
-            html + [expr $startPos - 1]
-        }
+        html + [expr $startPos - $hist($setNo,maxPresent)]
+        html + [expr $startPos - 1]
         html {">Previous records</a>} " | \n"
     }
     html {<a href="http:} $env(SCRIPT_NAME)
-    html / $sessionId {/targets.egw">New target</a>} " | \n"
-    html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo 
-    html {">New query</a>} "\n<p>\n"
+    html {">New query</a>} " | \n"
+
+    html {<a href="http:} $env(SCRIPT_NAME)
+    html / $sessionId {/targets.egw">New target</a>} "<p>\n"
+
+    if {!$after && $startPos != "" && $startPos != "1"} {
+        html "<center>\n"
+        html {<a href="http:} $env(SCRIPT_NAME)
+        html / $sessionId {/search.egw/} $setNo 
+        html + [expr $startPos - $hist($setNo,maxPresent)]
+        html + [expr $startPos - 1]
+        html {"><img src="/gif/uarrw.gif"></a>}
+        html "</center><p>\n"
+    }
+
 }
 
     if {[info commands saveState] == ""} {
@@ -69,7 +89,7 @@ proc buttons {setNo setMax startPos} {
     set setMax 0
     set setOffset 0
     if {$startPos == ""} {
-        if {[z39search $setNo 1 0] != "1"} {
+        if {[z39search $setNo 1 0 B] != "1"} {
             return
         }
         set r [z39.$setNo resultCount]
@@ -83,7 +103,7 @@ proc buttons {setNo setMax startPos} {
             set setMax $hist($setNo,maxPresent)
         }
     } else {
-        if {[z39search $setNo 0 0] != "1"} {
+        if {[z39search $setNo 0 0 B] != "1"} {
             return 
         }
         set r [z39.$setNo resultCount]
@@ -95,14 +115,14 @@ proc buttons {setNo setMax startPos} {
             set setMax $endPos
         }
         if {$setMax > 0} {
-            buttons $setNo $setMax $startPos
+            buttons $setNo $setMax $startPos 0
         }
     }
     if {$setMax > 0} {
-        z39present $setNo 0 $setOffset $setMax display-brief 
+        z39present $setNo 0 $setOffset $setMax display-brief B
     }
 
-    buttons $setNo $setMax $startPos
+    buttons $setNo $setMax $startPos 1
 }
 
 {
index ea8998b..5791e16 100644 (file)
@@ -1,12 +1,20 @@
 <html>
 {
-# $Id: showfull.egw,v 1.9 1995/11/10 14:47:32 adam Exp $
+# $Id: showfull.egw,v 1.10 1995/11/13 15:41:44 adam Exp $
 
-proc buttons {setNo tno no format count host} {
+proc buttons {setNo tno no format count host after} {
     global sessionId
     global env
     global hist
 
+    if {$after && $no < $count} {
+        html "<p><center>\n"
+        html {<a href="http:} $env(SCRIPT_NAME)
+        html / $sessionId {/showfull.egw/} $setNo + $tno + 
+        html [expr $no + 1] + $format
+        html {"><img src="/gif/darrw.gif"></a>}
+        html "</center>\n"
+    }
     html "<p>\n"
     if {$no < $count} {
         html {<a href="http:} $env(SCRIPT_NAME)
@@ -37,25 +45,33 @@ proc buttons {setNo tno no format count host} {
     }
     html $setNo + 1
     html + $hist($setNo,maxPresent)
-    html {">Result</a>} " | \n"
+    html {">Result set</a>} " | \n"
        
     html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
     if {$tno > 0} {
-        html {/mtargets.egw} 
+        html {/mquery.egw/} 
     } else {
-        html {/targets.egw} 
+        html {/query.egw/} 
     }
-    html {">New target</a>} " | \n"
+    html $host + $setNo 
+    html {">New query</a>} " | \n"
 
     html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
     if {$tno > 0} {
-        html {/mquery.egw/} 
+        html {/mtargets.egw} 
     } else {
-        html {/query.egw/} 
+        html {/targets.egw} 
     }
-    html $host + $setNo 
-    html {">New query</a>} "<p>\n"
+    html {">New target</a>} "<p>\n"
 
+    if {!$after && $no > 1} {
+        html "<p><center>\n"
+        html {<a href="http:} $env(SCRIPT_NAME)
+        html / $sessionId {/showfull.egw/} $setNo + $tno +
+        html [expr $no - 1] + $format
+        html {"><img src="/gif/uarrw.gif"></a>}
+        html "</center>\n"
+    }
 }
 
     if {[info commands saveState] == ""} {
@@ -80,19 +96,19 @@ proc buttons {setNo tno no format count host} {
         set host $hist($setNo,$tno,host)
     } else {
         set zz z39
-        set host $hist($setNo,$0,host)
+        set host $hist($setNo,host)
     }
     
-    if {[z39search $setNo 0 $tno] != "1"} {
+    if {[z39search $setNo 0 $tno F] != "1"} {
         return
     }
     set count [$zz.$setNo resultCount]
     html "<h2>Record \#$no out of $count </h2><br>\n"
 
-    buttons $setNo $tno $no $format $count $host
+    buttons $setNo $tno $no $format $count $host 0
 
-    eval {z39present $setNo $tno $no $no display-$format}
-    buttons $setNo $tno $no $format $count $host
+    eval {z39present $setNo $tno $no $no display-$format F}
+    buttons $setNo $tno $no $format $count $host 1
 }
 </body>
 </html>
diff --git a/www/uarrw.gif b/www/uarrw.gif
new file mode 100644 (file)
index 0000000..7683672
Binary files /dev/null and b/www/uarrw.gif differ
index 6deb504..ff283de 100644 (file)
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wproto.c,v $
- * Revision 1.7  1995/11/10 14:47:32  adam
+ * Revision 1.8  1995/11/13 15:41:45  adam
+ * Arrow gifs.
+ * Gateway uses record element set names B(rief) and F(ull).
+ * Bug fix. Didn't save idAuthentication correctly.
+ *
+ * Revision 1.7  1995/11/10  14:47:32  adam
  * Plus (+) characters automatically converted to space in forms.
  * Work on search in multiple targets. Doesn't work well - yet.
  * Presentation formats enhanced.
@@ -365,10 +370,7 @@ WCLIENT wproto_init(void)
     new->id = atoi (val);
     sprintf(new->path, "%s/%s/clt%d", FIFOROOT, FIFODIR, new->id);
     if (mkfifo(new->path, 0666 | S_IFIFO) < 0)
-    {
-       gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, mod, "mkfifo(%s)", new->path);
-       exit(1);
-    }
+       gw_log (GW_LOG_WARN|GW_LOG_ERRNO, mod, "mkfifo(%s)", new->path);
     gw_log (GW_LOG_DEBUG, mod, "Synchronizing with server.");
     sprintf(path2, "%s/%s/srv%d", FIFOROOT, FIFODIR, getppid());
     if ((new->lineout = open(path2, O_WRONLY)) < 0)
index 4322d2c..bfbe03b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.7 1995/11/10 14:47:32 adam Exp $
+# $Id: z39util.tcl,v 1.8 1995/11/13 15:41:46 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -377,7 +377,7 @@ proc build-query {t} {
     return $q
 }
 
-proc z39search {setNo piggy tno} {
+proc z39search {setNo piggy tno elements} {
     global hist
     global sessionWait
 
@@ -405,7 +405,6 @@ proc z39search {setNo piggy tno} {
     if {$oldHost != $host} {
         catch [list $zz disconnect]
 
-        html "Connecting to target " $host " <br>\n"
         set sessionWait 0
         if {[catch [list $zz connect $host]]} {
             html "Cannot connect to target ${host} <br>\n"
@@ -444,8 +443,12 @@ proc z39search {setNo piggy tno} {
         return 1
     }
     ir-set $zz.$setNo $zz
+    $zz.$setNo smallSetElementSetNames $elements
+    $zz.$setNo mediumSetElementSetNames $elements
+    $zz.$setNo recordElements $elements
     eval $zz.$setNo databaseNames $database
 
+
     $zz.$setNo preferredRecordSyntax USMARC
 
     $zz callback search-response $setNo
@@ -523,7 +526,7 @@ proc search-m-response {setNo i} {
     set zstatus($i) 2
 }
 
-proc z39msearch {setNo piggy} {
+proc z39msearch {setNo piggy elements} {
     global zleft
     global zstatus
     global hist
@@ -552,6 +555,7 @@ proc z39msearch {setNo piggy} {
             set zstatus($i) 1
             continue
         }
+        z39$i idAuthentication $hist($setNo,$i,idAuthentication)
         html "Connecting to target " $host " <br>\n"
         set zstatus($i) -1
         if {![catch {z39$i connect $host}]} {
@@ -572,6 +576,11 @@ proc z39msearch {setNo piggy} {
             ir-set z39$i.$setNo z39$i
             set hist($setNo,$i,offset) 0
             eval z39$i.$setNo databaseNames $hist($setNo,$i,database)
+
+            z39$i.$setNo smallSetElementSetNames $elements
+            z39$i.$setNo mediumSetElementSetNames $elements
+            z39$i.$setNo recordElements $elements
+
             z39$i.$setNo preferredRecordSyntax USMARC
             z39$i callback [list search-m-response $setNo $i]
 
@@ -607,7 +616,7 @@ proc z39msearch {setNo piggy} {
     }
 }
 
-proc z39present {setNo tno setOffset setMax dfunc} {
+proc z39present {setNo tno setOffset setMax dfunc elements} {
     global hist
     global sessionWait
 
@@ -617,6 +626,8 @@ proc z39present {setNo tno setOffset setMax dfunc} {
         set zz z39
     }
 
+    $zz.$setNo elementSetNames $elements
+    $zz.$setNo recordElements $elements
     set toGet [expr 1 + $setMax - $setOffset]
     while {$setMax > 0 && $toGet > 0} {
         for {set got 0} {$got < $toGet} {incr got} {