# Sebastian Hammer, Adam Dickmeiss
#
# $Log: client.tcl,v $
-# Revision 1.55 1995-06-27 17:10:37 adam
+# Revision 1.56 1995-06-27 19:03:48 adam
+# Bug fix in do_present in ir-tcl.c: p->set_child member weren't set.
+# nextResultSetPosition used instead of setOffset.
+#
+# Revision 1.55 1995/06/27 17:10:37 adam
# Bug fix: install procedure didn't work on some systems.
# Error turned up when clientrc.tcl was't present.
#
set hostid Default
set settingsChanged 0
set setNo 0
+set setNoLast 0
set cancelFlag 0
set scanEnable 0
set fullMarcSeq 0
}
proc dputs {m} {
-# puts $m
+ puts $m
}
proc set-display-format {f} {
}
update idletasks
add-title-lines -1 10000 1
- if {!$busy} {
- .bot.a.status configure -text "Ready"
- }
}
proc initBindings {} {
}
if {$setNo == 0} {
.top.service.m disable 1
- } elseif {$setOffset > 0 && $setOffset <= [z39.$setNo resultCount]} {
+ } elseif {[z39.$setNo nextResultSetPosition] > 0 &&
+ [z39.$setNo nextResultSetPosition] <= [z39.$setNo resultCount]} {
.top.service.m enable 1
.mid.present configure -state normal
} else {
.top.service.m disable 1
+ .mid.present configure -state disabled
}
if {[winfo exists .scan-window]} {
.scan-window.bot.2 configure -state normal
global hostid
global cancelFlag
global setNo
+ global setNoLast
set cancelFlag 0
set setNo 0
+ set setNoLast 0
.bot.a.set configure -text ""
set hostid Default
z39 disconnect
show-message {}
.top.target.m disable 1
.top.target.m disable 2
- .top.rset.m delete 2 last
+ .top.rset.m delete 1 last
+ .top.rset.m add separator
.top.target.m enable 0
}
proc load-set-action {} {
- global setNo
+ global setNoLast
- incr setNo
- ir-set z39.$setNo z39
+ incr setNoLast
+ ir-set z39.$setNoLast z39
set fname [.load-set.top.filename.entry get]
destroy .load-set
update
z39.$setNo loadFile $fname
- set no [z39.$setNo numberOfRecordsReturned]
- add-title-lines $setNo $no 1
+ set no [z39.$setNoLast numberOfRecordsReturned]
+ add-title-lines $setNoLast $no 1
}
- set l [format "%-4d %7d" $setNo $no]
+ set l [format "%-4d %7d" $setNoLast $no]
.top.rset.m add command -label $l \
- -command [list add-title-lines $setNo 10000 1]
+ -command [list add-title-lines $setNoLast 10000 1]
show-status {Ready} 0 {}
}
}
proc init-request {} {
- global setNo
global cancelFlag
if {$cancelFlag} {
proc search-request {bflag} {
global setNo
+ global setNoLast
global profile
global hostid
global busy
if {$query==""} {
return
}
- incr setNo
+ incr setNoLast
+ set setNo $setNoLast
ir-set z39.$setNo z39
if {[lindex $profile($target) 10] == 1} {
show-status {Ready} 0 1
set status [z39.$setNo responseStatus]
if {[lindex $status 0] == "NSD"} {
+ z39.$setNo nextResultSetPosition 0
set code [lindex $status 1]
set msg [lindex $status 2]
set addinfo [lindex $status 3]
tkerror "NSD$code: $msg: $addinfo"
return
}
- if {$setMax > 20} {
- set setMax 20
- }
show-message "${setMax} hits"
if {$setMax == 0} {
return
set l [format "%-4d %7d" $setNo $setMax]
.top.rset.m add command -label $l \
-command [list add-title-lines $setNo 10000 1]
+ if {$setMax > 20} {
+ set setMax 20
+ }
z39 callback {present-response}
z39.$setNo present $setOffset 1
show-status {Retrieving} 1 0
dputs "setNo=$setNo"
return
}
+ set setOffset [z39.$setNo nextResultSetPosition]
+ dputs "setOffest=${setOffset}"
+ dputs "setNo=${setNo}"
set max [z39.$setNo resultCount]
- if {$max <= $setOffset} {
+ if {$max < $setOffset} {
dputs "max=$max"
dputs "setOffset=$setOffset"
+ show-status Ready 0 1
return
}
if {$number == ""} {
proc add-title-lines {setno no offset} {
global displayFormats
global displayFormat
- global lastSetNo
+ global setNo
+ global busy
- if {$setno == -1} {
- set setno $lastSetNo
+ if {$setno != -1} {
+ set setNo $setno
} else {
- set lastSetNo $setno
+ set setno $setNo
}
if {$offset == 1} {
.bot.a.set configure -text $setno
[list popup-marc $setno $o 0 0]
update idletasks
}
+ if {!$busy} {
+ show-status Ready 0 1
+ }
}
proc present-response {} {
# Setup file
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(ztest)} {{test server} localhost 9999 {} 16384 4096 tcpip dummy 1 {} 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 {} 1 {} {} {} 27}
-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(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 {} 1 Z39 5}
set {profile(AT&T server)} {{AT&T Z39 Server} z3950.research.att.com 210 {} 16384 16384 tcpip Default 1 {} {} Z39 21}
set {profile(LOC)} {{Library of Congress} IBM2.LOC.gov 2210 {} 16384 16384 tcpip {BOOKS NAMES} 1 {} 0 Z39 6}
set {profile(DANBIB)} {{SR Target DANBIB} 0103/find2.denet.dk 4500 {} 8192 8192 mosi danbib 1 {} 1 SR 8}
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(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} {} Z39 15}
+set {profile(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} 1 Z39 15}
set {profile(canberra)} {canberra canberra.cs.umass.edu 2110 {} 30000 30000 tcpip cacm_dots 1 {} {} Z39 25}
set queryTypes {Simple phrase}
set queryButtons {{ {I 0} {I 1} {I 2} } {{I 0} {I 1} {I 0}}}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: ir-tcl.c,v $
- * Revision 1.47 1995-06-25 10:25:04 adam
+ * Revision 1.48 1995-06-27 19:03:50 adam
+ * Bug fix in do_present in ir-tcl.c: p->set_child member weren't set.
+ * nextResultSetPosition used instead of setOffset.
+ *
+ * Revision 1.47 1995/06/25 10:25:04 adam
* Working on triggerResourceControl. Description of compile/install
* procedure moved to ir-tcl.sgml.
*
Z_APDU *apdu;
Odr_oct ccl_query;
IrTcl_SetObj *obj = o;
- IrTcl_Obj *p = obj->parent;
+ IrTcl_Obj *p;
int r;
oident bib1;
if (argc <= 0)
return TCL_OK;
+ p = obj->parent;
p->set_child = o;
if (argc != 3)
{
IrTcl_SetObj *obj = o;
if (argc <= 0)
+ {
+ obj->nextResultSetPosition = 0;
return TCL_OK;
+ }
return get_set_int (&obj->nextResultSetPosition, interp, argc, argv);
}
int argc, char **argv)
{
IrTcl_SetObj *obj = o;
- IrTcl_Obj *p = obj->parent;
+ IrTcl_Obj *p;
Z_APDU *apdu;
Z_PresentRequest *req;
int start;
interp->result = "not connected";
return TCL_ERROR;
}
+ p = obj->parent;
+ p->set_child = obj;
+
odr_reset (p->odr_out);
obj->start = start;
obj->number = number;