X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=www%2Fsearch.egw;h=daaf3b7fb70e32b74e0b4e700bfb6bb58e4fdeb5;hb=6ceeaa167e3ef2970b6ef0ce2b6c7d9c362eda0a;hp=26fce8de8c2143e6af4747fb040db09807c841d5;hpb=cbf0ef7549f996f4d96f41c6dafa76dc17dd7782;p=egate.git
diff --git a/www/search.egw b/www/search.egw
index 26fce8d..daaf3b7 100644
--- a/www/search.egw
+++ b/www/search.egw
@@ -1,254 +1,291 @@
{
-# $Id: search.egw,v 1.5 1995/10/31 16:56:24 adam Exp $
+# $Id: search.egw,v 1.22 1996/01/03 08:59:43 adam Exp $
-proc search-response {} {
+proc start-scan {scanNo cache dir} {
+ global sessionId
+ global sessionParms
global sessionWait
+ global setNo
+ global hist
+ global targets
+ global nextSetNo
+ global env
- set status [z39.1 responseStatus]
- if {[lindex $status 0] == "NSD"} {
- z39.1 nextResultSetPosition 0
- set code [lindex $status 1]
- set msg [lindex $status 2]
- set addinfo [lindex $status 3]
- htmlr {Error} $code {: } $msg {: } $addinfo {
}
- set sessionWait -2
+ set host $hist($setNo,host)
+
+ html "
\n" } -proc display-full {zset no} { - set type [$zset type $no] - if {$type == "SD"} { - set err [lindex [$zset diag $no] 1] - set add [lindex [$zset diag $no] 2] - if {$add != {}} { - set add " :${add}" - } - htmlr "
${no}
"
- htmlr "Error ${err}${add}
"
- return
- }
- if {$type != "DB"} {
- return
+proc buttons {setNo setMax startPos after} {
+ global sessionId
+ global useIcons
+ global env
+ global hist
+
+ if {!$useIcons && $after && $setMax < [z39.$setNo resultCount]} {
+ html "
\n" + html "
\n" } - htmlr "
${no}
"
- set rtype [$zset recordType $no]
- if {$rtype == "SUTRS"} {
- htmlr [join [$zset getSutrs $no]]
- return
- }
- if {[catch {set r [$zset getMarc $no line * * *]}]} {
- htmlr "Unknown record type: $rtype"
- return
+
+ html "
\n"
+ if {$useIcons} {
+ html {}
}
- foreach line $r {
- set tag [lindex $line 0]
- set indicator [lindex $line 1]
- set fields [lindex $line 2]
- set l [string length $indicator]
- html "$tag "
- if {$l > 0} {
- for {set i 0} {$i < $l} {incr i} {
- if {[string index $tag $i] == " "} {
- html "_"
- } else {
- html [string index $tag $i]
- }
- }
+ if {$setMax < [z39.$setNo resultCount]} {
+ html {
}
+ } else {
+ html {">Next Records} " | \n"
}
- foreach field $fields {
- set id [lindex $field 0]
- set data [lindex $field 1]
- if {$id != ""} {
- html " \$$id "
- }
- html $data
+ }
+ if {$startPos != "" && $startPos != "1"} {
+ html {
}
+ } else {
+ html {">Previous Records} " | \n"
}
- htmlr {
}
}
-}
-
-proc display-rec {from to} {
- while {$from <= $to} {
- display-brief z39.1 $from
- incr from
+ html {}
+ } else {
+ html {">New Query} " | \n"
}
-}
-proc build-query {} {
- global targets
- global t
-
- set op {}
- set q {}
- for {set i 1} {$i < 4} {incr i} {
- set term [wform entry$i]
- if {$term != ""} {
- set field [wform menu$i]
- foreach x [lindex $targets($t) 2] {
- if {[lindex $x 0] == $field} {
- set attr [lindex $x 1]
- }
- }
- switch $op {
- And
- { set q "@and $q ${attr} ${term}" }
- Or
- { set q "@or $q ${attr} ${term}" }
- {And not}
- { set q "@not $q ${attr} ${term}" }
- {}
- { set q "${attr} ${term}" }
- }
- set op [wform logic$i]
- }
+ html {
}
+ } else {
+ html {">New Target}
+ }
+ html "
\n" + if {!$useIcons && !$after && $startPos != "" && $startPos != "1"} { + html "
\n" } - return $q + } + if {[info commands saveState] == ""} { + source z39util.tcl + } global sessionWait - global host + global nextSetNo + global setNo + global hist - set newHost $sessionParms - set databases [lindex $targets($newHost) 1] + set setNo [lindex $sessionParms 0] - htmlr {
} - htmlr {