home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
filerefsec.tcl
< prev
next >
Wrap
Text File
|
1996-10-17
|
3KB
|
108 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)filerefsec.tcl /main/hindenburg/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)filerefsec.tcl /main/hindenburg/2 17 Oct 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
# End user added include file section
require "docsection.tcl"
require "sfileldbob.tcl"
Class FileRefSection : {DocSection SFileLDbObj} {
method destructor
constructor
method promoter
method edit
method isDocDirUpToDate
method uiName
}
method FileRefSection::destructor {this} {
# Start destructor user section
# End destructor user section
$this DocSection::destructor
$this SFileLDbObj::destructor
}
constructor FileRefSection {class this name document} {
set this [SFileLDbObj::constructor $class $this $name]
set this [DocSection::constructor $class $this $name $document]
return $this
}
selfPromoter SFileLDbObj {this} {
set sysV [$this systemVersion]
if {"[[$sysV system] type]" != "document"} return
set editor [$sysV editor]
if {! [isCommand $editor]} return
set editorName [$editor name]
set editorVersion [$editor version]
set class [Document::getClass $editorName $editorVersion [$this type]]
if {$class != ""} {
$class promote $this $sysV
} else {
set fileV [$this referredFileVersion]
if {![$fileV isNil]} {
if {[$fileV isA ExternalFileVersion]} {
# for text file references without
# a section class
TextRefSection promote $this $sysV
}
}
}
}
method FileRefSection::promoter {this document} {
$this DocSection::promoter $document
}
method FileRefSection::edit {this} {
$this DocSection::edit
}
method FileRefSection::isDocDirUpToDate {this} {
# do not update if document is frozen
if {"[[$this document] getInfo Status]" == "frozen"} {
return 1
}
# if the timestamp of the docLocation is > then the
# one of the location the section is up to date
if {! [file exists [$this docLocation]]} {
return 0
}
set fileV [$this referredFileVersion]
if [$fileV isNil] {
return 0
}
set source [$fileV updateTime]
file stat [$this docLocation] info
if {$source > $info(mtime)} {
return 0
}
return 1
}
method FileRefSection::uiName {this args} {
if {$args == ""} {
return [$this name]
} else {
# can not change name
}
return ""
}
# Do not delete this line -- regeneration end marker