Modified to use egw_-commands.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 24 Jan 1996 08:27:23 +0000 (08:27 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 24 Jan 1996 08:27:23 +0000 (08:27 +0000)
www/history.egw
www/mquery.egw
www/msearch.egw
www/query.egw
www/search.egw
www/z39util.tcl

index a099c3b..f3d0bdf 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: history.egw,v 1.3 1996/01/12 10:03:16 adam Exp $
+# $Id: history.egw,v 1.4 1996/01/24 08:27:25 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -36,7 +36,7 @@
     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
         html $e {: } $env($e) {<br>} \n
     }
-    html "form: " [wform] " <br>\n"
+    html "form: " [egw_form] " <br>\n"
 }
 </body></html>
 
index c205519..4fc8f45 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: mquery.egw,v 1.9 1996/01/09 16:16:47 adam Exp $
+# $Id: mquery.egw,v 1.10 1996/01/24 08:27:25 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -25,7 +25,7 @@
 
     set phost {}
     set i 0
-    foreach t [lsort [wform target]] {
+    foreach t [lsort [egw_form target]] {
         set host [lindex $t 0]
         set base [lindex $t 1]
         if {$host != $phost} {
@@ -38,7 +38,7 @@
     }
     if {$i == 0} {
         html "<h2>No targets specified</h2></body></html>"
-        wabort 1
+        egw_abort 1
     }
     set hist($setNo,0,host) $i
 }
@@ -99,7 +99,7 @@
         html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database) 
         html "<br>\n"
     }
-    html "form: " [wform] " <br>\n"
+    html "form: " [egw_form] " <br>\n"
     html "target: " $host " <br>\n"
     html "setNo: " $setNo " <br>\n"
     html "nextSetNo: " $nextSetNo " <br>\n"
index 5c4f410..08f5ea6 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: msearch.egw,v 1.11 1996/01/09 16:16:48 adam Exp $
+# $Id: msearch.egw,v 1.12 1996/01/24 08:27:26 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -15,7 +15,7 @@
     html "</head><body>\n"
     set setNo [lindex $sessionParms 0]
 
-    if {[wform menu1] != ""} {
+    if {[egw_form menu1] != ""} {
         set hist($nextSetNo,0,host) $hist($setNo,0,host)
         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
             set hist($nextSetNo,$i,host) $hist($setNo,$i,host)
@@ -29,7 +29,7 @@
         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
             set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 3]
         }
-        set hist($setNo,maxPresent) [wform hits]
+        set hist($setNo,maxPresent) [egw_form hits]
         if {$hist($setNo,maxPresent) == ""} {
             set hist($setNo,maxPresent) 30
         }
@@ -91,7 +91,7 @@
     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
         html $e {: } $env($e) {<br>} \n
     }
-    html "form: " [wform] " <br>\n"
+    html "form: " [egw_form] " <br>\n"
     html "target: " $host " <br>\n"
     html "query: --" $hist($setNo,1,query) "-- <br>\n"
     html "database: " $hist($setNo,1,database) "<br>\n"
index a8db8ff..698c861 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: query.egw,v 1.28 1996/01/12 13:08:28 adam Exp $
+# $Id: query.egw,v 1.29 1996/01/24 08:27:28 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
@@ -44,7 +44,7 @@ proc ok-response {} {
         ir z39
     }
 
