From: Adam Dickmeiss Date: Tue, 12 Mar 1996 16:30:26 +0000 (+0000) Subject: Work on WAIS protocol. X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=a4571caef991e968e3c20b515490b7923306a1cf;p=egate.git Work on WAIS protocol. --- diff --git a/www/Makefile b/www/Makefile index f201b75..8744ac0 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1,7 +1,7 @@ # Makefile for www gateway utility # Europagate, 1995 # -# $Id: Makefile,v 1.36 1996/03/11 17:40:47 adam Exp $ +# $Id: Makefile,v 1.37 1996/03/12 16:30:26 adam Exp $ # SHELL=/bin/sh @@ -21,7 +21,7 @@ TCLINC= WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \ mtargets.egw mquery.egw msearch.egw history.egw tform.egw tdefine.egw \ - sameas.egw nwi.egw + sameas.egw nwi.egw nwiutil.tcl HSCRIPTS=egwindex.html CONFFILES=egw.res ztargets.conf TPROG1=egwcgi diff --git a/www/gif/button-nwi.gif b/www/gif/button-nwi.gif new file mode 100644 index 0000000..fe77fdb Binary files /dev/null and b/www/gif/button-nwi.gif differ diff --git a/www/gif/button-raw-marc.gif b/www/gif/button-raw-marc.gif index 38b4052..c1ce36f 100644 Binary files a/www/gif/button-raw-marc.gif and b/www/gif/button-raw-marc.gif differ diff --git a/www/history.egw b/www/history.egw index 90ce2ce..fe8e872 100644 --- a/www/history.egw +++ b/www/history.egw @@ -4,20 +4,20 @@ { -# $Id: history.egw,v 1.5 1996/01/26 15:50:06 adam Exp $ +# $Id: history.egw,v 1.6 1996/03/12 16:30:26 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl } set useIcons 1 - button-europagate + button-main button-new-target 0 z39history set useIcons 0 - button-europagate + button-main button-new-target 0 } { diff --git a/www/mquery.egw b/www/mquery.egw index 69dcd19..fa2c809 100644 --- a/www/mquery.egw +++ b/www/mquery.egw @@ -4,7 +4,7 @@ { -# $Id: mquery.egw,v 1.13 1996/03/08 16:47:04 adam Exp $ +# $Id: mquery.egw,v 1.14 1996/03/12 16:30:26 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -21,7 +21,7 @@ } set useIcons 1 - button-europagate + button-main button-new-target 0 html {

\n" set useIcons 0 - button-europagate + button-main button-new-target 0 } { diff --git a/www/msearch.egw b/www/msearch.egw index e31fff3..6959878 100644 --- a/www/msearch.egw +++ b/www/msearch.egw @@ -1,6 +1,6 @@ { -# $Id: msearch.egw,v 1.18 1996/03/11 17:40:47 adam Exp $ +# $Id: msearch.egw,v 1.19 1996/03/12 16:30:26 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -16,7 +16,7 @@ set setNo [lindex $sessionParms 0] - if {[string length [egw_form entry1]] > 0} { + if {[llength [egw_form]] > 0} { if {[string length [egw_form host]] > 0} { set hist($setNo,0,host) [llength [egw_form host]] set i 1 @@ -27,6 +27,10 @@ incr i } } + if {![info exists hist($setNo,0,host)]} { + displayError {No servers selected} {} + egw_abort + } set hist($nextSetNo,0,host) $hist($setNo,0,host) for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} { set hist($nextSetNo,$i,host) $hist($setNo,$i,host) @@ -40,6 +44,19 @@ for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} { set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 3] } + + set hist($setNo,form,menu1) [egw_form menu1] + set hist($setNo,form,menu2) [egw_form menu2] + set hist($setNo,form,menu3) [egw_form menu3] + + set hist($setNo,form,entry1) [egw_form entry1] + set hist($setNo,form,entry2) [egw_form entry2] + set hist($setNo,form,entry3) [egw_form entry3] + + set hist($setNo,form,logic1) [egw_form logic1] + set hist($setNo,form,logic2) [egw_form logic2] + set hist($setNo,form,logic3) {} + set hist($setNo,maxPresent) [egw_form hits] if {$hist($setNo,maxPresent) == ""} { set hist($setNo,maxPresent) 20 @@ -55,7 +72,7 @@ } set useIcons 1 - button-europagate + button-main button-new-query 1 $setNo button-new-target 0 @@ -65,7 +82,7 @@ display-result-set-m $setNo set useIcons 0 - button-europagate + button-main button-new-query 1 $setNo button-new-target 0 } diff --git a/www/mtargets.egw b/www/mtargets.egw index 46cd770..4ac743e 100644 --- a/www/mtargets.egw +++ b/www/mtargets.egw @@ -1,6 +1,6 @@ { -# $Id: mtargets.egw,v 1.17 1996/03/08 16:47:05 adam Exp $ +# $Id: mtargets.egw,v 1.18 1996/03/12 16:30:27 adam Exp $ set setNo 1 source ztargets.conf if {[info commands saveState] == ""} { @@ -33,8 +33,11 @@ { + set scriptQuery mquery.egw + set scriptTarget mtargets.egw + set useIcons 1 - button-europagate + button-main button-define-target 0 html "

