From 841680acd268a8d673fbec862e21cd607c787cfa Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 16 Oct 1995 17:00:51 +0000 Subject: [PATCH] New setting: elementSetNames. Various client improvements. Medium presentation format looks better. --- CHANGELOG | 4 ++- client.tcl | 77 ++++++++++++++++++++++++++++++++++++++++++++-------------- clientrc.tcl | 15 ++++++------ ir-tcl.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++-- ir-tclp.h | 8 +++++- 5 files changed, 139 insertions(+), 29 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1f7dae6..c75afd8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.5 1995-08-28 12:50:51 adam Exp $ +$Id: CHANGELOG,v 1.6 1995-10-16 17:00:51 adam Exp $ 06/19/95 Release of ir-tcl-1.0b ------------------------------------------------------ @@ -50,3 +50,5 @@ $Id: CHANGELOG,v 1.5 1995-08-28 12:50:51 adam Exp $ 08/24/95 IrTcl works with tk4.0 and tcl7.4. 08/28/95 Release of ir-tcl-1.0b2 +------------------------------------------------------ +10/16/95 New setting: ElementSetNames. diff --git a/client.tcl b/client.tcl index 5059a97..1bb1466 100644 --- a/client.tcl +++ b/client.tcl @@ -4,7 +4,11 @@ # Sebastian Hammer, Adam Dickmeiss # # $Log: client.tcl,v $ -# Revision 1.71 1995-10-13 15:35:27 adam +# Revision 1.72 1995-10-16 17:00:52 adam +# New setting: elementSetNames. +# Various client improvements. Medium presentation format looks better. +# +# Revision 1.71 1995/10/13 15:35:27 adam # Relational operators may be used in search entries - changes # in proc index-query. # @@ -317,6 +321,7 @@ set displayFormat 1 set popupMarcdf 0 set textWrap word set recordSyntax None +set elementSetNames None set delayRequest {} set queryTypes {Simple} @@ -778,6 +783,16 @@ proc popup-marc {sno no b df} { -font -Adobe-Times-Medium-R-Normal-*-180-* \ -background black -foreground white + $w.top.record tag configure marc-pref \ + -font -Adobe-Times-Medium-R-Normal-*-180-* \ + -foreground blue + $w.top.record tag configure marc-text \ + -font -Adobe-Times-Medium-R-Normal-*-180-* \ + -foreground black + $w.top.record tag configure marc-it \ + -font -Adobe-Times-Medium-I-Normal-*-180-* \ + -foreground black + pack $w.top.s -side right -fill y pack $w.top.record -expand yes -fill both @@ -1077,6 +1092,7 @@ proc search-request {bflag} { global cancelFlag global delayRequest global recordSyntax + global elementSetNames set target $hostid @@ -1122,6 +1138,11 @@ proc search-request {bflag} { } else { z39.$setNo preferredRecordSyntax $recordSyntax } + if {$elementSetNames == "None" } { + z39.$setNo elementSetNames {} + } else { + z39.$setNo elementSetNames $elementSetNames + } z39 callback {search-response} z39.$setNo search $query show-status Searching 1 0 @@ -2097,7 +2118,8 @@ proc save-geometry {} { global displayFormat global popupMarcdf global recordSyntax - + global elementSetNames + set windowGeometry(.) [wm geometry .] if {[catch {set f [open ~/.clientrc.tcl w]}]} { @@ -2108,6 +2130,7 @@ proc save-geometry {} { puts $f "set displayFormat $displayFormat" puts $f "set popupMarcdf $popupMarcdf" puts $f "set recordSyntax $recordSyntax" + puts $f "set elementSetNames $elementSetNames" foreach n [array names windowGeometry] { puts -nonewline $f "set \{windowGeometry($n)\} \{" puts -nonewline $f $windowGeometry($n) @@ -2577,6 +2600,14 @@ proc index-setup {attr queryNo indexNo} { set completenessTmpValue 0 set useTmpValue 0 + catch {destroy $w} + toplevelG $w + + set n [lindex $attr 0] + wm title $w "Index setup $n" + + top-down-window $w + set len [llength $attr] for {set i 1} {$i < $len} {incr i} { set q [lindex $attr $i] @@ -2600,15 +2631,6 @@ proc index-setup {attr queryNo indexNo} { } } } - if {[winfo exists $w]} { - destroy $w - } - toplevelG $w - - set n [lindex $attr 0] - wm title $w "Index setup $n" - - top-down-window $w frame $w.top.use -relief ridge -border 2 frame $w.top.relation -relief ridge -border 2 @@ -2757,7 +2779,7 @@ proc query-setup {queryNo} { listbox $w.top.index.list -yscrollcommand [list $w.top.index.scroll set] scrollbar $w.top.index.scroll -orient vertical -border 1 \ -command [list $w.top.index.list yview] - bind $w.top.index.list <2> [list query-edit-index $queryNo] + bind $w.top.index.list [list query-edit-index $queryNo] pack $w.top.index.list -side left -fill both -expand yes -padx 2 -pady 2 pack $w.top.index.scroll -side right -fill y -padx 2 -pady 2 @@ -2773,13 +2795,14 @@ proc query-setup {queryNo} { foreach x $queryInfoTmp { $w.top.index.list insert end [lindex $x 0] } + # Bottom bottom-buttons $w [list \ - {Ok} [list query-setup-action $queryNo] \ - {Add index} [list query-add-index $queryNo] \ - {Edit index} [list query-edit-index $queryNo] \ - {Delete index} [list query-delete-index $queryNo] \ - {Cancel} [list destroy $w]] 0 + Ok [list query-setup-action $queryNo] \ + Add [list query-add-index $queryNo] \ + Edit [list query-edit-index $queryNo] \ + Delete [list query-delete-index $queryNo] \ + Cancel [list destroy $w]] 0 } proc index-clear {} { @@ -3035,6 +3058,7 @@ menu .top.options.m .top.options.m add cascade -label "Format" -menu .top.options.m.formats .top.options.m add cascade -label "Wrap" -menu .top.options.m.wrap .top.options.m add cascade -label "Syntax" -menu .top.options.m.syntax +.top.options.m add cascade -label "Elements" -menu .top.options.m.elements menu .top.options.m.query .top.options.m.query add cascade -label "Select" \ @@ -3092,6 +3116,14 @@ menu .top.options.m.syntax .top.options.m.syntax add radiobutton -label "GRS1" \ -value GRS1 -variable recordSyntax +menu .top.options.m.elements +.top.options.m.elements add radiobutton -label "Unspecified" \ + -value None -variable elementSetNames +.top.options.m.elements add radiobutton -label "Full" \ + -value F -variable elementSetNames +.top.options.m.elements add radiobutton -label "Brief" \ + -value B -variable elementSetNames + menubutton .top.help -text "Help" -menu .top.help.m menu .top.help.m @@ -3135,8 +3167,17 @@ if {! $monoFlag} { } .data.record tag configure marc-data -foreground black .data.record tag configure marc-head \ - -font -Adobe-Times-Medium-R-Normal-*-180-* \ + -font -Adobe-Times-Medium-R-Normal-*-140-* \ -foreground white -background black +.data.record tag configure marc-pref \ + -font -Adobe-Times-Medium-R-Normal-*-140-* \ + -foreground blue +.data.record tag configure marc-text \ + -font -Adobe-Times-Medium-R-Normal-*-140-* \ + -foreground black +.data.record tag configure marc-it \ + -font -Adobe-Times-Medium-I-Normal-*-140-* \ + -foreground black button .bot.logo -bitmap @${libdir}/bitmaps/book1 -command cancel-operation if {[tk4]} { diff --git a/clientrc.tcl b/clientrc.tcl index 49c8248..73a1c90 100644 --- a/clientrc.tcl +++ b/clientrc.tcl @@ -1,21 +1,22 @@ # Setup file +set {profile(zserver)} {Zserver localhost 8889 {} 90000 90000 tcpip dummy 1 {} 1 Z39 28} 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 210 {} 16384 4096 tcpip dummy 1 {} 1 Z39 3} +set {profile(ztest)} {{test server} localhost 210 {} 60000 60000 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(bibsys)} {{BIBSYS Target (YAZ-based)} z3950.bibsys.no 2100 {} 16384 8192 tcpip BIBSYS 1 {} 1 Z39 27} -set {profile(Default)} {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} {} 28} +set {profile(Default)} {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} {} 29} 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(OCLC)} {{OCLC First search engine} z3950.oclc.org 210 {} 16384 8192 tcpip {ArticleFirst BiographyIndex BusinessPeriodicalsIndex} 1 {} {} Z39 9} -set {profile(adad)} {a {} 210 {} 16384 8192 tcpip {} 1 {} {} Z39 26} set {profile(CARL)} {{CARL systems} Z3950.carl.org 210 {} 16384 8192 tcpip {ACC AIC AUR BEM CUB DPL DNU EPL FRC LAW LCC MCC MIN MPL NJC NWC OCC PPC PUE RDR RGU SPL TCC TKU UNC WYO} 1 {} {} Z39 11} -set {profile(CLSI)} {CLSI inet-gw.clsi.us.geac.com 210 {} 16384 8192 tcpip cl_default 1 {} {} Z39 13} +set {profile(adad)} {a {} 210 {} 16384 8192 tcpip {} 1 {} {} Z39 26} set {profile(Innovative)} {{Innovatives server: demo.iii.com} demo.iii.com 210 {} 16384 8192 tcpip DEFAULT 1 {} {} Z39 12} +set {profile(CLSI)} {CLSI inet-gw.clsi.us.geac.com 210 {} 16384 8192 tcpip cl_default 1 {} {} Z39 13} 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 {} 1 Z39 15} set {profile(canberra)} {canberra canberra.cs.umass.edu 2110 {} 30000 30000 tcpip cacm_dots 1 {} {} Z39 25} +set {profile(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} 1 Z39 15} set queryTypes {Simple phrase} -set queryButtons {{ {I 0} {I 1} {I 2} } {{I 0} {I 1} {I 0}}} -set queryInfo {{ {Title {1=4}} {Author {1=1}} {Subject {1=21}} {Any {1=1016}}} {{Title 1=4 4=1 6=2} {Author 1=1003 4=1 6=2} {ISBN 1=7} {ISSN 1=8} {Year 1=30 4=4 6=2} {Any {}}}} +set queryButtons {{{I 3} {I 0} {I 1} {I 2}} {{I 0} {I 1} {I 0}}} +set queryInfo {{ {Title {1=4}} {Author {1=1}} {Subject {1=21}} {Any {1=1016}} {Query 1=1016 2=102} {Title-rank 1=4 2=102} {Date/time 1=1012}} {{Title 1=4 4=1 6=2} {Author 1=1003 4=1 6=2} {ISBN 1=7} {ISSN 1=8} {Year 1=30 4=4 6=2} {Any {}}}} diff --git a/ir-tcl.c b/ir-tcl.c index ab6ef29..be6bba7 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.57 1995-09-21 13:11:51 adam + * Revision 1.58 1995-10-16 17:00:55 adam + * New setting: elementSetNames. + * Various client improvements. Medium presentation format looks better. + * + * Revision 1.57 1995/09/21 13:11:51 adam * Support of dynamic loading. * Test script uses load command if necessary. * @@ -1366,6 +1370,32 @@ static int do_preferredRecordSyntax (void *obj, Tcl_Interp *interp, } +/* + * do_elementSetNames: Set/Get element Set Names + */ +static int do_elementSetNames (void *obj, Tcl_Interp *interp, + int argc, char **argv) +{ + IrTcl_SetCObj *p = obj; + + if (argc == 0) + { + p->elementSetNames = NULL; + return TCL_OK; + } + else if (argc == -1) + return ir_tcl_strdel (interp, &p->elementSetNames); + if (argc == 3) + { + free (p->elementSetNames); + if (ir_tcl_strdup (interp, &p->elementSetNames, argv[2]) == TCL_ERROR) + return TCL_ERROR; + } + Tcl_AppendResult (interp, p->elementSetNames, NULL); + return TCL_OK; +} + + static IrTcl_Method ir_method_tab[] = { { 1, "comstack", do_comstack }, { 1, "protocol", do_protocol }, @@ -1403,6 +1433,7 @@ static IrTcl_Method ir_set_c_method_tab[] = { { 0, "largeSetLowerBound", do_largeSetLowerBound}, { 0, "mediumSetPresentNumber", do_mediumSetPresentNumber}, { 0, "referenceId", do_referenceId }, +{ 0, "elementSetNames", do_elementSetNames }, { 0, NULL, NULL} }; @@ -1577,6 +1608,18 @@ static int do_search (void *o, Tcl_Interp *interp, int argc, char **argv) } else req->preferredRecordSyntax = 0; + + if (obj->set_inher.elementSetNames && *obj->set_inher.elementSetNames) + { + Z_ElementSetNames *esn = odr_malloc (p->odr_out, sizeof(*esn)); + + esn->which = Z_ElementSetNames_generic; + esn->u.generic = obj->set_inher.elementSetNames; + req->mediumSetElementSetNames = esn; + } + else + req->mediumSetElementSetNames = NULL; + req->query = &query; if (!strcmp (obj->set_inher.queryType, "rpn")) @@ -2072,7 +2115,20 @@ static int do_present (void *o, Tcl_Interp *interp, int argc, char **argv) } else req->preferredRecordSyntax = 0; - + if (obj->set_inher.elementSetNames && *obj->set_inher.elementSetNames) + { + Z_ElementSetNames *esn = odr_malloc (p->odr_out, sizeof(*esn)); + Z_RecordComposition *compo = odr_malloc (p->odr_out, sizeof(*compo)); + + esn->which = Z_ElementSetNames_generic; + esn->u.generic = obj->set_inher.elementSetNames; + + req->recordComposition = compo; + compo->which = Z_RecordComp_simple; + compo->u.simple = esn; + } + else + req->recordComposition = NULL; return ir_tcl_send_APDU (interp, p, apdu, "present", argv[0]); } @@ -2232,6 +2288,10 @@ static int ir_set_obj_mk (ClientData clientData, Tcl_Interp *interp, == TCL_ERROR) return TCL_ERROR; + if (ir_tcl_strdup (interp, &dst->elementSetNames, src->elementSetNames) + == TCL_ERROR) + return TCL_ERROR; + if (src->preferredRecordSyntax && (dst->preferredRecordSyntax = ir_tcl_malloc (sizeof(*dst->preferredRecordSyntax)))) diff --git a/ir-tclp.h b/ir-tclp.h index c4635ae..45e3ccd 100644 --- a/ir-tclp.h +++ b/ir-tclp.h @@ -5,7 +5,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tclp.h,v $ - * Revision 1.16 1995-09-20 11:37:01 adam + * Revision 1.17 1995-10-16 17:00:56 adam + * New setting: elementSetNames. + * Various client improvements. Medium presentation format looks better. + * + * Revision 1.16 1995/09/20 11:37:01 adam * Configure searches for tk4.1 and tk7.5. * Work on GRS. * @@ -100,6 +104,8 @@ typedef struct { int replaceIndicator; char *referenceId; + char *elementSetNames; + int smallSetUpperBound; int largeSetLowerBound; int mediumSetPresentNumber; -- 1.7.10.4