<html>
{
-# $Id: msearch.egw,v 1.9 1996/01/04 10:40:00 adam Exp $
+# $Id: msearch.egw,v 1.22 1996/05/15 18:43:37 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
+ if {![info exists debug]} {
+ session-lost
+ egw_abort
+ }
}
global sessionWait
global nextSetNo
html "<head><title> WWW/Z39.50 Gateway Search </title>\n"
html "</head><body>\n"
+
set setNo [lindex $sessionParms 0]
- if {[wform menu1] != ""} {
+ if {[llength [egw_form]] > 0} {
+ if {[string length [egw_form host]] > 0} {
+ set hist($setNo,0,host) [llength [egw_form host]]
+ set i 1
+ foreach t [egw_form host] {
+ set hist($setNo,$i,host) $t
+ set hist($setNo,$i,database) [splitDatabaseSpec $t]
+ set hist($setNo,$i,idAuthentication) {}
+ 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)
incr nextSetNo
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,$i,query) [build-query $hist($setNo,$i,host) 6]
}
- set hist($setNo,maxPresent) [wform hits]
+
+ set hist($setNo,scan) 0
+
+ for {set i 1} {$i < 6} {incr i} {
+ set hist($setNo,form,menu$i) [egw_form menu$i]
+ set hist($setNo,form,entry$i) [egw_form entry$i]
+ set hist($setNo,form,logic$i) [egw_form logic$i]
+ }
+ set hist($setNo,maxPresent) [egw_form hits]
if {$hist($setNo,maxPresent) == ""} {
- set hist($setNo,maxPresent) 30
+ 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
}
}
- z39msearch $setNo 1 B
- 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><ul>\n"
+ set useIcons 1
+ button-main
+ button-new-query $setNo
+ button-view-history
+ button-new-target
- display-rec 1 $hist($setNo,$i,offset) display-brief $i
- html "</ul>"
- }
- html "\n"
- }
- html "</dl>\n"
-}
+ html "<br>\n"
+ z39msearch $setNo B 1 $hist($setNo,maxPresent) 1
-{
- global useIcons
+ display-result-set-m $setNo
- if {$useIcons} {
- html {<img src="/gif/button-egw.gif">}
- }
- html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/mtargets.egw}
- if {$useIcons} {
- html {"><img src="/gif/button-new-target.gif" border=0></a>}
- } else {
- html {"> New target </a>} " | \n"
- }
- html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/mquery.egw/} $setNo
- if {$useIcons} {
- html {"><img src="/gif/button-new-query.gif" border=0></a>}
- } else {
- html {"> New query </a>}
- }
+ set useIcons 0
+ button-main
+ button-new-query $setNo
+ button-view-history
+ button-new-target
}
{
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 "form: " [egw_form] " <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"
}