home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1995
- #
- # File: %W%
- # Author: Challenger
- # Description: Implementation of old Report Writer table File
- #
- #---------------------------------------------------------------------------
- # SccsId = %W% %G% Copyright 1995 Cadre Technologies Inc.
-
-
- constructor FileRecord {class this configVersion phaseVersion systemVersion \
- fileVersion} {
- set this [GCObject::constructor $class $this]
-
- set system [$systemVersion system]
- set phase [$phaseVersion phase]
-
- if ![$fileVersion isNil] {
- set file [$fileVersion file]
- }
-
- # extra attributes
- #
-
- if ![$fileVersion isNil] {
- $this _file $file
- $this _fileVersion $fileVersion
- }
-
- $this _configVersion $configVersion
- $this _objtype ""
- $this _reference ""
- $this _link ""
-
- $this project_version [$configVersion versionNumber]
- $this phase_version [$phaseVersion versionNumber]
- $this phase_id [$phase identity]
- $this system_version [$systemVersion versionNumber]
- $this system_id [$system identity]
- if ![$fileVersion isNil] {
- $this file_id [$file identity]
- $this file_version [$fileVersion versionNumber]
- $this name [$file name]
- $this item_id [[$file item] identity]
- $this file_type [$file type]
- $this working [expr {[$fileVersion status] == "working"}]
- $this status [expr { [$fileVersion status] == "working"
- ? "Unfrozen" : "Frozen" }]
- $this check_status [$fileVersion getPropertyValue check_status]
- $this frz_time [fmtclock [$fileVersion freezeTime] "%e-%h-%Y %X"]
- $this comment [$fileVersion comments]
- }
- $this link_desc_id ""
- $this link_desc_type ""
- $this backup_version ""
-
- return $this
- }
-
- method FileRecord::qualifier {this} {
- set qual [[[$this _file] item] qualifier]
- if ![$qual isNil] {
- return [$qual name]
- }
- return ""
- }
-
- method FileRecord::qualifier_id {this} {
- set qual [[[$this _file] item] qualifier]
- if ![$qual isNil] {
- return [$qual identity]
- }
-
- return 0
- }
-
- method FileRecord::link_to_system {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredSystem] name]
- }
-
- method FileRecord::link_to_file {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredFile] name]
- }
-
- method FileRecord::link_type {this} {
- if { [$this _objtype] == "local" } {
- return "no link"
- }
- if { [$this _objtype] == "reference" } {
- return "symbolic link"
- }
- if { [$this _objtype] == "link" } {
- return "external link"
- }
-
- return ""
- }
-
- method FileRecord::link_status {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- if [$this working] {
- return working
- } else {
- return fixed
- }
- }
-
- method FileRecord::link_phase_id {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[[$this _reference] referredSystem] phase] identity]
- }
-
- method FileRecord::link_phase_name {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[[$this _reference] referredSystem] phase] name]
- }
-
- method FileRecord::link_phase_version {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[[$this _reference] referredSystem] phase] \
- selectedVersion [$reference referredConfigVersion]]
- }
-
- method FileRecord::link_system_id {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredSystem] identity]
- }
-
- method FileRecord::link_system_name {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredSystem] name]
- }
-
- method FileRecord::link_system_version {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredSystem] selectedVersion \
- [$reference referredConfigVersion]]
- }
-
- method FileRecord::link_file_id {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredFile] identity]
- }
-
- method FileRecord::link_file_name {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredFile] name]
- }
-
- method FileRecord::link_file_version {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- set reffilev [[$this _reference] referredFileVersion]
- if ![$reffilev isNil] {
- return [$reffilev versionNumber]
- } else {
- return -1
- }
- }
-
- method FileRecord::link_file_type {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[$this _reference] referredFile] type]
- }
-
- method FileRecord::link_item_id {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[[$this _reference] referredFile] item] identity]
- }
-
- method FileRecord::link_item_name {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[[$this _reference] referredFile] item] name]
- }
-
- method FileRecord::link_item_type {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- return [[[[$this _reference] referredFile] item] type]
- }
-
- method FileRecord::link_item_scope {this} {
- if { [$this _objtype] != "reference" } {
- return ""
- }
- if ![[[[[$this _reference] referredFile] item] qualifier] isNil] {
- return qualified
- } else {
- set scope [[[[$this _reference] referredFile] item] scope]
- return [old2newscope $scope]
- }
- return ""
- }
-
- method FileRecord::section_type {this} {
- if { [$this _objtype] == "local" } {
- if { [[$this _file] type] == "dsm" } {
- return [[$this _fileVersion] getPropertyValue SECTIONTYPE]
- }
- return ""
- }
- if { [$this _objtype] == "reference" } {
- return [[$this _reference] getPropertyValue SECTIONTYPE]
- }
-
- return ""
- }
-
-
- method FileRecord::file_path {this} {
- if { [$this _objtype] == "local" } {
- if [[$this _fileVersion] isA ExternalFileVersion] {
- set extfilv [ExternalFileVersion new \
- [[$this _fileVersion] identity]]
- if ![$extfilv isNil] {
- return [$extfilv path [$this _configVersion]]
- }
- }
- }
-
- if { [$this _objtype] == "link" } {
- return [[$this _link] path]
- }
-
- return ""
- }
-