}
+ if {[info exists hist($setNo,scan)]} {
+ if {$hist($setNo,scan) > 0} continue
}
- html [lindex $targets($host) 0]
- if {$html3} {
- html {} [join $hist($setNo,0,database)]
+ if {[info exists hist($setNo,1,host)]} {
+ set start 1
+ set end $hist($setNo,0,host)
} else {
- if {[llength [lindex $targets($host) 1]] > 1} {
- html ": "
- foreach b $hist($setNo,0,database) {
- html " $b"
+ set start 0
+ set end 0
+ }
+ for {set i $start} {$i <= $end} {incr i} {
+ if {$html3} {
+ html { | }
+ } else {
+ html { }
+ }
+ set host $hist($setNo,$i,host)
+ html [lindex $targets($host) 0]
+ if {$html3} {
+ html {} [join $hist($setNo,$i,database)]
+ } else {
+ if {[llength [lindex $targets($host) 1]] > 1} {
+ html ": "
+ foreach b $hist($setNo,$i,database) {
+ html " $b"
+ }
}
+ html {. }
}
- html {. }
- }
- if {$html3} {
- html { | }
- }
- if {[info exists hist($setNo,hits)]} {
- html { } $hist($setNo,hits) {}
+ if {$html3} {
+ html { | }
+ }
+ if {[info exists hist($setNo,$i,hits)]} {
+ html { } $hist($setNo,$i,hits) {}
} else {
- html {">Result: } $hist($setNo,hits) { hits.}
+ if {$html3} {
+ html {Failed}
+ } else {
+ html {Search failed.}
+ }
}
- } else {
if {$html3} {
- html {Failed}
+ html { | }
} else {
- html {Search failed.}
+ html "\n"
}
- }
- if {$html3} {
- html {}
- } else {
- html "\n"
- }
- html { }
- } else {
- html {">Query: }
- }
- set op {}
- for {set i 1} {$i <= 3} {incr i} {
- if {[string length $hist($setNo,form,entry$i)] > 0} {
- html " " [join $op " "] " "
- html [join $hist($setNo,form,menu$i)] "="
- html $hist($setNo,form,entry$i)
- set op $hist($setNo,form,logic$i)
+ html { }
+ } else {
+ html {">Query: }
+ }
+ set op {}
+ for {set j 1} {$j <= 3} {incr j} {
+ if {[string length $hist($setNo,form,entry$j)] > 0} {
+ html " " [join $op " "] " "
+ set pre [join $hist($setNo,form,menu$j)]
+ if {[string length $pre] > 0} {
+ html $pre "="
+ }
+ html $hist($setNo,form,entry$j)
+ set op $hist($setNo,form,logic$j)
+ }
+ }
+ if {$html3} {
+ html {} "\n"
}
- }
- if {$html3} {
- html { } "\n"
}
}
if {$html3} {
@@ -1625,7 +1657,7 @@ proc button-main {} {
}
}
-proc button-define-target {more} {
+proc button-define-target {} {
global useIcons
global env
global sessionId
@@ -1643,11 +1675,10 @@ proc button-define-target {more} {
}
}
-proc button-new-target {more} {
+proc button-new-target {} {
global useIcons
global env
global sessionId
- global mMode
global scriptTarget
if {[string length $scriptTarget] == 0} return
@@ -1665,7 +1696,7 @@ proc button-new-target {more} {
}
}
-proc button-view-history {more} {
+proc button-view-history {} {
global useIcons
global env
global sessionId
@@ -1685,19 +1716,18 @@ proc button-view-history {more} {
}
}
-proc button-new-query {more setNo} {
+proc button-new-query {setNo} {
global useIcons
global env
global sessionId
global hist
- global mMode
global scriptQuery
if {!$useIcons} {
html "\n | "
}
html {}
+ html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,0,host) {">}
if {$useIcons} {
html {}
+ } else {
+ html {">Result Set}
+ }
+}
+
+proc button-scan-window {setNo} {
global useIcons
global env
global sessionId
@@ -1779,6 +1833,61 @@ proc mkAssoc {assoc host} {
}
}
+proc serverList {headlineProc targetProc} {
+ global targets
+ global groupsDescription
+
+ proc targetsCmp {l r} {
+ global targets
+ return [string compare [string tolower [lindex $targets($l) 0]] \
+ [string tolower [lindex $targets($r) 0]]]
+ }
+ proc groupCmp {l r} {
+ global groupsOrder
+ if {[catch {set lo $groupsOrder($l)}]} {
+ set lo 10
+ }
+ if {[catch {set ro $groupsOrder($r)}]} {
+ set ro 10
+ }
+ return [expr $lo - $ro]
+ }
+
+ foreach tt [array names targets] {
+ lappend groupsTmp([lindex $targets($tt) 6]) $tt
+ }
+ set gts [lsort -command groupCmp [array names groupsTmp]]
+ foreach gt $gts {
+ if {[info exists groupsDescription($gt)]} {
+ eval $headlineProc [list $groupsDescription($gt)]
+ } else {
+ eval $headlineProc $gt
+ }
+ set tn [lsort -command targetsCmp $groupsTmp($gt)]
+ foreach t $tn {
+ eval $targetProc $t
+ }
+ }
+
+ rename targetsCmp {}
+}
+
+proc session-lost {} {
+ global useIcons
+
+ html {WWW/Z39.50 Gateway: Session Expired}
+ html \n {}
+ set useIcons 1
+ button-main
+ html {Session Expired}
+ html {Your session has expired. Please reload the gateways' }
+ html {front page.
} \n
+ set useIcons 0
+ button-main
+ html { | | |