From: Per M. Hansen Date: Thu, 8 Oct 1998 08:58:41 +0000 (+0000) Subject: Procedure to change record syntax information added. Bug fixes. X-Git-Tag: IRTCL.1.4~46 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=28500a1e0369e989973f214e839039e9f9e38622;p=ir-tcl-moved-to-github.git Procedure to change record syntax information added. Bug fixes. --- diff --git a/client2/bib-1.tcl b/client2/bib-1.tcl index 8abb3ca..62409a8 100644 --- a/client2/bib-1.tcl +++ b/client2/bib-1.tcl @@ -6,17 +6,17 @@ set bib1(5) {Title series} set bib1(6) {Title uniform} set bib1(7) {ISBN} set bib1(8) {ISSN} -set bib1(9) {LC card number} +set bib1(9) {LC card no.} set bib1(10) {BNB card no.} -set bib1(11) {BGF number} -set bib1(12) {Local number} +set bib1(11) {BGF no.} +set bib1(12) {Local no.} set bib1(13) {Dewey classificat} set bib1(14) {UDC classification} set bib1(15) {Bliss classification} -set bib1(16) {LC call number} -set bib1(17) {NLM call number} -set bib1(18) {NAL call number} -set bib1(19) {MOS call number} +set bib1(16) {LC call no.} +set bib1(17) {NLM call no.} +set bib1(18) {NAL call no.} +set bib1(19) {MOS call no.} set bib1(20) {Local classification} set bib1(21) {Subject heading} set bib1(22) {Subject Rameau} @@ -65,15 +65,15 @@ set bib1(1000) {Author-title} set bib1(1001) {Record type} set bib1(1002) {Name} set bib1(1003) {Author} -set bib1(1004) {Author-name personal} -set bib1(1005) {Author-name corporate} -set bib1(1006) {Author-name conference} +set bib1(1004) {Author, personal} +set bib1(1005) {Author, corporate} +set bib1(1006) {Author, conference} set bib1(1007) {Identifier--standard} set bib1(1008) {Subject--LC children's} -set bib1(1009) {Subject name -- personal} +set bib1(1009) {Subject name--personal} set bib1(1010) {Body of text} set bib1(1011) {Date/time added to db} -set bib1(1012) {Date/time last modified} +set bib1(1012) {Date/time last mod.} set bib1(1013) {Authority/format id} set bib1(1014) {Concept-text} set bib1(1015) {Concept-reference} @@ -88,9 +88,9 @@ set bib1(1023) {Indexed-by} set bib1(1024) {Map-scale} set bib1(1025) {Music-key} set bib1(1026) {Related-periodical} -set bib1(1027) {Report-number} -set bib1(1028) {Stock-number} -set bib1(1030) {Thematic-number} +set bib1(1027) {Report-no.} +set bib1(1028) {Stock-no.} +set bib1(1030) {Thematic-no.} set bib1(1031) {Material-type} set bib1(1032) {Doc-id} set bib1(1033) {Host-item} diff --git a/client2/client.tcl b/client2/client.tcl index a248e26..86c66d9 100644 --- a/client2/client.tcl +++ b/client2/client.tcl @@ -98,6 +98,7 @@ set recordSyntax None set elementSetNames None set delayRequest {} set debugMode 0 +set queryAutoOld 0 set queryTypes {Simple} set queryButtons { { {I 0} {I 1} {I 2} } } @@ -109,6 +110,9 @@ wm minsize . 0 0 set setOffset 0 set setMax 0 +set syntaxList {None sep USMARC UNIMARC UKMARC DANMARC FINMARC NORMARC PICAMARC sep SUTRS sep GRS1} + + set font(bb,normal) {Helvetica 24} set font(bb,bold) {Helvetica 24 bold} set font(b,normal) {Helvetica 24} @@ -164,6 +168,8 @@ if {[file readable "${libdir}/.clientrc.tcl"]} { source "bib-1.tcl" +set queryAutoOld $queryAuto + # Convert old format to new format... foreach target [array names profile] { set timedef [clock seconds] @@ -1080,7 +1086,7 @@ proc init-response {target base} { tkerror "Connection rejected by target: $u" } else { z39 failback [list explain-crash $target $base] - explain-check $target [list ready-response $base] + explain-check $target [list ready-response $base] $base } } @@ -1098,9 +1104,9 @@ proc explain-crash {target base} { # Procedure explain-check # Stub function to check explain. May be overwritten later. -proc explain-check {target response} { - eval $response [list $target] -} +#proc explain-check {target response} +# eval $response [list $target] + # Procedure ready-response # Called after a target has been initialized and, possibly, explained @@ -1147,6 +1153,7 @@ proc ready-response-actions {target base} { global profile queryAuto get-attributeDetails $target $base changeQueryButtons $target $base + configureOptionsSyntax $target $base if {[info exists profile($target,AttributeDetails,$base,Bib1Use)] && $queryAuto == 1} { changeQueryButtons $target $base change-queryInfo $target $base @@ -2072,7 +2079,16 @@ proc cascade-target-list {} { # query type information given by the globals $queryButtonsFind and # $queryInfoFind are affected by this operation. proc query-select {i} { - global queryButtonsFind queryInfoFind queryButtons queryInfo + global queryButtonsFind queryInfoFind queryButtons queryInfo queryAuto queryAutoOld hostid currentDb profile + + if {$queryAutoOld == 1 && $queryAuto == 0} { + set queryAutoOld $queryAuto + return + } + if {$queryAutoOld == 0 && $queryAuto == 1 && [info exists profile($hostid,AttributeDetails,$currentDb,Bib1Use)] == 0} { + set queryAutoOld $queryAuto + return + } set queryInfoFind [lindex $queryInfo $i] set queryButtonsFind [lindex $queryButtons $i] index-lines .lines 1 $queryButtonsFind $queryInfoFind activate-index @@ -2157,7 +2173,7 @@ proc cascade-query-list {} { $w.clist delete 0 last foreach n $queryTypes { if {$n == "Auto"} { - $w.clist add check -label $n -variable queryAuto + $w.clist add check -label $n -variable queryAuto -command [list query-select $i] } else { $w.clist add command -label $n -command [list query-select $i] } @@ -2401,10 +2417,7 @@ proc query-add-index-action {queryNo} { lappend queryInfoTmp [list $newI {}] $w.top.index.list insert end $newI destroy .query-add-index - #destroy $w.top.lines - #frame $w.top.lines -relief ridge -border 2 index-lines $w.top.lines 0 $queryButtonsTmp $queryInfoTmp activate-e-index - #pack $w.top.lines -side left -pady 6 -padx 6 -fill y } # Procedure query-add-line @@ -3143,11 +3156,31 @@ proc search-fields {w buttondefs} { #base database name #Changes the Options|Syntax menu acording to the information obtained via explain. proc configureOptionsSyntax {target base} { - if {[info exists profile{$target,syntax,$base}]} { - #Dette kan ikke laves færdigt da Zebra ikke leverer nogle record syntax oplysninger endnu. - + global profile syntaxList + set activate 0 + set i -1 + if {[info exists profile($target,RecordSyntaxes,$base)]} { + foreach syntax $syntaxList { + incr i + if {$syntax == "sep"} {continue} + .top.options.m.syntax entryconfigure $i -variable 0 + if {[lsearch $profile($target,RecordSyntaxes,$base) $syntax] != -1} { + configure-enable-e .top.options.m.syntax $i + if {$activate == 0} { + .top.options.m.syntax invoke $i + set activate 1 + } + } else { + configure-disable-e .top.options.m.syntax $i + } + } } else { - initOptionsSyntax + foreach syntax $syntaxList { + incr i + if {$syntax == "sep"} {continue} + configure-enable-e .top.options.m.syntax $i + } + .top.options.m.syntax invoke 0 } } @@ -3262,26 +3295,16 @@ irmenu .top.options.m.wrap # Init: Definition of the Options|Syntax menu. proc initOptionsSyntax {} { - irmenu .top.options.m.syntax - .top.options.m.syntax add radiobutton -label None -value None -variable recordSyntax - .top.options.m.syntax add separator - .top.options.m.syntax add radiobutton -label USMARC \ - -value USMARC -variable recordSyntax - .top.options.m.syntax add radiobutton -label UNIMARC \ - -value UNIMARC -variable recordSyntax - .top.options.m.syntax add radiobutton -label UKMARC \ - -value UKMARC -variable recordSyntax - .top.options.m.syntax add radiobutton -label DANMARC \ - -value DANMARC -variable recordSyntax - .top.options.m.syntax add radiobutton -label FINMARC \ - -value FINMARC -variable recordSyntax - .top.options.m.syntax add radiobutton -label NORMARC \ - -value NORMARC -variable recordSyntax - .top.options.m.syntax add radiobutton -label PICAMARC -value PICAMARC -variable recordSyntax - .top.options.m.syntax add separator - .top.options.m.syntax add radiobutton -label SUTRS -value SUTRS -variable recordSyntax - .top.options.m.syntax add separator - .top.options.m.syntax add radiobutton -label GRS1 -value GRS1 -variable recordSyntax + global syntaxList + set w .top.options.m.syntax + irmenu $w + foreach syntax $syntaxList { + if {$syntax == "sep"} { + $w add separator + } else { + $w add radiobutton -label $syntax -value $syntax -variable recordSyntax + } + } } initOptionsSyntax diff --git a/client2/explain.tcl b/client2/explain.tcl index 004f59a..fcf2455 100644 --- a/client2/explain.tcl +++ b/client2/explain.tcl @@ -41,6 +41,7 @@ proc get-attributeDetails {target base} { } incr index } + rename z39.attributeDetails "" } else { .debug-window.top.t insert end "Ingen explain\n" } @@ -210,7 +211,6 @@ proc explain-check-ok {target zz category finish} { puts $crec set rec [z39.targetInfo getExplain 1] - set trec [z39.targetInfo getExplain 1 targetInfo] puts "--- targetInfo" puts $rec @@ -271,14 +271,14 @@ proc explain-refresh {target finish} { # Procedure explain-check # Checks target for explain database. # Evals "$finish $target" on finish. -proc explain-check {target finish} { +proc explain-check {target finish base} { global profile set refresh 0 set time [clock seconds] set etime $profile($target,timeLastExplain) if {[string length $etime]} { - # Check last explain. If 1 day since last explain do explain egain. + # Check last explain. If 1 day since last explain do explain again. # 1 day = 86400 if {$time > [expr 0 + $etime]} { set refresh 1 @@ -295,6 +295,7 @@ proc explain-check {target finish} { } if {$refresh} { explain-refresh $target $finish +# get-attributeDetails $target $base } else { eval $finish [list $target] } diff --git a/client2/irtdb.tcl b/client2/irtdb.tcl index 436c86b..2e3616e 100644 --- a/client2/irtdb.tcl +++ b/client2/irtdb.tcl @@ -1,6 +1,4 @@ # Setup file -set profile(BIBSYS,AttributeDetails,gils,Bib1Use) {1012 1019 1007 62 1005 4} -set profile(BIBSYS,AttributeDetails,marc,Bib1Use) {1005 30 1018 1006 59 4 1003 1004} set profile(BIBSYS,authentication) {} set profile(BIBSYS,comstack) tcpip set profile(BIBSYS,databases) {BIBSYS PERI} @@ -25,11 +23,12 @@ set profile(BIBSYS,smallSetUpperBound) 0 set profile(BIBSYS,targetInfoName) {} set profile(BIBSYS,timeDefine) 878567355 set profile(BIBSYS,timeLastExplain) {} -set profile(BIBSYS,timeLastInit) 907078128 +set profile(BIBSYS,timeLastInit) 907773417 set profile(BIBSYS,welcomeMessage) {} -set profile(BIBSYS,windowNumber) 4 +set profile(BIBSYS,windowNumber) 3 set profile(Bagel:210,AttributeDetails,gils,Bib1Use) {1012 1019 1007 62 1005 4} set profile(Bagel:210,AttributeDetails,marc,Bib1Use) {1005 30 1018 1006 59 4 1003 1004} +set profile(Bagel:210,RecordSyntaxes,gils) {SUTRS GRS1 USMARC} set profile(Bagel:210,authentication) {} set profile(Bagel:210,comstack) tcpip set profile(Bagel:210,databases) {dranet.dra.com IR-Explain-1 gils marc} @@ -56,8 +55,8 @@ set profile(Bagel:210,recentNews) {} set profile(Bagel:210,smallSetUpperBound) 0 set profile(Bagel:210,targetInfoName) Zebra set profile(Bagel:210,timeDefine) {} -set profile(Bagel:210,timeLastExplain) 907078051 -set profile(Bagel:210,timeLastInit) 907078051 +set profile(Bagel:210,timeLastExplain) 907773347 +set profile(Bagel:210,timeLastInit) 907773347 set profile(Bagel:210,welcomeMessage) {} set profile(Bagel:210,windowNumber) 1 set {profile(Bell Laboratories Library Network,authentication)} {} @@ -86,7 +85,7 @@ set {profile(Bell Laboratories Library Network,timeDefine)} 878567355 set {profile(Bell Laboratories Library Network,timeLastExplain)} 887288368 set {profile(Bell Laboratories Library Network,timeLastInit)} 887288368 set {profile(Bell Laboratories Library Network,welcomeMessage)} {Salutations - this is Lucent Technologies experimental Z39.50 server. No guarentees, but free and unlimited access!} -set {profile(Bell Laboratories Library Network,windowNumber)} 16 +set {profile(Bell Laboratories Library Network,windowNumber)} 15 set {profile(Bibliothèque Nationale du Québec,authentication)} {} set {profile(Bibliothèque Nationale du Québec,comstack)} tcpip set {profile(Bibliothèque Nationale du Québec,databases)} IRIS @@ -143,7 +142,7 @@ set {profile(British Library:,timeDefine)} {} set {profile(British Library:,timeLastExplain)} {} set {profile(British Library:,timeLastInit)} 893840445 set {profile(British Library:,welcomeMessage)} {} -set {profile(British Library:,windowNumber)} 3 +set {profile(British Library:,windowNumber)} 4 set profile(DanBib,authentication) {} set profile(DanBib,comstack) tcpip set profile(DanBib,databases) DANBIBV2 @@ -197,7 +196,7 @@ set profile(Default,timeDefine) {} set profile(Default,timeLastExplain) {} set profile(Default,timeLastInit) {} set profile(Default,welcomeMessage) {} -set profile(Default,windowNumber) 20 +set profile(Default,windowNumber) 19 set profile(LOC,authentication) {} set profile(LOC,comstack) tcpip set profile(LOC,databases) {BOOKS NAMES AUTH MAPS MUSIC BIB SERIALS SUBJECTS} @@ -226,7 +225,7 @@ set profile(LOC,targetMaxResultSize) {} set profile(LOC,targetMaxTerms) {} set profile(LOC,timeDefine) 878567355 set profile(LOC,timeLastExplain) {} -set profile(LOC,timeLastInit) 902482859 +set profile(LOC,timeLastInit) 907587281 set profile(LOC,welcomeMessage) {} set profile(LOC,windowNumber) 12 set {profile(OCLC FirstSearch,authentication)} {} @@ -257,9 +256,9 @@ set {profile(OCLC FirstSearch,targetMaxResultSize)} {} set {profile(OCLC FirstSearch,targetMaxTerms)} {} set {profile(OCLC FirstSearch,timeDefine)} {} set {profile(OCLC FirstSearch,timeLastExplain)} {} -set {profile(OCLC FirstSearch,timeLastInit)} 893840324 +set {profile(OCLC FirstSearch,timeLastInit)} 907164654 set {profile(OCLC FirstSearch,welcomeMessage)} {} -set {profile(OCLC FirstSearch,windowNumber)} 15 +set {profile(OCLC FirstSearch,windowNumber)} 14 set profile(Penn,authentication) {} set profile(Penn,comstack) tcpip set profile(Penn,databases) CATALOG @@ -290,7 +289,7 @@ set profile(Penn,timeDefine) 878567355 set profile(Penn,timeLastExplain) {} set profile(Penn,timeLastInit) 902483000 set profile(Penn,welcomeMessage) {} -set profile(Penn,windowNumber) 19 +set profile(Penn,windowNumber) 18 set {profile(Steiermrkische Landesbibliothek,authentication)} {} set {profile(Steiermrkische Landesbibliothek,comstack)} tcpip set {profile(Steiermrkische Landesbibliothek,databases)} {lbopac miopac} @@ -322,8 +321,6 @@ set {profile(Steiermrkische Landesbibliothek,timeLastExplain)} 893840781 set {profile(Steiermrkische Landesbibliothek,timeLastInit)} {} set {profile(Steiermrkische Landesbibliothek,welcomeMessage)} {} set {profile(Steiermrkische Landesbibliothek,windowNumber)} 2 -set {profile(University of Crete,AttributeDetails,gils,Bib1Use)} {1012 1019 1007 62 1005 4} -set {profile(University of Crete,AttributeDetails,marc,Bib1Use)} {1005 30 1018 1006 59 4 1003 1004} set {profile(University of Crete,authentication)} {} set {profile(University of Crete,comstack)} tcpip set {profile(University of Crete,databases)} ptolemeos_ii @@ -410,7 +407,7 @@ set profile(author,timeDefine) 878567355 set profile(author,timeLastExplain) {} set profile(author,timeLastInit) 887288138 set profile(author,welcomeMessage) {} -set profile(author,windowNumber) 18 +set profile(author,windowNumber) 17 set profile(dranet,authentication) {} set profile(dranet,comstack) tcpip set profile(dranet,databases) drewdb @@ -527,8 +524,8 @@ set profile(ztest9999,timeDefine) 878567355 set profile(ztest9999,timeLastExplain) 902228978 set profile(ztest9999,timeLastInit) 902228978 set profile(ztest9999,welcomeMessage) {} -set profile(ztest9999,windowNumber) 14 +set profile(ztest9999,windowNumber) 13 set queryTypes {Simple Phrase Auto} set queryButtons {{{I 3} {I 0} {I 0}} {{I 0} {I 1} {I 0}} {{I 4} {I 5} {I 3}}} -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-regular 1=4 2=3 4=2 5=102} {Ranked 1=1016 2=102 3=3 4=1 6=1}} {{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 {}}} {{{Author-name corporate} 1=1005} {Date 1=30} {Publisher 1=1018} {{Author-name conference} 1=1006} {{Place publication} 1=59} {Title 1=4} {Author 1=1003} {{Author-name personal} 1=1004}}} -set queryAuto 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-regular 1=4 2=3 4=2 5=102} {Ranked 1=1016 2=102 3=3 4=1 6=1}} {{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 {}}} {{{Date/time last mod.} 1=1012} {Record-source 1=1019} {Identifier--standard 1=1007} {Abstract 1=62} {{Author, corporate} 1=1005} {Title 1=4}}} +set queryAuto 1