-    html "<h2>Search in " [lindex $targets($host) 0] "</h2>\n"
+    html "<h2>Search in " [lindex $targets($host) 0] "</h2><br>\n"
     z39 callback ok-response
     z39 failback fail-response
     if {$host != $oldHost} {
@@ -55,19 +55,19 @@ proc ok-response {} {
             displayError "Cannot connect to target ${host}" {}
             html "</body></html>\n"
             z39 disconnect
-            wabort
+            egw_abort
         } elseif {$sessionWait == 0} {
-            if {[catch {zwait sessionWait 35}]} {
+            if {[catch {egw_wait sessionWait 35}]} {
                 displayError "Cannot connect to target ${host}" {}
                 html "</body></html>\n"
                z39 disconnect
-                wabort
+                egw_abort
             }
             if {$sessionWait != 1} {
                 displayError "Cannot connect to target ${host}" {}
                 html "</body></html>\n"
                z39 disconnect
-                wabort
+                egw_abort
             }
         }
         set sessionWait 0
@@ -75,24 +75,24 @@ proc ok-response {} {
         if {[catch {z39 init}]} {
             displayError "Cannot initialize target ${host}" {}
             html "</body></html>\n"
-            wabort
+            egw_abort
         }
-        if {[catch {zwait sessionWait 60}]} {
+        if {[catch {egw_wait sessionWait 60}]} {
             displayError "Cannot initialize target ${host}" {}
             html "</body></html>\n"
-            wabort
+            egw_abort
        }       
         if {$sessionWait != "1"} {
             displayError "Cannot initialize target ${host}" {}
-            htmlr "</body></html>\n"
-            wabort
+            html "</body></html>\n"
+            egw_abort
         }
         if {![z39 initResult]} {
             displayError "Connection rejected by target ${host}" \
                  [z39 userInformationField]
             z39 disconnect
-            htmlr "</body></html>"
-            wabort
+            html "</body></html>\n"
+            egw_abort
         }
     }
     set databases [lindex $targets($host) 1]
@@ -218,7 +218,7 @@ proc ok-response {} {
     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
         html $e {: } $env($e) {<br>} \n
     }
-    html "form: " [wform] " <br>\n"
+    html "form: " [egw_form] " <br>\n"
     html "target: " $host " <br>\n"
     html "databases: " $databases " <br>\n"
     html "setNo: " $setNo " <br>\n"
index d6d8717..588f13a 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: search.egw,v 1.29 1996/01/12 13:39:22 adam Exp $
+# $Id: search.egw,v 1.30 1996/01/24 08:27:29 adam Exp $
 
 proc start-scan {scanNo cache dir initSet} {
     global sessionId
@@ -78,7 +78,7 @@ proc start-scan {scanNo cache dir initSet} {
 
     if {$hist($setNo,$scanNo,scanTerm) == ""} {
         button-new-query 0 $setNo
-        wabort
+        egw_abort
         return
     }
     if {$dir == "b"} {
@@ -149,10 +149,10 @@ proc start-scan {scanNo cache dir initSet} {
     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
         html $e {: } $env($e) {<br>} \n
     }
-    html "form: " [wform] " <br>\n"
+    html "form: " [egw_form] " <br>\n"
     html "target: " $host " <br>\n"
     html "databases: " $hist($setNo,database) " <br>\n"
-    html "selected: " [wform base] " <br>\n"
+    html "selected: " [egw_form base] " <br>\n"
     html "setNo: " $setNo " <br>\n"
     html "nextSetNo: " $nextSetNo " <br>\n"    
 }
@@ -205,7 +205,7 @@ proc buttons {setNo setMax startPos after} {
 
     set setNo [lindex $sessionParms 0]
 
-    if {[wform] != ""} {
+    if {[egw_form] != ""} {
         set hist($nextSetNo,idAuthentication) $hist($setNo,idAuthentication)
         set hist($nextSetNo,host) $hist($setNo,host)
 
@@ -217,37 +217,37 @@ proc buttons {setNo setMax startPos after} {
         }
         set hist($setNo,scan) 0
 
-        set hist($setNo,form,menu1) [wform menu1]
-        set hist($setNo,form,menu2) [wform menu2]
-        set hist($setNo,form,menu3) [wform menu3]
+        set hist($setNo,form,menu1) [egw_form menu1]
+        set hist($setNo,form,menu2) [egw_form menu2]
+        set hist($setNo,form,menu3) [egw_form menu3]
 
-        set hist($setNo,form,entry1) [wform entry1]
-        set hist($setNo,form,entry2) [wform entry2]
-        set hist($setNo,form,entry3) [wform entry3]
+        set hist($setNo,form,entry1) [egw_form entry1]
+        set hist($setNo,form,entry2) [egw_form entry2]
+        set hist($setNo,form,entry3) [egw_form entry3]
 
-        set hist($setNo,form,logic1) [wform logic1]
-        set hist($setNo,form,logic2) [wform logic2]
+        set hist($setNo,form,logic1) [egw_form logic1]
+        set hist($setNo,form,logic2) [egw_form logic2]
         set hist($setNo,form,logic3) {}
         
         set host $hist($setNo,host)
         set databases [lindex $targets($host) 1]
 
-        set b [wform base]
-       if {[wform baseall] != ""} {
+        set b [egw_form base]
+       if {[egw_form baseall] != ""} {
            set hist($setNo,database) $databases
         } elseif {$b == ""} {
             set hist($setNo,database) $databases
         } else {
             set hist($setNo,database) $b
         }
-        set hist($setNo,maxPresent) [wform hits]
+        set hist($setNo,maxPresent) [egw_form hits]
         if {$hist($setNo,maxPresent) == ""} {
             set hist($setNo,maxPresent) 30
         }
         set i [lindex $sessionParms 1]
         if {$i == ""} {
             for {set j 1} {$j <= 3} {incr j} {
-                if {[wform scan$j] != ""} {
+                if {[egw_form scan$j] != ""} {
                     set i $j
                     break
                 }
@@ -261,7 +261,7 @@ proc buttons {setNo setMax startPos after} {
             set hist($setNo,scanAttr) [lindex $termPlusAttr 1]
             start-scan $scanNo 0 {} {}
             html "</body></html>\n"
-            wabort
+            egw_abort
             return
         }
         set query [build-query $hist($setNo,host) 3]
@@ -270,7 +270,7 @@ proc buttons {setNo setMax startPos after} {
             displayError "Empty query" \
                 "You must specify at least one search word"
             html "</body></html>\n"
-            wabort
+            egw_abort
         }
         set hist($setNo,query) $query
     } else {
@@ -279,7 +279,7 @@ proc buttons {setNo setMax startPos after} {
             set hist($setNo,$scanNo,scanTerm) {}
             start-scan $scanNo 0 {} {}
             html "</body></html>\n"
-            wabort
+            egw_abort
         }
         if {![info exists hist($setNo,scan)]} return
         if {$hist($setNo,scan) > 0} {
@@ -290,7 +290,7 @@ proc buttons {setNo setMax startPos after} {
             }
             start-scan $scanNo 1 $dir $setNo
             html "</body></html>\n"
-            wabort
+            egw_abort
         }
     }
     set host $hist($setNo,host)
@@ -313,7 +313,7 @@ proc buttons {setNo setMax startPos after} {
         } else {
             html "<h3> No hits</h3>\n"
         }
-        wflush
+        egw_flush
         html "<ul>\n"
         display-rec 1 $setOffset display-brief 0
         incr setOffset
@@ -339,7 +339,7 @@ proc buttons {setNo setMax startPos after} {
         } else {
             html "<h3> No hits</h3>\n"
         }
-        wflush
+        egw_flush
         html "<ul>\n"
     }
     if {$setMax > 0} {
@@ -359,10 +359,10 @@ proc buttons {setNo setMax startPos after} {
     foreach n [array names env] {
         html "env($n) = " $env($n) " <br>\n"
     }
-    html "form: " [wform] " <br>\n"
+    html "form: " [egw_form] " <br>\n"
     html "target: " $host " <br>\n"
     html "databases: " $hist($setNo,database) " <br>\n"
-    html "selected: " [wform base] " <br>\n"
+    html "selected: " [egw_form base] " <br>\n"
     html "query: --" $hist($setNo,query) "-- <br>"
     html "setNo: " $setNo " <br>\n"
     html "nextSetNo: " $nextSetNo " <br>\n"
index 51d3e18..3eb4dff 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.22 1996/01/23 14:22:03 adam Exp $
+# $Id: z39util.tcl,v 1.23 1996/01/24 08:27:23 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -208,7 +208,7 @@ proc display-raw {zset no tno} {
             }
             html $data
         }
-        htmlr {<br>}
+        html "<br>\n"
     }
 }
 
@@ -432,9 +432,9 @@ proc display-rec {from to dfunc tno} {
 proc build-scan {t i} {
     global targets
 
-    set term [wform entry$i]
+    set term [egw_form entry$i]
     if {$term != ""} {
-        set field [join [wform menu$i]]
+        set field [join [egw_form menu$i]]
         set attr {Title}
         foreach x [lindex $targets($t) 2] {
             if {[lindex $x 0] == $field} {
@@ -452,9 +452,9 @@ proc build-query {t ilines} {
     set op {}
     set q {}
     for {set i 1} {$i <= $ilines} {incr i} {
-        set term [join [wform entry$i]]
+        set term [join [egw_form entry$i]]
         if {[string length $term] > 0} {
-            set field [join [wform menu$i]]
+            set field [join [egw_form menu$i]]
             foreach x [lindex $targets($t) 2] {
                 if {[lindex $x 0] == $field} {
                     set attr [lindex $x 1]
@@ -470,7 +470,7 @@ proc build-query {t ilines} {
             {}
                 { set q "${attr} ${term}" }
             }
-            set op [wform logic$i]
+            set op [egw_form logic$i]
         }
     }
     return $q
@@ -513,7 +513,7 @@ proc z39scan {setNo scanNo tno scanLines scanPos cache} {
             displayError "Cannot connect to target" $host
             return 0
         } elseif {$sessionWait == 0} {
-            if {[catch {zwait sessionWait 300}]} {
+            if {[catch {egw_wait sessionWait 300}]} {
                $zz disconnect
                 displayError "Cannot connect to target" $host
                 return 0
@@ -530,7 +530,7 @@ proc z39scan {setNo scanNo tno scanLines scanPos cache} {
            $zz disconnect
             return 0
         }
-        if {[catch {zwait sessionWait 60}]} {
+        if {[catch {egw_wait sessionWait 60}]} {
             displayError "Cannot initialize target" $host
            $zz disconnect
             return 0
@@ -563,8 +563,8 @@ proc z39scan {setNo scanNo tno scanLines scanPos cache} {
     set sessionWait 0
     $zs scan "${scanAttr} ${scanTerm}"
 
-    if {[catch {zwait sessionWait 60}]} {
-        wlog debug "timeout/cancel in scan"
+    if {[catch {egw_wait sessionWait 60}]} {
+        egw_log debug "timeout/cancel in scan"
         displayError "Timeout in scan" {}
         html "</body></html>\n"
         $zz disconnect
@@ -655,7 +655,7 @@ proc z39search {setNo piggy tno elements} {
             displayError "Cannot connect to target" $host
             return 0
         } elseif {$sessionWait == 0} {
-            if {[catch {zwait sessionWait 300}]} {
+            if {[catch {egw_wait sessionWait 300}]} {
                $zz disconnect
                 displayError "Cannot connect to target" $host
                 return 0
@@ -672,7 +672,7 @@ proc z39search {setNo piggy tno elements} {
            $zz disconnect
             return 0
         }
-        if {[catch {zwait sessionWait 60}]} {
+        if {[catch {egw_wait sessionWait 60}]} {
             displayError "Cannot initialize target" $host
            $zz disconnect
             return 0
@@ -704,7 +704,7 @@ proc z39search {setNo piggy tno elements} {
     $zz.$setNo mediumSetElementSetNames $elements
     $zz.$setNo recordElements $elements
 
-    wlog debug "database=$database"
+    egw_log debug "database=$database"
     eval $zz.$setNo databaseNames $database
 
     $zz.$setNo preferredRecordSyntax USMARC
@@ -722,8 +722,8 @@ proc z39search {setNo piggy tno elements} {
     set sessionWait 0
     $zz.$setNo search $query
 
-    if {[catch {zwait sessionWait 600}]} {
-        wlog debug "timeout/cancel in search"
+    if {[catch {egw_wait sessionWait 600}]} {
+        egw_log debug "timeout/cancel in search"
         displayError "Timeout in search" {}
         html "</body></html>\n"
         $zz disconnect
@@ -746,7 +746,7 @@ proc init-m-response {i} {
     global zstatus
     global zleft
 
-    wlog debug "init-m-response"
+    egw_log debug "init-m-response"
 
     set zstatus($i) 1
     incr zleft -1
@@ -756,7 +756,7 @@ proc connect-m-response {i} {
     global zstatus
     global zleft
 
-    wlog debug "connect-m-response"
+    egw_log debug "connect-m-response"
     z39$i callback [list init-m-response $i]
     if {[catch {z39$i init}]} {
         set zstatus($i) -1
@@ -768,7 +768,7 @@ proc fail-m-response {i} {
     global zstatus
     global zleft
     
-    wlog debug "fail-m-response"
+    egw_log debug "fail-m-response"
     set zstatus($i) -1
     incr zleft -1
 }
@@ -819,8 +819,8 @@ proc z39msearch {setNo piggy elements} {
         } 
     }
     while {$zleft > 0} {
-        wlog debug "Waiting for init response"
-        if {[catch {zwait zleft 10}]} {
+        egw_log debug "Waiting for init response"
+        if {[catch {egw_wait zleft 10}]} {
             break
         }
     }
@@ -855,7 +855,7 @@ proc z39msearch {setNo piggy elements} {
                 z39$i.$setNo mediumSetPresentNumber 0
             }
             set zstatus($i) 1
-            wlog debug "search " $hist($setNo,$i,query)
+            egw_log debug "search " $hist($setNo,$i,query)
             z39$i.$setNo search $hist($setNo,$i,query)
             incr zleft
         } else {
@@ -863,8 +863,8 @@ proc z39msearch {setNo piggy elements} {
         }
     }
     while {$zleft > 0} {
-        wlog debug "Waiting for search response"
-        if {[catch {zwait zleft 30}]} {
+        egw_log debug "Waiting for search response"
+        if {[catch {egw_wait zleft 30}]} {
             break
         }
     }
@@ -909,8 +909,8 @@ proc z39present {setNo tno setOffset setMax dfunc elements} {
         if {$got < $toGet} {
             set sessionWait 0
             $zz.$setNo present $setOffset $toGet
-            if {[catch {zwait sessionWait 300}]} {
-                wlog debug "timeout/cancel in present"
+            if {[catch {egw_wait sessionWait 300}]} {
+                egw_log debug "timeout/cancel in present"
                $zz disconnect
                 break
            }
@@ -928,7 +928,7 @@ proc z39present {setNo tno setOffset setMax dfunc elements} {
         display-rec $setOffset [expr $got + $setOffset - 1] $dfunc $tno
         set setOffset [expr $got + $setOffset]
         set toGet [expr 1 + $setMax - $setOffset]
-        wflush
+        egw_flush
     }
 }