# Sebastian Hammer, Adam Dickmeiss
#
# $Log: client.tcl,v $
-# Revision 1.48 1995-06-20 08:07:23 adam
+# Revision 1.49 1995-06-20 14:16:42 adam
+# More work on cancel mechanism.
+#
+# Revision 1.48 1995/06/20 08:07:23 adam
# New setting: failInfo.
# Working on better cancel mechanism.
#
set setNo 0
set lastSetNo 0
set cancelFlag 0
-set searchEnable 0
set scanEnable 0
set fullMarcSeq 0
set displayFormat 1
global busy
global delayRequest
- set cancelFlag 1
- set delayRequest {}
if {$busy} {
+ set cancelFlag 1
+ set delayRequest {}
show-status Cancel 0 1
}
}
proc show-status {status b sb} {
global busy
- global searchEnable
global scanEnable
global setOffset
global setMax
.scan-window.bot.2 configure -state normal
.scan-window.bot.4 configure -state normal
}
- set searchEnable 1
} else {
.top.service configure -state disabled
.mid.search configure -state disabled
.scan-window.bot.2 configure -state disabled
.scan-window.bot.4 configure -state disabled
}
- set searchEnable 0
}
}
}
}
-proc search-request {} {
+proc search-request {bflag} {
global setNo
global profile
global hostid
global busy
global cancelFlag
- global searchEnable
global delayRequest
set target $hostid
dputs "search-request"
- if {$searchEnable < 0} {
- dputs "searchEnable == 0"
+ show-message {}
+ if {!$bflag && $busy} {
+ dputs "busy: search-request ignored"
return
}
if {$cancelFlag} {
dputs "cancelFlag"
show-status {Searching} 1 0
- set delayRequest search-request
+ set delayRequest {search-request 1}
return
}
set delayRequest {}
global curIndexEntry
global queryButtonsFind
global queryInfoFind
+ global cancelFlag
+ global delayRequest
+
+ dputs "scan-request"
+ if {$cancelFlag} {
+ dputs "cancelFlag"
+ show-status {Scanning} 1 0
+ set delayRequest scan-request
+ return
+ }
+ set delayRequest {}
set target $hostid
set scanView 0
proc scan-response {attr start toget} {
global cancelFlag
+ global delayRequest
global scanTerm
global scanView
dputs toget=$toget
if {![winfo exists .scan-window]} {
+ if {$cancelFlag} {
+ set cancelFlag 0
+ dputs "Handling cancel"
+ if {$delayRequest != ""} {
+ eval $delayRequest
+ }
+ return
+ }
show-status {Ready} 0 1
- set cancelFlag 0
return
}
set nScanTerm [$w.top.entry get]
}
}
if {$cancelFlag} {
- show-status {Ready} 0 1
+ dputs "Handling cancel"
set cancelFlag 0
+ if {$delayRequest != ""} {
+ eval $delayRequest
+ }
return
}
+ set delayRequest {}
if {$toget > 0 && $m > 1 && $m < $toget} {
set ntoget [expr $toget - $m + 1]
dputs ntoget=$ntoget
proc scan-down {attr} {
global scanView
+ global cancelFlag
+ global delayRequest
+
+ dputs {scan-down}
+ if {$cancelFlag} {
+ dputs "cancelFlag"
+ show-status {Scanning down} 1 0
+ set delayRequest [list scan-down $attr]
+ return
+ }
+ set delayRequest {}
set w .scan-window
set scanView [expr $scanView + 5]
proc scan-up {attr} {
global scanView
+ global cancelFlag
+ global delayRequest
+
+ dputs {scan-up}
+ if {$cancelFlag} {
+ dputs "cancelFlag"
+ show-status {Scanning up} 1 0
+ set delayRequest [list scan-up $attr]
+ return
+ }
+ set delayRequest {}
set w .scan-window
set scanView [expr $scanView - 5]
dputs "Handling cancel"
set cancelFlag 0
if {$delayRequest != ""} {
- $delayRequest
+ eval $delayRequest
}
return
}
dputs "present-more"
if {$cancelFlag} {
show-status {Retrieving} 1 0
- set delayRequest [list present-request $number]
+ set delayRequest "present-more $number"
return
}
set delayRequest {}
global cancelFlag
global delayRequest
+ dputs "In present-response"
+ set no [z39.$setNo numberOfRecordsReturned]
+ dputs "Returned $no records, setOffset $setOffset"
+ add-title-lines $setNo $no $setOffset
+ set setOffset [expr $setOffset + $no]
if {$cancelFlag} {
dputs "Handling cancel"
set cancelFlag 0
if {$delayRequest != ""} {
- $delayRequest
+ eval $delayRequest
}
return
}
- dputs "In present-response"
- set no [z39.$setNo numberOfRecordsReturned]
- dputs "Returned $no records, setOffset $setOffset"
- add-title-lines $setNo $no $setOffset
- set setOffset [expr $setOffset + $no]
set status [z39.$setNo responseStatus]
if {[lindex $status 0] == "NSD"} {
show-status {Ready} 0 1
pack $w.$i -side top -fill x -padx 2 -pady 2
bind $w.$i.e <Left> [list left-cursor $w.$i.e]
bind $w.$i.e <Right> [list right-cursor $w.$i.e]
- bind $w.$i.e <Return> search-request
+ bind $w.$i.e <Return> {search-request 0}
}
} else {
pack $w.$i.l -side left
-command [list present-more 10]
.top.service.m.present add command -label "All" \
-command [list present-more {}]
-.top.service.m add command -label "Search" -command {search-request}
+.top.service.m add command -label "Search" -command {search-request 0}
.top.service.m add command -label "Scan" -command {scan-request}
.top.service configure -state disabled
index-lines .lines 1 $queryButtonsFind [lindex $queryInfo 0] activate-index
-button .mid.search -width 7 -text {Search} -command search-request \
+button .mid.search -width 7 -text {Search} -command {search-request 0} \
-state disabled
button .mid.scan -width 7 -text {Scan} \
-command scan-request -state disabled
set {profile(Penn)} {{Penn State's Library} 128.118.88.200 210 {} 16384 8192 tcpip CATALOG 1 {} {} Z39 2}
set {profile(ztest)} {{test server} localhost 9999 {} 16384 4096 tcpip dummy 1 {} {} Z39 3}
set {profile(madison)} {{University of Wisconsin-Madison} z3950.adp.wisc.edu 210 {} 16384 8192 tcpip madison 1 {} {} Z39 22}
-set {profile(Default)} {{} {} {210} {} 16384 8192 tcpip {} {} {} {} {} 24}
+set {profile(Default)} {{} {} {210} {} 16384 8192 tcpip {} {} {} {} {} 25}
set {profile(RLG)} {{Research Libraries group} rlg.stanford.edu 210 {} 4096 4096 tcpip {BKS AMC MAPS MDF REC SCO SER VIM NAF SAF AUT CATALOG ABI AVI DSA EIP FLP HAP HST NPA PAI PRA WLI} 1 {} {} Z39 5}
set {profile(AT&T server)} {{AT&T Z39 Server} z3950.research.att.com 210 {} 16384 8192 tcpip Default {} {} {} Z39 21}
set {profile(LOC)} {{Library of Congress} IBM2.LOC.gov 2210 {} 16384 16384 tcpip {BOOKS NAMES} 1 {} 0 Z39 6}
set {profile(CLSI)} {CLSI inet-gw.clsi.us.geac.com 210 {} 16384 8192 tcpip cl_default 1 {} {} Z39 13}
set {profile(Innovative)} {{Innovatives server: demo.iii.com} demo.iii.com 210 {} 16384 8192 tcpip DEFAULT 1 {} {} Z39 12}
set {profile(AULS)} {{Acadia university} auls.acadiau.ca 210 {} 16384 8192 tcpip AULS 1 {} {} Z39 14}
+set {profile(Europagate)} {{Europagate Z39/SR gateway} dagwood.ucd.ie 210 <<denmark>> 16384 8192 tcpip danbib 1 {} 1 Z39 24}
set {profile(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} {} Z39 15}
set queryTypes {Simple phrase}
set queryButtons {{ {I 0} {I 1} {I 2} } {{I 0} {I 1} {I 0}}}