Added descriptive text field in target info.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Nov 1995 12:42:16 +0000 (12:42 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 8 Nov 1995 12:42:16 +0000 (12:42 +0000)
Added authentication field in target info.

www/egwindex.html
www/query.egw
www/search.egw
www/showfull.egw
www/targets.egw
www/wcgi.c
www/z39util.tcl
www/ztargets.conf

index f27315d..f6c7dfd 100644 (file)
@@ -3,16 +3,14 @@
 <title>Europagate WWW index</title>
 </head>
 <body>
-<h2>Europagate WWW index, $Id: egwindex.html,v 1.5 1995/11/07 10:44:30 adam Exp $</h2>
-<p>
-egwcgi ref:
- <a href="http://localhost/cgi-bin/egwcgi/egwtcl/egwscript">egwcgi</a>
+<h2>Europagate WWW index, $Id: egwindex.html,v 1.6 1995/11/08 12:42:16 adam Exp $</h2>
 <p>
 z39 targets:
  <a href="http://localhost/cgi-bin/egwcgi/egwirtcl/targets.egw">targets.egw</a>
-<br>
+(experimental) <br> 
 Multiple z39 targets:
- <a href="http://localhost/cgi-bin/egwcgi/egwirtcl/mtargets.egw">mtargets.egw</a>
+ <a href="http://localhost/cgi-bin/egwcgi/egwirtcl/mtargets.egw">mtargets.egw</a> (very experimental)
+<br>
 </body>
 </html>
 
index 9a72fe3..8f816be 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: query.egw,v 1.9 1995/11/06 17:44:20 adam Exp $
+# $Id: query.egw,v 1.10 1995/11/08 12:42:17 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -36,16 +36,19 @@ proc ok-response {} {
         set setNo 1
     }
     set hist($setNo,host) $host
+    set hist($setNo,idAuthentication) [lindex $targets($host) 3]
 
     if {[catch {z39 failback fail-response}]} {
         ir z39
     }
