home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)drssystemo.tcl /main/titanic/4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)drssystemo.tcl /main/titanic/4 29 Aug 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- require reqdriver.tcl
- # End user added include file section
-
- require "drslinkabl.tcl"
- require "drssmmodel.tcl"
-
- Class DrsSystemObject : {DrsLinkableObject DrsSMModelObject} {
- method destructor
- constructor
- method childLevelVersions
- method getClassFeatures
- method getChildLevels
- method getLocalFileVersions
- method getMatrices
- method getPhase
- method installClassFeatures
- attribute classFeatures
- attribute localFileVersions
- attribute matrices
- }
-
- method DrsSystemObject::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this DrsLinkableObject::destructor
- $this DrsSMModelObject::destructor
- }
-
- constructor DrsSystemObject {class this system systemV pLevel pLevelV} {
- set this [DrsLinkableObject::constructor $class $this $system $systemV $pLevel $pLevelV]
- set this [DrsSMModelObject::constructor $class $this [$system systemVersions]]
-
- $this levelVersions [$system systemVersions]
- return $this
- }
-
- method DrsSystemObject::childLevelVersions {this} {
- set versOfCurrLevel [[$this level] systemVersions]
- set thisSysVers [ReqDriver::searchOnVersion $versOfCurrLevel [$this versionId]]
- if [llength $thisSysVers] {
- set childLevelVersions \
- [concat [$this getLocalFileVersions] [$this getClassFeatures]]
- } else {
- set childLevelVersions ""
- }
- return [concat $childLevelVersions [$this getItemDefs]]
- }
-
- method DrsSystemObject::getClassFeatures {this} {
- set sysV [$this getLevelV]
- set features [$this classFeatures]
- if [llength $features] {
- return $features
- }
- set configV [$this getConfigVersion]
- foreach matrix [$this getMatrices] {
- $matrix loadRowData "name_type" rows
- foreach rowData $rows {
- foreach item [lindex $rowData 1] {
- set itemType [$item type]
- set workItem [$sysV findDefinition $item $configV]
- if {$itemType == "de"} {
- lappend features $workItem.Attribute
- }
- if {$itemType == "pe"} {
- lappend features $workItem.Operation
- }
- }
- }
- }
- $this classFeatures $features
- return $features
-
- }
-
- method DrsSystemObject::getChildLevels {this} {
- set childLevels [$this childLevels]
- if [llength $childLevels] {
- return $childLevels
- }
- set system [$this level]
- set childLevels [concat [$this getChildObjects] [$system files]]
- $this childLevels [concat [$this getClassFeatures] $childLevels]
- $this childLevels $childLevels
- return $childLevels
- }
-
- method DrsSystemObject::getLocalFileVersions {this} {
- set localFileVersions [$this localFileVersions]
- if [llength $localFileVersions] {
- return
- }
- set sysV [$this getLevelV]
- if ![llength $sysV] {
- return
- }
- set system [$sysV system]
- set localFileVersions ""
- set matrices ""
- foreach fileV [$sysV localFileVersions] {
- set file [$fileV file]
- if {[$file type] == "cdm"} {
- lappend matrices $fileV
- } else {
- lappend localFileVersions $fileV
- }
- }
- $this localFileVersions $localFileVersions
- $this matrices $matrices
- return $localFileVersions
- }
-
- method DrsSystemObject::getMatrices {this} {
- $this getLocalFileVersions
- return [$this matrices]
- }
-
- method DrsSystemObject::getPhase {this} {
- set system [$this level]
- return [$system phase]
- }
-
- method DrsSystemObject::installClassFeatures {this} {
- set sysV [$this getLevelV]
- set system [$sysV system]
- set configV [$this getConfigVersion]
- set smModel [$this getSMModel]
- set st [SMTypeDB::find "Class"]
- foreach matrix [$this getMatrices] {
- set file [$matrix file]
- set fileItem [$file item]
- if ![llength [$smModel getNamedSMObjects $st $fileItem]] {
- continue
- }
- $matrix loadRowData "name_type" rows
- foreach rowData $rows {
- foreach item [lindex $rowData 1] {
- set workItem [$sysV findDefinition $item $configV]
- set itemType [$item type]
- if {$itemType == "de" || $itemType == "pe"} {
- set drsQItem [DrsQItemObject new $workItem $file [ReqDriver::getVersion $matrix]]
- $drsQItem qualifier [$item qualifier]
- $drsQItem driver [$this driver]
- set dxlResult [$drsQItem install]
- if ![llength $dxlResult] {
- return
- }
- }
- }
- }
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-