X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=www%2Fz39util.tcl;h=ba0b55eae59549aac99bd00ce82b2a3b8343a6cc;hb=a61ad0378b93e99e362a1d92c33d701dbf103eba;hp=9efda0b3fc2c7011e13cf6958e2bb39c291bd288;hpb=02d3e042a063e539acce998f74b00a09df000cd0;p=egate.git
diff --git a/www/z39util.tcl b/www/z39util.tcl
index 9efda0b..ba0b55e 100644
--- a/www/z39util.tcl
+++ b/www/z39util.tcl
@@ -1,5 +1,5 @@
#
-# $Id: z39util.tcl,v 1.38 1996/03/11 17:40:49 adam Exp $
+# $Id: z39util.tcl,v 1.40 1996/03/13 14:07:32 adam Exp $
#
proc saveState {} {
uplevel #0 {
@@ -120,6 +120,7 @@ proc display-medium {zset no setNo targetNo} {
set location [$zset getMarc $no field 260 * a]
set publisher [$zset getMarc $no field 260 * b]
set year [$zset getMarc $no field 260 * c]
+ set score [$zset getMarc $no field 999 * r]
} dispError ] } {
html { }
@@ -161,6 +162,9 @@ proc display-medium {zset no setNo targetNo} {
html "No Title"
}
html { }
+ if {[scan $score %d nscore]} {
+ html "; Score " $nscore
+ }
} else {
html { }
@@ -175,6 +179,7 @@ proc display-brief {zset no setNo targetNo} {
global env
global sessionId
+ html { \n"
- button-europagate
+ button-main
if {$setMax > 0 && $setMax < [$zz.$setNo resultCount]} {
+ if {!$useIcons} {
+ html "\n | "
+ }
html {
\n"
dl-marc-field $zset $no 538 * "System details" {} "
\n"
dl-marc-field $zset $no 787 {[rstw6]} "Related information" {} "
\n"
+ dl-marc-field $zset $no 999 r "Score" {} ", "
dl-marc-field $zset $no 001 * "Local control number" {} ", "
html "\n"
}
@@ -581,41 +587,47 @@ proc display-full-wais {zset no setNo targetNo} {
} else {
set nwi 1
}
+ html "\n"
+ html {
\n"
- html {URL: } $data(linkage) "
\n"
+ html {
\n"
} else {
- html {Title: } [join [$zset getWAIS $no headline]] "
\n"
+ html {
\n"
+ html {
\n"
+ html {
\n"
}
if {!$nwi} {
- html "\n" [join [$zset getWAIS $no text]] "\n
\n"
+ html "\n" [join [$zset getWAIS $no text]] "\n
\n"
return
}
if {[info exists data(bytes)]} {
- html {Bytes: } $data(bytes) "
\n"
+ html {
\n"
+ html {
\n"
+ html {
\n"
}
if {[info exists data(ip)]} {
- html {
\n"
+ html {
\n"
+ }
+ if {0} {
+ html {}
+ html {Similar WAIS record
}
+ }
+ if {[info exists data($i,linkage)]} {
+ html "
}
- html "}
+ html {">
}
} else {
- html {">Previous Records} " | \n"
+ html {">Previous Records}
}
}
- button-new-query 1 $setNo
- button-new-target 1
- button-view-history 0
+ if {$targetNo > 0} {
+ button-result-set $setNo $targetNo
+ }
+ button-new-query $setNo
+ button-new-target
+ button-view-history
html "
\n"
}
@@ -1353,35 +1369,48 @@ proc display-result-set-m-score {setNo} {
if {$zstatus($i) != 2} continue
set status [z39$i.$setNo responseStatus]
if {[lindex $status 0] != "DBOSD"} continue
- if {$hist($setNo,$i,offset) > $hist($setNo,maxPresent)} {
- set nor $hist($setNo,maxPresent)
- } else {
- set nor $hist($setNo,$i,offset)
- }
+ set nor $hist($setNo,$i,offset)
for {set j 1} {$j <= $nor} {incr j} {
if {![string compare [z39$i.$setNo recordType $j] WAIS]} {
set score [z39$i.$setNo getWAIS $j score]
- if {$score > 0} {
- lappend scoreArray [list $score $i $j]
+ } elseif {![string compare [z39$i.$setNo recordType $j] USmarc]} {
+ set score [z39$i.$setNo getMarc $j field 999 * r]
+ if {[scan $score %d score] != 1} {
+ set score 10
}
} else {
- lappend scoreArray [list 10 $i $j]
+ set score 10
+ }
+ if {$score > 0} {
+ lappend scoreArray [list $score $i $j]
}
}
}
if {![info exists scoreArray]} {
html "
\n"
}
-proc button-europagate {} {
+proc button-main {} {
global useIcons
html {}
if {$useIcons} {
html {}
} else {
- html {Europagate | }
+ html {Europagate}
}
}
-proc button-define-target {more} {
+proc button-define-target {} {
global useIcons
global env
global sessionId
+ if {!$useIcons} {
+ html "\n | "
+ }
html {}
} else {
html {">Define Target}
- if {$more} {
- html " | \n"
- } else {
- html "\n"
- }
}
}
-proc button-new-target {more} {
+proc button-new-target {} {
global useIcons
global env
global sessionId
- global mMode
+ global scriptTarget
- html {
}
} else {
html {">New Target}
- if {$more} {
- html " | \n"
- } else {
- html "\n"
- }
}
}
-proc button-view-history {more} {
+proc button-view-history {} {
global useIcons
global env
global sessionId
global nextSetNo
+ if {!$useIcons} {
+ html "\n | "
+ }
html {}
} else {
html {">View History}
- if {$more} {
- html " | \n"
- } else {
- html "\n"
- }
}
}
-proc button-new-query {more setNo} {
+proc button-new-query {setNo} {
global useIcons
global env
global sessionId
global hist
- global mMode
+ global scriptQuery
- html {}
+ html {}
+
if {$useIcons} {
html {
}
} else {
html {New Query}
- if {$more} {
- html " | \n"
- } else {
- html "\n"
- }
}
}
-proc button-scan-window {more setNo} {
+proc button-result-set {setNo tno} {
+ global useIcons
+ global env
+ global sessionId
+ global hist
+
+ if {!$useIcons} {
+ html "\n | "
+ }
+ html {
}
+ } else {
+ html {">Result Set}
+ }
+}
+
+proc button-scan-window {setNo} {
global useIcons
global env
global sessionId
global hist
+ if {!$useIcons} {
+ html "\n | "
+ }
set targetNo 0
html {}
@@ -1722,11 +1778,6 @@ proc button-scan-window {more setNo} {
html {alt="Scan" border=0>}
} else {
html {Scan}
- if {$more} {
- html " | \n"
- } else {
- html "\n"
- }
}
}
@@ -1759,7 +1810,7 @@ proc splitDatabaseSpec {host} {
}
proc mergeHostSpec {host databases} {
- return ${host}.[join $databases -]
+ return ${host}/[join $databases -]
}
proc mkAssoc {assoc host} {
@@ -1780,4 +1831,47 @@ proc mkAssoc {assoc host} {
ir $assoc
}
}
+}
+
+proc serverList {headlineProc targetProc} {
+ global targets
+ global groupsDescription
+
+ proc targetsCmp {l r} {
+ global targets
+ return [string compare [string tolower [lindex $targets($l) 0]] \
+ [string tolower [lindex $targets($r) 0]]]
+ }
+ proc groupCmp {l r} {
+ global groupsOrder
+ if {[catch {set lo $groupsOrder($l)}]} {
+ set lo 10
+ }
+ if {[catch {set ro $groupsOrder($r)}]} {
+ set ro 10
+ }
+ return [expr $lo - $ro]
+ }
+
+ foreach tt [array names targets] {
+ lappend groupsTmp([lindex $targets($tt) 6]) $tt
+ }
+ set gts [lsort -command groupCmp [array names groupsTmp]]
+ foreach gt $gts {
+ if {[info exists groupsDescription($gt)]} {
+ eval $headlineProc [list $groupsDescription($gt)]
+ } else {
+ eval $headlineProc $gt
+ }
+ set tn [lsort -command targetsCmp $groupsTmp($gt)]
+ foreach t $tn {
+ eval $targetProc $t
+ }
+ }
+
+ rename targetsCmp {}
+}
+
+if {[info exists utilExtension]} {
+ source $utilExtension
}
\ No newline at end of file