X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=www%2Fz39util.tcl;h=451fb70af4e1c44487b44c1c021747b187c2216c;hb=2e38b5dbea87903010208d15a8a9073d2049bbae;hp=ca41b996fb5c25c49afe78562da19d1fe5e3d1b7;hpb=fa0ddb755d3a836e4e13cc05a6ba3eb6b0010958;p=egate.git
diff --git a/www/z39util.tcl b/www/z39util.tcl
index ca41b99..451fb70 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.29 1996/01/31 15:56:37 adam Exp $
#
proc saveState {} {
uplevel #0 {
@@ -105,6 +105,8 @@ proc display-brief {zset no tno} {
set publisher [$zset getMarc $no field 260 * b]
set year [$zset getMarc $no field 260 * c]
} ] } {
+ html { }
set p 0
foreach a $author {
if {$p} {
@@ -130,32 +132,20 @@ 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} {
+ html [string range $v 0 38] "..."
+ } else {
+ html $v
+ }
}
- html {
}
- foreach v $location {
- html " $v"
- }
- foreach v $publisher {
- html " $v"
- }
- foreach v $year {
- html " $v"
- }
- html { -- }
- html "view full"
+ html { }
}
html "
\n"
}
@@ -462,13 +452,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 +495,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 +551,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 +601,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 {