First search request/response that works.
[egate.git] / www / query.egw
1 <html>
2 {
3 # $Id: query.egw,v 1.3 1995/10/27 17:30:15 adam Exp $
4 proc fail-response {} {
5     global sessionWait
6     htmlr {Init fail<br>}
7     set sessionWait 0
8 }
9
10 proc init-response {} {
11     global sessionWait
12     htmlr {Init ok <br>}
13     htmlr {</body>}
14     htmlr {</html>}
15     set sessionWait 0
16 }
17
18     set t $sessionParms
19     set databases [lindex $targets($t) 1]
20     set sessionWait 1
21     ir z39
22     z39 failback fail-response
23     z39 connect $t
24     z39 callback init-response
25     z39 init
26 }
27 <head>
28 <title> WWW/Z39.50 Gateway Query Form</title>
29 </head>
30 <body>
31 <h2> Search in databases </h2>
32 <h1> <blink> Not Functional Yet </blink> </h1>
33 {
34     html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
35     htmlr / $sessionId {/search.egw" method=post>}
36     set nodb [llength $databases]
37     if {$nodb > 1} {
38         if {$nodb > 2} {
39             htmlr {The chosen target supports searching in several databases. <br>}
40             htmlr {Choose the bases you want to search: <br>}
41         }
42         set i 0
43         foreach d $databases {
44             html {<input type="checkbox" name="base" value="} $d 
45             if {[incr i] > 1} {
46                 htmlr {"> } $d
47             } else {
48                 htmlr {" checked> } $d
49             }
50         }
51         htmlr {<br>}
52         if {$nodb > 2} {
53             html {<input type="checkbox" name="base" value="} 
54             htmlr [concat $databases] {"> All <br>}
55         }
56     }
57 }
58 <hr>
59 <strong>Input your search criteria: </strong> <br>
60 {
61     set fields [lindex $targets($t) 2]
62     for {set no 1} {$no < 4} {incr no} {
63         htmlr {<select name="menu} $no {">}
64         foreach f $fields {
65             htmlr {<option> } [lindex $f 0]
66         }
67         htmlr </select>
68         htmlr {<input type="text" name="entry} $no {" size=30>}
69         if {$no < 3} {
70             htmlr {<select name="logic} $no {">}
71             htmlr {<option> And}
72             htmlr {<option> Or}
73             htmlr {<option> And not}
74             htmlr {</select>}
75         }
76         htmlr <br>
77     }
78 }
79 <hr>
80 <p>
81 Alternatively you can enter your query in <a href="ccl.html"> CCL </a> here: <br>
82 <input type=text name="cclentry" size=60> <br>
83 <hr>
84 <strong> Various technical parameters: </strong> <br>
85 Max hits: <input type="text" name="hits" value="50" size=3>
86 Records are shown in:
87 <select name="format">
88 <option> Long format
89 <option> Medium format
90 <option> Short format
91 <option> Raw MARC
92 </select>
93 <br>
94 <p>
95 <input type="submit" value="Send Query">
96 </form>
97 <hr>
98 This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
99 Last modified 29. september 1995. <br>
100 <em> This and the following pages are under construction and will continue to be so
101 until the end of December 1995.</em>
102 <hr>
103 sessionId: {html $sessionId} <br>
104 sessionParms: {html $sessionParms} <br>
105 {
106     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
107         htmlr $e {: } $env($e) {<br>}
108     }
109 }
110 form: {html [form]} <br>
111 target: {html $t} <br>
112 databases: {html $databases} <br>