home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
reqdriver.tcl
< prev
next >
Wrap
Text File
|
1997-08-29
|
9KB
|
284 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)reqdriver.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)reqdriver.tcl /main/titanic/2 29 Aug 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class ReqDriver : {GCObject} {
constructor
method destructor
method init
method applyToLevel
method applyRecursive
method elementSet
method addElement
method removeElement
attribute corporate
attribute project
attribute configV
attribute phaseV
attribute systemV
attribute fileV
attribute integrationType
attribute prefix
attribute _elementSet
}
constructor ReqDriver {class this} {
set this [GCObject::constructor $class $this]
$this _elementSet [List new]
# Start constructor user section
source [m4_path_name tcl platform.tcl]
set cc [ClientContext::global]
$this corporate [$cc currentCorporate]
$this project [$cc currentProject]
$this configV [$cc currentConfig]
$this phaseV [$cc currentPhase]
$this systemV [$cc currentSystem]
$this fileV [$cc currentFile]
# End constructor user section
return $this
}
method ReqDriver::destructor {this} {
# Start destructor user section
# End destructor user section
}
method ReqDriver::init {this intType prefix} {
$this integrationType $intType
$this prefix $prefix
set intType [$this integrationType]
[$this prefix]Driver::getProjectName
set doorsSections [m4_var get M4_${intType}_section_mapping]
if ![llength $doorsSections] {
m4_var set M4_${intType}_section_mapping {\
etd "Sequence Diagram" \
ucd "Use Case Diagram" \
std "State Diagrams" \
cad "Class Diagram"\
dfd "Data Flow Diagram"\
ccd "Class Communication Diagram"\
cod "Class Object Diagram"\
mgd "Message Generalization Diagram"\
c++ "C++-Source File"\
h++ "C++-Header File"\
UseCase "Use Case"\
lex++ "Lex File Section"\
}
m4_var saveStatus M4_${intType}_section_mapping 0
}
set intProp [m4_var get M4_${intType}_integrated_properties]
if ![llength $intProp] {
m4_var set M4_${intType}_integrated_properties freeText
m4_var saveStatus M4_${intType}_integrated_properties 0
}
set objText [m4_var get M4_${intType}_objecttext_property]
if ![llength $objText] {
m4_var set M4_${intType}_objecttext_property freeText
m4_var saveStatus M4_${intType}_objecttext_property 0
}
}
proc ReqDriver::getVersion {levelV} {
set versionNumber [$levelV versionNumber]
set origConf [$levelV [$levelV ORB_class]::config]
set origConfName [$origConf name]
return "$origConfName.$versionNumber"
}
proc ReqDriver::getSMTypeName {semType} {
set semTypeName [$semType name]
set filteredName $semTypeName
if {[llength $semTypeName] > 1} {
set filteredName [lindex $semTypeName 1]
}
if {[llength $semTypeName] > 2} {
set filteredName [lindex $semTypeName 2]
}
return $filteredName
}
method ReqDriver::applyToLevel {this objTeamObjs operation dxlCommandRef {arg1 ""} {arg2 ""}} {
upvar $dxlCommandRef dxlCommand
set orgOperation $operation
set operation install
set corporate [$this corporate]
set project [$this project]
set configV [$this configV]
set phaseV [$this phaseV]
set systemV [$this systemV]
set fileV [$this fileV]
$this applyToMultiple $project $corporate $operation dxlCommand $arg1 $arg2
set currentLevel $phaseV
set parentLevel $configV
$this applyToMultiple $phaseV $configV $operation dxlCommand $arg1 $arg2
if ![$systemV isNil] {
set currentLevel $systemV
set parentLevel $phaseV
$this applyToMultiple $systemV $phaseV $operation dxlCommand $arg1 $arg2
}
if ![$fileV isNil] {
set currentLevel $fileV
set parentLevel $systemV
$this applyToMultiple $fileV $systemV $operation dxlCommand $arg1 $arg2
}
if [$fileV isNil] {
$this applyToMultiple $objTeamObjs $currentLevel $operation dxlCommand $arg1 $arg2
$this applyToMultiple $currentLevel $parentLevel $orgOperation dxlCommand $arg1 $arg2
}
}
method ReqDriver::applyRecursive {this objTeamObjs parentOTObject operation dxlCommandRef {arg1 ""} {arg2 ""} {objectsDone ""}} {
upvar $dxlCommandRef dxlCommand
if ![llength $objTeamObjs] {
return
}
if {[llength $objTeamObjs] > 1} {
foreach objTeamObj $objTeamObjs {
$this applyRecursive $objTeamObj $parentOTObject $operation dxlCommand $arg1 $arg2 $objectsDone
}
return
}
set objTeamObj $objTeamObjs
if {[lsearch "install filter installRefs" $operation] != -1 && [lsearch $objectsDone $objTeamObj] == -1} {
$this applyToMultiple $objTeamObj $parentOTObject $operation dxlCommand $arg1 $arg2
lappend objectsDone $objTeamObj
}
set toDo ""
if [$objTeamObj isA Project] {
set toDo [$objTeamObj configVersions]
}
if [$objTeamObj isA Config] {
set toDo [$objTeamObj phaseVersions]
}
if [$objTeamObj isA PhaseVersion] {
set toDo [$objTeamObj systemVersions]
}
if [$objTeamObj isA SystemVersion] {
set toDo [$objTeamObj localFileVersions]
}
set objectsDone [$this applyRecursive $toDo $objTeamObj $operation dxlCommand $arg1 $arg2 $objectsDone]
return $objectsDone
}
proc ReqDriver::searchOnName {objList name} {
# searchlist consists of customlevels and workItems.semType
set type [lindex [split $name .] 1]
set name [lindex [split $name .] 0]
foreach element $objList {
if ![isCommand $element] {
set splitIndex [string last . $element]
set typeIndex [expr $splitIndex + 1]
set endNameIndex [expr $splitIndex - 1]
set elementType [string range $element $typeIndex end]
set element [string range $element 0 $endNameIndex]
} else {
set elementType [$element type]
}
if [$element isA File] {
set elementName [$element qualifiedName :]
} else {
set elementName [$element name]
}
if {$elementName == $name} {
if { ![llength $type] || $type == $elementType} {
return $element
}
}
}
}
proc ReqDriver::searchOnVersion {objList versionId} {
foreach levelV $objList {
set versionNumber [$levelV versionNumber]
set origConf [$levelV [$levelV ORB_class]::config]
set origConfName [$origConf name]
if {"$origConfName.$versionNumber" == $versionId} {
return $levelV
}
}
}
proc ReqDriver::searchOnNameAndVersion {objList name versionId} {
# searchlist consists of customlevels and workItems.semType
set type [lindex [split $name .] 1]
set name [lindex [split $name .] 0]
foreach element $objList {
if ![isCommand $element] {
set splitIndex [string last . $element]
set typeIndex [expr $splitIndex + 1]
set endNameIndex [expr $splitIndex - 1]
set elementType [string range $element $typeIndex end]
set element [string range $element 0 $endNameIndex]
} else {
set levelV $element
set elementType [[$levelV object] type]
}
if [$element isA FileVersion] {
set file [$element file]
set elementName [$file qualifiedName :]
} else {
set elementName [$element name]
}
if {$elementName == $name} {
if { ![llength $type] || $type == $elementType} {
if ![llength $versionId] {
# element is not versiond
return $element
}
set levelV $element
set versionNumber [$levelV versionNumber]
set origConf [$levelV [$levelV ORB_class]::config]
set origConfName [$origConf name]
if {"$origConfName.$versionNumber" == $versionId} {
return $levelV
}
}
}
}
}
# Do not delete this line -- regeneration end marker
method ReqDriver::elementSet {this} {
return [$this _elementSet]
}
method ReqDriver::addElement {this newElement} {
[$this _elementSet] append $newElement
$newElement _driver $this
}
method ReqDriver::removeElement {this oldElement} {
$oldElement _driver ""
[$this _elementSet] removeValue $oldElement
}