5544a3c2080592314d58760e3b9b3188a629261d
[egate.git] / www / msearch.egw
1 <html>
2 {
3 # $Id: msearch.egw,v 1.21 1996/03/14 11:50:45 adam Exp $
4
5     if {[info commands saveState] == ""} {
6         source z39util.tcl
7         if {![info exists debug]} {
8             session-lost
9             egw_abort
10         }
11     }
12     global sessionWait
13     global nextSetNo
14     global setNo
15     global hist
16     global zstatus
17
18     html "<head><title> WWW/Z39.50 Gateway Search </title>\n"
19     html "</head><body>\n"
20
21     set setNo [lindex $sessionParms 0]
22
23     if {[llength [egw_form]] > 0} {
24         if {[string length [egw_form host]] > 0} {
25             set hist($setNo,0,host) [llength [egw_form host]]
26             set i 1
27             foreach t [egw_form host] {
28                 set hist($setNo,$i,host) $t
29                 set hist($setNo,$i,database) [splitDatabaseSpec $t]
30                 set hist($setNo,$i,idAuthentication) {}
31                 incr i
32             }
33         }
34         if {![info exists hist($setNo,0,host)]} {
35             displayError {No servers selected} {}
36             egw_abort
37         }
38         set hist($nextSetNo,0,host) $hist($setNo,0,host)
39         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
40             set hist($nextSetNo,$i,host) $hist($setNo,$i,host)
41             set hist($nextSetNo,$i,database) $hist($setNo,$i,database)
42             set hist($nextSetNo,$i,idAuthentication) \
43                 $hist($setNo,$i,idAuthentication) 
44         }
45         set setNo $nextSetNo
46         incr nextSetNo
47
48         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
49             set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 3]
50         }
51
52         set hist($setNo,scan) 0
53
54         set hist($setNo,form,menu1) [egw_form menu1]
55         set hist($setNo,form,menu2) [egw_form menu2]
56         set hist($setNo,form,menu3) [egw_form menu3]
57
58         set hist($setNo,form,entry1) [egw_form entry1]
59         set hist($setNo,form,entry2) [egw_form entry2]
60         set hist($setNo,form,entry3) [egw_form entry3]
61
62         set hist($setNo,form,logic1) [egw_form logic1]
63         set hist($setNo,form,logic2) [egw_form logic2]
64         set hist($setNo,form,logic3) {}
65         
66         set hist($setNo,maxPresent) [egw_form hits]
67         if {$hist($setNo,maxPresent) == ""} {
68             set hist($setNo,maxPresent) 20
69         }
70         set hist($setNo,format) [egw_form format]
71         if {![string length $hist($setNo,format)]} {
72             set hist($setNo,format) brief
73         }
74         set hist($setNo,sort) [egw_form sort]
75         if {![string length $hist($setNo,sort)]} {
76             set hist($setNo,sort) server
77         }
78     }
79
80     set useIcons 1
81     button-main
82     button-new-query $setNo
83     button-view-history
84     button-new-target
85
86     html "<br>\n"
87     z39msearch $setNo B 1 $hist($setNo,maxPresent) 1
88
89     display-result-set-m $setNo
90
91     set useIcons 0
92     button-main
93     button-new-query $setNo
94     button-view-history
95     button-new-target
96 }
97
98 {
99     if {!$debug} return
100     html "<hr>\n"
101     html "<h3>Debug information</h3>\n"
102     html "sessionId: $sessionId <br>\n"
103     html "sessionParms: $sessionParms <br>\n"
104     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
105         html $e {: } $env($e) {<br>} \n
106     }
107     html "form: " [egw_form] " <br>\n"
108     html "query: --" $hist($setNo,1,query) "-- <br>\n"
109     html "database: " $hist($setNo,1,database) "<br>\n"
110     html "sort: " $hist($setNo,sort) "<br>\n"
111     html "format: " $hist($setNo,format) "<br>\n"
112     html "setNo: " $setNo " <br>\n"
113     html "nextSetNo: " $nextSetNo " <br>\n"
114 }
115
116 </body>
117 </html>