home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
mtcorpgrou.tcl
< prev
next >
Wrap
Text File
|
1997-11-20
|
3KB
|
128 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)mtcorpgrou.tcl /main/titanic/1
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)mtcorpgrou.tcl /main/titanic/1 20 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "mergeobjec.tcl"
Class MTCorpGroup : {MergeObject} {
constructor
method destructor
method hasConflict
method getInfo
method merge
method import
method getOwners
attribute level
}
constructor MTCorpGroup {class this name fromRepObj toRepObj} {
set this [MergeObject::constructor $class $this $name $fromRepObj $toRepObj]
# Start constructor user section
# End constructor user section
return $this
}
method MTCorpGroup::destructor {this} {
# Start destructor user section
# End destructor user section
$this MergeObject::destructor
}
method MTCorpGroup::hasConflict {this} {
return 0
}
method MTCorpGroup::getInfo {this} {
set owners [$this getOwners]
set fromOwners [lindex $owners 0]
set toOwners [lindex $owners 1]
set info ""
set systems ""
foreach owner $fromOwners {
if {$systems != ""} {
append systems "\n"
}
append systems "- [$owner status] [$owner text] \
in phase '[[$owner phase] name]'"
}
if {$systems != ""} {
lappend info "From Reused In"
lappend info $systems
}
set systems ""
foreach owner $toOwners {
if {$systems != ""} {
append systems "\n"
}
append systems "- [$owner status] [$owner text] \
in phase '[[$owner phase] name]'"
}
if {$systems != ""} {
lappend info "To Reused In"
lappend info $systems
}
return $info
}
method MTCorpGroup::merge {this} {
return [$this import]
}
method MTCorpGroup::import {this} {
set fromRepObj [$this fromRepObj]
set name [$fromRepObj getInfo Name]
set type [$fromRepObj getInfo Type]
wmtkmessage "Merging object $name.$type"
# import the file
set parent [$this parent]
if {$parent != "" && [$parent toRepObj] != ""} {
MTProcs::makeToWorking $parent
} else {
set warning "Cannot merge object, \
parent object does not exist in 'to' version."
wmtkwarning $warning
wmtkmessage ""
return 0
}
set toRepObj [$this toRepObj]
set toSys [$parent toRepObj]
if {$toRepObj != ""} {
$toSys unuse $toRepObj
}
$toSys reuse $fromRepObj [.main toConfig]
$this toRepObj $fromRepObj
wmtkmessage ""
return 1
}
method MTCorpGroup::getOwners {this} {
set owners ""
lappend owners [[$this fromRepObj] reusedIn]
set toRepObj [$this toRepObj]
if {$toRepObj != ""} {
lappend owners [$toRepObj ReusedIn]
} else {
lappend owners {}
}
return $owners
}
# Do not delete this line -- regeneration end marker