home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
filevobj.tcl
< prev
next >
Wrap
Text File
|
1997-10-03
|
5KB
|
211 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)filevobj.tcl /main/titanic/11
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)filevobj.tcl /main/titanic/11 3 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "browsdbobj.tcl"
require "versionobj.tcl"
Class FileVObj : {VersionObj BrowsDbObj} {
method destructor
constructor
method promoter
method browserType
method canBeDragged
method compareVersion
method compareVersionAllowed
method copyVersion
method customLevelVersion
method file
method hasChildren
method inCorporate2String
method initializeInfo
method linkStatus
method makeUpToDate
method name
method openFile
method removeVersion
}
method FileVObj::destructor {this} {
# Start destructor user section
# End destructor user section
$this VersionObj::destructor
$this BrowsDbObj::destructor
}
constructor FileVObj {class this name} {
set this [BrowsDbObj::constructor $class $this $name]
set this [VersionObj::constructor $class $this $name]
return $this
}
selfPromoter FileVersion {this} {
[$this ORB_class] new [$this identity]
}
method FileVObj::promoter {this} {
$this BrowsDbObj::promoter
module_promoter FileVObj $this
}
proc FileVObj::associations {} {
return {}
}
method FileVObj::browserType {this} {
return "[[$this file] type]"
}
method FileVObj::canBeDragged {this} {
return 1
}
method FileVObj::compareVersion {this} {
set versionList ""
foreach version [[$this file] fileVersions] {
if {"$version" == "$this"} continue
lappend versionList $version
}
BrowserProcs::compareVersion $this [$this file] $versionList
}
method FileVObj::compareVersionAllowed {this} {
if {"[$this getParent CorpGVDbObj]" != ""} {
return 0
}
return 1
}
proc FileVObj::controlledLists {} {
return {"[[$this file] fileVersionList]"}
}
method FileVObj::copyVersion {this} {
set versionList ""
set myType [[$this file] type]
foreach system [[$this phase] systems] {
foreach file [$system files] {
if {"[$file type]" != "$myType"} continue
foreach version [$file fileVersions] {
if {"$version" == "$this"} continue
lappend versionList [list $version "[$file qualifiedName :]"]
}
}
}
BrowserProcs::copyVersion $this $versionList
}
method FileVObj::customLevelVersion {this} {
set confV [[ClientContext::global] currentConfig]
if [$confV isNil] {
if [$this inCorporate] {
return [$this corporate]
}
return $confV
}
if {[$confV ConfigVersion::config] != [$this FileVersion::config]} {
return [ORB::nil]
}
return [[$this system] selectedVersion $confV]
}
method FileVObj::file {this} {
if {[catch {set file [[[$this info] set SystemFileLink] file]}] ||
[$file isNil]} {
global errorInfo
set errorInfo ""
global errorCode
set errorCode ""
return [$this FileVersion::file]
}
return $file
}
method FileVObj::hasChildren {this} {
return 0
}
method FileVObj::inCorporate2String {this} {
if {[$this inCorporate] || "[$this getInfo Status]" == "reused"} {
return "Yes"
}
return "No"
}
proc FileVObj::infoProperties {} {
return [concat \
[BrowserProcs::infoProperties] \
{Status Link Version Comments Created Updated Frozen \
"In Corporate" "Controlled Actions" "Created By" "Updated By"} \
]
}
method FileVObj::initializeInfo {this dummy} {
set oldLink [[$this info] set SystemFileLink]
[$this info] contents ""
$this setInfo SystemFileLink $oldLink
}
method FileVObj::linkStatus {this} {
return [[[$this info] set SystemFileLink] status]
}
method FileVObj::makeUpToDate {this} {
$this VersionObj::makeUpToDate
}
method FileVObj::name {this {qualifier ":"}} {
case [$this getInfo Type] in {
{cod etd std} {
return "[[$this file] qualifiedName $qualifier]"
}
default {
return "[[$this file] name]"
}
}
}
method FileVObj::openFile {this} {
if {"[$this getParent CorporateGroupVersion]" != "" ||
[$this getInfo Status] == "backGround"} {
set treeNode [$this treeNode]
if {"$treeNode" != ""} {
$treeNode open
} else {
[$this infoObject] open
}
} elseif {[$this getInfo "In Corporate"] == "Yes" ||
[$this getInfo Status] != "working"} {
$this showFile
} else {
$this editFile
}
}
method FileVObj::removeVersion {this} {
set sysV [$this getParent SystemVersion]
if {"$sysV" == ""} {
wmtkerror "Cannot access corporate FileVersion(s)"
return
}
set versionList ""
foreach version [[$this file] fileVersions] {
if [$version isLeaf] {
lappend versionList $version
}
}
BrowserProcs::removeVersion "$sysV" "[$this file]" "$versionList"
}
# Do not delete this line -- regeneration end marker