home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)svdgvdbobj.tcl /main/hindenburg/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)svdgvdbobj.tcl /main/hindenburg/2 30 Oct 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "browsdbobj.tcl"
-
- Class SvdGVDbObj : {BrowsDbObj SavedGroupVersion} {
- method destructor
- constructor
- method createdBy
- method inCorporate2String
- method makeCorporate
- method makeCorporateAllowed
- method name
- method newObjects
- method phaseName
- method printObjects
- method projectName
- method removeObjects
- method removeVersion
- method systemName
- method versionInLabel
- method versionName
- }
-
- method SvdGVDbObj::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this BrowsDbObj::destructor
- }
-
- constructor SvdGVDbObj {class this name} {
- set this [SavedGroupVersion::constructor $class $this $name]
- set this [BrowsDbObj::constructor $class $this $name]
- return $this
- }
-
- selfPromoter SavedGroupVersion {this} {
- SvdGVDbObj promote $this
- }
-
- proc SvdGVDbObj::associations {} {
- return {fileVersions accessRuleSet}
- }
-
- proc SvdGVDbObj::childTypes {assoc} {
- if {[lsearch -exact "[SvdGVDbObj::associations]" "$assoc"] == -1} {
- return ""
- }
- set childTypes [BrowserProcs::childTypes $assoc]
- case "$childTypes" in {
- {FileVersion} {
- return [concat \
- ${BrowserProcs::diagramFileTypes} \
- ${BrowserProcs::programmerFileTypes}]
- }
- {default} {
- return "$childTypes"
- }
- }
- }
-
- proc SvdGVDbObj::controlledLists {} {
- return ""
- }
-
- method SvdGVDbObj::createdBy {this} {
- return [[$this creator] name]
- }
-
- method SvdGVDbObj::inCorporate2String {this} {
- if [[$this corporateGroupVersion] isNil] {
- return "No"
- }
- return "Yes"
- }
-
- proc SvdGVDbObj::infoProperties {} {
- return [concat \
- [BrowserProcs::infoProperties] \
- {Version Comments Created "Created By" "In Corporate" \
- Project Phase System "Controlled Actions"} \
- ]
- }
-
- method SvdGVDbObj::makeCorporate {this} {
- require "newobjentr.tcl"
-
- set box $wmttoolObj.makeCorporate
- NewObjEntryDlg new $box \
- -title "Make Corporate" \
- -message "Corporate Group Name:" \
- -dbObj $this \
- -cancelPressed {%this delete} \
- -okPressed {
- set name [%this entry]
- set comments [%this.top.comments text]
- set script "[%this dbObj] toCorporate [list $comments] [list $name]"
- $wmttoolObj startCommand tcl \
- "$script" "" \
- "Creating corporate group version '$name'..." \
- {1 0} 1
- %this delete
- }
- Label new $box.top.commentsLab \
- -text "Comments:"
- SingleLineText new $box.top.comments
-
- set corpG [[$this savedGroup] corporateGroup]
- if [$corpG isNil] {
- $box entry "[$this name]"
- $box.top.name sensitive 1
- } else {
- $box entry "[$corpG name]"
- $box.top.name sensitive 0
- }
- $box popUp
- }
-
- method SvdGVDbObj::makeCorporateAllowed {this} {
- if {! [[$this corporateGroupVersion] isNil]} {
- return 0
- }
-
- set sysV [$this getParent SystemVersion]
- if {"$sysV" == ""} {
- return 0
- }
- if {[$sysV getInfo Status] == "backGround"} {
- return 0
- }
-
- return 1
- }
-
- method SvdGVDbObj::name {this} {
- return "[[$this savedGroup] name]"
- }
-
- method SvdGVDbObj::newObjects {this} {
- set sysV [$this getParent SystemVersion]
- if {"$sysV" == ""} {
- wmtkerror "Cannot access corporate FileVersion(s)"
- return
- }
- $sysV newObjects
- }
-
- method SvdGVDbObj::phaseName {this} {
- return [[[$this system] phase] name]
- }
-
- method SvdGVDbObj::printObjects {this} {
- set asciiFiles ""
- set topostObjects ""
- foreach obj [$wmttoolObj selectedObjSet] {
- if [$obj isA Graph] {
- lappend topostObjects $obj
- } elseif [$obj isA ExternalFileVersion] {
- $obj synchWithFileSystem
- lappend asciiFiles [$obj path]
- }
- }
- BrowserProcs::printObjects $asciiFiles "" $topostObjects
- }
-
- method SvdGVDbObj::projectName {this} {
- return [[$this project] name]
- }
-
- method SvdGVDbObj::removeObjects {this} {
- set sysV [$this getParent SystemVersion]
- if {"$sysV" == ""} {
- wmtkerror "Cannot access corporate FileVersion(s)"
- return
- }
- $sysV removeObjects
- }
-
- method SvdGVDbObj::removeVersion {this} {
- set box $wmttoolObj.removeVersionWarning
- WarningDialog new $box \
- -title "Delete Version Warning" \
- -message [BrowserProcs::removeMessage] \
- -helpPressed {.main helpOnName removeVersionWarning} \
- -cancelPressed {%this delete} \
- -okPressed {
- set script ""
- foreach obj [$wmttoolObj selectedObjSet] {
- if {"$script" != ""} {
- append script " ;"
- }
- append script " [$obj savedGroup] removeVersion $obj"
- }
- $wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
- %this delete
- }
- $box popUp
- }
-
- method SvdGVDbObj::systemName {this} {
- return [[$this system] name]
- }
-
- method SvdGVDbObj::versionInLabel {this} {
- return 1
- }
-
- method SvdGVDbObj::versionName {this} {
- return [$this versionNumber]
- }
-
- # Do not delete this line -- regeneration end marker
-
-