home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)contsysvdb.tcl /main/hindenburg/4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)contsysvdb.tcl /main/hindenburg/4 16 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- require_module_file "newcontinu.tcl" continuus-vcm
- require_module_file "contsysdia.tcl" continuus-vcm
- require_module_file "contchange.tcl" continuus-vcm
- require_module_file "vssyswarni.tcl" vcm
- # End user added include file section
-
- require_module_file "contsystem.tcl" continuus
- require_module_file "vssysvdbob.tcl" vcm
-
- # This class represents a system with Continuus files in the browser.
-
- Class ContSysVDbObj : {ContSystem VSSysVDbObj} {
- constructor
- method destructor
- method promoter
- method promoteFile
- method path
- method localFileVersions
- method copy
- method vsFiles
- method fileList
- method addContFile
- method checkOutFiles
- method checkInFiles
- method checkInTask
- method findUse
- method useVersion
- method unUseVersions
- method deleteVersions
- method history
- method editProperties
- method updateWorkArea
- method startQuery
- method startObjectMake
- method startSelectTask
- method startProblemTracking
- method showProjectVersion
- method changeProjectVersion
- method initializeVCMVars
-
- # Used to hold information about files in this system:
- # Version, Owner, Status, Continuus Type, Created,
- # Modified, Platform, Release, Task.
- # For performance reasons.
- #
- attribute continuusFileInfoDict
- }
-
- constructor ContSysVDbObj {class this name i_name} {
- set this [ContSystem::constructor $class $this $name]
- set this [VSSysVDbObj::constructor $class $this $i_name]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method ContSysVDbObj::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this ContSystem::destructor
- $this VSSysVDbObj::destructor
- }
-
-
- # Reuse associations of VSSysVDbObj.
- #
- proc ContSysVDbObj::associations {} {
- return [VSSysVDbObj::associations]
- }
-
-
- # Reuse childTypes of VSSysVDbObj.
- #
- proc ContSysVDbObj::childTypes {assoc} {
- return [VSSysVDbObj::childTypes $assoc]
- }
-
-
- # Reuse controlledLists of VSSysVDbObj.
- #
- proc ContSysVDbObj::controlledLists {} {
- return [VSSysVDbObj::controlledLists]
- }
-
-
- # Reuse infoProperties of VSSysVDbObj.
- #
- proc ContSysVDbObj::infoProperties {} {
- return [VSSysVDbObj::infoProperties]
- }
-
- method ContSysVDbObj::promoter {this} {
- $this continuusFileInfoDict [Dictionary new]
- $this VSSysVDbObj::promoter
- }
-
-
- # Promotes file to a ContFileUiObj.
- #
- method ContSysVDbObj::promoteFile {this file} {
- ContFileUiObj promote $file
- }
-
-
- # Call path in ContSystem.
- #
- method ContSysVDbObj::path {this} {
- return [$this ContSystem::path]
- }
-
-
- # Resolve ambiguity: call localFileVersions of ContSystem.
- #
- method ContSysVDbObj::localFileVersions {this} {
- return [$this ContSystem::localFileVersions]
- }
-
-
- # Call copy of VSSysDbObj.
- #
- method ContSysVDbObj::copy {this args} {
- eval $this VSSysVDbObj::copy $args
- }
-
-
- # Redefine to perform initialization and cache updates.
- #
- method ContSysVDbObj::vsFiles {this} {
- # read customization files for this system
- if { ![$this initializedCustomization] } {
- $this initializeCustomization
- }
- $this initializeVCMVars
-
- set files [$this ContSystem::vsFiles]
- $this updateFileInfo $files
- return $files
- }
-
-
- # returns a list of Continuus controlled file names in
- # the directories specified in pathList and
- # fills continuusFileInfoDict with additional
- # info about the files.
- #
- method ContSysVDbObj::fileList {this pathList} {
- # refresh continuusFileInfoDict
- foreach name [[$this continuusFileInfoDict] names] {
- [$this continuusFileInfoDict] unset $name
- }
-
- ContCommand::longListing $pathList [$this continuusFileInfoDict]
- set fileList {}
- foreach fileName [[$this continuusFileInfoDict] names] {
- lappend fileList [path_name file $fileName]
- }
-
- return $fileList
- }
-
-
- # Pop up dialog to create new Continuus file.
- #
- method ContSysVDbObj::addContFile {this} {
- if { ![isCommand .main.newContFile] } {
- NewContinuusFileDialog new .main.newContFile
- }
-
- .main.newContFile popUp
- }
-
- method ContSysVDbObj::checkOutFiles {this} {
- if { ![isCommand .main.cont.checkout] } {
- ContSysDialog new .main.cont.checkout
- .main.cont.checkout contDialogCommand [ContCommand::checkOutDialog]
- .main.cont.checkout needsUpdate 1
- }
-
- .main.cont.checkout popUpContinuusDialog
- }
-
- method ContSysVDbObj::checkInFiles {this} {
- if { ![isCommand .main.cont.checkin] } {
- ContSysDialog new .main.cont.checkin
- .main.cont.checkin contDialogCommand [ContCommand::checkInDialog]
- .main.cont.checkin needsUpdate 1
- }
-
- .main.cont.checkin popUpContinuusDialog
- }
-
-
- # Checks in the task related with the selected file in the browser.
- # Generates warning if no task is associated.
- #
- method ContSysVDbObj::checkInTask {this} {
- set selectedFile [lindex [.main selectedObjSet] 0]
- set task [$selectedFile getInfo Task]
- set fileVersion "[path_name file [$selectedFile path]]-[$selectedFile getInfo Version]"
- if { "$task" == "<void>" } {
- wmtkwarning "No tasks associated with $fileVersion"
- return
- }
-
- vsCommandHandler execute [ContCommand::checkInTaskDialog $task]
- }
-
-
- # Pop up the find use dialog for the selected object.
- #
- method ContSysVDbObj::findUse {this} {
- if { ![isCommand .main.cont.finduse] } {
- ContSysDialog new .main.cont.finduse
- .main.cont.finduse contDialogCommand [ContCommand::findUseDialog]
- .main.cont.finduse needsUpdate 0
- }
-
- .main.cont.finduse popUpContinuusDialog
- }
-
- method ContSysVDbObj::useVersion {this} {
- if { ![isCommand .main.cont.use] } {
- ContSysDialog new .main.cont.use
- .main.cont.use contDialogCommand [ContCommand::useDialog]
- .main.cont.use needsUpdate 1
- }
-
- .main.cont.use popUpContinuusDialog
- }
-
- method ContSysVDbObj::unUseVersions {this} {
- if { ![isCommand .main.contUnuse] } {
- VSSysWarningDialog new .main.contUnuse
- .main.contUnuse vsMethod { $file unuseVersion }
- .main.contUnuse action "Unuse and replace current version of"
- }
-
- .main.contUnuse popUp
- }
-
- method ContSysVDbObj::deleteVersions {this} {
- if { ![isCommand .main.contDelete] } {
- VSSysWarningDialog new .main.contDelete
- .main.contDelete vsMethod { $file deleteVersion }
- .main.contDelete action "Delete and replace current version of"
- }
-
- .main.contDelete popUp
- }
-
- method ContSysVDbObj::history {this} {
- if { ![isCommand .main.cont.history] } {
- ContSysDialog new .main.cont.history
- .main.cont.history contDialogCommand [ContCommand::historyDialog]
- .main.cont.history needsUpdate 0
- }
-
- .main.cont.history popUpContinuusDialog
- }
-
- method ContSysVDbObj::editProperties {this} {
- if { ![isCommand .main.cont.properties] } {
- ContSysDialog new .main.cont.properties
- .main.cont.properties contDialogCommand [ContCommand::propertyDialog]
- .main.cont.properties needsUpdate 0
- }
-
- .main.cont.properties popUpContinuusDialog
- }
-
- method ContSysVDbObj::updateWorkArea {this} {
- set reconfigCommand [ContCommand::reconfigure [$this path]]
- vsCommandHandler execute $reconfigCommand
-
- .main updateView
- }
-
- method ContSysVDbObj::startQuery {this} {
- set queryDialog [ContCommand::queryDialog]
- vsCommandHandler execute $queryDialog
- }
-
- method ContSysVDbObj::startObjectMake {this} {
- set objectMakeDialog [ContCommand::objectMakeDialog]
-
- # invoke from current directory
- set oldDir [pwd]
- cd [$this path]
- vsCommandHandler execute $objectMakeDialog
- cd $oldDir
- }
-
- method ContSysVDbObj::startSelectTask {this} {
- set selectTaskDialog [ContCommand::selectTaskDialog]
- vsCommandHandler execute $selectTaskDialog
- }
-
- method ContSysVDbObj::startProblemTracking {this} {
- set problemTrackingDialog [ContCommand::problemTrackingBrowser]
- vsCommandHandler execute $problemTrackingDialog
- }
-
-
- # Show the project version currently in use in
- # an info dialog box.
- #
- method ContSysVDbObj::showProjectVersion {this} {
- InfoDialog new .main.versionInfo \
- -title "Current Project Version" \
- -message "[$this currentProjectVersion]" \
- -okPressed { %this delete }
-
- .main.versionInfo delHelpButton
- .main.versionInfo popUp
- }
-
-
- # Change the current project version:
- # allow selection of the working versions
- # or selection of the latest working version.
- #
- method ContSysVDbObj::changeProjectVersion {this} {
- if { ![isCommand .main.changeprojectversion] } {
- ContChangeProjectVersionDialog new .main.changeprojectversion
- }
-
- # pass current version
- set currentProjectVersion [$this currentProjectVersion]
- .main.changeprojectversion currentVersion $currentProjectVersion
-
- # make list of project versions and pass to dialog
- regsub {\-[^-]*$} $currentProjectVersion "" project
- set projectVersions {}
- foreach version [ContCommand::getWorkingProjectVersions $project] {
- lappend projectVersions "$project-$version"
- }
- .main.changeprojectversion workingVersions $projectVersions
- .main.changeprojectversion currentSystem $this
-
- .main.changeprojectversion popUp
- }
-
-
- # Initialize work area variable.
- #
- method ContSysVDbObj::initializeVCMVars {this} {
- # sport7/Continuus: initialize Continuus vars, always at system level
- global ContCommand::ccmWorkArea
- if { ${ContCommand::ccmWorkArea} == "" } {
- if { ![ContCommand::initializeCcmVars] } {
- return
- }
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-