X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=inline;f=www%2Fsearch.egw;h=eabe4b9344aa2b75185065f9c40d5636e6348149;hb=3871eda3b3a1518d4d18c1ffc0ed0375cb88bdf5;hp=0b2c02c10b72536c10c885b307643f11cf24caaa;hpb=949f8c4efedfe6d191264853690c84f527e1790b;p=egate.git
diff --git a/www/search.egw b/www/search.egw
index 0b2c02c..eabe4b9 100644
--- a/www/search.egw
+++ b/www/search.egw
@@ -1,349 +1,403 @@
{
-# $Id: search.egw,v 1.6 1995/11/01 16:15:45 adam Exp $
+# $Id: search.egw,v 1.32 1996/02/12 13:39:40 adam Exp $
-proc search-response {sno} {
+proc start-scan {scanNo cache dir initSet} {
+ global sessionId
+ global sessionParms
global sessionWait
+ global setNo
+ global hist
+ global targets
+ global nextSetNo
+ global env
+ global useIcons
+ global debug
- set status [z39.$sno responseStatus]
- if {[lindex $status 0] == "NSD"} {
- z39.$sno 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
- } else {
- set sessionWait 1
- }
-}
-
-proc ok-response {} {
- global sessionWait
- set sessionWait 1
-}
+ set host $hist($setNo,host)
-proc fail-response {} {
- global sessionWait
- set sessionWait -1
-}
+ html "
WWW/Z39.50 Gateway Scan " [splitHostSpec $host]
+ html " \n"
+ html "\n"
-proc display-brief {zset no} {
- global env
- global setNo
- global sessionId
+ set useIcons 1
+ button-europagate
- 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} Error ${err}${add}
"
- return
- }
- if {$type != "DB"} {
- return
- }
- html "${no} "
- set rtype [$zset recordType $no]
- if {$rtype == "SUTRS"} {
- html [join [$zset getSutrs $no]]
- htmlr {
}
- return
- }
- if {![catch {
- set title [lindex [$zset getMarc $no field 245 * a] 0]
- set year [lindex [$zset getMarc $no field 260 * c] 0]
- } ] } {
- html { } $title {}
- html " ${year} "
+ if {$dir == "b"} {
+ set lines 20
+ set pos 20
+ } elseif {$dir == "f"} {
+ set lines 20
+ set pos 1
+ } else {
+ set lines 20
+ set pos 10
}
- htmlr {
}
-}
-
-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}"
+ if {$hist($setNo,$scanNo,scanTerm) != ""} {
+ if {[z39scan $setNo $scanNo 0 $lines $pos $cache] != "1"} {
+ button-new-query 0 $setNo
+ egw_log debug "z39_scan failed"
+ return
}
- htmlr "
${no}
"
- htmlr "Error ${err}${add}
"
- return
- }
- if {$type != "DB"} {
- return
- }
- 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
- }
- 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]
- }
- }
+ html {}
+ if {$useIcons} {
+ html {}
+ } else {
+ html {Previous Terms | }
}
- foreach field $fields {
- set id [lindex $field 0]
- set data [lindex $field 1]
- if {$id != ""} {
- html " \$$id "
- }
- html $data
+
+ html {}
+ if {$useIcons} {
+ html {}
+ } else {
+ html {Next Terms | }
}
- htmlr {
}
+ html {}
}
-}
+ button-new-query 0 $setNo
-proc display-rec {from to} {
- global setNo
+ set databases [lindex $targets($host) 1]
- while {$from <= $to} {
- display-brief z39.$setNo $from
- incr from
+ if {$initSet == ""} {
+ set databaseDefault [lindex $databases 0]
+ set oSetNo 0
+ } else {
+ set oSetNo $initSet
+ set databaseDefault $hist($oSetNo,database)
}
-}
-
-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}" }
+
+ html {