Choose one or more targets

\n" @@ -42,8 +45,6 @@ html / $sessionId {/mquery.egw/} $setNo {" method=get>
} \n html "
\n" - - proc targetsCmp {l r} { global targets return [string compare [string tolower [lindex $targets($l) 0]] \ @@ -71,7 +72,7 @@ html "

\n" set useIcons 0 - button-europagate + button-main button-define-target 0 } diff --git a/www/nwi.egw b/www/nwi.egw index b2b7d22..ef66aec 100644 --- a/www/nwi.egw +++ b/www/nwi.egw @@ -1,7 +1,12 @@ { -# $Id: nwi.egw,v 1.1 1996/03/11 17:41:16 adam Exp $ +# $Id: nwi.egw,v 1.2 1996/03/12 16:30:27 adam Exp $ source ztargets.conf + + set scriptQuery nwi.egw + set scriptTarget {} + set utilExtension nwiutil.tcl + if {[info commands saveState] == ""} { source z39util.tcl } @@ -43,32 +48,72 @@ } set useIcons 1 - button-europagate - button-new-target 0 + button-main + set initSet [lindex $sessionParms 0] + set curSort score + set curFormat brief + set curEntry {} + catch { + if {$initSet > 0} { + for {set i 1} {$i <= $hist($initSet,0,host)} {incr i} { + lappend curTargets $hist($initSet,$i,host) + } + set curSort $hist($initSet,sort) + set curFormat $hist($initSet,format) + set curEntry $hist($initSet,form,entry1) + } + } html {} \n - html "Enter your query:
\n" + html "

" + html {
Enter your query
} - html {} + html {} html {
} - html {and search the following servers:
} + html {
and search the following servers
} - html { Sweden} - html { Norway} - - html "
\n" - - html {Display each record in } [lindex $targets($t) 0] + } + catch {unset curTargets} + html {

Display each record in notation" html { and sort by
\n" -} \ No newline at end of file + if {![string compare $curSort score]} { + html "

