1 #Procedure display-grs-medium {w r i}
2 # w text widget in which the record should be displayed
5 #This procedure displaies the GRS-1 records in a medium sized format and
6 #puts tags around the text in order to format the output.
7 proc display-grs-medium {w r i} {
10 $w tag configure indent$i -lmargin1 [expr $i * 16] \
11 -lmargin2 [expr $i * 16 + 8]
13 set start [$w index insert]
14 set ttype [lindex $e 0]
15 set tval [lindex $e 2]
17 insertWithTags $w "$tval " marc-pref
18 } elseif {[info exists tagSet($ttype,$tval)]} {
19 insertWithTags $w "$tagSet($ttype,$tval) " marc-pref
21 insertWithTags $w "($ttype,$tval) " marc-tag
23 if {[lindex $e 3] == "string"} {
24 insertWithTags $w [lindex $e 4] marc-text
25 insertWithTags $w "\n"
26 } elseif {[lindex $e 3] == "subtree"} {
27 insertWithTags $w "\n"
29 insertWithTags $w [lindex $e 4] {}
30 insertWithTags $w " \n" {}
32 $w tag add indent$i $start insert
33 if {[lindex $e 3] == "subtree"} {
34 display-grs-medium $w [lindex $e 4] [expr $i+1]
39 # Procedure display-medium {sno no w hflag}
40 # sno result set number (integer)
41 # no record position (integer)
42 # w text widget in which the record should be displayed
43 # hflag header flag. If true a header showing the record position
44 # should be displayed.
45 # This procedure attempts to display records in a medium-sized format.
46 proc display-medium {sno no w hflag} {
48 insertWithTags $w " $no " marc-head
49 insertWithTags $w "\n"
53 set type [z39.$sno type $no]
55 set err [lindex [z39.$sno diag $no] 1]
56 set add [lindex [z39.$sno diag $no] 2]
60 insertWithTags $w "Error ${err}${add}\n" marc-id
66 set rtype [z39.$sno recordType $no]
67 if {$rtype == "SUTRS"} {
68 insertWithTags $w [join [z39.$sno getSutrs $no]] {}
72 if {$rtype == "GRS-1"} {
73 display-grs-medium $w [z39.$sno getGrs $no] 0
76 if {[catch {set i [z39.$sno getMarc $no field 245 * a]}]} {
77 insertWithTags $w "Unknown record type: $rtype\n" marc-id
81 insertWithTags $w "Title " marc-pref
82 insertWithTags $w [string trimright [lindex $i 0] /] marc-text
83 set i [z39.$sno getMarc $no field 245 * b]
85 insertWithTags $w [string trimright [lindex $i 0] /] marc-text
89 set i [z39.$sno getMarc $no field 700 * a]
91 set i [z39.$sno getMarc $no field 100 * a]
94 if {[llength $i] > 1} {
95 insertWithTags $w "Authors " marc-pref
97 insertWithTags $w "Author " marc-pref
100 insertWithTags $w $x marc-it
104 set i [z39.$sno getMarc $no field 110 * *]
106 insertWithTags $w "Co-Author " marc-pref
108 insertWithTags $w $x marc-text
113 set i [z39.$sno getMarc $no field 650 * *]
116 insertWithTags $w "Keywords " marc-pref
121 insertWithTags $w $x marc-it
126 set i [concat [z39.$sno getMarc $no field 260 * a] \
127 [z39.$sno getMarc $no field 260 * b] [z39.$sno getMarc $no field 260 * c]]
129 insertWithTags $w "Publisher " marc-pref
131 insertWithTags $w $x marc-text
135 set i [z39.$sno getMarc $no field 300 * a]
137 insertWithTags $w "Phys. Desc. " marc-pref
139 insertWithTags $w $x marc-text
143 set i [z39.$sno getMarc $no field 020 * a]
145 insertWithTags $w "ISBN " marc-pref
147 insertWithTags $w $x marc-text
151 set i [z39.$sno getMarc $no field 022 * a]
153 insertWithTags $w "ISSN " marc-pref
155 insertWithTags $w $x marc-text
159 set i [z39.$sno getMarc $no field 030 * a]
161 insertWithTags $w "CODEN " marc-pref
163 insertWithTags $w $x marc-text
167 set i [z39.$sno getMarc $no field 015 * a]
169 insertWithTags $w "Ctl number " marc-pref
171 insertWithTags $w $x marc-text
175 set i [z39.$sno getMarc $no field 010 * a]
177 insertWithTags $w "LC number " marc-pref
179 insertWithTags $w $x marc-text
183 set i [z39.$sno getMarc $no field 710 * a]
185 insertWithTags $w "Corporate name " marc-pref
187 insertWithTags $w $x marc-text