1 # IR toolkit for tcl/tk
3 # See the file LICENSE for details.
4 # Sebastian Hammer, Adam Dickmeiss
7 # Revision 1.8 1995-10-17 10:58:09 adam
8 # More work on presentation formats.
10 # Revision 1.7 1995/10/16 17:01:03 adam
11 # Medium presentation format looks better.
13 # Revision 1.6 1995/09/20 11:37:06 adam
16 # Revision 1.5 1995/06/22 13:16:29 adam
17 # Feature: SUTRS. Setting getSutrs implemented.
18 # Work on display formats.
20 # Revision 1.4 1995/06/14 12:16:42 adam
21 # Minor presentation format changes.
23 # Revision 1.3 1995/06/13 14:39:06 adam
24 # Fix: if {$var != ""} doesn't work if var is a large numerical!
25 # Highlight when line format is used.
27 # Revision 1.2 1995/06/12 15:18:10 adam
28 # Work on presentation formats. These are used in the main window as well
32 proc display-grs-medium {w r i} {
34 for {set j 0} {$j < $i} {incr j} {
35 insertWithTags $w " " marc-tag
37 insertWithTags $w "([lindex $e 0]:[lindex $e 2]) " marc-tag
38 if {[lindex $e 3] == "string"} {
39 insertWithTags $w [lindex $e 4] marc-text
40 insertWithTags $w "\n" marc-text
41 } elseif {[lindex $e 3] == "subtree"} {
42 insertWithTags $w "\n" marc-text
43 display-grs-medium $w [lindex $e 4] [expr $i+1]
45 insertWithTags [lindex $e 4] {}
46 insertWithTags $w " ?\n" {}
51 proc display-medium {sno no w hflag} {
53 insertWithTags $w " $no " marc-head
54 insertWithTags $w "\n"
58 set type [z39.$sno type $no]
60 set err [lindex [z39.$sno diag $no] 1]
61 set add [lindex [z39.$sno diag $no] 2]
65 insertWithTags $w "Error ${err}${add}\n" marc-id
71 set rtype [z39.$sno recordType $no]
72 if {$rtype == "SUTRS"} {
73 insertWithTags $w [join [z39.$sno getSutrs $no]] {}
77 if {$rtype == "GRS1"} {
78 display-grs-medium $w [z39.$sno getGrs $no] 0
81 if {[catch {set i [z39.$sno getMarc $no field 245 * a]}]} {
82 insertWithTags $w "Unknown record type: $rtype\n" marc-id
86 insertWithTags $w "Title " marc-pref
87 insertWithTags $w [string trimright [lindex $i 0] /] marc-text
88 set i [z39.$sno getMarc $no field 245 * b]
90 insertWithTags $w [string trimright [lindex $i 0] /] marc-text
94 set i [z39.$sno getMarc $no field 700 * a]
96 set i [z39.$sno getMarc $no field 100 * a]
99 if {[llength $i] > 1} {
100 insertWithTags $w "Authors " marc-pref
102 insertWithTags $w "Author " marc-pref
105 insertWithTags $w $x marc-it
109 set i [z39.$sno getMarc $no field 110 * *]
111 insertWithTags $w "Co-Author " marc-pref
113 insertWithTags $w $x marc-text
118 set i [z39.$sno getMarc $no field 650 * *]
121 insertWithTags $w "Keywords " marc-pref
126 insertWithTags $w $x marc-it
131 set i [concat [z39.$sno getMarc $no field 260 * a] \
132 [z39.$sno getMarc $no field 260 * b]]
134 insertWithTags $w "Publisher " marc-pref
136 insertWithTags $w $x marc-text
140 set i [z39.$sno getMarc $no field 020 * a]
142 insertWithTags $w "ISBN " marc-pref
144 insertWithTags $w $x marc-text
148 set i [z39.$sno getMarc $no field 022 * a]
150 insertWithTags $w "ISSN " marc-pref
152 insertWithTags $w $x marc-text
156 set i [z39.$sno getMarc $no field 030 * a]
158 insertWithTags $w "CODEN " marc-pref
160 insertWithTags $w $x marc-text
164 set i [z39.$sno getMarc $no field 015 * a]
166 insertWithTags $w "Ctl number " marc-pref
168 insertWithTags $w $x marc-text
172 set i [z39.$sno getMarc $no field 010 * a]
174 insertWithTags $w "LC number " marc-pref
176 insertWithTags $w $x marc-text