home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)contfileui.tcl /main/hindenburg/6
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)contfileui.tcl /main/hindenburg/6 30 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require_module_file "contfile.tcl" continuus
- require_module_file "vsfileobj.tcl" vcm
-
- # This class represents a Continuus file in the browser.
-
- Class ContFileUiObj : {ContFile VSFileObj} {
- constructor
- method destructor
- method initializeInfo
- method showDiff
- method getInfo
- method path
- method previousVersion
- method promoter
- method otherVersions
- }
-
- constructor ContFileUiObj {class this name type system i_name} {
- set this [ContFile::constructor $class $this $name $type $system]
- set this [VSFileObj::constructor $class $this $i_name]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method ContFileUiObj::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this ContFile::destructor
- $this VSFileObj::destructor
- }
-
- proc ContFileUiObj::associations {} {
- return "[VSFileObj::associations]"
- }
-
- proc ContFileUiObj::childTypes {assoc} {
- return "[VSFileObj::childTypes $assoc]"
- }
-
- proc ContFileUiObj::controlledLists {} {
- return "[VSFileObj::controlledLists]"
- }
-
- proc ContFileUiObj::infoProperties {} {
- return [concat \
- [VSFileObj::infoProperties] \
- {Version Status Owner Modified Created Comment \
- "Continuus Type" Path Instance Platform Release Task} \
- ]
- }
-
-
- # Initialize all info except Comment.
- #
- method ContFileUiObj::initializeInfo {this dummy} {
- $this VSFileObj::initializeInfo $dummy
- set fileName [path_name file [$this path]]
- $this setInfo Text "Continuus File $fileName"
- $this setInfo Path [$this vsPath]
-
- # get infoList from system and transfer information
- set infoList [[[$this systemVersion] continuusFileInfoDict] set $fileName]
- if { ![lempty $infoList] } {
- $this setInfo Version [lindex $infoList 0]
- $this setInfo Owner [lindex $infoList 1]
- $this setInfo Status [lindex $infoList 2]
- $this setInfo "Continuus Type" [lindex $infoList 3]
- $this setInfo Created [lindex $infoList 4]
- $this setInfo Modified [lindex $infoList 5]
- $this setInfo Platform [lindex $infoList 6]
- $this setInfo Release [lindex $infoList 7]
- $this setInfo Task [lindex $infoList 8]
- $this setInfo "Generated From Class" [lindex $infoList 9]
- $this setInfo Instance [lindex $infoList 10]
- } else {
- # clear Info and indicate not found status
- $this setInfo Version ""
- $this setInfo Owner ""
- $this setInfo Status "<not found>"
- $this setInfo "Continuus Type" ""
- $this setInfo Created ""
- $this setInfo Modified ""
- $this setInfo Platform ""
- $this setInfo Release ""
- $this setInfo Task ""
- $this setInfo "Generated From Class" ""
- $this setInfo Instance ""
- }
- }
-
-
- # Show diff in mtool using the Continuus diff command.
- #
- method ContFileUiObj::showDiff {this version {options ""}} {
- # execute diff in directory of the file
- set diffDir [path_name directory [$this path]]
-
- set diffCommand [ContCommand::diff [$this path] $version]
- vsCommandHandler executeExternal $diffCommand mtool "" $diffDir
- }
-
-
- # If the requested info is Comment get it, and set
- # initializedAllInfo to true.
- # Return the requested info.
- #
- method ContFileUiObj::getInfo {this header} {
- if { [$this initializedAllInfo] != "1" } {
- if { "$header" == "Comment" } {
- # get the description items and add them to info
- busy {
- $this setInfo Comment [ContCommand::getComment [$this path]]
- $this initializedAllInfo 1
- }
- }
- }
-
- set info [[$this info] set $header]
- if { $info != ""} {
- return $info
- }
-
- return "[$this BrowsUiObj::getInfo $header]"
- }
-
-
- # Returns result of path of ContFile.
- #
- method ContFileUiObj::path {this} {
- return [$this ContFile::path]
- }
-
- method ContFileUiObj::previousVersion {this} {
- return [ContCommand::getPredecessor [$this path] [$this getInfo Version]]
- }
-
- method ContFileUiObj::promoter {this} {
- $this VSFileObj::promoter
- }
-
- method ContFileUiObj::otherVersions {this} {
- set versions [ContCommand::candidates [$this path]]
-
- # remove current version
- set currentVersion [$this getInfo Version]
- set currentVersionIndex [lsearch -exact $versions $currentVersion]
- if { $currentVersionIndex == -1 } {
- return $versions
- }
- return [join [lreplace $versions $currentVersionIndex $currentVersionIndex ""]]
- }
-
- # Do not delete this line -- regeneration end marker
-
-