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