home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
drsprojobj.tcl
< prev
next >
Wrap
Text File
|
1997-09-12
|
4KB
|
113 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)drsprojobj.tcl /main/titanic/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)drsprojobj.tcl /main/titanic/5 12 Sep 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require reqdriver.tcl
# End user added include file section
require "drstreeobj.tcl"
Class DrsProjObject : {DrsTreeObject} {
method destructor
constructor
method install
method synObjects
method deleteObject
method childLevelVersions
attribute parentLevel
}
method DrsProjObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this DrsTreeObject::destructor
}
constructor DrsProjObject {class this proj corp} {
set this [DrsTreeObject::constructor $class $this $proj]
$this parentLevel $corp
$this childLevels [$proj phases]
return $this
}
method DrsProjObject::install {this} {
set level [$this level]
set doorsObjId [$level getPropertyValue ${DrsDriver::FORMALMODULE}]
set projectName [$this levelName]
if [llength $doorsObjId] {
set intProj [$level getPropertyValue ${DrsDriver::FORMALMODULE}_Project]
if {$intProj == $projectName} {
return "1"
}
}
set dxlCommand [$this newDxlCommand "edit"]
if [llength $doorsObjId] {
set doorsObject [$dxlCommand doorsObjectFind $doorsObjId]
} else {
set doorsObject [$dxlCommand doorsObjectCreateTopObject $projectName]
$dxlCommand doorsObjectAttrSetValue $doorsObject OTType [$this levelType]
}
$dxlCommand doorsObjectAttrSave $doorsObject "Absolute Number"
$dxlCommand doorsObjectAttrSetValue $doorsObject \
"Object Heading" $projectName
set result [$this sendDxlCommand]
if {$result > 0} {
$level setProperty ${DrsDriver::FORMALMODULE} $result
$level setProperty ${DrsDriver::FORMALMODULE}_Project $projectName
} else {
wmtkinfo "Operation cancelled"
}
return $result
}
method DrsProjObject::synObjects {this} {
return "1"
}
method DrsProjObject::deleteObject {this} {
set doorsObjId [[$this level] getPropertyValue ${DrsDriver::FORMALMODULE}]
if ![llength $doorsObjId] {
wmtkinfo "Unable to remove [$this levelType] [$this levelName] \
from DOORS because it is not installed"
return "1"
}
set dxlCommand [$this newDxlCommand "edit"]
set searchObject [$dxlCommand doorsObjectFind $doorsObjId]
$dxlCommand doorsObjectDelete $searchObject
$dxlCommand doorsResultSave "1"
set dxlResult [$this sendDxlCommand]
if {$dxlResult <= 0 } {
wmtkinfo "Operation on project cancelled, result: $dxlResult"
return
}
set thisLevel [$this level]
$thisLevel removeProperty ${DrsDriver::FORMALMODULE}
set parentLevel [$this parentLevel]
set projectName [$this levelName]
set parentChilds [$parentLevel getPropertyValue ${DrsDriver::FORMALMODULE}_SelectedItems]
set removeIndex [lsearch $parentChilds $projectName]
set parentChilds [lreplace $parentChilds $removeIndex $removeIndex]
if [llength $parentChilds] {
$parentLevel setProperty ${DrsDriver::FORMALMODULE}_SelectedItems $parentChilds
} else {
$parentLevel removeProperty ${DrsDriver::FORMALMODULE}_SelectedItems
}
}
method DrsProjObject::childLevelVersions {this} {
set versOfCurrLevel [$level phaseVersions]
set thisPhaseVers [ReqDriver::searchOnVersion $versOfCurrLevel [$this versionId]]
return [$thisPhaseVers systemVersions]
}
# Do not delete this line -- regeneration end marker