home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
filevobj.tcl
< prev
next >
Wrap
Text File
|
1996-10-30
|
5KB
|
199 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)filevobj.tcl /main/hindenburg/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)filevobj.tcl /main/hindenburg/5 30 Oct 1996 Copyright 1996 Cadre Technologies 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 file
method hasChildren
method inCorporate2String
method initializeInfo
method linkStatus
method name
method openFile
method removeVersion
}
method FileVObj::destructor {this} {
# Start destructor user section
[$this controlledListSet] delete
# 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
set controlledListSet $this.${CListUiObj::uiClass}:0
if {! [isCommand $controlledListSet]} {
CListUiObj new $controlledListSet -parent $this
}
$this controlledListSet $controlledListSet
}
proc FileVObj::associations {} {
return {controlledListSet accessRuleSet}
}
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::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 1
}
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"} \
]
}
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::name {this {qualifier ":"}} {
case [$this getInfo Type] in {
{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