- set i 0
- set element junk
- htmlToken l [join [$zset getWAIS $no text]] {
- if {[string compare [string index $l 0] {<}]} {
- set data($element) $l
- continue
- }
- switch -exact $l {
- <ti> {
- set element title
- }
- <dm> {
- set element dateOfLastModification
- }
- <ci> {
- set element controlIdentifier
- }
- <lc> {
- set element lastChecked
- }
- <by> {
- set element bytes
- }
- <avli> {
- set element linkage
- }
- <cr> {
- incr i
- }
- <li> {
- set element "$i,linkage"
- }
- <cp> {
- set element "$i,title"
- }
- default {
- set element junk
- }
- }
- }
- if {![info exists data(title)] || ![info exists data(linkage)]} {
- html "<pre>" [join [$zset getWAIS $no text]] "\n</pre>\n"
- return
- }
- html {Title: } {<a href="} $data(linkage) {">} $data(title) "</a><br>\n"
- html {URL: } $data(linkage) "<br>\n"
- html {Score: } [$zset getWAIS $no score] "<br>\n"
- html {Lines: } [$zset getWAIS $no lines] "<br>\n"
- if {[info exists data(bytes)]} {
- html {Bytes: } $data(bytes) "<br>\n"
- }
- if {[info exists data(dateOfLastModification)]} {
- html {Last modified: } $data(dateOfLastModification) "<br>\n"
- }
- if {[info exists data(lastChecked)]} {
- html {Last checked: } $data(lastChecked) "<br>\n"
- }
- html {<a href="} $env(SCRIPT_NAME) / $sessionId {/sameas.egw/}
- html $setNo + $targetNo + 1 + $hist($setNo,maxPresent) +
- html [egw_enc [$zset getWAIS $no documentID]] {">}
- html {Similar WAIS record</a><br>}
- html "<ul>\n"
- for {set i 1} {[info exists data($i,linkage)]} {incr i} {
- html {<li><a href="} $data($i,linkage) {">}
- html $data($i,title) "</a><br>\n"
- html "URL: " $data($i,linkage)
- }
- html "</ul>\n"
-}
-
-proc display-full {zset no setNo targetNo} {
- set type [$zset type $no]
- if {$type == "SD"} {
- set err [lindex [$zset diag $no] 1]
- set add [lindex [$zset diag $no] 2]
- if {$add != {}} {
- set add " :${add}"
- }
- html "Error ${err}${add} <br>\n"
- return
- }
- if {$type != "DB"} {
- return
- }
- set rtype [$zset recordType $no]
- if {$rtype == "SUTRS"} {
- html "<pre>"
- html [join [$zset getSutrs $no]]
- html "</pre><br>\n"
- return
- }
- if {$rtype == "WAIS"} {
- display-full-wais $zset $no $setNo $targetNo
- return
- }
- if {[catch {set r [$zset getMarc $no line * * *]}]} {
- html "Unknown record type: $rtype <br>\n"
- return
- }