3 # $Id: tdefine.egw,v 1.6 1996/03/14 11:50:49 adam Exp $
5 if {[info commands saveState] == ""} {
7 if {![info exists debug]} {
13 html {<head><title> WWW/Z39.50 Gateway Target Definition Response</title>}
21 html "<h2>Target definition response</h2><br>\n"
23 set name [lindex [egw_form name] 0]
24 set description [lindex [egw_form description] 0]
25 set host [lindex [egw_form host] 0]
26 set databases [lindex [egw_form databases] 0]
27 set authentication [egw_form authentication]
28 set fields [lindex [egw_form fields] 0]
29 set recordType [lindex [egw_form recordtype] 0]
32 if {[string length $name] == 0} {
33 html "You didn't specify a target name. A target name <em>must</em> "
34 html "be specified.<br>\n"
37 if {[string length $host] == 0} {
38 html "You didn't specify a target name. A host <em>must</em> "
39 html "be specified.<br>\n"
42 if {[string length $databases] == 0} {
43 html "You didn't specify any database(s). At least one database "
44 html "<em>must</em> be specified.<br>\n"
47 if {[string length $recordType] == 0} {
48 html "You didn't specify any record type. One record type "
49 html "<em>must</em> be specified.<br>\n"
53 catch {unset attrList}
56 set eqn [string first = $e]
58 lappend item {@attr} $e
60 if {[info exists item]} {
61 lappend attrList [list $fname $item]
65 if {[string length $fname] > 0} {
66 set fname "${fname} $e"
72 if {[info exists item]} {
73 lappend attrList [list $fname $item]
75 if {![info exists attrList]} {
76 html "You didn't specify proper search fields. At least one"
77 html " search fields must be present<br>\n"
80 if {![string compare recordType WAIS]} {
81 set attrList { {Free-text} {} }
83 set hostSpec [mergeHostSpec $host $databases]
86 set targets($hostSpec) [list \
94 html "Target successfully defined<br>\n"
107 html "\n<br>name=" $name "<br>\n"
108 html "description=" $description "<br>\n"
109 html "host=" $host "<br>\n"
110 html "databases=" $databases "<br>\n"
111 html "fields=" $fields "<br>\n"
112 html "attrList=$attrList<br>\n"