</head>
<body>
{
-# $Id: mquery.egw,v 1.12 1996/01/29 17:31:45 adam Exp $
+# $Id: mquery.egw,v 1.13 1996/03/08 16:47:04 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
}
html {<input type=submit value="Search"><input type=reset value="Reset">}
html "<br>\n"
- html {Number of records to display in the result set list: }
- html {<input type="text" name="hits" value="}
- html 10
- html {" size=3></form>}
-
+ html {Display each record in <select name="format">}
+ html "<option>brief\n"
+ html "<option>medium\n"
+ html "</select> notation"
+ html { and sort by <select name="sort">}
+ html "<option>score\n"
+ html "<option>server\n"
+ html "</select><br>\n"
+
set useIcons 0
button-europagate
button-new-target 0
<html>
{
-# $Id: msearch.egw,v 1.16 1996/03/07 12:46:08 adam Exp $
+# $Id: msearch.egw,v 1.17 1996/03/08 16:47:04 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
if {$hist($setNo,maxPresent) == ""} {
set hist($setNo,maxPresent) 20
}
+ set hist($setNo,format) [egw_form format]
+ if {![string length $hist($setNo,format)]} {
+ set hist($setNo,format) brief
+ }
+ set hist($setNo,sort) [egw_form sort]
+ if {![string length $hist($setNo,sort)]} {
+ set hist($setNo,sort) server
+ }
}
set useIcons 1
html "<br>\n"
z39msearch $setNo B 1 $hist($setNo,maxPresent) 1
- html "<dl>\n"
- set not $hist($setNo,0,host)
- for {set i 1} {$i <= $not} {incr i} {
- if {$zstatus($i) != 2} continue
- html "<dt><h3>" [lindex $targets($hist($setNo,$i,host)) 0] ": "
- set status [z39$i.$setNo responseStatus]
- if {[lindex $status 0] == "NSD"} {
- z39$i.$setNo nextResultSetPosition 0
- set code [lindex $status 1]
- set msg [lindex $status 2]
- set addinfo [lindex $status 3]
- html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
- } else {
- set r [z39$i.$setNo resultCount]
- html "$r hits</h3>\n<dd>\n<ul>\n"
-
- if {$hist($setNo,$i,offset) > $hist($setNo,maxPresent)} {
- display-rec 1 $hist($setNo,maxPresent) display-brief $setNo $i
- } else {
- display-rec 1 $hist($setNo,$i,offset) display-brief $setNo $i
- }
- html "</ul>"
- }
- html "\n"
- }
- html "</dl>\n"
+ display-result-set-m $setNo
set useIcons 0
button-europagate
html "target: " $host " <br>\n"
html "query: --" $hist($setNo,1,query) "-- <br>\n"
html "database: " $hist($setNo,1,database) "<br>\n"
+ html "sort: " $hist($setNo,sort) "<br>\n"
+ html "format: " $hist($setNo,format) "<br>\n"
html "setNo: " $setNo " <br>\n"
html "nextSetNo: " $nextSetNo " <br>\n"
}
<html>
{
-# $Id: mtargets.egw,v 1.16 1996/03/05 18:50:25 adam Exp $
+# $Id: mtargets.egw,v 1.17 1996/03/08 16:47:05 adam Exp $
set setNo 1
source ztargets.conf
if {[info commands saveState] == ""} {
foreach t $tn {
html {<dt>} [ lindex $targets($t) 0]
html {<dd>}
- set databases [lindex $targets($t) 1]
-
+ set databases [splitDatabaseSpec $t]
+
set desc [lindex $targets($t) 4]
if {$desc != ""} {
html "$desc<br>\n"
</head>
<body>
{
-# $Id: query.egw,v 1.35 1996/03/07 12:46:08 adam Exp $
+# $Id: query.egw,v 1.36 1996/03/08 16:47:05 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
html [lindex $targets($host) 4] "<br>\n"
- set databases [lindex $targets($host) 1]
-
+ set databases [splitDatabaseSpec $host]
if {$initSet == ""} {
set databaseDefault [lindex $databases 0]
set oSetNo 0
<html>
{
-# $Id: search.egw,v 1.34 1996/03/07 12:46:09 adam Exp $
+# $Id: search.egw,v 1.35 1996/03/08 16:47:05 adam Exp $
proc start-scan {scanNo targetNo cache dir initSet} {
global sessionId
}
button-new-query 0 $setNo
- set databases [lindex $targets($host) 1]
+ set databases [splitDatabaseSpec $host]
if {$initSet == ""} {
set databaseDefault [lindex $databases 0]
set hist($setNo,form,logic3) {}
set host $hist($setNo,0,host)
- set databases [lindex $targets($host) 1]
+
+ set databases [splitDatabaseSpec $host]
set b [egw_form base]
if {[egw_form baseall] != ""} {
<html>
{
-# $Id: targets.egw,v 1.20 1996/03/05 18:50:25 adam Exp $
+# $Id: targets.egw,v 1.21 1996/03/08 16:47:06 adam Exp $
source ztargets.conf
if {[info commands saveState] == ""} {
source z39util.tcl
set tt [array names targets]
set tn [lsort -command targetsCmp $tt]
foreach t $tn {
- if {[string index $t 0] == "."} continue
html {<dt><a href="http:} $env(SCRIPT_NAME) /
html "$sessionId/query.egw;/$t" {"> } [lindex $targets($t) 0] " </a>\n"
set desc [lindex $targets($t) 4]
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wshmain.c,v $
- * Revision 1.1 1996/02/29 15:36:34 adam
+ * Revision 1.2 1996/03/08 16:47:06 adam
+ * Logs of changes.
+ *
+ * Revision 1.1 1996/02/29 15:36:34 adam
* Main shell loop implemented as a separate function called wshmain.
*
*/
W_Interp w_interp;
GW_DB gw_db;
GwRes shRes;
-#if 0
+#if 1
struct rlimit rlim;
rlim.rlim_cur = RLIM_INFINITY;
#
-# $Id: z39util.tcl,v 1.36 1996/03/07 12:46:09 adam Exp $
+# $Id: z39util.tcl,v 1.37 1996/03/08 16:47:08 adam Exp $
#
proc saveState {} {
uplevel #0 {
}
set rtype [$zset recordType $no]
if {$rtype == "SUTRS"} {
+ html { <a href="http:} $env(SCRIPT_NAME) /
+ html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
html [join [$zset getSutrs $no]]
- html "<br>\n"
+ html "</a><br>\n"
return
}
if {$rtype == "WAIS"} {
}
}
if {![info exists data(title)] || ![info exists data(linkage)]} {
- html "<tt>" [join [$zset getWAIS $no text]] "</tt>\n"
+ html "<pre>" [join [$zset getWAIS $no text]] "\n</pre>\n"
return
}
html {Title: } {<a href="} $data(linkage) {">} $data(title) "</a><br>\n"
}
set rtype [$zset recordType $no]
if {$rtype == "SUTRS"} {
- html [join [$zset getSutrs $no]] "<br>\n"
+ html "<pre>"
+ html [join [$zset getSutrs $no]]
+ html "</pre><br>\n"
return
}
if {$rtype == "WAIS"} {
set q {}
for {set i 1} {$i <= $ilines} {incr i} {
set term [join [egw_form entry$i]]
- if {[lindex $targets($t) 6] == "1"} {
+ if {![string compare [lindex $targets($t) 1] WAIS]} {
if {[string length $op] == 0} {
set q $term
} else {
}
if {[string length $term] > 0} {
set field [join [egw_form menu$i]]
+ catch {unset attr}
foreach x [lindex $targets($t) 2] {
- if {[lindex $x 0] == $field} {
+ if {![string compare [lindex $x 0] $field]} {
set attr [lindex $x 1]
}
}
+ if {![info exists attr]} {
+ egw_log debug "attr failed for $t"
+ set attr [lindex [lindex [lindex $targets($t) 2] 0] 1]
+ }
switch $op {
And
{ set q "@and $q ${attr} \"${term}\"" }
}
}
- if {[lindex $targets($host) 6] == "1"} {
+ if {![string compare [lindex $targets($host) 1] WAIS]} {
wais-set $zz.$setNo $zz
} else {
ir-set $zz.$setNo $zz
+ $zz.$setNo preferredRecordSyntax [lindex $targets($host) 1]
+ egw_log debug "set syntax to [lindex $targets($host) 1]"
}
if {![lindex $targets($host) 5]} {
set elements {}
egw_log debug "database=$database"
eval $zz.$setNo databaseNames $database
- $zz.$setNo preferredRecordSyntax USMARC
-
$zz callback [list search-response $zz.$setNo]
if {$piggy} {
$zz.$setNo largeSetLowerBound 999999
}
continue
}
- if {[catch [list z39$i.$setNo preferredRecordSyntax USMARC]]} {
+ if {[catch [list z39$i.$setNo preferredRecordSyntax]]} {
if {$debug} {
html "ok<br>\n"
}
- if {[lindex $targets($host) 6] == "1"} {
+ if {![string compare [lindex $targets($host) 1] WAIS]} {
wais-set z39$i.$setNo z39$i
} else {
ir-set z39$i.$setNo z39$i
+ z39$i.$setNo preferredRecordSyntax [lindex $targets($host) 1]
+ egw_log debug "set syntax to [lindex $targets($host) 1]"
}
set hist($setNo,$i,offset) 0
eval z39$i.$setNo databaseNames $hist($setNo,$i,database)
z39$i.$setNo elementSetNames $thisElements
z39$i.$setNo recordElements $thisElements
- z39$i.$setNo preferredRecordSyntax USMARC
z39$i callback [list search-m-response $setNo $i $start $number]
if {$start == 1} {
}
html "present<br>\n"
- z39$i.$setNo preferredRecordSyntax USMARC
z39$i callback [list search-m-response $setNo $i $start $tnumber]
incr zleft
egw_log debug "mpresent start=$start number=$tnumber"
html "<p>\n"
}
+proc display-result-set-m-score {setNo} {
+ global hist
+ global useIcons
+ global zstatus
+ global targets
+
+ set not $hist($setNo,0,host)
+ for {set i 1} {$i <= $not} {incr i} {
+ if {[lindex $status 0] != "DBOSD"} continue
+
+ if {$hist($setNo,$i,offset) > $hist($setNo,maxPresent)} {
+ set nor $hist($setNo,$i,maxPresent)
+ } else {
+ set nor $hist($setNo,$i,offset)
+ }
+ for {set j 1} {$j < $not} {incr j} {
+ if {![string compare [z39$i.$setNo recordType] WAIS]} {
+ lappend scoreArray [list \
+ [z39$i.$setNo getWAIS $j score] $i $setNo $j]
+ } else {
+ lappend scoreArray [list 0 $i $setNo $j]
+ }
+ }
+ }
+ html "score merge<br>"
+}
+
+proc display-result-set-m-server {setNo} {
+ global hist
+ global useIcons
+ global zstatus
+ global targets
+
+ set not $hist($setNo,0,host)
+ html "<dl>\n"
+ for {set i 1} {$i <= $not} {incr i} {
+ if {$zstatus($i) != 2} continue
+ html "<dt><h3>" [lindex $targets($hist($setNo,$i,host)) 0] ": "
+ set status [z39$i.$setNo responseStatus]
+ if {[lindex $status 0] == "NSD"} {
+ z39$i.$setNo nextResultSetPosition 0
+ set code [lindex $status 1]
+ set msg [lindex $status 2]
+ set addinfo [lindex $status 3]
+ html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
+ } else {
+ set r [z39$i.$setNo resultCount]
+ html "$r hits</h3>\n<dd>\n<ul>\n"
+
+ if {$hist($setNo,$i,offset) > $hist($setNo,maxPresent)} {
+ display-rec 1 $hist($setNo,maxPresent) \
+ display-brief $setNo $i
+ } else {
+ display-rec 1 $hist($setNo,$i,offset) \
+ display-brief $setNo $i
+ }
+ html "</ul>"
+ }
+ html "\n"
+ }
+ html "</dl>\n"
+}
+
+proc display-result-set-m {setNo} {
+ global hist
+ global useIcons
+ global zstatus
+ global targets
+
+ egw_log debug "sort=$hist($setNo,sort)"
+ switch $hist($setNo,sort) {
+ score {
+ display-result-set-m-score $setNo
+ }
+ default {
+ display-result-set-m-server $setNo
+ }
+ }
+}
+
proc display-result-set-s {setNo targetNo startPos endPos} {
global hist
global useIcons
}
proc splitHostSpec {host} {
- set i [string last . $host]
+ set i [string first / $host]
if {$i > 1} {
incr i -1
return [string range $host 0 $i]
return $host
}
+proc splitDatabaseSpec {host} {
+ set i [string first / $host]
+ if {$i > 1} {
+ incr i
+ regsub -all -- - [string range $host $i end] { } res
+ return $res
+ }
+ regsub -all -- - $host {} res
+ return $res
+}
+
proc mergeHostSpec {host databases} {
return ${host}.[join $databases -]
}
global targets
if {[catch {$assoc failback fail-response}]} {
- if {[lindex $targets($host) 6] == "1"} {
+ if {![string compare [lindex $targets($host) 1] WAIS]} {
wais $assoc
} else {
ir $assoc
}
} else {
- if {[lindex $targets($host) 6] == "1"} {
+ if {![string compare [lindex $targets($host) 1] WAIS]} {
if {[$assoc comstack] == "wais"} return
wais $assoc
} else {
-# $Id: ztargets.conf,v 1.27 1996/03/07 12:46:10 adam Exp $
+# $Id: ztargets.conf,v 1.28 1996/03/08 16:47:09 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
-# targets array is indexed by a hostname followed by a dot and a descriptor.
-# The descriptor should be the local database name (without dots in it).
+# targets array is indexed by a hostname followed by slash (/) and a
+# a list of databases.
+# slash (/).
# Each entry consists of 6 fields. They are:
-# 1 Short-hand notaton for the target/target. Specify whatever you
-# think is appropriate
-# 2 Database list (one or more databases in list notation)
+# 1 Short-hand notaton for the target/database. Specify whatever you
+# think is appropriate.
+# 2 Preferred record syntax - USMARC/UKMARC/SUTRS, etc..
# 3 Search fields and their mapping to Bib-1
# 4 Authentication string; an empty string indicates
# "no authentication".
{ All {@attr 1=1016} }
}
-set targets(myriad.middlebury.edu.MIDCAT) {
+set locFields {
+ { Title {@attr 1=4} }
+ { Author {@attr 1=1} }
+ { Abstract {@attr 1=62} }
+ { Date {@attr 1=30} }
+ { {Doc ID} {@attr 1=1032} }
+}
+
+set targets(myriad.middlebury.edu/MIDCAT) {
Midcat
- MIDCAT
+ USMARC
{ { Title {@attr 1=4} }
{ Author {@attr 1=1003} }
{ Abstract {@attr 1=62} }
1
}
-set targets(rlg.stanford.edu.BKS-AMC-MAP-MDF-REC-SCO-SER-VIM) [list \
+set targets(rlg.stanford.edu/SAM) [list \
RLG \
- {BKS AMC MAP MDF REC SCO SER VIM} \
+ USMARC \
$commonFields \
{} \
- {Research Libraries group, Stanford University. Databases:<br>
- AMC:Archival and manuscripts control;
- BKS:Books;
- MAP:Maps;
- MDF:Computer files;
- REC:Recordings;
- SCO:Musical scores;
- SER:Serials/periodicals;
- VIM:Visual materials (films, videos, images)
- } \
- 1
+ {Research Libraries group, Stanford University. Sample database} \
+ 1 \
]
-set targets(z3950.bibsys.no:2100.BIBSYS) [list \
- BIBSYS \
+set targets(z3950.bibsys.no:2100/BIBSYS) [list \
BIBSYS \
+ USMARC \
$commonFields \
{} \
{BIBSYS; Norway.} \
0 \
]
-#set targets(dtbsun.dtv.dk:4501.DEM) [list \
+#set targets(dtbsun.dtv.dk:4501/DEM) [list \
# Aleph \
# DEM \
# $commonFields \
# 0 \
#]
-set targets(ir.dbc.bib.dk:2008.danbib) {
+set targets(ir.dbc.bib.dk:2008/danbib) {
DanBib
- danbib
+ DANMARC
{
{ Title {@attr 1=4} }
{ Author {@attr 1=1003} }
{ Abstract {@attr 1=62} }
{ Date {@attr 1=30} }
- { All {@attr 1=1016} }
}
{}
{Danish Union Catalogue}
0
}
-set targets(dtbsun.dtv.dk:9999.usgs-esdd-uah) {
+set targets(dtbsun.dtv.dk:9999/usgs-esdd-uah) {
Zebra
- {usgs esdd iah}
+ USMARC
{
{ Title {@attr 1=4} }
{ Author {@attr 1=1003} }
1
}
-set targets(z3950.research.att.com.books) [list \
+set targets(z3950.research.att.com/books) [list \
{AT&T Server} \
- books \
+ USMARC \
$commonFields \
{} \
{AT&T book catalog, mainly IEEE} \
1 \
]
-set targets(dranet.dra.com.drewdb) [list \
+set targets(dranet.dra.com/drewdb) [list \
{Dranet} \
- drewdb \
+ USMARC \
$commonFields \
{} \
{Sample database of 400,000 bibliographic records from Drew University} \
1 \
]
-set targets(libcat1.cc.emory.edu.UNICORN) [list \
+set targets(libcat1.cc.emory.edu/UNICORN) [list \
Emory \
- UNICORN \
+ USMARC \
$commonFields \
{} \
{Emory University} \
0 \
]
-set targets(161.253.225.10.UNICORN) [ list \
+set targets(161.253.225.10/UNICORN) [ list \
GWUW \
- UNICORN \
- $commonFields \
+ USMARC \
+ $locFields \
{} \
{George Washington University} \
0 \
]
-set targets(IBM2.LOC.GOV:2210.BOOKS) [ list \
- LOC \
- BOOKS \
- $commonFields \
+set targets(IBM2.LOC.GOV:2210/BOOKS) [ list \
+ LOC,BOOKS \
+ {} \
+ $locFields \
{} \
{Library of Congress: Production file of monograph (book) records} \
1 \
]
-set targets(IBM2.LOC.GOV:2210.NAMES) [ list \
- LOC \
- NAMES \
- $commonFields \
+set targets(IBM2.LOC.GOV:2210/NAMES) [ list \
+ LOC,NAMES \
+ USMARC \
+ $locFields \
{} \
{Library of Congress: Production file of name authority records} \
1 \
]
-set targets(199.92.147.99.UNICORN) [list \
+set targets(199.92.147.99/Baystate) [list \
Baystate \
- UNICORN \
+ USMARC \
$commonFields \
{} \
{Baystate Medical Center} \
0 \
]
-set targets(Tikal.dev.oclc.org.AGRICOLA) [list \
- AGRICOLA \
+set targets(Tikal.dev.oclc.org/AGRICOLA) [list \
AGRICOLA \
+ USMARC \
$commonFields \
{} \
{OCLC-FirstSearch: AGRICOLA} \
1 \
]
-set targets(nwi.ub2.lu.se.sverige) {
+set targets(nwi.ub2.lu.se/sverige) {
NWI-Sweden
- sverige
+ WAIS \
{ { Ranked {@attr 1=4} } }
{}
{Nordic Web Index - Sweden}
1
+}
+
+set targets(netsrv.casi.sti.nasa.gov:10210/GILS) {
+ NASA
+ WAIS \
+ { { Ranked {@attr 1=4} } }
+ {}
+ {NASA database}
1
}
-set targets(nwi.ub2.lu.se.new_nor_lib) {
+set targets(nwi.ub2.lu.se/new_nor_lib) {
NWI-Norway
- new_nor_lib
+ {}
{ { Ranked {@attr 1=4} } }
{}
{Nordic Web Index - Norway}
1
+}
+
+set targets(z3950.research.att.com/z39dbs) {
+ Z39DB
+ SUTRS
+ { All {} }
+ {}
+ {Server with description of other Z39.50 databases}
+ 1
+}
+
+set targets(z3950.research.att.com/netlib) {
+ Netlib
+ SUTRS
+ { All {} }
+ {}
+ {Netlib server}
1
}
-set targets(localhost:210.Default) {
+set targets(localhost:210/Default) {
Ztest
- Default
- { { Ranked {@attr 1=4} } }
+ USMARC
+ {
+ { Title {@attr 1=4} }
+ { Author {@attr 1=1003} }
+ { Abstract {@attr 1=62} }
+ { Date {@attr 1=30} }
+ { {Doc ID} {@attr 1=1032} }
+ { All {@attr 1=1016} }
+ { Ranked {@attr 1=1016 @attr 4=105} }
+ }
{}
{Test server on port 210}
1
- 0
}