home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
drsgrouped.tcl
< prev
next >
Wrap
Text File
|
1997-03-07
|
5KB
|
138 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)drsgrouped.tcl /main/hindenburg/9
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)drsgrouped.tcl /main/hindenburg/9 7 Mar 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "drslinkabl.tcl"
#Class DrsGroupedObject : {DrsLinkableObject} {
# constructor
# method destructor
# method deleteLevel
# method getDoorsParObjId
# method removeRefObject
# method saveReference
# method show
# method synObjects
#}
constructor DrsGroupedObject {class this level levelVersion pLevel pVersion} {
set this [DrsLinkableObject::constructor $class $this $level $levelVersion $pLevel $pVersion]
# Start constructor user section
# End constructor user section
return $this
}
method DrsGroupedObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this DrsLinkableObject::destructor
}
method DrsGroupedObject::deleteLevel {this fileLevel parChilds} {
$this DrsLevelObject::deleteLevel $fileLevel ""
set levelType [$this levelType]
set parLevel [$this getParentPropertyObject]
set doorsObjId [$parLevel getPropertyValue ${FORMALMODULE}_$levelType]
if ![llength $doorsObjId] {
return
}
set selectedFilesDict [Dictionary new]
$selectedFilesDict contents $parChilds
set typeAvailable 0
$selectedFilesDict foreach fileName systemVersions {
if { [lindex [split $fileName .] 1] == $levelType } {
set typeAvailable 1
break
}
}
if !$typeAvailable {
set dxlCommand [$this dxlCommand]
set doorsObject [$dxlCommand doorsObjectFind $doorsObjId]
$dxlCommand doorsObjectDelete $doorsObject
}
}
method DrsGroupedObject::getDoorsParObjId {this } {
set parLevel [$this getParentPropertyObject]
set levelType [$this levelType]
set parDrsObjId [$parLevel getPropertyValue ${FORMALMODULE}_$levelType]
if ![llength $parDrsObjId] {
set dxlCommand [$this dxlCommand]
set doorsObject [$dxlCommand doorsObjectFind \
[$parLevel getPropertyValue ${FORMALMODULE}]]
# for external files do a filtering
regsub -all {\.|\(|\)|\:|\\|\||\]|\[|\*|\+|\#|\-|\!|\=} $levelType "" filteredName
set doorsObject [$dxlCommand doorsObjectCreateChild \
$doorsObject $levelType $filteredName]
$dxlCommand doorsObjectAttrSave $doorsObject "Absolute Number"
} else {
set dxlCommand [$this dxlCommand]
set doorsObject [$dxlCommand doorsObjectFind $parDrsObjId]
$dxlCommand doorsObjectShow $doorsObject
}
return $doorsObject
}
method DrsGroupedObject::removeRefObject {this fileObject} {
set levelType [$this levelType]
set systemLevel [$this parentLevel]
set selectedFilesDict [Dictionary new]
$selectedFilesDict contents [$systemLevel getPropertyValue \
${FORMALMODULE}_SelectedItems]
set selectedFilesOfType [$selectedFilesDict set $levelType]
if ![llength $selectedFilesOfType] {
$this DrsLevelObject::removeRefObject $fileObject
$systemLevel removeProperty ${FORMALMODULE}_$levelType
}
}
method DrsGroupedObject::saveReference {this fLevel drsRefs parOTVers selIts} {
if {[llength $drsRefs] > 1 } {
# group object created
set ownDRef [lreplace $drsRefs 0 0]
# file section created
set levelType [$this levelType]
set parentLevel [$this parentLevel]
set doorsObjId [lindex $drsRefs 0]
$parentLevel setProperty ${FORMALMODULE}_$levelType $doorsObjId
#$this addDoorsRefToCorp [[[$this level] project] name] $doorsObjId
} else {
# group object already exists
set ownDRef [lindex $drsRefs 0]
}
$this DrsLinkableObject::saveReference $fLevel $ownDRef \
$parOTVers $selIts
}
method DrsGroupedObject::show {this majorOper minorOper} {
set parentLevel [$this parentLevel]
set levelType [$this levelType]
set myTypeObjId [$parentLevel getPropertyValue \
${FORMALMODULE}_$levelType]
set dxlCommand [$this dxlCommand]
if {[llength $myTypeObjId] && $myTypeObjId > 0 } {
set doorsObject [$dxlCommand doorsObjectFind $myTypeObjId]
$dxlCommand doorsObject$majorOper $doorsObject $minorOper
}
$this DrsTreeObject::show $majorOper $minorOper
}
method DrsGroupedObject::synObjects {this} {
return "1"
}
# Do not delete this line -- regeneration end marker