{
# $Id: msearch.egw,v 1.15 1996/02/29 15:41:38 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
}
global sessionWait
global nextSetNo
global setNo
global hist
global zstatus
html "
WWW/Z39.50 Gateway Search \n"
html "\n"
set setNo [lindex $sessionParms 0]
if {[egw_form menu1] != ""} {
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)
set hist($nextSetNo,$i,database) $hist($setNo,$i,database)
set hist($nextSetNo,$i,idAuthentication) \
$hist($setNo,$i,idAuthentication)
}
set setNo $nextSetNo
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,maxPresent) [egw_form hits]
if {$hist($setNo,maxPresent) == ""} {
set hist($setNo,maxPresent) 20
}
}
set useIcons 1
button-europagate
button-new-query 1 $setNo
button-new-target 0
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