X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=www%2Fz39util.tcl;h=d78e5d62932d81457e37cf7fb1c18f287d67cdfb;hb=309c35b155c617707995d52197f64f7e17d143a2;hp=aa5378202b21b4ded38f4edb51340988c5e66e0b;hpb=2db244d8b36c27ed7af8591fe334869fef60c57b;p=egate.git diff --git a/www/z39util.tcl b/www/z39util.tcl index aa53782..d78e5d6 100644 --- a/www/z39util.tcl +++ b/www/z39util.tcl @@ -1,5 +1,5 @@ # -# $Id: z39util.tcl,v 1.34 1996/02/29 15:41:40 adam Exp $ +# $Id: z39util.tcl,v 1.35 1996/03/05 18:50:26 adam Exp $ # proc saveState {} { uplevel #0 { @@ -305,79 +305,64 @@ proc dl-marc-field-rec {zset no tag lead start stop startid sep} { } proc display-full-wais {zset no} { - set i0 0 - set i1 0 - set refNo 0 - set body [$zset getWAIS $no text] - - while {[string length [set c [string index $body $i1]]]} { - if {[string compare $c \n]} { - incr i1 - continue - } - set l [string trim [string range $body $i0 $i1]] - egw_log debug "line=$l" - incr i1 - set i0 $i1 + set i 0 + set element junk + htmlToken l [join [$zset getWAIS $no text]] { if {[string compare [string index $l 0] {<}]} { - egw_log "xxxxxxxxxxxxxxxx" + set data($element) $l continue } - if {[set mark [string first > $l ]] < 1} { - egw_log "yyyyyyyyyyyyyyyy" - continue - } - set data [string trim [string range $l [expr $mark +1] end]] - incr mark -1 - set sw [string range $l 1 $mark] - egw_log debug "sw=$sw" - egw_log debug "data=$data" - switch -exact $sw { - ti { - set title $data + switch -exact $l { + { + set element title + } + { + set element dateOfLastModification } - dm { - set dateOfLastModification $data + { + set element controlIdentifier } - ci { - set controlIdentifier $data + { + set element lastChecked } - lc { - set lastChecked $data + { + set element bytes } - by { - set bytes $data + { + set element linkage } - avli { - set linkage $data + { + incr i } - cr { - incr refNo +
  • { + set element "$i,linkage" } - li { - set crossRef($refNo,linkage) $data + { + set element "$i,title" } - cp { - set crossRef($refNo,title) $data + default { + set element junk } } } - html {Title: } {} $title "
    \n" - html {URL: } $linkage "
    \n" - if {[info exists bytes]} { - html {Bytes: } $bytes "
    \n" + html {Title: } {} $data(title) "
    \n" + html {URL: } $data(linkage) "
    \n" + html {Score: } [$zset getWAIS $no score] "
    \n" + html {Lines: } [$zset getWAIS $no lines] "
    \n" + if {[info exists data(bytes)]} { + html {Bytes: } $data(bytes) "
    \n" } - if {[info exists dateOfLastModification]} { - html {Last modified: } $dateOfLastModification "
    \n" + if {[info exists data(dateOfLastModification)]} { + html {Last modified: } $data(dateOfLastModification) "
    \n" } - if {[info exists lastChecked]} { - html {Last checked: } $lastChecked "
    \n" + if {[info exists data(lastChecked)]} { + html {Last checked: } $data(lastChecked) "
    \n" } html "\n" } @@ -841,7 +826,12 @@ proc z39search {setNo piggy tno elements} { } set sessionWait 0 egw_log debug "search: $query" - $zz.$setNo search $query + if {[catch {$zz.$setNo search $query}]} { + displayError "Search fail" "Connection closed" + html "\n" + $zz disconnect + return 0 + } if {[catch {egw_wait sessionWait 60}]} { egw_log debug "timeout/cancel in search"