home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)projdbobj.tcl /main/hindenburg/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)projdbobj.tcl /main/hindenburg/2 14 Oct 1996 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "browsdbobj.tcl"
-
- Class ProjDbObj : {BrowsDbObj Project} {
- method destructor
- constructor
- method promoter
- method activateObject
- method addConfigVersion
- method deactivateObject
- method deselectVersion
- method newObjects
- method removeObjects
- method selectVersion
- attribute roleSet
- attribute controlledClassSet
- }
-
- method ProjDbObj::destructor {this} {
- # Start destructor user section
-
- [$this customFileVersionSet] delete
- [$this controlledClassSet] delete
- [$this controlledListSet] delete
- [$this roleSet] delete
-
- # End destructor user section
- $this BrowsDbObj::destructor
- }
-
- constructor ProjDbObj {class this name} {
- set this [Project::constructor $class $this $name]
- set this [BrowsDbObj::constructor $class $this $name]
- return $this
- }
-
- selfPromoter Project {this} {
- ProjDbObj promote $this
- }
-
- method ProjDbObj::promoter {this} {
- $this BrowsDbObj::promoter
-
- set customFileVersionSet $this.${CustFVUiObj::uiClass}:0
- if {! [isCommand $customFileVersionSet]} {
- CustFVUiObj new $customFileVersionSet -parent $this
- }
- $this customFileVersionSet $customFileVersionSet
- set controlledClassSet $this.${CClassUiObj::uiClass}:0
- if {! [isCommand $controlledClassSet]} {
- CClassUiObj new $controlledClassSet -parent $this
- }
- $this controlledClassSet $controlledClassSet
- set controlledListSet $this.${CListUiObj::uiClass}:0
- if {! [isCommand $controlledListSet]} {
- CListUiObj new $controlledListSet -parent $this
- }
- $this controlledListSet $controlledListSet
- set roleSet $this.${RoleUiObj::uiClass}:0
- if {! [isCommand $roleSet]} {
- RoleUiObj new $roleSet -parent $this
- }
- $this roleSet $roleSet
- }
-
- method ProjDbObj::activateObject {this} {
- set obj [lindex [$wmttoolObj selectedObjSet] 0]
- set script "$obj activate"
- $wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
- }
-
- method ProjDbObj::addConfigVersion {this} {
- require "newobjentr.tcl"
-
- if {! [isCommand $wmttoolObj.newConfigV]} {
- NewObjEntryDlg new $wmttoolObj.newConfigV \
- -title "New Config Version" \
- -message "Configuration Name:" \
- -okPressed {
- set confName [%this entry]
- set script "[%this dbObj] createConfigVersion [list $confName]"
- $wmttoolObj startCommand tcl \
- "$script" "" \
- "Creating configuration version '$confName'..." \
- {1 0} 1
- }
- }
- $wmttoolObj.newConfigV dbObj $this
- $wmttoolObj.newConfigV popUp
- }
-
- proc ProjDbObj::associations {} {
- return {\
- configVersions customFileVersionSet controlledClassSet \
- controlledListSet accessRuleSet roleSet\
- }
- }
-
- proc ProjDbObj::childTypes {assoc} {
- if {[lsearch -exact "[ProjDbObj::associations]" "$assoc"] == -1} {
- return ""
- }
- return "[BrowserProcs::childTypes $assoc]"
- }
-
- proc ProjDbObj::controlledLists {} {
- return {
- "[$this configList]"
- "[$this customFileList]"
- "[$this customFileVersionLinkList]"
- "[$this phaseList]"
- }
- }
-
- method ProjDbObj::deactivateObject {this} {
- set obj [lindex [$wmttoolObj selectedObjSet] 0]
- set script "$obj deactivate"
- $wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
- }
-
- method ProjDbObj::deselectVersion {this version} {
- $this deselect $version
- }
-
- proc ProjDbObj::infoProperties {} {
- return [concat \
- [BrowserProcs::infoProperties] \
- {"Controlled Actions"} \
- ]
- }
-
- method ProjDbObj::newObjects {this} {
- set script ""
- foreach obj [$wmttoolObj selectedObjSet] {
- if {"$script" != ""} {
- append script " ;"
- }
- append script " $obj derive -self"
- }
- $wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
- }
-
- method ProjDbObj::removeObjects {this} {
- set box $wmttoolObj.removeWarning
- ClassMaker::extend WarningDialog RemoveObjectsWarningDialog dbObj
- RemoveObjectsWarningDialog new $box \
- -title "Delete Warning" \
- -message [BrowserProcs::removeMessage] \
- -dbObj $this \
- -helpPressed {.main helpOnName removeWarning} \
- -cancelPressed {%this delete} \
- -okPressed {
- set dbObj [%this dbObj]
- set script ""
- foreach obj [$wmttoolObj selectedObjSet] {
- if {"$script" != ""} {
- append script " ;"
- }
- append script " $dbObj removeObject $obj"
- }
- $wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
- %this delete
- }
- $box popUp
- }
-
- method ProjDbObj::selectVersion {this version} {
- $this select $version
- }
-
- # Do not delete this line -- regeneration end marker
-
-