home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
drsobject.tcl
< prev
next >
Wrap
Text File
|
1997-08-29
|
4KB
|
124 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)drsobject.tcl /main/titanic/4
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)drsobject.tcl /main/titanic/4 29 Aug 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "reqobject.tcl"
Class DrsObject : {ReqObject} {
method destructor
constructor
method levelName
method levelType
method newDxlCommand
method getDxlCommand
method sendDxlCommand
method removeDoorsRefFromCorp
method addDoorsRefToCorp
method filter
attribute level
attribute doorsModule
attribute dxlCommand
attribute corporate
}
method DrsObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this ReqObject::destructor
}
constructor DrsObject {class this level} {
set this [ReqObject::constructor $class $this]
$this level $level
$this corporate [[ClientContext::global] currentCorporate]
return $this
}
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"
m4_var saveStatus M4_doors_edit_shared 0
}
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"
m4_var saveStatus M4_doors_edit_displayed 0
}
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 \
${DrsDriver::FORMALMODULE}_${projectName}_ids ]
set removeIndex [lsearch $projectChilds $doorsId ]
set projectChilds [lreplace $projectChilds $removeIndex $removeIndex]
[$this corporate] setProperty \
${DrsDriver::FORMALMODULE}_${projectName}_ids $projectChilds
}
method DrsObject::addDoorsRefToCorp {this projectName doorsId} {
set projectChilds [[$this corporate] getPropertyValue \
${DrsDriver::FORMALMODULE}_${projectName}_ids ]
set projectChilds "$doorsId $projectChilds"
[$this corporate] setProperty \
${DrsDriver::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