X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=www%2Fz39util.tcl;h=59131ff122de2d5b9cb69a7cb7e32713289f314b;hb=a124021540d0bb0854668f509b28921b771c70fd;hp=ca41b996fb5c25c49afe78562da19d1fe5e3d1b7;hpb=fa0ddb755d3a836e4e13cc05a6ba3eb6b0010958;p=egate.git
diff --git a/www/z39util.tcl b/www/z39util.tcl
index ca41b99..59131ff 100644
--- a/www/z39util.tcl
+++ b/www/z39util.tcl
@@ -1,5 +1,5 @@
#
-# $Id: z39util.tcl,v 1.24 1996/01/24 14:14:20 adam Exp $
+# $Id: z39util.tcl,v 1.30 1996/02/12 13:39:41 adam Exp $
#
proc saveState {} {
uplevel #0 {
@@ -104,7 +104,9 @@ proc display-brief {zset no tno} {
set location [$zset getMarc $no field 260 * a]
set publisher [$zset getMarc $no field 260 * b]
set year [$zset getMarc $no field 260 * c]
- } ] } {
+ } dispError ] } {
+ html { }
set p 0
foreach a $author {
if {$p} {
@@ -130,32 +132,30 @@ proc display-brief {zset no tno} {
if {$p} {
html ": "
}
- html {}
set nope 1
foreach v $title {
html $v
set nope 0
}
if {$nope} {
- html {No title}
- }
- html { }
- foreach v $cover {
- html $v
+ set v [join $cover ""]
+ if {[string length $v] > 40} {
+ set nope 0
+ html [string range $v 0 38] "..."
+ } elseif {[string length $v] > 0} {
+ set nope 0
+ html $v
+ } else {
+ html "No Title"
+ }
}
- html {
}
- foreach v $location {
- html " $v"
- }
- foreach v $publisher {
- html " $v"
- }
- foreach v $year {
- html " $v"
- }
- html { -- }
- html "view full"
+ html {No Title}
+ html { }
+ html "Error: " $dispError "\n"
}
html "
\n"
}
@@ -462,13 +462,13 @@ proc build-query {t ilines} {
}
switch $op {
And
- { set q "@and $q ${attr} ${term}" }
+ { set q "@and $q ${attr} \"${term}\"" }
Or
- { set q "@or $q ${attr} ${term}" }
+ { set q "@or $q ${attr} \"${term}\"" }
{And not}
- { set q "@not $q ${attr} ${term}" }
+ { set q "@not $q ${attr} \"${term}\"" }
{}
- { set q "${attr} ${term}" }
+ { set q "${attr} \"${term}\"" }
}
set op [egw_form logic$i]
}
@@ -505,45 +505,46 @@ proc z39scan {setNo scanNo tno scanLines scanPos cache} {
set zs $zz.s$scanNo.$setNo
$zz callback ok-response
$zz failback fail-response
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch [list $zz disconnect]
set sessionWait 0
- if {[catch [list $zz connect $host]]} {
- displayError "Cannot connect to target" $host
+ if {[catch [list $zz connect $thisHost]]} {
+ displayError "Cannot connect to target" $thisHost
return 0
} elseif {$sessionWait == 0} {
if {[catch {egw_wait sessionWait 300}]} {
$zz disconnect
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
if {$sessionWait != 1} {
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
}
$zz idAuthentication $idAuth
set sessionWait 0
if {[catch {$zz init}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {[catch {egw_wait sessionWait 60}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {$sessionWait != "1"} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {![$zz initResult]} {
set u [$zz userInformationField]
$zz disconnect
- displayError "Cannot initialize target $host" $u
+ displayError "Cannot initialize target $thisHost" $u
return 0
}
} else {
@@ -560,6 +561,7 @@ proc z39scan {setNo scanNo tno scanLines scanPos cache} {
$zz callback [list scan-response $zs]
+ egw_log debug "scan: ${scanAttr} ${scanTerm}"
set sessionWait 0
$zs scan "${scanAttr} ${scanTerm}"
@@ -609,16 +611,31 @@ proc display-scan {setNo scanNo tno} {
set hist($setNo,[expr $scanNo + 1],scanTerm) $t
}
}
+ html {
Scan term} + html { | Hits} + html { |
}
+ if {0} {
+ regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
+ html {}
+ } else {
+ regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
+ html {}
+ }
html [lindex [$zs scanLine $i] 1]
- html {: }
+ html {}
+ html {}
html [lindex [$zs scanLine $i] 2]
- html " | \n" + html { |
Target} + html { | Database} + html { | Hits} + html { | Query} + html { |
}
+ } else {
+ html {} [join $hist($setNo,database)]
+ } else {
+ if {[llength [lindex $targets($host) 1]] > 1} {
+ html ": "
+ foreach b $hist($setNo,database) {
+ html " $b"
+ }
}
+ html {. }
+ }
+ if {$html3} {
+ html { | }
}
- html {. }
-
if {[info exists hist($setNo,hits)]} {
html { Result: } $hist($setNo,hits) { hits.}
+ if {1} {
+ html {">} $hist($setNo,hits) {}
+ } else {
+ html {">Result: } $hist($setNo,hits) { hits.}
+ }
+ } else {
+ if {$html3} {
+ html {Failed}
+ } else {
+ html {Search failed.}
+ }
+ }
+ if {$html3} {
+ html { | }
} else {
- html {Search failed.}
+ html " | |
} + } else { + html {