\n" + + set useIcons 0 + button-main + + catch maintenance +} + + diff --git a/www/nwiutil.tcl b/www/nwiutil.tcl new file mode 100644 index 0000000..a3aa8ba --- /dev/null +++ b/www/nwiutil.tcl @@ -0,0 +1,20 @@ +# +# $Id: nwiutil.tcl,v 1.1 1996/03/12 16:30:27 adam Exp $ +# + +proc button-main {} { + global useIcons + html {} + if {$useIcons} { + html {NWI} + } else { + html {NWI} + } +} + +proc maintenance {} { + html {
This page is maintained by } + html { Adam Dickmeiss .} + html {Last modified March 12, 1996.
} +} + diff --git a/www/query.egw b/www/query.egw index 3e11570..5c5e033 100644 --- a/www/query.egw +++ b/www/query.egw @@ -4,7 +4,7 @@ { -# $Id: query.egw,v 1.36 1996/03/08 16:47:05 adam Exp $ +# $Id: query.egw,v 1.37 1996/03/12 16:30:27 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -24,8 +24,8 @@ proc ok-response {} { global nextSetNo global hist - set host [lindex $sessionParms 0] - set initSet [lindex $sessionParms 1] + set initSet [lindex $sessionParms 0] + set host [lindex $sessionParms 1] set scanLine [lindex $sessionParms 2] set scanTerm [lrange $sessionParms 3 end] @@ -95,7 +95,7 @@ proc ok-response {} { } set useIcons 1 - button-europagate + button-main button-new-target 1 if {[lsearch [z390 options] scan] >= 0} { button-scan-window 1 $setNo @@ -107,7 +107,7 @@ proc ok-response {} { html [lindex $targets($host) 4] "
\n" set databases [splitDatabaseSpec $host] - if {$initSet == ""} { + if {$initSet == -1} { set databaseDefault [lindex $databases 0] set oSetNo 0 } else { @@ -166,7 +166,7 @@ proc ok-response {} { if {[string length $template] > 0} { html { value="} $template {"} } - html { size=43> } + html { size=35> } if {0 && [lsearch [z390 options] scan] >= 0} { html {} } @@ -205,7 +205,7 @@ proc ok-response {} { html "

\n" set useIcons 0 - button-europagate + button-main button-new-target 1 if {[lsearch [z390 options] scan] >= 0} { button-scan-window 1 $setNo diff --git a/www/search.egw b/www/search.egw index 5c90170..3e66629 100644 --- a/www/search.egw +++ b/www/search.egw @@ -1,6 +1,6 @@ { -# $Id: search.egw,v 1.36 1996/03/11 17:40:48 adam Exp $ +# $Id: search.egw,v 1.37 1996/03/12 16:30:28 adam Exp $ proc start-scan {scanNo targetNo cache dir initSet} { global sessionId @@ -21,7 +21,7 @@ proc start-scan {scanNo targetNo cache dir initSet} { html "\n" set useIcons 1 - button-europagate + button-main if {$dir == "b"} { set lines 20 @@ -120,7 +120,7 @@ proc start-scan {scanNo targetNo cache dir initSet} { set useIcons 0 if {$hist($setNo,$scanNo,scanTerm) == ""} { - button-europagate + button-main button-new-query 0 $setNo return } @@ -129,7 +129,7 @@ proc start-scan {scanNo targetNo cache dir initSet} { display-scan $setNo $scanNo 0 html "

\n" - button-europagate + button-main html {\n" - button-europagate + button-main if {$no < $count} { + if {!$useIcons} { + html "\n | " + } html {} } else { - html {">Next} " | \n" + html {">Next} } } if {$no > 1} { + if {!$useIcons} { + html "\n | " + } html {} } else { - html {">Previous} " | \n" + html {">Previous} } } + if {!$useIcons} { + html "\n | " + } html {} } else { - html {">Raw Format} " | \n" + html {">Raw Format} } } else { html full @@ -49,10 +58,13 @@ proc buttons {setNo tno no format count host after} { html {">} } else { - html {">Full Format} " | \n" + html {">Full Format} } } + if {!$useIcons} { + html "\n | " + } html {} } else { - html {">Result Set} " | \n" + html {">Result Set} } button-new-query 1 $setNo diff --git a/www/targets.egw b/www/targets.egw index 975631d..b597347 100644 --- a/www/targets.egw +++ b/www/targets.egw @@ -1,6 +1,6 @@ { -# $Id: targets.egw,v 1.21 1996/03/08 16:47:06 adam Exp $ +# $Id: targets.egw,v 1.22 1996/03/12 16:30:29 adam Exp $ source ztargets.conf if {[info commands saveState] == ""} { source z39util.tcl @@ -32,9 +32,12 @@ { + set scriptQuery query.egw + set scriptTarget targets.egw + set useIcons 1 - button-europagate + button-main if {[info exists nextSetNo]} { button-view-history 1 } @@ -51,7 +54,8 @@ set tn [lsort -command targetsCmp $tt] foreach t $tn { html {

} [lindex $targets($t) 0] " \n" + html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0] + html " \n" set desc [lindex $targets($t) 4] if {$desc != ""} { html "
$desc\n" @@ -59,7 +63,7 @@ } html "

\n" set useIcons 0 - button-europagate + button-main if {[info exists nextSetNo]} { button-view-history 1 } diff --git a/www/tdefine.egw b/www/tdefine.egw index 1db4d89..268f9f8 100644 --- a/www/tdefine.egw +++ b/www/tdefine.egw @@ -4,13 +4,13 @@ { -# $Id: tdefine.egw,v 1.3 1996/01/26 15:50:11 adam Exp $ +# $Id: tdefine.egw,v 1.4 1996/03/12 16:30:29 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl } set useIcons 1 - button-europagate + button-main button-define-target 1 button-new-target 0 @@ -72,7 +72,7 @@ global targets set targets($hostSpec) [list \ [join $name] \ - $databases \ + USMARC \ $attrList \ $authentication \ $description \ @@ -81,7 +81,7 @@ } html "

\n" set useIcons 0 - button-europagate + button-main button-define-target 1 button-new-target 0 } diff --git a/www/tform.egw b/www/tform.egw index 368c2c9..14b34e3 100644 --- a/www/tform.egw +++ b/www/tform.egw @@ -4,13 +4,13 @@ { -# $Id: tform.egw,v 1.3 1996/01/26 15:50:11 adam Exp $ +# $Id: tform.egw,v 1.4 1996/03/12 16:30:29 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl } set useIcons 1 - button-europagate + button-main button-new-target 0 html "

Target definition form


\n" @@ -63,7 +63,7 @@ html "\n
\n" set useIcons 0 - button-europagate + button-main button-new-target 0 } \ No newline at end of file diff --git a/www/z39util.tcl b/www/z39util.tcl index 9efda0b..e50db2b 100644 --- a/www/z39util.tcl +++ b/www/z39util.tcl @@ -1,5 +1,5 @@ # -# $Id: z39util.tcl,v 1.38 1996/03/11 17:40:49 adam Exp $ +# $Id: z39util.tcl,v 1.39 1996/03/12 16:30:30 adam Exp $ # proc saveState {} { uplevel #0 { @@ -175,6 +175,7 @@ proc display-brief {zset no setNo targetNo} { global env global sessionId + html {
  • } set type [$zset type $no] if {$type == "SD"} { set err [lindex [$zset diag $no] 1] @@ -581,41 +582,45 @@ proc display-full-wais {zset no setNo targetNo} { } else { set nwi 1 } + html "
    \n" + html {
    Title} if {$nwi} { - html {Title: } $data(title) "
    \n" - html {URL: } $data(linkage) "
    \n" + html {
    } $data(title) "" + html {
    URL} + html {
    } $data(linkage) "
    \n" } else { - html {Title: } [join [$zset getWAIS $no headline]] "
    \n" + html {
    } [join [$zset getWAIS $no headline]] } - html {Score: } [$zset getWAIS $no score] "
    \n" + html {
    Score
    } [$zset getWAIS $no score] set lines [$zset getWAIS $no lines] if {$lines > 0} { - html {Lines: } $lines "
    \n" + html {
    Lines
    } $lines "
    \n" } if {!$nwi} { - html "
    \n" [join [$zset getWAIS $no text]] "\n
    \n" + html "
    \n" [join [$zset getWAIS $no text]] "\n
    \n" return } if {[info exists data(bytes)]} { - html {Bytes: } $data(bytes) "
    \n" + html {
    Bytes
    } $data(bytes) } if {[info exists data(dateOfLastModification)]} { - html {Last modified: } $data(dateOfLastModification) "
    \n" + html {
    Last modified
    } $data(dateOfLastModification) } if {[info exists data(lastChecked)]} { - html {Last checked: } $data(lastChecked) "
    \n" + html {
    Last checked
    } $data(lastChecked) "
    \n" } if {[info exists data(ip)]} { - html {
    Initial text
    } $data(ip) "

    \n" + html {
    Initial text
    } $data(ip) "
    \n" } - - html {} - html {Similar WAIS record
    } - html "
    References\n
    \n" + if {0} { + html {} + html {Similar WAIS record
    } + } + html "
    References\n" for {set i 1} {[info exists data($i,linkage)]} {incr i} { - html {} + html {
    } if {[info exists data($i,title)]} { html $data($i,title) } else { @@ -694,16 +699,16 @@ proc build-query {t ilines} { set q {} for {set i 1} {$i <= $ilines} {incr i} { set term [join [egw_form entry$i]] + if {[string length $term] == 0} continue if {![string compare [lindex $targets($t) 1] WAIS]} { - if {[string length $op] == 0} { + if {[string length $q] == 0} { set q $term } else { set q "$term $q" } set op [egw_form logic$i] continue - } - if {[string length $term] > 0} { + } else { set field [join [egw_form menu$i]] catch {unset attr} foreach x [lindex $targets($t) 2] { @@ -716,13 +721,13 @@ proc build-query {t ilines} { set attr [lindex [lindex [lindex $targets($t) 2] 0] 1] } switch $op { - And + And { set q "@and $q ${attr} \"${term}\"" } - Or + Or { set q "@or $q ${attr} \"${term}\"" } - {And not} + {And not} { set q "@not $q ${attr} \"${term}\"" } - {} + {} { set q "${attr} \"${term}\"" } } set op [egw_form logic$i] @@ -833,6 +838,7 @@ proc display-scan {setNo scanNo tno} { global targets global env global sessionId + global scriptQuery set zz z39$tno set zs $zz.s$scanNo.$setNo @@ -862,7 +868,7 @@ proc display-scan {setNo scanNo tno} { if {0} { regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm html {} } else { regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm @@ -1307,19 +1313,25 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} { set zz z39$targetNo html "

    \n" - button-europagate + button-main if {$setMax > 0 && $setMax < [$zz.$setNo resultCount]} { + if {!$useIcons} { + html "\n | " + } html {Next Records} + html {">} } else { - html {">Next Records} " | \n" + html {">Next Records} } } if {$setMax > 0 && $startPos != "" && $startPos != "1"} { + if {!$useIcons} { + html "\n | " + } html {} } else { - html {">Previous Records} " | \n" + html {">Previous Records} } } button-new-query 1 $setNo @@ -1504,6 +1516,7 @@ proc z39history {} { global sessionId global targets global html3 + global scriptQuery set targetNo 0 if {![info exists nextSetNo]} { @@ -1565,7 +1578,7 @@ proc z39history {} { html "

    \n" } html { } } else { @@ -1596,19 +1609,19 @@ proc displayError {msga msgb} { html "

    \n" html {Error} html "

    " $msga "

    \n" - if {$msgb != ""} { + if {[string length $msgb] > 0} { html "

    " $msgb "

    \n" } html "

    \n" } -proc button-europagate {} { +proc button-main {} { global useIcons html {} if {$useIcons} { html {Europagate} } else { - html {Europagate | } + html {Europagate} } } @@ -1617,6 +1630,9 @@ proc button-define-target {more} { global env global sessionId + if {!$useIcons} { + html "\n | " + } html {} } else { html {">Define Target} - if {$more} { - html " | \n" - } else { - html "\n" - } } } @@ -1637,24 +1648,20 @@ proc button-new-target {more} { global env global sessionId global mMode + global scriptTarget - html {} } else { html {">New Target} - if {$more} { - html " | \n" - } else { - html "\n" - } } } @@ -1664,6 +1671,9 @@ proc button-view-history {more} { global sessionId global nextSetNo + if {!$useIcons} { + html "\n | " + } html {} } else { html {">View History} - if {$more} { - html " | \n" - } else { - html "\n" - } } } @@ -1686,25 +1691,19 @@ proc button-new-query {more setNo} { global sessionId global hist global mMode + global scriptQuery - html {} + html {} + if {$useIcons} { html {} } else { html {New Query} - if {$more} { - html " | \n" - } else { - html "\n" - } } } @@ -1714,6 +1713,9 @@ proc button-scan-window {more setNo} { global sessionId global hist + if {!$useIcons} { + html "\n | " + } set targetNo 0 html {} @@ -1722,11 +1724,6 @@ proc button-scan-window {more setNo} { html {alt="Scan" border=0>} } else { html {Scan} - if {$more} { - html " | \n" - } else { - html "\n" - } } } @@ -1759,7 +1756,7 @@ proc splitDatabaseSpec {host} { } proc mergeHostSpec {host databases} { - return ${host}.[join $databases -] + return ${host}/[join $databases -] } proc mkAssoc {assoc host} { @@ -1780,4 +1777,8 @@ proc mkAssoc {assoc host} { ir $assoc } } +} + +if {[info exists utilExtension]} { + source $utilExtension } \ No newline at end of file diff --git a/www/ztargets.conf b/www/ztargets.conf index 0fdadb5..d1515fb 100644 --- a/www/ztargets.conf +++ b/www/ztargets.conf @@ -1,4 +1,4 @@ -# $Id: ztargets.conf,v 1.29 1996/03/11 17:40:49 adam Exp $ +# $Id: ztargets.conf,v 1.30 1996/03/12 16:30:30 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 @@ -194,6 +194,16 @@ set targets(nwi.ub2.lu.se/sverige) { 1 } + +set targets(nwi.ub2.lu.se/new_nor_lib) { + NWI-Norway + WAIS + { { Ranked {@attr 1=4} } } + {} + {Nordic Web Index - Norway} + 1 +} + set targets(netsrv.casi.sti.nasa.gov:10210/GILS) { NASA WAIS @@ -203,16 +213,16 @@ set targets(netsrv.casi.sti.nasa.gov:10210/GILS) { 1 } - -set targets(nwi.ub2.lu.se/new_nor_lib) { - NWI-Norway +set targets(localhost:9999/test) { + localwais WAIS { { Ranked {@attr 1=4} } } {} - {Nordic Web Index - Norway} + {Localhost test base} 1 } + set targets(z3950.research.att.com/z39dbs) { Z39DB SUTRS