home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)fileprdbob.tcl /main/hindenburg/1
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)fileprdbob.tcl /main/hindenburg/1 8 Oct 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "browsdbobj.tcl"
-
- Class FilePRDbObj : {BrowsDbObj FilePropertyReference} {
- method destructor
- constructor
- method browserObjType
- method browserType
- method editFile
- method hasChildren
- method initializeInfo
- method pathName
- method previewFile
- method selectFixed
- method showFile
- method versionName
- }
-
- method FilePRDbObj::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this BrowsDbObj::destructor
- }
-
- constructor FilePRDbObj {class this name} {
- set this [FilePropertyReference::constructor $class $this $name]
- set this [BrowsDbObj::constructor $class $this $name]
- return $this
- }
-
- selfPromoter FilePropertyReference {this} {
- FilePRDbObj promote $this
- }
-
- proc FilePRDbObj::associations {} {
- return {accessRuleSet}
- }
-
- method FilePRDbObj::browserObjType {this} {
- return "FilePRDbObj"
- }
-
- method FilePRDbObj::browserType {this} {
- return [$this type]
- }
-
- proc FilePRDbObj::childTypes {assoc} {
- if {[lsearch -exact "[FilePRDbObj::associations]" "$assoc"] == -1} {
- return ""
- }
- return "[BrowserProcs::childTypes $assoc]"
- }
-
- proc FilePRDbObj::controlledLists {} {
- return ""
- }
-
- method FilePRDbObj::editFile {this} {
- $this edit
- }
-
- method FilePRDbObj::hasChildren {this} {
- return 1
- }
-
- proc FilePRDbObj::infoProperties {} {
- return [concat \
- [BrowserProcs::infoProperties] \
- {Status Version "Controlled Actions" Path} \
- ]
- }
-
- method FilePRDbObj::initializeInfo {this confV} {
- [$this info] contents ""
- $this setInfo FileVersion [$this referredFileVersion $confV]
- }
-
- method FilePRDbObj::pathName {this} {
- return "[path_name concat \
- [[$this document] directory] [$this getPropertyValue fileSystemPath] \
- ]"
- }
-
- method FilePRDbObj::previewFile {this} {
- $this preview
- }
-
- method FilePRDbObj::selectFixed {this} {
- set versionList ""
- set file [$this referredFile]
- set fileV [[$this info] set FileVersion]
- foreach version [$file fileVersions] {
- if {"$version" == "$fileV"} continue
- lappend versionList $version
- }
-
- if [lempty $versionList] {
- wmtkinfo "There are no other versions to select from"
- return
- }
-
- set headerSpecList {
- {Version 25 ascii {increasing 1}}
- {Status 14 ascii {increasing 2}}
- {"Frozen date" 30 ascii {none}}
- {Comments 50 ascii {none}}
- }
- set objectSpecList ""
- foreach version $versionList {
- set typeSpec [getObjectSpec [$wmttoolObj objectHdlr] \
- [$version uiClass] [$version browserType] \
- ]
- if {"$typeSpec" != ""} {
- set icon [$typeSpec smallIcon]
- } else {
- set icon ""
- }
- lappend objectSpecList [list $icon \
- [$version versionName] \
- [$version status] \
- [$version freezeTime2String] \
- [$version comments] \
- ]
- }
-
- require "browsviewd.tcl"
- set box $wmttoolObj.selectFixed
- ClassMaker::extend BrowsViewDialog SelectFixedBrowsViewDialog dbObj
- SelectFixedBrowsViewDialog new $box \
- -title "Select Fixed" \
- -message "File '[$file name].[$file type]'" \
- -headerSpecList $headerSpecList \
- -objectSpecList $objectSpecList \
- -objectList $versionList \
- -dbObj $this \
- -cancelPressed {%this delete} \
- -okPressed {
- set dbObj [%this dbObj]
- set version [[lindex [[%this view] selectedSet] 0] object]
- set script "$dbObj fixate $version"
- set confVId [[$dbObj getParent ConfigVersion] identity]
- set sysVId [[$dbObj getParent SystemVersion] identity]
- set argsfile [args_file [$dbObj identity]]
- set args "updateDocDir $confVId $sysVId [list $argsfile]"
- set cmd "$wmttoolObj startDocbatch mtool [list $args] \"\" {0 0} 0"
- $wmttoolObj startCommand tcl "$script" "$cmd" "" {1 0} 1
- %this delete
- }
- [$box view] selectionPolicy BROWSE
- $box popUp
- }
-
- method FilePRDbObj::showFile {this} {
- $this show
- }
-
- method FilePRDbObj::versionName {this} {
- set fileV [[$this info] set FileVersion]
- if [$fileV isNil] {
- return ""
- }
- return [$fileV versionName]
- }
-
- # Do not delete this line -- regeneration end marker
-
-