3 <title> WWW/Z39.50 Gateway Query Form</title>
7 # $Id: query.egw,v 1.10 1995/11/08 12:42:17 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} {
59 if {$sessionWait != 1} {
60 html "Cannot connect to target ${host} <br>\n"
61 html "</body></html>\n"
66 z39 idAuthentication $hist($setNo,idAuthentication)
67 if {[catch {z39 init}]} {
68 htmlr "Cannot initialize with target ${host} <br>"
69 htmlr "</body></html>"
73 if {$sessionWait != "1"} {
74 htmlr "Cannot initialize with target ${host} <br>"
75 htmlr "</body></html>"
79 set databases [lindex $targets($host) 1]
81 html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
82 html / $sessionId {/search.egw/} $setNo {" method=post>} \n
83 set nodb [llength $databases]
86 html "The chosen target supports searching in "
87 html "several databases. <br>\n"
88 html "Choose the bases you want to search: <br>\n"
91 foreach d $databases {
92 html {<input type="checkbox" name="base" value="} $d
96 html {" checked> } $d \n
101 html {<input type="checkbox" name="base" value="}
102 html [concat $databases] {"> All <br>} \n
107 <h3>Input your search criteria: </h3> <br>
109 set fields [lindex $targets($host) 2]
110 for {set no 1} {$no < 4} {incr no} {
111 html {<select name="menu} $no {">} \n
113 html {<option> } [lindex $f 0] \n
116 html {<input type="text" name="entry} $no {" size=30>} \n
118 html {<select name="logic} $no {">} \n
119 html "<option> And\n"
121 html "<option> And not\n"
128 Alternatively you can enter your query in
129 <a href="ccl.html"> CCL </a> here: <br>
130 <input type=text name="cclentry" size=52> <br>
132 <h3> Various technical parameters: </h3> <br>
133 Max hits: <input type="text" name="hits" value="10" size=3>
134 Records are shown in:
135 <select name="format">
137 <option> Medium format
138 <option> Short format
143 <input type="submit" value="Send Query">
146 This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
147 Last modified 29. september 1995. <br>
148 <em> This and the following pages are under construction
149 and will continue to be so until the end of December 1995.</em>
153 html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
154 html / $sessionId {/targets.egw"> New target </a>}
158 html "<h3>Debug information</h3>\n"
159 html "sessionId: $sessionId <br>\n"
160 html "sessionParms: $sessionParms <br>\n"
161 foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
162 html $e {: } $env($e) {<br>} \n
164 html "form: " [wform] " <br>\n"
165 html "target: " $host " <br>\n"
166 html "databases: " $databases " <br>\n"
167 html "setNo: " $setNo " <br>\n"
168 html "nextSetNo: " $nextSetNo " <br>\n"