X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=www%2Fz39util.tcl;h=19c75f3e4681c26f36fb594a98940d88b1009d53;hb=8475d385a59bc414a07804de7de9692edc022364;hp=bd6a7b52d8685779a95c8dde5f605a184ff613fa;hpb=f0e3e1b012eb28daf13e575c5e78e0e5aced3abb;p=egate.git
diff --git a/www/z39util.tcl b/www/z39util.tcl
index bd6a7b5..19c75f3 100644
--- a/www/z39util.tcl
+++ b/www/z39util.tcl
@@ -1,5 +1,5 @@
#
-# $Id: z39util.tcl,v 1.45 1996/05/24 11:16:02 adam Exp $
+# $Id: z39util.tcl,v 1.46 1996/08/28 09:36:03 adam Exp $
#
proc saveState {} {
uplevel #0 {
@@ -92,20 +92,6 @@ proc display-medium {zset no setNo targetNo} {
html "
\n"
return
}
- WAIS {
- html { }
- html [join [$zset getWAIS $no headline]]
- html {}
- html "
\n"
- html {Score: } [$zset getWAIS $no score]
- set lines [$zset getWAIS $no lines]
- if {$lines > 0} {
- html {, } $lines { lines}
- }
- html "
\n"
- return
- }
}
if {![catch {
set author [$zset getMarc $no field 100 * a]
@@ -202,17 +188,6 @@ proc display-brief {zset no setNo targetNo} {
html "
\n"
return
}
- WAIS {
- html { }
- html [string range [join [$zset getWAIS $no headline]] 0 70]
-
- html {}
- set score [$zset getWAIS $no score]
- html { Score } $score
- html "
\n"
- return
- }
}
if {![catch {
set author [$zset getMarc $no field 100 * a]
@@ -310,10 +285,6 @@ proc display-raw {zset no setNo targetNo} {
html "
\n" [join [$zset getSutrs $no]] "\n\n"
return
}
- WAIS {
- html "\n" [join [$zset getWAIS $no text]] "\n\n"
- return
- }
}
if {[catch {set r [$zset getMarc $no line * * *]}]} {
html "Unknown record type: $rtype
\n"
@@ -530,114 +501,6 @@ proc display-full-marc {zset no setNo targetNo} {
html "\n"
}
-proc display-full-wais {zset no setNo targetNo} {
- global env
- global hist
- global sessionId
-
- set i 0
- set element junk
- htmlToken l [join [$zset getWAIS $no text]] {
- if {[string compare [string index $l 0] {<}]} {
- if {[info exist data($element)]} {
- set data($element) $data($element)$l
- } else {
- set data($element) $l
- }
- continue
- }
- switch -- $l {
- {
- set element title
- }
- {
- set element dateOfLastModification
- }
- {
- set element controlIdentifier
- }
- {
- set element lastChecked
- }
- {
- set element bytes
- }
- {
- set element linkage
- }
- {
- incr i
- }
- {
- set element "$i,linkage"
- }
- {
- set element "$i,title"
- }
- {
- set element ip
- }
- default {
- set element junk
- }
- }
- }
- if {![info exists data(title)] || ![info exists data(linkage)]} {
- set nwi 0
- } else {
- set nwi 1
- }
- html "\n"
- html {- Title}
- if {$nwi} {
- html {
- } $data(title) ""
- html {
- URL}
- html {
- } $data(linkage) "
\n"
- } else {
- html {- } [join [$zset getWAIS $no headline]]
- }
- html {
- Score
- } [$zset getWAIS $no score]
- set lines [$zset getWAIS $no lines]
- if {$lines > 0} {
- html {
- Lines
- } $lines "
\n"
- }
- if {!$nwi} {
- html "
\n" [join [$zset getWAIS $no text]] "\n
\n"
- return
- }
- if {[info exists data(bytes)]} {
- html {Bytes} $data(bytes)
- }
- if {[info exists data(dateOfLastModification)]} {
- html {Last modified} $data(dateOfLastModification)
- }
- if {[info exists data(lastChecked)]} {
- html {Last checked} $data(lastChecked) "
\n"
- }
- if {[info exists data(ip)]} {
- html {Initial text} $data(ip) "
\n"
- }
- if {0} {
- html {}
- html {Similar WAIS record
}
- }
- if {[info exists data($i,linkage)]} {
- html "References\n"
- }
- for {set i 1} {[info exists data($i,linkage)]} {incr i} {
- html {}
- if {[info exists data($i,title)]} {
- html $data($i,title)
- } else {
- html Untitled
- }
- html "
\n"
- }
- html "\n"
-}
-
proc display-full {zset no setNo targetNo} {
set type [$zset type $no]
switch $type {
@@ -662,10 +525,6 @@ proc display-full {zset no setNo targetNo} {
html "" [join [$zset getSutrs $no]] "
\n"
return
}
- WAIS {
- display-full-wais $zset $no $setNo $targetNo
- return
- }
}
if {[catch {set r [$zset getMarc $no line * * *]}]} {
html "Unknown record type: $rtype
\n"
@@ -707,39 +566,29 @@ proc build-query {t ilines} {
for {set i 1} {$i <= $ilines} {incr i} {
set term [join [egw_form entry$i]]
if {[string length $term] == 0} continue
- if {![string compare [lindex $targets($t) 1] WAIS]} {
- if {[string length $q] == 0} {
- set q $term
- } else {
- set q "$term $q"
- }
- set op [egw_form logic$i]
- continue
- } else {
- set field [join [egw_form menu$i]]
- catch {unset attr}
- foreach x [lindex $targets($t) 2] {
- if {![string compare [lindex $x 0] $field]} {
- set attr [lindex $x 1]
- }
- }
- if {![info exists attr]} {
- egw_log debug "attr failed for $t"
- set attr [lindex [lindex [lindex $targets($t) 2] 0] 1]
- }
- egw_log debug "op=${op}"
- switch $op {
- And
- { set q "@and $q ${attr} \"${term}\""; egw_log debug AND }
- Or
- { set q "@or $q ${attr} \"${term}\""; egw_log debug OR }
- {}
- { set q "${attr} \"${term}\""; egw_log debug NOPE }
- default
- { set q "@not $q ${attr} \"${term}\""; egw_log debug ANDNOT }
+ set field [join [egw_form menu$i]]
+ catch {unset attr}
+ foreach x [lindex $targets($t) 2] {
+ if {![string compare [lindex $x 0] $field]} {
+ set attr [lindex $x 1]
}
- set op [egw_form logic$i]
}
+ if {![info exists attr]} {
+ egw_log debug "attr failed for $t"
+ set attr [lindex [lindex [lindex $targets($t) 2] 0] 1]
+ }
+ egw_log debug "op=${op}"
+ switch $op {
+ And
+ { set q "@and $q ${attr} \"${term}\""; egw_log debug AND }
+ Or
+ { set q "@or $q ${attr} \"${term}\""; egw_log debug OR }
+ {}
+ { set q "${attr} \"${term}\""; egw_log debug NOPE }
+ default
+ { set q "@not $q ${attr} \"${term}\""; egw_log debug ANDNOT }
+ }
+ set op [egw_form logic$i]
}
return $q
}
@@ -959,13 +808,9 @@ proc z39search {setNo piggy tno elements} {
}
}
- if {![string compare [lindex $targets($host) 1] WAIS]} {
- wais-set $zz.$setNo $zz
- } else {
- ir-set $zz.$setNo $zz
- $zz.$setNo preferredRecordSyntax [lindex $targets($host) 1]
- egw_log debug "set syntax to [lindex $targets($host) 1]"
- }
+ ir-set $zz.$setNo $zz
+ $zz.$setNo preferredRecordSyntax [lindex $targets($host) 1]
+ egw_log debug "set syntax to [lindex $targets($host) 1]"
if {![lindex $targets($host) 5]} {
set elements {}
}
@@ -1170,13 +1015,9 @@ proc z39msearch {setNo elements start number cache} {
html "ok
\n"
}
- if {![string compare [lindex $targets($host) 1] WAIS]} {
- wais-set z39$i.$setNo z39$i
- } else {
- ir-set z39$i.$setNo z39$i
- z39$i.$setNo preferredRecordSyntax [lindex $targets($host) 1]
- egw_log debug "set syntax to [lindex $targets($host) 1]"
- }
+ ir-set z39$i.$setNo z39$i
+ z39$i.$setNo preferredRecordSyntax [lindex $targets($host) 1]
+ egw_log debug "set syntax to [lindex $targets($host) 1]"
set hist($setNo,$i,offset) 0
eval z39$i.$setNo databaseNames $hist($setNo,$i,database)
@@ -1400,9 +1241,7 @@ proc display-result-set-m-score {setNo} {
if {[lindex $status 0] != "DBOSD"} continue
set nor $hist($setNo,$i,offset)
for {set j 1} {$j <= $nor} {incr j} {
- if {![string compare [z39$i.$setNo recordType $j] WAIS]} {
- set score [z39$i.$setNo getWAIS $j score]
- } elseif {![string compare [z39$i.$setNo recordType $j] USmarc]} {
+ if {![string compare [z39$i.$setNo recordType $j] USmarc]} {
set score [z39$i.$setNo getMarc $j field 999 * r]
if {[scan $score %d score] != 1} {
set score 10
@@ -1827,8 +1666,8 @@ proc button-scan-window {setNo} {
proc maintenance {} {
html {
This page is maintained by }
- html { Peter Wad Hansen .}
- html {Last modified March 15, 1996.
}
+ html { Nobody .}
+ html {Last modified x x x.
}
}
proc splitHostSpec {host} {
@@ -1859,21 +1698,12 @@ proc mkAssoc {assoc host} {
global targets
if {[catch {$assoc failback fail-response}]} {
- if {![string compare [lindex $targets($host) 1] WAIS]} {
- wais $assoc
- } else {
- ir $assoc
- $assoc maximumRecordSize 1000000
- }
+ ir $assoc
+ $assoc maximumRecordSize 1000000
} else {
- if {![string compare [lindex $targets($host) 1] WAIS]} {
- if {[$assoc comstack] == "wais"} return
- wais $assoc
- } else {
- if {[$assoc comstack] == "tcpip"} return
- ir $assoc
- $assoc maximumRecordSize 1000000
- }
+ if {[$assoc comstack] == "tcpip"} return
+ ir $assoc
+ $assoc maximumRecordSize 1000000
}
}