home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
drsobject.tcl
< prev
next >
Wrap
Text File
|
1997-02-13
|
4KB
|
120 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)drsobject.tcl /main/hindenburg/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)drsobject.tcl /main/hindenburg/5 13 Feb 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
#Class DrsObject : {GCObject} {
# constructor
# method destructor
# method levelName
# method levelType
# method newDxlCommand
# method getDxlCommand
# method sendDxlCommand
# method removeDoorsRefFromCorp
# method addDoorsRefToCorp
# method filter
# attribute level
# attribute doorsModule
# attribute corporate
# attribute dxlCommand
#}
constructor DrsObject {class this level} {
set this [GCObject::constructor $class $this]
$this level $level
$this corporate [[ClientContext::global] currentCorporate]
return $this
}
method DrsObject::destructor {this} {
# Start destructor user section
# End destructor user section
}
method DrsObject::levelName {this} {
return [[$this level] name]
}
method DrsObject::levelType {this} {
return [[$this level] ORB_class]
}
method DrsObject::newDxlCommand {this {editType "edit"} {displayed "false"}} {
set m4_shared [m4_var get M4_doors_edit_shared]
if ![llength $m4_shared] {
m4_var set M4_doors_edit_shared "false"
}
if {$editType == "edit" && $m4_shared == "true"} {
set editType "share"
}
set m4_disp [m4_var get M4_doors_edit_displayed]
if ![llength $m4_disp] {
m4_var set M4_doors_edit_displayed "true"
}
if {$m4_disp == "true"} {
set displayed "true"
}
set dxlCommand [DrsDxlCommand new]
$this dxlCommand $dxlCommand
$dxlCommand doorsInitialize
set formalModName [m4_var get M4_doors_formal_module]
set doorsModule [$dxlCommand doorsModuleEdit $formalModName $editType $displayed]
$this doorsModule $doorsModule
return $dxlCommand
}
method DrsObject::getDxlCommand {this {editType "read"}} {
# only used by filter operation, so read is enough
set dxlCommand [$this dxlCommand]
if ![llength [$this dxlCommand]] {
$this newDxlCommand $editType "true"
}
return [$this dxlCommand]
}
method DrsObject::sendDxlCommand {this} {
set dxlCommand [$this dxlCommand]
set doorsModule [$this doorsModule]
return [$dxlCommand execute $doorsModule ]
}
method DrsObject::removeDoorsRefFromCorp {this projectName doorsId} {
set projectChilds [[$this corporate] getPropertyValue \
${FORMALMODULE}_${projectName}_ids ]
set removeIndex [lsearch $projectChilds $doorsId ]
set projectChilds [lreplace $projectChilds $removeIndex $removeIndex]
[$this corporate] setProperty \
${FORMALMODULE}_${projectName}_ids $projectChilds
}
method DrsObject::addDoorsRefToCorp {this projectName doorsId} {
set projectChilds [[$this corporate] getPropertyValue \
${FORMALMODULE}_${projectName}_ids ]
set projectChilds "$doorsId $projectChilds"
[$this corporate] setProperty \
${FORMALMODULE}_${projectName}_ids $projectChilds
}
method DrsObject::filter {this majorOper minorOper} {
set dxlCommand [$this getDxlCommand]
if {$minorOper == "All"} {
$dxlCommand doorsObject$majorOper "" $minorOper
return
}
}
# Do not delete this line -- regeneration end marker