home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
ccu_uce.tcl
< prev
next >
Wrap
Text File
|
1997-05-16
|
5KB
|
181 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)ccu_uce.tcl /main/hindenburg/6
# Author: Lex Warners
# Description: VCM integration file
#---------------------------------------------------------------------------
# SccsId = @(#)ccu_uce.tcl /main/hindenburg/6 18 Mar 1997
require vcm_compat.tcl
require_module_file ccsysvdbob.tcl
require_module_file ccfileuiob.tcl
require viewdefine.tcl
method ViewDefineDialog::associationChanged {this} {
set typeList ""
set orgSelectedSet [[$this iPage].typesTL selectedSet]
set selAsso [[$this iPage].associationsTL selectedSet]
set class /
foreach asso $selAsso {
set object [$this curObject]
set objClass [.main getBrowsObj [$object repositoryType]]
# determine the right system type
if {$objClass == "SSysVDbObj"} {
# assocs are different for a Document
if {[$object browserType] == "DocumentVersion"} {
set types [DSysVDbObj::childTypes $asso]
} elseif {[$object browserType] == "VCMSystemVersion" } {
set types [concat \
[CCSysVDbObj::childTypes $asso] \
[SSysVDbObj::childTypes $asso]]
} else {
# because if not possible to determine
# the right phase, take all the possibilities
set types [concat \
[PSysVDbObj::childTypes $asso] \
[SSysVDbObj::childTypes $asso]]
}
} else {
set types [$objClass::childTypes $asso]
}
foreach i $types {
set idx [lsearch $typeList $i]
# if this type is not in the current list, add it
if {$idx == -1} {
set typeList [concat $typeList $i]
}
}
}
[$this iPage].typesTL entrySet $typeList
[$this iPage].typesTL selectedSet $orgSelectedSet
}
method ViewDefineDialog::load {this object} {
set associations ""
# get all the associations of the current loaded object
set objClass [.main getBrowsObj [$object repositoryType]]
if {$objClass == "SSysVDbObj"} {
# assocs are different for a Document
if {[$object browserType] == "DocumentVersion"} {
set objClass DSysVDbObj
} elseif { [$object browserType] == "VCMSystemVersion"} {
set objClass CCSysVDbObj
} else {
set objClass PSysVDbObj
}
}
if {![isCommand $objClass]} {
wmtkmessage "No associations found for type \
'[$object repositoryType]'"
} else {
foreach i [$objClass::associations] {
#if this associations is not in the current list, add it
if { [lsearch $associations $i] == -1} {
lappend associations $i
}
}
}
# get the associationsClasses of the objClass
# from these classes the infoProperties must be shown
set infoProps ""
set assocClasses ""
# get all the infoProps of the associationsClasses
foreach association $associations {
case "$association" in {
{vsFiles} {
set assocClasses {CCFileUiObj}
}
{customFileVersions} {
set assocClasses {CustFVDbObj}
}
{directFileVersions fileVersions localFileVersions} {
set assocClasses {ExtFVDbObj GraphVDbObj MtrxVDbObj}
}
{definedItems} {
set assocClasses {WItemDbObj}
}
{externalFiles} {
set assocClasses {ExtFUiObj}
}
{externalLinks} {
set assocClasses {ExtLDbObj}
}
{fileVersionReferences} {
set assocClasses {SFileLDbObj}
}
{phaseVersions} {
set assocClasses {PhaseVDbObj}
}
{roleLinks userLinks} {
set assocClasses {UsrLDbObj}
}
{rules} {
set assocClasses {RuleUiObj}
}
{sections} {
set assocClasses \
{ExtFVDbObj SFileLDbObj FilePRDbObj ItemPRDbObj}
}
{default} {
set childTypes [$objClass::childTypes $association]
set assocClasses ""
foreach childType $childTypes {
lappend assocClasses [.main getBrowsObj $childType]
}
}
}
foreach class $assocClasses {
if {![isCommand $class::infoProperties]} {
continue
}
foreach prop [$class::infoProperties] {
# if this infoProp is not in the current list,
# add it
if { [lsearch $infoProps $prop] == -1} {
lappend infoProps $prop
}
}
}
}
[$this iPage].associationsTL entrySet $associations
# refresh the types that belongs to the new associations
$this associationChanged
set props [$this pPage].propertiesBV
# delete the old propertyList
foreach row [[$this pPage].propertiesBV objectSet] {
$row delete
}
foreach row [[$this pPage].hidpropertiesBV objectSet] {
$row delete
}
# build the new propertyList
set index 0
set props [$this pPage].hidpropertiesBV
foreach i $infoProps {
PropViewObject new $props.$index
$props.$index label $i
$props.$index details "10 ascii none {}"
incr index
}
$this DefineDialog::load $object
}