From: Adam Dickmeiss Date: Fri, 8 Mar 1996 16:47:04 +0000 (+0000) Subject: Logs of changes. X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=e406f6fe976eeae769f193a9d48938d903c02543;p=egate.git Logs of changes. --- diff --git a/www/mquery.egw b/www/mquery.egw index 3cf1ca1..69dcd19 100644 --- a/www/mquery.egw +++ b/www/mquery.egw @@ -4,7 +4,7 @@ { -# $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 @@ -76,11 +76,15 @@ } html {} html "
\n" - html {Number of records to display in the result set list: } - html {} - + html {Display each record in notation" + html { and sort by
\n" + set useIcons 0 button-europagate button-new-target 0 diff --git a/www/msearch.egw b/www/msearch.egw index ee8add3..084353d 100644 --- a/www/msearch.egw +++ b/www/msearch.egw @@ -1,6 +1,6 @@ { -# $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 @@ -34,6 +34,14 @@ 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 @@ -44,32 +52,7 @@ html "
\n" z39msearch $setNo B 1 $hist($setNo,maxPresent) 1 - html "
\n" - set not $hist($setNo,0,host) - for {set i 1} {$i <= $not} {incr i} { - if {$zstatus($i) != 2} continue - html "

" [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

\n
NSD$code: $msg: $addinfo" - } else { - set r [z39$i.$setNo resultCount] - html "$r hits\n
\n
    \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 "
" - } - html "\n" - } - html "
\n" + display-result-set-m $setNo set useIcons 0 button-europagate @@ -90,6 +73,8 @@ html "target: " $host "
\n" html "query: --" $hist($setNo,1,query) "--
\n" html "database: " $hist($setNo,1,database) "
\n" + html "sort: " $hist($setNo,sort) "
\n" + html "format: " $hist($setNo,format) "
\n" html "setNo: " $setNo "
\n" html "nextSetNo: " $nextSetNo "
\n" } diff --git a/www/mtargets.egw b/www/mtargets.egw index fbcd44d..46cd770 100644 --- a/www/mtargets.egw +++ b/www/mtargets.egw @@ -1,6 +1,6 @@ { -# $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] == ""} { @@ -54,8 +54,8 @@ foreach t $tn { html {
} [ lindex $targets($t) 0] html {
} - set databases [lindex $targets($t) 1] - + set databases [splitDatabaseSpec $t] + set desc [lindex $targets($t) 4] if {$desc != ""} { html "$desc
\n" diff --git a/www/query.egw b/www/query.egw index d2280ab..3e11570 100644 --- a/www/query.egw +++ b/www/query.egw @@ -4,7 +4,7 @@ { -# $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 @@ -106,8 +106,7 @@ proc ok-response {} { html [lindex $targets($host) 4] "
\n" - set databases [lindex $targets($host) 1] - + set databases [splitDatabaseSpec $host] if {$initSet == ""} { set databaseDefault [lindex $databases 0] set oSetNo 0 diff --git a/www/search.egw b/www/search.egw index 738906b..425c829 100644 --- a/www/search.egw +++ b/www/search.egw @@ -1,6 +1,6 @@ { -# $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 @@ -62,7 +62,7 @@ proc start-scan {scanNo targetNo cache dir initSet} { } button-new-query 0 $setNo - set databases [lindex $targets($host) 1] + set databases [splitDatabaseSpec $host] if {$initSet == ""} { set databaseDefault [lindex $databases 0] @@ -209,7 +209,8 @@ proc start-scan {scanNo targetNo cache dir initSet} { 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] != ""} { diff --git a/www/targets.egw b/www/targets.egw index f9c15f1..975631d 100644 --- a/www/targets.egw +++ b/www/targets.egw @@ -1,6 +1,6 @@ { -# $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 @@ -50,7 +50,6 @@ set tt [array names targets] set tn [lsort -command targetsCmp $tt] foreach t $tn { - if {[string index $t 0] == "."} continue html {
} [lindex $targets($t) 0] " \n" set desc [lindex $targets($t) 4] diff --git a/www/wshmain.c b/www/wshmain.c index 680d0fc..9a34f7e 100644 --- a/www/wshmain.c +++ b/www/wshmain.c @@ -41,7 +41,10 @@ * 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. * */ @@ -70,7 +73,7 @@ void wshmain (int argc, char **argv, W_Interp_Type w_interp_type) W_Interp w_interp; GW_DB gw_db; GwRes shRes; -#if 0 +#if 1 struct rlimit rlim; rlim.rlim_cur = RLIM_INFINITY; diff --git a/www/z39util.tcl b/www/z39util.tcl index 8740be4..bfa5608 100644 --- a/www/z39util.tcl +++ b/www/z39util.tcl @@ -1,5 +1,5 @@ # -# $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 { @@ -85,8 +85,10 @@ proc display-brief {zset no setNo targetNo} { } set rtype [$zset recordType $no] if {$rtype == "SUTRS"} { + html { } html [join [$zset getSutrs $no]] - html "
\n" + html "

\n" return } if {$rtype == "WAIS"} { @@ -349,7 +351,7 @@ proc display-full-wais {zset no setNo targetNo} { } } if {![info exists data(title)] || ![info exists data(linkage)]} { - html "" [join [$zset getWAIS $no text]] "\n" + html "
" [join [$zset getWAIS $no text]] "\n
\n" return } html {Title: } {} $data(title) "
\n" @@ -394,7 +396,9 @@ proc display-full {zset no setNo targetNo} { } set rtype [$zset recordType $no] if {$rtype == "SUTRS"} { - html [join [$zset getSutrs $no]] "
\n" + html "
"
+        html [join [$zset getSutrs $no]]
+        html "

\n" return } if {$rtype == "WAIS"} { @@ -529,7 +533,7 @@ proc build-query {t ilines} { 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 { @@ -540,11 +544,16 @@ proc build-query {t ilines} { } 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}\"" } @@ -781,10 +790,12 @@ proc z39search {setNo piggy tno elements} { } } - 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 {} @@ -796,8 +807,6 @@ proc z39search {setNo piggy tno 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 @@ -974,15 +983,17 @@ proc z39msearch {setNo elements start number cache} { } continue } - if {[catch [list z39$i.$setNo preferredRecordSyntax USMARC]]} { + if {[catch [list z39$i.$setNo preferredRecordSyntax]]} { if {$debug} { html "ok
\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) @@ -997,7 +1008,6 @@ proc z39msearch {setNo elements start number cache} { 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} { @@ -1049,7 +1059,6 @@ proc z39msearch {setNo elements start number cache} { } html "present
\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" @@ -1164,6 +1173,86 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} { html "

\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
" +} + +proc display-result-set-m-server {setNo} { + global hist + global useIcons + global zstatus + global targets + + set not $hist($setNo,0,host) + html "

\n" + for {set i 1} {$i <= $not} {incr i} { + if {$zstatus($i) != 2} continue + html "

" [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

\n
NSD$code: $msg: $addinfo" + } else { + set r [z39$i.$setNo resultCount] + html "$r hits\n
\n
    \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 "
" + } + html "\n" + } + html "
\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 @@ -1468,7 +1557,7 @@ proc maintenance {} { } 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] @@ -1476,6 +1565,17 @@ proc splitHostSpec {host} { 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 -] } @@ -1484,13 +1584,13 @@ proc mkAssoc {assoc host} { 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 { diff --git a/www/ztargets.conf b/www/ztargets.conf index 6b259af..90e5d7a 100644 --- a/www/ztargets.conf +++ b/www/ztargets.conf @@ -1,14 +1,15 @@ -# $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". @@ -28,9 +29,17 @@ set commonFields { { 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} } @@ -42,34 +51,25 @@ set targets(myriad.middlebury.edu.MIDCAT) { 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:
- 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 \ @@ -78,24 +78,23 @@ set targets(z3950.bibsys.no:2100.BIBSYS) [list \ # 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} } @@ -114,105 +113,137 @@ set targets(dtbsun.dtv.dk:9999.usgs-esdd-uah) { 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 }