X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=inline;f=www%2Fz39util.tcl;h=7903fd4773e40b20457945f2129371a2cdc866e1;hb=d1fc0ff84894bba24f827a81597717e9f69b6c06;hp=3eb4dff5e265a1c5e0aead9f743213ea974ae4e0;hpb=ebeb5e591b8f1bf6c5045efaddf74f3eee7bdbaf;p=egate.git
diff --git a/www/z39util.tcl b/www/z39util.tcl
index 3eb4dff..7903fd4 100644
--- a/www/z39util.tcl
+++ b/www/z39util.tcl
@@ -1,5 +1,5 @@
#
-# $Id: z39util.tcl,v 1.23 1996/01/24 08:27:23 adam Exp $
+# $Id: z39util.tcl,v 1.25 1996/01/24 16:59:29 adam Exp $
#
proc saveState {} {
uplevel #0 {
@@ -130,7 +130,8 @@ proc display-brief {zset no tno} {
if {$p} {
html ": "
}
- html {}
+ html { }
set nope 1
foreach v $title {
html $v
@@ -139,23 +140,22 @@ proc display-brief {zset no tno} {
if {$nope} {
html {No title}
}
- html { }
+ html { }
foreach v $cover {
html $v
}
- html {
}
- foreach v $location {
- html " $v"
- }
- foreach v $publisher {
- html " $v"
- }
- foreach v $year {
- html " $v"
+ if {0} {
+ html {
}
+ foreach v $location {
+ html " $v"
+ }
+ foreach v $publisher {
+ html " $v"
+ }
+ foreach v $year {
+ html " $v"
+ }
}
- html { -- }
- html "view full"
}
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 {
@@ -647,45 +648,46 @@ proc z39search {setNo piggy tno elements} {
}
$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 {
@@ -720,6 +722,7 @@ proc z39search {setNo piggy tno elements} {
$zz.$setNo mediumSetPresentNumber 0
}
set sessionWait 0
+ egw_log debug "search: $query"
$zz.$setNo search $query
if {[catch {egw_wait sessionWait 600}]} {
@@ -797,7 +800,8 @@ proc z39msearch {setNo piggy elements} {
if {[catch {set oldHost [z39$i connect]}]} {
set oldHost ""
}
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch {z39$i disconnect}
}
z39$i callback [list connect-m-response $i]
@@ -807,14 +811,15 @@ proc z39msearch {setNo piggy elements} {
for {set i 1} {$i <= $not} {incr i} {
set oldHost [z39$i connect]
set host $hist($setNo,$i,host)
- if {$oldHost == $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost == $thisHost} {
set zstatus($i) 1
continue
}
z39$i idAuthentication $hist($setNo,$i,idAuthentication)
- html "Connecting to target " $host "
\n"
+ html "Connecting to target " $thisHost "
\n"
set zstatus($i) -1
- if {![catch {z39$i connect $host}]} {
+ if {![catch {z39$i connect $thisHost}]} {
incr zleft
}
}
@@ -826,7 +831,7 @@ proc z39msearch {setNo piggy elements} {
}
set zleft 0
for {set i 1} {$i <= $not} {incr i} {
- html "host " $hist($setNo,$i,host) ": "
+ html "host " [splitHostSpec $hist($setNo,$i,host)] ": "
if {$zstatus($i) >= 1} {
html "ok
\n"
ir-set z39$i.$setNo z39$i
@@ -998,6 +1003,26 @@ proc button-europagate {} {
}
}
+proc button-define-target {more} {
+ global useIcons
+ global env
+ global sessionId
+
+ html {}
+ } else {
+ html {">New Target}
+ if {$more} {
+ html " | \n"
+ } else {
+ html "\n"
+ }
+ }
+}
+
proc button-new-target {more} {
global useIcons
global env
@@ -1085,7 +1110,20 @@ proc button-scan-window {more setNo} {
proc maintenance {} {
html {