{ # $Id: tdefine.egw,v 1.6 1996/03/14 11:50:49 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl if {![info exists debug]} { session-lost egw_abort } } html { WWW/Z39.50 Gateway Target Definition Response} html {} set useIcons 1 button-main button-define-target button-new-target html "

Target definition response


\n" set name [lindex [egw_form name] 0] set description [lindex [egw_form description] 0] set host [lindex [egw_form host] 0] set databases [lindex [egw_form databases] 0] set authentication [egw_form authentication] set fields [lindex [egw_form fields] 0] set recordType [lindex [egw_form recordtype] 0] set ok 1 if {[string length $name] == 0} { html "You didn't specify a target name. A target name must " html "be specified.
\n" set ok 0 } if {[string length $host] == 0} { html "You didn't specify a target name. A host must " html "be specified.
\n" set ok 0 } if {[string length $databases] == 0} { html "You didn't specify any database(s). At least one database " html "must be specified.
\n" set ok 0 } if {[string length $recordType] == 0} { html "You didn't specify any record type. One record type " html "must be specified.
\n" set ok 0 } catch {unset item} catch {unset attrList} set fname {} foreach e $fields { set eqn [string first = $e] if {$eqn > 0} { lappend item {@attr} $e } else { if {[info exists item]} { lappend attrList [list $fname $item] set fname {} unset item } if {[string length $fname] > 0} { set fname "${fname} $e" } else { set fname $e } } } if {[info exists item]} { lappend attrList [list $fname $item] } if {![info exists attrList]} { html "You didn't specify proper search fields. At least one" html " search fields must be present
\n" set ok 0 } if {![string compare recordType WAIS]} { set attrList { {Free-text} {} } } set hostSpec [mergeHostSpec $host $databases] if {$ok} { global targets set targets($hostSpec) [list \ [join $name] \ $recordType \ $attrList \ $authentication \ $description \ 1 \ user ] html "Target successfully defined
\n" } html "

\n" set useIcons 0 button-main button-define-target button-new-target } { global debug if {!$debug} return html "\n
name=" $name "
\n" html "description=" $description "
\n" html "host=" $host "
\n" html "databases=" $databases "
\n" html "fields=" $fields "
\n" html "attrList=$attrList
\n" }