3 <title> WWW/Z39.50 Gateway Query Form</title>
7 # $Id: query.egw,v 1.9 1995/11/06 17:44:20 adam Exp $
9 if {[info commands saveState] == ""} {
13 proc fail-response {} {
27 set host [lindex $sessionParms 0]
29 if {[info exists setNo]} {
30 set oldHost $hist($setNo,host)
34 if {[catch {set setNo $nextSetNo}]} {
38 set hist($setNo,host) $host
40 if {[catch {z39 failback fail-response}]} {
43 z39 callback ok-response
44 z39 failback fail-response
45 if {$host != $oldHost} {
46 catch {z39 disconnect}
48 html "Connecting to target " $host " <br>\n"
50 if {[catch {z39 connect $host}]} {
51 html "Cannot connect to target ${host} <br>\n"
52 html "</body></html>\n"
54 } elseif {$sessionWait == 0} {
56 if {$sessionWait != 1} {
57 html "Cannot connect to target ${host} <br>\n"
58 html "</body></html>\n"
63 if {[catch {z39 init}]} {
64 htmlr "Cannot initialize with target ${host} <br>"
65 htmlr "</body></html>"
69 if {$sessionWait != "1"} {
70 htmlr "Cannot initialize with target ${host} <br>"
71 htmlr "</body></html>"
75 set databases [lindex $targets($host) 1]
77 html "<h2> Search in databases </h2>\n"
78 html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
79 html / $sessionId {/search.egw/} $setNo {" method=post>} \n
80 set nodb [llength $databases]
83 html "The chosen target supports searching in "
84 html "several databases. <br>\n"
85 html "Choose the bases you want to search: <br>\n"
88 foreach d $databases {
89 html {<input type="checkbox" name="base" value="} $d
93 html {" checked> } $d \n
98 html {<input type="checkbox" name="base" value="}
99 html [concat $databases] {"> All <br>} \n
104 <h3>Input your search criteria: </h3> <br>
106 set fields [lindex $targets($host) 2]
107 for {set no 1} {$no < 4} {incr no} {
108 html {<select name="menu} $no {">} \n
110 html {<option> } [lindex $f 0] \n
113 html {<input type="text" name="entry} $no {" size=30>} \n
115 html {<select name="logic} $no {">} \n
116 html "<option> And\n"
118 html "<option> And not\n"
125 Alternatively you can enter your query in
126 <a href="ccl.html"> CCL </a> here: <br>
127 <input type=text name="cclentry" size=52> <br>
129 <h3> Various technical parameters: </h3> <br>
130 Max hits: <input type="text" name="hits" value="10" size=3>
131 Records are shown in:
132 <select name="format">
134 <option> Medium format
135 <option> Short format
140 <input type="submit" value="Send Query">
143 This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
144 Last modified 29. september 1995. <br>
145 <em> This and the following pages are under construction
146 and will continue to be so until the end of December 1995.</em>
150 html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
151 html / $sessionId {/targets.egw"> New target </a>}
155 html "<h3>Debug information</h3>\n"
156 html "sessionId: $sessionId <br>\n"
157 html "sessionParms: $sessionParms <br>\n"
158 foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
159 html $e {: } $env($e) {<br>} \n
161 html "form: " [wform] " <br>\n"
162 html "target: " $host " <br>\n"
163 html "databases: " $databases " <br>\n"
164 html "setNo: " $setNo " <br>\n"
165 html "nextSetNo: " $nextSetNo " <br>\n"