Better working scan.
New maintanance function to print contact info, etc.
# Europagate, 1995
#
# $Log: Makefile,v $
-# Revision 1.19 1996/01/02 10:52:25 adam
+# Revision 1.20 1996/01/03 15:19:35 adam
+# Improved history.
+# Better working scan.
+# New maintanance function to print contact info, etc.
+#
+# Revision 1.19 1996/01/02 10:52:25 adam
# In images Alt=... are defined.
#
# Revision 1.18 1995/12/20 16:31:30 adam
TCLLIB=/usr/local/lib/libtcl7.4.a
#
WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \
- mtargets.egw mquery.egw msearch.egw
+ mtargets.egw mquery.egw msearch.egw history.egw
HSCRIPTS=egwindex.html
CONFFILES=ztargets.conf
TPROG1=egwcgi
--- /dev/null
+<html>
+<head>
+<title> WWW/Z39.50 Gateway History</title>
+</head>
+<body>
+{
+# $Id: history.egw,v 1.1 1996/01/03 15:19:36 adam Exp $
+
+ if {[info commands saveState] == ""} {
+ source z39util.tcl
+ }
+
+ z39history
+
+ if {$useIcons} {
+ html {<img src="/gif/button-egw.gif" alt="Europagate" border=0></a>}
+ } else {
+ html {Europagate | }
+ }
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/targets.egw}
+ if {$useIcons} {
+ html {"><img src="/gif/button-new-target.gif" }
+ html {alt="New Target" border=0></a>}
+ } else {
+ html {">New Target</a>} "\n"
+ }
+}
+{
+ catch maintenance
+ if {!$debug} return
+ html "<hr>\n"
+ html "<h3>Debug information</h3>\n"
+ html "sessionId: $sessionId <br>\n"
+ html "sessionParms: $sessionParms <br>\n"
+ foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
+ html $e {: } $env($e) {<br>} \n
+ }
+ html "form: " [wform] " <br>\n"
+ html "target: " $host " <br>\n"
+ html "databases: " $databases " <br>\n"
+ html "setNo: " $setNo " <br>\n"
+ html "nextSetNo: " $nextSetNo " <br>\n"
+ html "initSet: " $initSet " <br>\n"
+ html "scanLine: " $scanLine " <br>\n"
+ html "scanTerm: " $scanTerm " <br>\n"
+}
+</body></html>
+
+
</head>
<body>
{
-# $Id: mquery.egw,v 1.6 1995/12/21 15:49:51 adam Exp $
+# $Id: mquery.egw,v 1.7 1996/01/03 15:19:37 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
html {"> New target </a>}
}
}
-<hr>
-This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
-Last modified 29. september 1995. <br>
-<em> This and the following pages are under construction
-and will continue to be so until the end of December 1995.</em>
{
+ catch maintenance
+ if {!$debug} return
html "<hr>\n"
html "<h3>Debug information</h3>\n"
html "sessionId: $sessionId <br>\n"
<html>
{
-# $Id: msearch.egw,v 1.7 1995/12/22 14:21:15 adam Exp $
+# $Id: msearch.egw,v 1.8 1996/01/03 15:19:38 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
}
{
+ if {!$debug} return
html "<hr>\n"
html "<h3>Debug information</h3>\n"
html "sessionId: $sessionId <br>\n"
<html>
{
-# $Id: mtargets.egw,v 1.7 1995/12/21 15:49:51 adam Exp $
+# $Id: mtargets.egw,v 1.8 1996/01/03 15:19:38 adam Exp $
set setNo 1
source /usr/local/etc/httpd/conf/ztargets.conf
if {[info commands saveState] == ""} {
<title>Europagate, WWW/Z39.50 Gateway</title>
</head>
<body>
+{
+ if {![info exists debug]} {
+ if {[lindex $sessionParms 0] == "1"} {
+ set debug 1
+ } else {
+ set debug 0
+ }
+ }
+ if {![info exists useIcons]} {
+ if {[lindex $sessionParms 1] == "1"} {
+ set useIcons 0
+ } else {
+ set useIcons 1
+ }
+ }
+}
<center>
<img src="/gif/button-egw.gif" Alt="EUROPAGATE">
</center>
}
<input type="submit" value="Select">
</form>
-<hr>
-This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
-Last modified 25. september 1995. <br>
-<em> This and the following pages are under construction and will continue
-to be so until the end of December 1995.</em>
{
+ catch maintenance
+ if {!$debug} return
html "<hr>\n"
html "<h3>Debug information</h3>\n"
html "sessionId: $sessionId <br>\n"
</head>
<body>
{
-# $Id: query.egw,v 1.23 1996/01/03 08:59:41 adam Exp $
+# $Id: query.egw,v 1.24 1996/01/03 15:19:39 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
set host [lindex $sessionParms 0]
set initSet [lindex $sessionParms 1]
set scanLine [lindex $sessionParms 2]
- set scanTerm [lindex $sessionParms 3]
+ set scanTerm [lrange $sessionParms 3 end]
if {[catch {set setNo $nextSetNo}]} {
set nextSetNo 1
}
html "<h2>Search in " [lindex $targets($host) 0] "</h2>\n"
-
z39 callback ok-response
z39 failback fail-response
if {$host != $oldHost} {
html "</select>\n"
html {<input type="text" name="entry} $no {"}
if {$scanLine == $no} {
- html { value="} $scanTerm {" }
+ html { value="} [join $scanTerm " "] {"}
+ } elseif {[info exists hist($oSetNo,form,entry$no)]} {
+ html { value="} [join $hist($oSetNo,form,entry$no) " "] {"}
}
html { size=35>} \n
html {<input type="checkbox" name="scan} $no {" value="1" scan>}
if {$no < 3} {
html {<select name="logic} $no {">} \n
if {$oSetNo > 0} {
- html "<option> " $hist($oSetNo,form,logic$no) \n
+ html "<option> " [join $hist($oSetNo,form,logic$no) " "] \n
}
foreach op {And Or {And not}} {
if {$oSetNo > 0} {
if {$hist($oSetNo,form,logic$no) == $op} continue
}
- html "<option> " $op \n
+ html "<option> " [join $op " "] \n
}
html "</select>\n"
}
} else {
html 20
}
- html {" size=3>}
+ html {" size=4>}
}
</form>
<p>
{
- html {<img src="/gif/button-egw.gif" alt="Europagate" border=0></a>}
- html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/targets.egw}
- html {"><img src="/gif/button-new-target.gif" alt="New Target" }
- html {border=0 alt="New Target"></a>}
-}
+ button-europagate
-<hr>
-This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
-Last modified 29. september 1995. <br>
-<em> This and the following pages are under construction
-and will continue to be so until the end of December 1995.</em>
+ button-new-target 1
+ button-view-history 0
+}
{
+ catch maintenance
+ global debug
+ if {!$debug} return
html "<hr>\n"
html "<h3>Debug information</h3>\n"
html "sessionId: $sessionId <br>\n"
<html>
{
-# $Id: search.egw,v 1.22 1996/01/03 08:59:43 adam Exp $
+# $Id: search.egw,v 1.23 1996/01/03 15:19:41 adam Exp $
proc start-scan {scanNo cache dir} {
global sessionId
global targets
global nextSetNo
global env
+ global useIcons
+ global debug
set host $hist($setNo,host)
if {$hist($setNo,$scanNo,scanTerm) == ""} {
displayError "Empty query" \
"You must specify at least one search word"
- html "</body></html>\n"
wabort
return
}
if {[z39scan $setNo $scanNo 0 $lines $pos $cache] != "1"} {
return
}
+ button-europagate
+
html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/search.egw/} $setNo + [expr $scanNo - 1] + b
- html {">Backward</a>} "\n"
+ html / $sessionId {/search.egw/} $setNo + [expr $scanNo - 1] + b {">}
+ if {$useIcons} {
+ html {<img src="/gif/button-previous-terms.gif" }
+ html {alt="Next Terms" border=0></a>}
+ } else {
+ html {Previous Terms</a> | }
+ }
html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/search.egw/} $setNo + [expr $scanNo + 1] + f
- html {">Forward</a><br>}
+ html / $sessionId {/search.egw/} $setNo + [expr $scanNo + 1] + f {">}
+ if {$useIcons} {
+ html {<img src="/gif/button-next-terms.gif" }
+ html {alt="Next Terms" border=0></a>}
+ } else {
+ html {Next Terms</a> | }
+ }
+ html {</a>}
+ button-new-query 0 $setNo
+ html "<br><p>\n"
display-scan $setNo $scanNo 0
+ html "<p>\n"
+
+ button-europagate
html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/search.egw/} $setNo + [expr $scanNo - 1] + b
- html {">Backward</a>} "\n"
+ html / $sessionId {/search.egw/} $setNo + [expr $scanNo - 1] + b {">}
+ if {$useIcons} {
+ html {<img src="/gif/button-previous-terms.gif" }
+ html {alt="Next Terms" border=0></a>}
+ } else {
+ html {Previous Terms</a> | }
+ }
html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/search.egw/} $setNo + [expr $scanNo + 1] + f
- html {">Forward</a><br>}
+ html / $sessionId {/search.egw/} $setNo + [expr $scanNo + 1] + f {">}
+ if {$useIcons} {
+ html {<img src="/gif/button-next-terms.gif" }
+ html {alt="Next Terms" border=0></a>}
+ } else {
+ html {Next Terms</a> | }
+ }
+ html {</a>}
+ button-new-query 0 $setNo
+ if {!$debug} return
html "<hr>\n"
html "<h3>Debug information</h3>\n"
html "sessionId: $sessionId <br>\n"
html "databases: " $hist($setNo,database) " <br>\n"
html "selected: " [wform base] " <br>\n"
html "setNo: " $setNo " <br>\n"
- html "nextSetNo: " $nextSetNo " <br>\n"
-
- html "</body>\n"
+ html "nextSetNo: " $nextSetNo " <br>\n"
}
proc buttons {setNo setMax startPos after} {
global env
global hist
- if {!$useIcons && $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 {$useIcons} {
- html {<img src="/gif/button-egw.gif" alt="Europagate" border=0>}
- }
+ button-europagate
if {$setMax < [z39.$setNo resultCount]} {
html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + [expr $setMax + 1]
html {">Previous Records</a>} " | \n"
}
}
- html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo
- if {$useIcons} {
- html {"><img src="/gif/button-new-query.gif" }
- html {alt="New Query" border=0></a>}
- } else {
- html {">New Query</a>} " | \n"
- }
+ button-new-query 1 $setNo
+ button-new-target 1
+ button-view-history 0
- html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/targets.egw}
- if {$useIcons} {
- html {"><img src="/gif/button-new-target.gif" }
- html {alt="New Target" border=0></a>}
- } else {
- html {">New Target</a>}
- }
html "<p>\n"
- if {!$useIcons && !$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] == ""} {
} else {
catch {unset hist($setNo,hits)}
}
+ set hist($setNo,scan) 0
+
set hist($setNo,form,menu1) [wform menu1]
set hist($setNo,form,menu2) [wform menu2]
set hist($setNo,form,menu3) [wform menu3]
set hist($setNo,form,logic1) [wform logic1]
set hist($setNo,form,logic2) [wform logic2]
+ set hist($setNo,form,logic3) {}
set host $hist($setNo,host)
set databases [lindex $targets($host) 1]
set hist($setNo,$scanNo,scanTerm) [lindex $termPlusAttr 0]
set hist($setNo,scanAttr) [lindex $termPlusAttr 1]
start-scan $scanNo 0 {}
+ html "</body></html>\n"
wabort
return
}
}
- set hist($setNo,scan) 0
set query [build-query $hist($setNo,host) 3]
if {"x$query" == "x"} {
html "<head><title> WWW/Z39.50 Gateway Search</title>\n<body>\n"
set scanNo 1000
}
start-scan $scanNo 1 $dir
+ html "</body></html>\n"
wabort
}
}
return
}
set r [z39.$setNo resultCount]
- html "<h3> Search result $r hits</h3>\n"
- wflush
set setOffset [z39.$setNo numberOfRecordsReturned]
+ html {<h3> Records 1-} $setOffset " out of $r</h3>\n"
+ wflush
+ html "<ul>\n"
display-rec 1 $setOffset display-brief 0
incr setOffset
set setMax [z39.$setNo resultCount]
if {$setMax > 0} {
buttons $setNo $setMax $startPos 0
}
- html "<h3> Search result $r hits</h3>\n"
+ html {<h3> Records } $startPos {-} $setMax " out $r</h3>\n"
wflush
+ html "<ul>\n"
}
if {$setMax > 0} {
z39present $setNo 0 $setOffset $setMax display-brief B
}
-
+ html "</ul>\n"
buttons $setNo $setMax $startPos 1
}
{
+ global debug
+ if {!$debug} return
html "<hr>\n"
html "<h3>Debug information</h3>\n"
html "sessionId: $sessionId <br>\n"
<html>
{
-# $Id: showfull.egw,v 1.14 1996/01/02 10:52:29 adam Exp $
+# $Id: showfull.egw,v 1.15 1996/01/03 15:19:47 adam Exp $
proc buttons {setNo tno no format count host after} {
global sessionId
global hist
html "<p>\n"
- if {!$useIcons && $after && $no < $count} {
- html "<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><p>\n"
- }
- if {$useIcons} {
- html {<img src="/gif/button-egw.gif" alt="Europagate" border=0>}
- }
+ button-europagate
if {$no < $count} {
html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/showfull.egw/} $setNo + $tno +
html {">New Target</a>}
}
html "<p>\n"
- if {!$useIcons && !$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><p>\n"
- }
}
if {[info commands saveState] == ""} {
<html>
{
-# $Id: targets.egw,v 1.10 1996/01/02 10:52:30 adam Exp $
+# $Id: targets.egw,v 1.11 1996/01/03 15:19:50 adam Exp $
source /usr/local/etc/httpd/conf/ztargets.conf
if {[info commands saveState] == ""} {
source z39util.tcl
<title> Europagate, WWW/Z39.50 Gateway </title>
</head>
<body>
-<center>
-<img src="/gif/button-egw.gif" Alt="EUROPAGATE">
-</center>
-
<h2>Choose Z39.50 target</h2><br>
<dl>
{
+ if {![info exists debug]} {
+ if {[lindex $sessionParms 0] == "1"} {
+ set debug 1
+ } else {
+ set debug 0
+ }
+ }
+
+ if {![info exists useIcons]} {
+ if {[lindex $sessionParms 1] == "1"} {
+ set useIcons 0
+ } else {
+ set useIcons 1
+ }
+ }
proc targetsCmp {l r} {
global targets
return [string compare [string tolower [lindex $targets($l) 0]] \
}
}
</dl>
+
{
- z39history
+ button-europagate
+ button-view-history 0
}
-<hr>
-This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
-Last modified 25. september 1995. <br>
-<em> This and the following pages are under construction and will continue to be so
-until the end of December 1995.</em>
+
{
+ catch maintenance
+ global debug
+ if {!$debug} return
html "<hr>\n"
html "<h3>Debug information</h3>\n"
html "sessionId: $sessionId <br>\n"
#
-# $Id: z39util.tcl,v 1.16 1996/01/03 08:59:45 adam Exp $
+# $Id: z39util.tcl,v 1.17 1996/01/03 15:19:52 adam Exp $
#
proc saveState {} {
uplevel #0 {
global setNo
global sessionId
+
+ html {<li>}
set type [$zset type $no]
if {$type == "SD"} {
set err [lindex [$zset diag $no] 1]
if {$type != "DB"} {
return
}
- html "${no}"
set rtype [$zset recordType $no]
if {$rtype == "SUTRS"} {
html [join [$zset getSutrs $no]]
return
}
if {![catch {
+ set author [$zset getMarc $no field 100 * a]
set title [lindex [$zset getMarc $no field 245 * a] 0]
set year [lindex [$zset getMarc $no field 260 * c] 0]
} ] } {
+ set p 0
+ foreach a $author {
+ if {$p} {
+ html ", "
+ }
+ html $a
+ set p 1
+ }
+ if {$p} {
+ html ": "
+ }
html {<a href="http:} $env(SCRIPT_NAME) /
- html $sessionId {/showfull.egw/} $setNo + $tno + $no + full
- html {"> } $title {</a>} " <i> ${year} </i>"
+ html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
+ if {[string length $title] == 0} {
+ html {No title}
+ } else {
+ html $title
+ }
+ html {</a>} " <i> ${year} </i>"
}
html "<br>\n"
}
set q {}
for {set i 1} {$i <= $ilines} {incr i} {
set term [wform entry$i]
- if {$term != ""} {
+ if {[string length $term] > 0} {
set field [wform menu$i]
foreach x [lindex $targets($t) 2] {
if {[lindex $x 0] == $field} {
}
}
for {set i 0} {$i < $m} {incr i} {
+ regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
html {<a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo +
- html $hist($setNo,scan) + [lindex [$zs scanLine $i] 1] {">}
+ html $hist($setNo,scan) + $tterm {">}
html [lindex [$zs scanLine $i] 1]
html {</a>: <em>}
html [lindex [$zs scanLine $i] 2]
if {![info exists nextSetNo]} {
return
}
- html "<hr><h2>History</h2><dl><br>\n"
+ html "<h2>History</h2><dl><br>\n"
for {set setNo 1} {$setNo < $nextSetNo} {incr setNo} {
+ if {$hist($setNo,scan) > 0} continue
html {<dt> <a href="http:} $env(SCRIPT_NAME)
html / $sessionId {/search.egw/} $setNo + 1
html + $hist($setNo,maxPresent)
html " $b"
}
}
- html "</a>\n"
- html "<dd> "
+ html "</a> -- "
if {[info exists hist($setNo,hits)]} {
html $hist($setNo,hits) " hits"
} else {
html failed
}
- html "\n"
+ html "<dd>\n"
+ set op {}
+ for {set i 1} {$i <= 3} {incr i} {
+ if {[string length $hist($setNo,form,entry$i)] > 0} {
+ html " <b>" [join $op " "] "</b> "
+ html $hist($setNo,form,menu$i) "=" $hist($setNo,form,entry$i)
+ set op $hist($setNo,form,logic$i)
+ }
+ }
}
html "</dl>\n"
}
html "</center><p>\n"
}
-set useIcons 1
+proc button-europagate {} {
+ global useIcons
+ if {$useIcons} {
+ html {<img src="/gif/button-egw.gif" alt="Europagate" border=0></a>}
+ } else {
+ html {Europagate | }
+ }
+}
+
+proc button-new-target {more} {
+ global useIcons
+ global env
+ global sessionId
+
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/targets.egw}
+ if {$useIcons} {
+ html {"><img src="/gif/button-new-target.gif" }
+ html {alt="New Target" border=0></a>}
+ } else {
+ html {">New Target</a>}
+ if {$more} {
+ html " | \n"
+ } else {
+ html "\n"
+ }
+ }
+}
+
+proc button-view-history {more} {
+ global useIcons
+ global env
+ global sessionId
+
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/history.egw}
+ if {$useIcons} {
+ html {"><img src="/gif/button-view-history.gif" alt="View History" }
+ html {border=0></a>}
+ } else {
+ html {">View History</a>}
+ if {$more} {
+ html " | \n"
+ } else {
+ html "\n"
+ }
+ }
+}
+
+proc button-new-query {more setNo} {
+ global useIcons
+ global env
+ global sessionId
+ global hist
+
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo {">}
+ if {$useIcons} {
+ html {<img src="/gif/button-new-query.gif" }
+ html {alt="New Query" border=0></a>}
+ } else {
+ html {New Query</a>}
+ if {$more} {
+ html " | \n"
+ } else {
+ html "\n"
+ }
+ }
+}
+
+proc maintenance {} {
+ html {<hr>This page is maintained by }
+ html {<a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.}
+ html {Last modified 3. january 1996. <br>}
+ html {<em> This and the following pages are under construction and }
+ html {will continue to be so until the end of January 1996.</em>}
+}
\ No newline at end of file
-# $Id: ztargets.conf,v 1.14 1995/12/22 14:21:17 adam Exp $
+# $Id: ztargets.conf,v 1.15 1996/01/03 15:19:54 adam Exp $
set commonFields {
{ Title {@attr 1=4} }
{ Author {@attr 1=1003} }
0 \
]
-set targets(localhost:9999) {
- Ztest9999
+set targets(localhost:9998) {
+ Ztest9998
{Default ABE BETA}
{
{ Title {@attr 1=4} }