home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
ssysvdbobj.tcl
< prev
next >
Wrap
Text File
|
1997-05-30
|
11KB
|
404 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)ssysvdbobj.tcl /main/hindenburg/6
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)ssysvdbobj.tcl /main/hindenburg/6 30 May 1997 Copyright 1996 Cayenne Software Inc.
# Start user added include file section
require "svdgvuiobj.tcl"
require "wmt_util.tcl"
# End user added include file section
require "sysvdbobj.tcl"
Class SSysVDbObj : {SysVDbObj} {
method destructor
constructor
method promoter
method addExternalLinks
method addFileVersion
method addGroupVersion
method allowsDrop
method canBeDragged
method compareWithPrevPhase
method importFiles
method importFromPrevPhase
method prevPhaseExists
method printObjects
method reverseEngineer
method savedGroupVersions
method snapshotObjects
attribute prevPhaseV
attribute savedGroupVersionSet
}
method SSysVDbObj::destructor {this} {
# Start destructor user section
[$this savedGroupVersionSet] delete
# End destructor user section
$this SysVDbObj::destructor
}
constructor SSysVDbObj {class this name} {
set this [SysVDbObj::constructor $class $this $name]
return $this
}
method SSysVDbObj::promoter {this} {
$this SysVDbObj::promoter
set savedGroupVersionSet $this.${SvdGVUiObj::uiClass}:0
if {! [isCommand $savedGroupVersionSet]} {
SvdGVUiObj new $savedGroupVersionSet -parent $this
}
$this savedGroupVersionSet $savedGroupVersionSet
}
method SSysVDbObj::addExternalLinks {this} {
set box $wmttoolObj.newExternalL
if {! [isCommand $box]} {
ClassMaker::extend FileChooser NewExternalLFileChooser dbObj
NewExternalLFileChooser new $box \
-title "New External Link(s)" \
-selectionPolicy EXTENDED \
-directory [pwd] \
-filter "*.*" \
-okPressed {
set script ""
set invisibleTypes ""
set currentSpec [[$wmttoolObj infoView] currentSpec]
if [isCommand $currentSpec] {
set visibleTypes [$currentSpec objectTypes]
} else {
set visibleTypes ""
}
foreach external [%this selectedSet] {
set type [path_name type $external]
set name [path_name base $external]
if {(! [lempty $visibleTypes]) &&
[lsearch -exact $visibleTypes "$type"] == -1} {
append invisibleTypes "\n$external"
}
if {"$script" != ""} {
append script " ;"
}
append script \
" [%this dbObj] createExternalLink \
[list $name] [list $type] [list $external]"
}
if {"$script" != ""} {
$wmttoolObj startCommand tcl \
"$script" "" \
"Creating external file link(s)..." \
{1 0} 1
}
if {"$invisibleTypes" != ""} {
set box $wmttoolObj.newExternalLWarning
set message \
"The following external file links are not visible\n\
within the current view:\n\
$invisibleTypes"
WarningDialog new $box \
-title "New External Link(s) Warning" \
-message $message \
-helpPressed {.main helpOnName newExternalLWarning} \
-okPressed "$box delete"
$box popUp
}
}
$box delHelpButton
}
$box dbObj $this
$box popUp
}
method SSysVDbObj::addFileVersion {this type} {
require "newdiagram.tcl"
set box "$wmttoolObj.new[string toupper $type]"
if {! [isCommand $box]} {
NewDiagramDlg new $box -type $type
}
$box dbObj $this
$box popUp
}
method SSysVDbObj::addGroupVersion {this} {
require "newgroupvd.tcl"
set box $wmttoolObj.newGroupV
if {! [isCommand $box]} {
NewGroupVDlg new $box
}
$box dbObj $this
$box popUp
}
method SSysVDbObj::allowsDrop {this uiClass} {
case "$uiClass" in {
{CorporateGroupVersion Graph GroupVersion Matrix} {
return 1
}
{default} {
return 0
}
}
}
proc SSysVDbObj::associations {} {
return {\
localFileVersions groupVersions customFileVersionSet \
savedGroupVersionSet workItemSet controlledListSet accessRuleSet\
}
}
method SSysVDbObj::canBeDragged {this} {
return 1
}
proc SSysVDbObj::childTypes {assoc} {
if {[lsearch -exact "[SSysVDbObj::associations]" "$assoc"] == -1} {
return ""
}
set childTypes [BrowserProcs::childTypes $assoc]
case "$childTypes" in {
{LocalFileVersion} {
return "${BrowserProcs::diagramFileTypes}"
}
{default} {
return [SysVDbObj::childTypes "$assoc"]
}
}
}
method SSysVDbObj::compareWithPrevPhase {this} {
require "comparepha.tcl"
ComparePhaseDlg new $wmttoolObj.compareWithPrevPhase \
-dbObj $this \
-title "Compare With Previous Phase" \
-helpPressed {.main helpOnName compareWithPrevPhase}
$wmttoolObj.compareWithPrevPhase popUp
}
proc SSysVDbObj::controlledLists {} {
return [concat \
[SysVDbObj::controlledLists] \
{"[$this corporateGroupVersionLinkList]"
"[$this externalLinkList]"
"[[$this system] groupList]"
"[$this groupVersionLinkList]"} \
]
}
method SSysVDbObj::importFiles {this fileList overwriteFlag} {
set args "-f impfiles.tcl"
if {"$overwriteFlag" != "" || (! [lempty $fileList])} {
append args " --"
if {"$overwriteFlag" != ""} {
append args " $overwriteFlag"
}
if {! [lempty $fileList]} {
append args " $fileList"
}
}
set script "[quoteIf [m4_path_name bin otsh$EXE_EXT]] $args"
$wmttoolObj startCommand mtool \
"$script" "" "Starting 'Import Files'" {1 0} 0
}
method SSysVDbObj::importFromPrevPhase {this mode} {
set fileList ""
case "$mode" in {
{selected} {
foreach obj [$wmttoolObj selectedObjSet] {
if [$obj isA SystemFileReference] {
set fileV [$obj getInfo "File Version"]
if {"$fileV" != ""} {
lappend fileList [[$fileV file] identity]
}
} elseif [$obj isA FileVersion] {
lappend fileList [[$obj file] identity]
}
}
}
}
ClassMaker::extend YesNoWarningDialog OverwritePropertiesDialog \
{dbObj fileList}
set box $wmttoolObj.overwriteProperties
OverwritePropertiesDialog new $box \
-title "Overwrite Properties" \
-message "Should properties of existing items be overwritten ?" \
-dbObj $this \
-fileList $fileList \
-yesPressed {
[%this dbObj] importFiles "[%this fileList]" "-overwrite"
%this delete
} \
-noPressed {
[%this dbObj] importFiles "[%this fileList]" ""
%this delete
} \
-cancelPressed {%this delete} \
-helpPressed {.main helpOnName overwriteProperties}
$box popUp
}
proc SSysVDbObj::infoProperties {} {
return [SysVDbObj::infoProperties]
}
method SSysVDbObj::prevPhaseExists {this} {
set confV [$this getParent ConfigVersion]
set phaseV [$this getParent PhaseVersion]
set prevPhaseV [$phaseV previous $confV]
if {! [$prevPhaseV isA PhaseVersion]} {
return 0
}
$this prevPhaseV $prevPhaseV
return 1
}
method SSysVDbObj::printObjects {this} {
set asciiFiles ""
set topostObjects ""
set errorStack ""
set confV [$this getParent ConfigVersion]
foreach obj [$wmttoolObj selectedObjSet] {
if [$obj isA ExternalLink] {
lappend asciiFiles [$obj path]
} elseif [$obj isA SystemFileReference] {
set fileV [$obj getInfo "File Version"]
if [$fileV isA Graph] {
set sysV [$obj referredSystemVersion]
if [$sysV isNil] {
if {"$errorStack" == ""} {
append errorStack "\n"
}
append errorStack "Could not print \
[$obj getInfo Type] '[$obj getInfo Name]':\n \
System '[[$obj referredSystem] name]' is not \
selected within the current PhaseVersion"
} else {
require "print.tcl"
eval Print::printDiagrams \
-configVersion $confV \
-systemVersion $sysV \
$fileV
}
} elseif [$fileV isA ExternalFileVersion] {
$fileV synchWithFileSystem
lappend asciiFiles [$fileV path]
}
} elseif [$obj isA Graph] {
lappend topostObjects $obj
} elseif [$obj isA ExternalFileVersion] {
$obj synchWithFileSystem
lappend asciiFiles [$obj path]
}
}
BrowserProcs::printObjects $asciiFiles "" $topostObjects
if {"$errorStack" != ""} {
wmtkerror $errorStack
}
}
method SSysVDbObj::reverseEngineer {this lang language hdrFileType} {
# e.g.: lang = "cpp", language = "C++", hdrFileType = "h++"
set typeSpec [getObjectSpec [$wmttoolObj objectHdlr] \
ExternalFileVersion $hdrFileType]
set hdrFileExt $hdrFileType
if {"$typeSpec" != ""} {
set hdrFileExt [$typeSpec fsExtension]
}
set filter *
if {"$hdrFileExt" != ""} {
append filter .$hdrFileExt
}
set box $wmttoolObj.reverseEngineer[cap $lang]Files
if {! [isCommand $box]} {
ClassMaker::extend FileChooser RevEng[cap $lang]FileChooser {dbObj lang}
RevEng[cap $lang]FileChooser new $box \
-title "Reverse Engineer $language" \
-selectionPolicy EXTENDED \
-directory [pwd] \
-filter $filter \
-okPressed {
set clang [cap [%this lang]]
set box $wmttoolObj.reverseEngineer$clang
require [string range reveng[%this lang]dlg 0 9].tcl
if {! [isCommand $box]} {
RevEng${clang}Dlg new $box \
-helpPressed ".main helpOnName reverseEngineer$clang"
}
$box config \
-dbObj [%this dbObj] \
-headerFiles [%this selectedSet]
$box popUp
}
$box delHelpButton
}
$box dbObj $this
$box lang $lang
$box popUp
}
method SSysVDbObj::savedGroupVersions {this} {
set savedGroupVersions ""
foreach savedGroup [[$this system] savedGroups] {
set savedGroupVersions \
[concat $savedGroupVersions [$savedGroup savedGroupVersions]]
}
return $savedGroupVersions
}
method SSysVDbObj::snapshotObjects {this} {
set objList [$wmttoolObj selectedObjSet]
if [lempty $objList] {
return
}
foreach obj $objList {
if {! [$obj isA GroupVersion]} {
return
}
}
if {! [isCommand $wmttoolObj.snapshotVersion]} {
ClassMaker::extend EntryDialog SnapshotVEntryDialog {dbObj objList}
SnapshotVEntryDialog new $wmttoolObj.snapshotVersion \
-modal yes \
-title "Snapshot" \
-message "Comments:" \
-helpPressed {.main helpOnName snapshotVersion} \
-okPressed {
set comments [%this entry]
set dbObj [%this dbObj]
set objList [%this objList]
set script ""
set confV [$dbObj getParent ConfigVersion]
foreach obj $objList {
if {"$script" != ""} {
append script " ;"
}
append script \
" $obj snapshot $dbObj $confV [list $comments]"
}
$wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
}
}
$wmttoolObj.snapshotVersion config \
-dbObj $this \
-objList $objList
$wmttoolObj.snapshotVersion popUp
}
# Do not delete this line -- regeneration end marker