home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)corpdbobj.tcl /main/3
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)corpdbobj.tcl /main/3 9 Jul 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "browsdbobj.tcl"
-
- Class CorpDbObj : {BrowsDbObj Corporate} {
- method destructor
- constructor
- method promoter
- method addProject
- method addRole
- method addUser
- method removeObjects
- attribute corporateGroupVersionSet
- attribute roleSet
- attribute userSet
- attribute controlledClassSet
- attribute customFileSet
- }
-
- method CorpDbObj::destructor {this} {
- # Start destructor user section
-
- [$this customFileSet] delete
- [$this corporateGroupVersionSet] delete
- [$this controlledClassSet] delete
- [$this controlledListSet] delete
- [$this roleSet] delete
- [$this userSet] delete
-
- # End destructor user section
- $this BrowsDbObj::destructor
- }
-
- constructor CorpDbObj {class this name} {
- set this [Corporate::constructor $class $this $name]
- set this [BrowsDbObj::constructor $class $this $name]
- return $this
- }
-
- selfPromoter Corporate {this} {
- if {(! [isCommand Browser]) || (! [info exists wmttoolObj])} return
-
- CorpDbObj promote $this
- }
-
- method CorpDbObj::promoter {this} {
- $this BrowsDbObj::promoter
-
- # this is the corporate object of the browser
- $wmttoolObj corporateObj $this
-
- # create BrowsUiObj children
- set customFileSet $this.${HCustFUiObj::uiClass}:0
- if {! [isCommand $customFileSet]} {
- HCustFUiObj new $customFileSet -parent $this
- }
- $this customFileSet $customFileSet
- 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
- set userSet $this.${UsrUiObj::uiClass}:0
- if {! [isCommand $userSet]} {
- UsrUiObj new $userSet -parent $this
- }
- $this userSet $userSet
- set corporateGroupVersionSet $this.${CorpGVUiObj::uiClass}:0
- if {! [isCommand $corporateGroupVersionSet]} {
- CorpGVUiObj new $corporateGroupVersionSet -parent $this
- }
- $this corporateGroupVersionSet $corporateGroupVersionSet
- }
-
- method CorpDbObj::addProject {this} {
- require "newobjentr.tcl"
-
- if {! [isCommand $wmttoolObj.newProject]} {
- NewObjEntryDlg new $wmttoolObj.newProject \
- -title "New Project" \
- -message "Name:" \
- -okPressed {
- set projName [%this entry]
- set script "[%this dbObj] createProject [list $projName]"
- $wmttoolObj startCommand tcl \
- "$script" "" "Creating project '$projName'..." {1 0} 1
- }
- }
- $wmttoolObj.newProject dbObj $this
- $wmttoolObj.newProject popUp
- }
-
- method CorpDbObj::addRole {this} {
- require "newobjentr.tcl"
-
- if {! [isCommand $wmttoolObj.newRole]} {
- NewObjEntryDlg new $wmttoolObj.newRole \
- -title "New Role" \
- -message "Name:" \
- -okPressed {
- set roleName [%this entry]
- set script "[%this dbObj] createRole [list $roleName]"
- $wmttoolObj startCommand tcl \
- "$script" "" "Creating role '$roleName'..." {1 0} 1
- }
- }
- $wmttoolObj.newRole dbObj $this
- $wmttoolObj.newRole popUp
- }
-
- method CorpDbObj::addUser {this} {
- require "newobjentr.tcl"
-
- if {! [isCommand $wmttoolObj.newUser]} {
- NewObjEntryDlg new $wmttoolObj.newUser \
- -title "New User" \
- -message "Name:" \
- -okPressed {
- set userName [%this entry]
- set script "[%this dbObj] createUser [list $userName]"
- $wmttoolObj startCommand tcl \
- "$script" "" "Creating user '$userName'..." {1 0} 1
- }
- }
- $wmttoolObj.newUser dbObj $this
- $wmttoolObj.newUser popUp
- }
-
- proc CorpDbObj::associations {} {
- return {\
- projects customFileSet corporateGroupVersionSet \
- controlledClassSet controlledListSet accessRuleSet roleSet userSet\
- }
- }
-
- proc CorpDbObj::childTypes {assoc} {
- if {[lsearch -exact "[CorpDbObj::associations]" "$assoc"] == -1} {
- return ""
- }
- return "[BrowserProcs::childTypes $assoc]"
- }
-
- proc CorpDbObj::controlledLists {} {
- return {
- "[$this projectList]"
- }
- }
-
- proc CorpDbObj::infoProperties {} {
- return [concat \
- [BrowserProcs::infoProperties] \
- {"DB Name" "DB Host" "DB Server" Release "Controlled Actions"} \
- ]
- }
-
- method CorpDbObj::removeObjects {this} {
- set box $wmttoolObj.removeWarning
- WarningDialog new $box \
- -title "Delete Warning" \
- -message [BrowserProcs::removeMessage] \
- -helpPressed {.main helpOnName removeWarning} \
- -cancelPressed {%this delete} \
- -okPressed {
- set script ""
- foreach obj [$wmttoolObj selectedObjSet] {
- if {"$script" != ""} {
- append script " ;"
- }
- if [$obj isA User] {
- append script " [$wmttoolObj corporateObj] removeUser $obj"
- } else {
- append script " $obj destroy"
- }
- }
- $wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
- %this delete
- }
- $box popUp
- }
-
- # Do not delete this line -- regeneration end marker
-
-