home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
csservicen.tcl
< prev
next >
Wrap
Text File
|
1997-11-05
|
4KB
|
142 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)csservicen.tcl /main/titanic/7
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)csservicen.tcl /main/titanic/7 5 Nov 1997 Copyright 1996 Cayenne Software Inc.
# Start user added include file section
require "csentrydia.tcl"
# End user added include file section
require "csnode.tcl"
Class CSServiceNode : {CSNode} {
method destructor
constructor
method changeEntry
method removeEntry
method shutdown
method doRemove
method doUpdateFromEntry
method doUpdate
attribute serverName
attribute serverId
attribute entryDialog
}
method CSServiceNode::destructor {this} {
# Start destructor user section
# End destructor user section
$this CSNode::destructor
}
constructor CSServiceNode {class this name entry} {
set this [CSNode::constructor $class $this $name]
$this serverName [lindex $entry 0]
$this serverId [lindex $entry 1]
$this label [$this serverName]
$this icon rep_service_16
$this activeIcon rep_service_16
$this hasChildren 0
$this canDelete 1
$this canChangeEntry 1
$this canShutdown 1
return $this
}
method CSServiceNode::changeEntry {this} {
if {[$this entryDialog] == ""} {
set name entrydlg-[$this serverName]
$this entryDialog [CSEntryDialog new [$this view].$name \
[$this view] \
[$this serverId] \
$this]
}
[$this entryDialog] popUp
}
method CSServiceNode::removeEntry {this} {
set dlg [YesNoWarningDialog new [$this view].removeentryconfirm \
-title "Confirm Server Definition Delete" \
-message "Are you sure you want to delete the definition of server\
'[$this serverName]'?" \
-yesPressed "$this doRemove" \
-helpPressed "[$this view] helpOnName deleteServerEntry"]
$dlg delCancelButton
$dlg popUp
}
method CSServiceNode::shutdown {this {confirm 1}} {
if $confirm {
set name [$this name]
$this confirmShutdown "All Servers Of '$name'" \
"Are you sure you want to shutdown all servers\
of implementation '$name'?" shutdownService
return
}
[[$this view] rep] shutdownDbServers [$this serverName] shutdownCount
if {$shutdownCount > 0} {
set brokers [[$this parent] parent].brokers
$brokers update 0
}
}
method CSServiceNode::doRemove {this} {
set view [$this view]
[$view rep] removeServerDefinition [$this serverId]
[$this parent] update 1
$view selectionChanged
}
method CSServiceNode::doUpdateFromEntry {this entry} {
set info [$this info]
ORB::splitImplemId [$this serverId] implemId implemVersion
$info addHeader "Server Definition"
$info addItem "Name" [$this serverName]
$info addItem "Id" ${implemId}.${implemVersion}
$info addItem "Policy" [lindex $entry 4]
$info addItem "Protocol" [lindex $entry 5]
if {[lindex $entry 6] != ""} {
$info addItem "Executable Path" [lindex $entry 6]
}
if {[lindex $entry 7] != ""} {
$info addItem "Command Line" [lindex $entry 7]
}
$info addItem "Host" [lindex $entry 8]
}
method CSServiceNode::doUpdate {this {rebuild 1}} {
$this CSNode::doUpdate $rebuild
if [[[$this view] rep] getServerById [$this serverId] serverDef] {
$this doUpdateFromEntry [list \
[$this serverName] \
[$this serverId] \
0 \
0 \
$serverDef(policy) \
$serverDef(protocol) \
$serverDef(executable) \
$serverDef(cmdline) \
$serverDef(host)]
} else {
[$this info] addHeader "ERROR: Definition with id [$this serverId]\
is not known at nameserver."
}
}
# Do not delete this line -- regeneration end marker