1 # IR toolkit for tcl/tk
3 # See the file LICENSE for details.
4 # Sebastian Hammer, Adam Dickmeiss
7 # Revision 1.10 1996-01-11 09:31:05 quinn
10 # Revision 1.9 1995/10/17 14:18:10 adam
11 # Minor changes in presentation formats.
13 # Revision 1.8 1995/10/17 10:58:09 adam
14 # More work on presentation formats.
16 # Revision 1.7 1995/10/16 17:01:03 adam
17 # Medium presentation format looks better.
19 # Revision 1.6 1995/09/20 11:37:06 adam
22 # Revision 1.5 1995/06/22 13:16:29 adam
23 # Feature: SUTRS. Setting getSutrs implemented.
24 # Work on display formats.
26 # Revision 1.4 1995/06/14 12:16:42 adam
27 # Minor presentation format changes.
29 # Revision 1.3 1995/06/13 14:39:06 adam
30 # Fix: if {$var != ""} doesn't work if var is a large numerical!
31 # Highlight when line format is used.
33 # Revision 1.2 1995/06/12 15:18:10 adam
34 # Work on presentation formats. These are used in the main window as well
38 proc display-grs-medium {w r i} {
40 for {set j 0} {$j < $i} {incr j} {
41 insertWithTags $w " " marc-tag
43 insertWithTags $w "([lindex $e 0]:[lindex $e 2]) " marc-tag
44 if {[lindex $e 3] == "string"} {
45 insertWithTags $w [lindex $e 4] {}
46 insertWithTags $w "\n"
47 } elseif {[lindex $e 3] == "subtree"} {
48 insertWithTags $w "\n"
49 display-grs-medium $w [lindex $e 4] [expr $i+1]
51 insertWithTags $w [lindex $e 4] {}
52 insertWithTags $w " ?\n" {}
57 proc display-medium {sno no w hflag} {
59 insertWithTags $w " $no " marc-head
60 insertWithTags $w "\n"
64 set type [z39.$sno type $no]
66 set err [lindex [z39.$sno diag $no] 1]
67 set add [lindex [z39.$sno diag $no] 2]
71 insertWithTags $w "Error ${err}${add}\n" marc-id
77 set rtype [z39.$sno recordType $no]
78 if {$rtype == "SUTRS"} {
79 insertWithTags $w [join [z39.$sno getSutrs $no]] {}
83 if {$rtype == "GRS1"} {
84 display-grs-medium $w [z39.$sno getGrs $no] 0
87 if {[catch {set i [z39.$sno getMarc $no field 245 * a]}]} {
88 insertWithTags $w "Unknown record type: $rtype\n" marc-id
92 insertWithTags $w "Title " marc-pref
93 insertWithTags $w [string trimright [lindex $i 0] /] marc-text
94 set i [z39.$sno getMarc $no field 245 * b]
96 insertWithTags $w [string trimright [lindex $i 0] /] marc-text
100 set i [z39.$sno getMarc $no field 700 * a]
102 set i [z39.$sno getMarc $no field 100 * a]
105 if {[llength $i] > 1} {
106 insertWithTags $w "Authors " marc-pref
108 insertWithTags $w "Author " marc-pref
111 insertWithTags $w $x marc-it
115 set i [z39.$sno getMarc $no field 110 * *]
117 insertWithTags $w "Co-Author " marc-pref
119 insertWithTags $w $x marc-text
124 set i [z39.$sno getMarc $no field 650 * *]
127 insertWithTags $w "Keywords " marc-pref
132 insertWithTags $w $x marc-it
137 set i [concat [z39.$sno getMarc $no field 260 * a] \
138 [z39.$sno getMarc $no field 260 * b]]
140 insertWithTags $w "Publisher " marc-pref
142 insertWithTags $w $x marc-text
146 set i [z39.$sno getMarc $no field 020 * a]
148 insertWithTags $w "ISBN " marc-pref
150 insertWithTags $w $x marc-text
154 set i [z39.$sno getMarc $no field 022 * a]
156 insertWithTags $w "ISSN " marc-pref
158 insertWithTags $w $x marc-text
162 set i [z39.$sno getMarc $no field 030 * a]
164 insertWithTags $w "CODEN " marc-pref
166 insertWithTags $w $x marc-text
170 set i [z39.$sno getMarc $no field 015 * a]
172 insertWithTags $w "Ctl number " marc-pref
174 insertWithTags $w $x marc-text
178 set i [z39.$sno getMarc $no field 010 * a]
180 insertWithTags $w "LC number " marc-pref
182 insertWithTags $w $x marc-text
186 set i [z39.$sno getMarc $no field 710 * a]
188 insertWithTags $w "Corporate name " marc-pref
190 insertWithTags $w $x marc-text