3 <title> WWW/Z39.50 Gateway Query Form</title>
7 # $Id: query.egw,v 1.15 1995/11/13 15:41:42 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
39 set hist($setNo,idAuthentication) [lindex $targets($host) 3]
41 if {[catch {z39 failback fail-response}]} {
45 html "<h2> Search in " [lindex $targets($host) 0] "</h2>\n"
47 z39 callback ok-response
48 z39 failback fail-response
49 if {$host != $oldHost} {
50 catch {z39 disconnect}
53 if {[catch {z39 connect $host}]} {
54 html "Cannot connect to target ${host} <br>\n"
55 html "</body></html>\n"
57 } elseif {$sessionWait == 0} {
58 if {[catch {zwait sessionWait 30}]} {
59 html "Cannot connect to target ${host} <br>\n"
60 html "</body></html>\n"
64 if {$sessionWait != 1} {
65 html "Cannot connect to target ${host} <br>\n"
66 html "</body></html>\n"
72 # z39 idAuthentication $hist($setNo,idAuthentication)
73 if {[catch {z39 init}]} {
74 htmlr "Cannot initialize with target ${host} <br>"
75 htmlr "</body></html>"
78 if {[catch {zwait sessionWait 60}]} {
79 htmlr "Cannot initialize with target ${host} <br>"
80 htmlr "</body></html>"
83 if {$sessionWait != "1"} {
84 htmlr "Cannot initialize with target ${host} <br>"
85 htmlr "</body></html>"
89 set databases [lindex $targets($host) 1]
91 html {<form action="http:} $env(SCRIPT_NAME)
92 html / $sessionId {/search.egw/} $setNo {" method=post>} \n
93 set nodb [llength $databases]
96 html "The chosen target supports searching in "
97 html "several databases. <br>\n"
98 html "Choose the bases you want to search: <br>\n"
101 foreach d $databases {
102 html {<input type="checkbox" name="base" value="} $d
106 html {" checked> } $d \n
111 html {<input type="checkbox" name="base" value="}
112 html [concat $databases] {"> All <br>} \n
117 <h3>Input your search criteria: </h3> <br>
119 set fields [lindex $targets($host) 2]
120 for {set no 1} {$no < 4} {incr no} {
121 html {<select name="menu} $no {">} \n
123 html {<option> } [lindex $f 0] \n
126 html {<input type="text" name="entry} $no {" size=30>} \n
128 html {<select name="logic} $no {">} \n
129 html "<option> And\n"
131 html "<option> And not\n"
138 Alternatively you can enter your query in
139 <a href="http://www.dtv.dk/ccl.html"> CCL </a> here: <br>
140 <input type=text name="cclentry" size=52> <br>
142 <input type=submit value="Search"><input type=reset value="Reset">
143 <h3> Various technical parameters: </h3> <br>
144 Max hits: <input type="text" name="hits" value="20" size=3>
145 Records are shown in:
146 <select name="format">
148 <option> Medium format
149 <option> Short format
156 This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
157 Last modified 29. september 1995. <br>
158 <em> This and the following pages are under construction
159 and will continue to be so until the end of December 1995.</em>
163 html {<a href="http:} $env(SCRIPT_NAME)
164 html / $sessionId {/targets.egw"> New target </a>}
168 html "<h3>Debug information</h3>\n"
169 html "sessionId: $sessionId <br>\n"
170 html "sessionParms: $sessionParms <br>\n"
171 foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
172 html $e {: } $env($e) {<br>} \n
174 html "form: " [wform] " <br>\n"
175 html "target: " $host " <br>\n"
176 html "databases: " $databases " <br>\n"
177 html "setNo: " $setNo " <br>\n"
178 html "nextSetNo: " $nextSetNo " <br>\n"