+
+    html "<h2> Search in " [lindex $targets($host) 0] "</h2>\n"
+
     z39 callback ok-response
     z39 failback fail-response
     if {$host != $oldHost} {
         catch {z39 disconnect}
 
-        html "Connecting to target " $host " <br>\n"
         set sessionWait 0
         if {[catch {z39 connect $host}]} {
             html "Cannot connect to target ${host} <br>\n" 
@@ -60,6 +63,7 @@ proc ok-response {} {
             }
         }
         set sessionWait 0
+        z39 idAuthentication $hist($setNo,idAuthentication)
         if {[catch {z39 init}]} {
             htmlr "Cannot initialize with target ${host} <br>"
             htmlr "</body></html>"
@@ -74,7 +78,6 @@ proc ok-response {} {
     }
     set databases [lindex $targets($host) 1]
 
-    html "<h2> Search in databases </h2>\n"
     html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo {" method=post>} \n
     set nodb [llength $databases]
index 76a4434..ebd2e66 100644 (file)
@@ -1,6 +1,33 @@
 <html>
 {
-# $Id: search.egw,v 1.9 1995/11/07 14:56:59 adam Exp $
+# $Id: search.egw,v 1.10 1995/11/08 12:42:17 adam Exp $
+
+proc buttons {setNo setMax startPos} {
+    global sessionId
+    global env
+    global hist
+
+    html "<p>\n"
+    if {$setMax < [z39.$setNo resultCount]} {
+        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+        html / $sessionId {/search.egw/} $setNo + [expr $setMax + 1]
+        html + [expr $setMax + $hist($setNo,maxPresent)] {"> Next </a>} "| \n"
+    }
+    if {$startPos != "" && $startPos != "1"} {
+        html {<a href="http://} $env(SERVER_NAME) $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 {"> Prev </a>} "| \n"
+    }
+    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+    html / $sessionId {/targets.egw"> New target </a>} " | \n"
+    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
+    html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo 
+    html {"> New query </a>} "<p>\n"
+}
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
         if {$setMax > $endPos} {
             set setMax $endPos
         }
+        if {$setMax > 0} {
+            buttons $setNo $setMax $startPos
+        }
     }
     if {$setMax > 0} {
         z39present $setNo $setOffset $setMax display-brief
     }
-}
-
 
-<hr>
-{
-    if {$setMax < [z39.$setNo resultCount]} {
-        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-        html / $sessionId {/search.egw/} $setNo + [expr $setMax + 1]
-        html + [expr $setMax + $hist($setNo,maxPresent)] {"> Next </a>} "| \n"
-    }
-    if {$startPos != "" && $startPos != "1"} {
-        html {<a href="http://} $env(SERVER_NAME) $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 {"> Prev </a>} "| \n"
-    }
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/targets.egw"> New target </a>} " | \n"
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/query.egw/} $host + $setNo {"> New query </a>}
+    buttons $setNo $setMax $startPos
 }
 
 {
index 4eb9d66..0e0c228 100644 (file)
@@ -1,36 +1,19 @@
 <html>
 {
-# $Id: showfull.egw,v 1.4 1995/11/07 14:56:59 adam Exp $
+# $Id: showfull.egw,v 1.5 1995/11/08 12:42:17 adam Exp $
 
-    if {[info commands saveState] == ""} {
-        source z39util.tcl
-    }
-
-    html "<head><title> WWW/Z39.50 Gateway Record " $host " </title>\n"
-    html "</head><body>\n"
-
-    global setNo
+proc buttons {setNo no} {
+    global sessionId
+    global env
     global hist
 
-    set sno [lindex $sessionParms 0]
-    set no [lindex $sessionParms 1]
-
-    set setNo $sno
-    
-    if {[z39search $setNo 0] != "1"} {
-        return
-    }
-    set total [z39.$setNo resultCount]
-    html "<h2>Record \#$no out of $total </h2><br>\n"
-}
-
-{
+    html "<p>\n"
     if {$no < [z39.$setNo resultCount]} {
         html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
         html / $sessionId {/showfull.egw/} $setNo + [expr $no + 1]
         html {"> Next </a>} "| \n"
     }
-    if {$no > 0} {
+    if {$no > 1} {
         html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
         html / $sessionId {/showfull.egw/} $setNo + [expr $no - 1]
         html {"> Prev </a>} "| \n"
     html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
     html / $sessionId {/targets.egw"> New target </a>} " | \n"
     html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/query.egw/} $host + $setNo {"> New query </a>}
+    html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo 
+    html {"> New query </a>} "<p>\n"
 }
 
-{
-    z39present $setNo $no $no display-full
-}
-<hr>
-{
-    if {$no < [z39.$setNo resultCount]} {
-        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-        html / $sessionId {/showfull.egw/} $setNo + [expr $no + 1]
-        html {"> Next </a>} "| \n"
+    if {[info commands saveState] == ""} {
+        source z39util.tcl
     }
-    if {$no > 0} {
-        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-        html / $sessionId {/showfull.egw/} $setNo + [expr $no - 1]
-        html {"> Prev </a>} "| \n"
+
+    html "<head><title> WWW/Z39.50 Gateway Record " $host " </title>\n"
+    html "</head><body>\n"
+
+    global setNo
+    global hist
+
+    set sno [lindex $sessionParms 0]
+    set no [lindex $sessionParms 1]
+
+    set setNo $sno
+    
+    if {[z39search $setNo 0] != "1"} {
+        return
     }
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/search.egw/} $setNo + 1
-    html + [expr $hist($setNo,maxPresent) - 1]
-    html {"> Result </a>} "| \n"
-       
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/targets.egw"> New target </a>} " | \n"
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/query.egw/} $host + $setNo {"> New query </a>}
-}
+    set total [z39.$setNo resultCount]
+    html "<h2>Record \#$no out of $total </h2><br>\n"
+
+    buttons $setNo $no
 
+    z39present $setNo $no $no display-full
+
+    buttons $setNo $no
+}
 </body>
 </html>
 
index 0111e42..cf0232c 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: targets.egw,v 1.5 1995/11/06 17:44:21 adam Exp $
+# $Id: targets.egw,v 1.6 1995/11/08 12:42:17 adam Exp $
     source /usr/local/etc/httpd/conf/ztargets.conf
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -27,9 +27,12 @@ Consejo Superior de Investigaciones Cient&iacute;ficas <br>
 <dl>
 {
     foreach t [array names targets] {
-        html {<dt> <a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME) /
-        html "$sessionId/query.egw/$t" {"> } $t "</a>\n"
-        html "<dd> " [lindex $targets($t) 0] \n
+        html {<dt><a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME) /
+        html "$sessionId/query.egw/$t" {"> } [lindex $targets($t) 0] " </a>\n"
+        set desc [lindex $targets($t) 4]
+        if {$desc != ""} {
+            html "<dd><em>$desc</em>\n"
+        }
     }
 }
 </dl>
index 0d55ccb..3a4dec6 100644 (file)
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wcgi.c,v $
- * Revision 1.6  1995/11/06 17:44:22  adam
+ * Revision 1.7  1995/11/08 12:42:18  adam
+ * Added descriptive text field in target info.
+ * Added authentication field in target info.
+ *
+ * Revision 1.6  1995/11/06  17:44:22  adam
  * State reestablised when shell restarts. History of previous
  * result sets.
  *
@@ -295,7 +299,7 @@ int main()
         exit (1);
     }
 #else
-#  if 0
+#  if 1
     fcntl (linein, F_SETFL, O_NONBLOCK);
 #  endif
     while (1)
index 796fdd2..20fcec2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.2 1995/11/07 14:57:00 adam Exp $
+# $Id: z39util.tcl,v 1.3 1995/11/08 12:42:18 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -71,7 +71,7 @@ proc display-brief {zset no} {
     set rtype [$zset recordType $no]
     if {$rtype == "SUTRS"} {
         html [join [$zset getSutrs $no]]
-        htmlr {<br>}
+        html "<br>\n"
         return
     } 
     if {![catch {
@@ -82,7 +82,7 @@ proc display-brief {zset no} {
         html $sessionId {/showfull.egw/} $setNo + $no {"> } $title {</a>}
         html " <i> ${year} </i>"
     }
-    htmlr {<br>}
+    html "<br>\n"
 }
 
 proc display-full {zset no} {
@@ -93,21 +93,21 @@ proc display-full {zset no} {
         if {$add != {}} {
             set add " :${add}"
         }
-        htmlr "<hr> ${no} <br>"
-        htmlr "Error ${err}${add} <br>"
+        html "<h3>${no}</h3>\n"
+        html "Error ${err}${add} <br>\n"
         return
     }
     if {$type != "DB"} {
         return
     }
-    htmlr "<hr> ${no} <br>"
+    html "<h3>${no}</h3>\n"
     set rtype [$zset recordType $no]
     if {$rtype == "SUTRS"} {
-        htmlr [join [$zset getSutrs $no]]
+        html [join [$zset getSutrs $no]] "<br>\n"
         return
     } 
     if {[catch {set r [$zset getMarc $no line * * *]}]} {
-        htmlr "Unknown record type: $rtype"
+        html "Unknown record type: $rtype <br>\n"
         return
     }
     foreach line $r {
@@ -118,8 +118,8 @@ proc display-full {zset no} {
         html "$tag "
         if {$l > 0} {
             for {set i 0} {$i < $l} {incr i} {
-                if {[string index $tag $i] == " "} {
-                    html "_"
+                if {[string index $indicator $i] == " "} {
+                    html "-"
                 } else {
                     html [string index $tag $i]
                 }
@@ -205,6 +205,7 @@ proc z39search {setNo piggy} {
                 return 0
             }
         }
+        z39 idAuthentication $hist($setNo,idAuthentication)
         set sessionWait 0
         if {[catch {z39 init}]} {
             html "Cannot initialize with target ${host} <br>\n"
@@ -397,7 +398,7 @@ proc z39present {setNo setOffset setMax dfunc} {
             }
             set got [z39.$setNo numberOfRecordsReturned]
         }
-        display-rec $setOffset [expr $got + $setOffset - 1] $dfunc
+        display-rec $setOffset [expr $got + $setOffset - 1] $dfunc z39
         set setOffset [expr $got + $setOffset]
         set toGet [expr 1 + $setMax - $setOffset]
         wflush
@@ -409,6 +410,7 @@ proc z39history {} {
     global hist
     global env
     global sessionId
+    global targets
 
     if {![info exists nextSetNo]} {
         return
@@ -418,7 +420,7 @@ proc z39history {} {
         html {<dt> <a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + 1
         html + [expr $hist($setNo,maxPresent) - 1]
-        html {"> } $hist($setNo,host)
+        html {"> } [lindex $targets($hist($setNo,host)) 0]
         if {[llength $hist($setNo,database)] > 1} {
             html ": "
             foreach b $hist($setNo,database) {
index c868e74..41371f0 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: ztargets.conf,v 1.5 1995/11/06 17:44:24 adam Exp $
+# $Id: ztargets.conf,v 1.6 1995/11/08 12:42:18 adam Exp $
 set commonFields {
  { Title {@attr 1=4} }
  { Author {@attr 1=1003} }
@@ -9,55 +9,83 @@ set commonFields {
 }
 
 set targets(myriad.middlebury.edu) {
-    {University somewhere, bla bla} 
-    {Default} 
+    Myriad 
+    Default
     { { Title {@attr 1=4} }
       { Author {@attr 1=1003} }
       { Abstract {@attr 1=62} }
       { Date {@attr 1=30} }
       { All {@attr 1=1016} }
-    } 
+    }
+    {} 
+    {Myriad} 
 }
 
 set targets(rlg.stanford.edu) [list \
-    {The famous Stanford University} \
+    rlg \
     {BKS AMC MAP MDF REC SCO SER VIM BIB} \
     $commonFields \
+    {} \
+    {Research Libraries group, Stanford University}
 ]
 
-set targets(bibsys) [list \
-    {BIBSYS - Norway} \
+set targets(z3950.bibsys.no:2100) [list \
+    BIBSYS \
     BIBSYS \
     $commonFields \
+    {} \
+    {BIBSYS - norway} \
 ]
 
 set targets(dtbsun.dtv.dk:4500) [list \
-    {Aleph, Z39.50 Server} \
+    {Aleph} \
     {DEM MAR} \
     $commonFields \
+    {} \
+    {Aleph, Z39.50 Server on DTV} \
 ]
 
-set targets(ir.dbc.bib.dk) [list \
-    {SR-DANBIB} \
-    DANBIB \
-    $commonFields \
+set targets(dtbsun.dtv.dk:210) [list \
+    {SR-DanBib} \
+    danbib \
+    { { Title {@attr 1=4} } \
+      { Author {@attr 1=1} } \
+      { Abstract {@attr 1=62} } \
+      { Date {@attr 1=30} } \
+      { All {@attr 1=1016} } \
+    } \
+    {<<danbib>>} \
+    {SR Target DanBib trough the Europagate gateway} \
 ]
 
 set targets(localhost:9999) [list \
-    ztest9999 \
+    Ztest9999 \
     {ABE BETA} \
     $commonFields \
+    {} \
+    {Test server on localhost} \
 ]
 
 set targets(dtbsun.dtv.dk:9999) [list \
-    zserver \
+    Zserver \
     {usgs esdd cd_rom unknown} \
     $commonFields \
+    {} \
+    {New Index Data Z39.50 Server in alpha-test} \
 ]
 
 set targets(z3950.research.att.com) [list \
-    {AT&T Z39.50 Server} \
-    {Default} \
+    {AT&T Server} \
+    Default \
     $commonFields \
+    {} \
+    {Z39.50 Server at AT&T} \
 ]
 
+set targets(dranet.dra.com) [list \
+    {Dranet} \
+    drewdb \
+    $commonFields \
+    {} \
+    {Data Research Z39.50 Server} \
+]