home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)reparchcor.tcl /main/titanic/5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)reparchcor.tcl /main/titanic/5 28 Nov 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "reparchdia.tcl"
-
- Class RepArchCorporateDialog : {RepArchDialog} {
- constructor
- method destructor
- method objType
- method objDescription
- method popUp
- method archive
- method archiveFinished
- }
-
- constructor RepArchCorporateDialog {class this name view} {
- set this [RepArchDialog::constructor $class $this $name $view]
- # Start constructor user section
-
- $this config \
- -title "Archive Entire Corporate" \
- -helpPressed "$view helpOnName archiveCorporate"
-
- [$this dirLabel] text "Corporate Directory"
-
- # End constructor user section
- return $this
- }
-
- method RepArchCorporateDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this RepArchDialog::destructor
- }
-
- method RepArchCorporateDialog::objType {this} {
- return "Corporate"
- }
-
- method RepArchCorporateDialog::objDescription {this} {
- set corp [[[$this view] rep] checkCorporate]
- return "repository '[$corp name]'"
- }
-
- method RepArchCorporateDialog::popUp {this} {
- $this RepArchDialog::popUp
- }
-
- method RepArchCorporateDialog::archive {this} {
- set rep [[$this view] rep]
- set dstFile [[$this dstField] text]
- set repName [$this currentRepositoryName]
- set repDir [$this currentRepositoryDir]
-
- return [$rep archiveRepositoryDirectory "$this archiveFinished" \
- $dstFile $repName $repDir]
- }
-
- method RepArchCorporateDialog::archiveFinished {this exitCode} {
- if {$exitCode == 0} {
- if [catch {
- set view [$this view]
- set rep [$view rep]
- set corp [$rep checkCorporate]
- if [$view projectsEnabled] {
- foreach proj [$corp projects] {
- $proj online
- }
- }
- if [$view modelsEnabled] {
- foreach model [$corp models] {
- if ![$model reserved] {
- continue
- }
- set comment [$model reserveComment]
- if {$comment == "Reserved for backup."} {
- $model unreserve
- }
- }
- }
- } error] {
- $this RepArchDialog::archiveFinished 1
- error $error
- return
- }
- }
- $this RepArchDialog::archiveFinished $exitCode
- }
-
- # Do not delete this line -- regeneration end marker
-
-