proc connect {server database} {
set serverName [$server getCurrentValue]
if {$serverName != "http://"} {
set buffer [ GuidoExecServer inSiteGetDatabases [subst {server = $serverName }] ]
set status [GuidoGetParamBufferValue $buffer status]
$database removeAllItems
if {$status >= 0} {
$database setNullAllowed false
$database setInputAllowed true
set databaseSize [ GuidoGetParamBufferValue $buffer "databaseCount" ]
for {set i 0} {$i < $databaseSize} {incr i} {
set next "databaseName($i)"
set nextName [ GuidoGetParamBufferValue $buffer $next ]
lappend alt_values "$nextName"
set next "databaseKey($i)"
set nextKey [ GuidoGetParamBufferValue $buffer $next ]
lappend values "$nextKey"
}
eval [concat {$database} {setValues} $values ]
eval [concat {$database} {setAlternativeValues} $alt_values ]
set currentDatabaseName [ GuidoGetParamBufferValue $buffer currentDatabaseName ]
if {$currentDatabaseName != ""} {
$database setCurrentValue $currentDatabaseName
}
$database setExclusive true
} else {
$database setNullAllowed true
$database setCurrentValue ""
$database setInputAllowed false
}
} else {
$database setNullAllowed true
$database setCurrentValue ""
$database setInputAllowed false
}
}
GuidoForm frm00101 {
-default_buttons
-label "Connect to InSite"
-layout BoxLayout X_AXIS
-tip INSITE_EXPORT_FORM_TIP
GuidoPanel panel {
-layout CentreLineLayout
GuidoFiller f1 {
-height 0.1
}
GuidoFiller f2 {
-height 0.1
}
GuidoField server {
-display_length 22.3
-label "Server"
-max_length 255
-tip INSITE_EXPORT_SERVER_TIP
-default "http://"
-null false
}
GuidoComboBox database {
-display_length 20
-label "Database"
-max_length 255
-tip INSITE_EXPORT_DATABASE_TIP
-null false
-exclusive false
-value_in "Retrieving databases from InSite..."
-default "Retrieving databases from InSite..."
-input false
}
}
GuidoPanel button {
GuidoButton connect_button {
-width 8
-height 1
-caption Connect
-action valueChanged {[connect $server $database]}
}
}
-action initial {[connect $server $database]}
}
