home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
drsude.tcl
< prev
next >
Wrap
Text File
|
1997-09-23
|
6KB
|
209 lines
# Copyright (c) 1997 by Cayenne Software Inc.
#
# This software is furnished under a license and may be used only in
# accordance with the terms of such license and with the inclusion of
# the above copyright notice. This software or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the software is hereby transferred.
#
# The information in this software is subject to change without notice
# and should not be construed as a commitment by Cayenne Software Inc
#
#---------------------------------------------------------------------------
#
# File : @(#)drsude.tcl /main/titanic/4 23 Jan 1997
# Author : H. Broeze
# Original date : 14 Januari 1997
# Description : DOORS navigation to ObjectTeam
#
#---------------------------------------------------------------------------
#
OtkRegister::extGui
source [m4_path_name tcl libocl.tcl]
require platform.tcl
require procs.tcl
require messagehdl.tcl
set caller ""
set args $argv
regsub -all {\\} $args "" args
set parentOTVersionsOfFileDict [Dictionary new]
set parentOTVersionsOfSystemDict [Dictionary new]
set parentOTVersionsOfPhaseDict [Dictionary new]
set projSelectedItems [lindex $args 0]
global projName
global configVersion
global phaseVerison
global systemVersion
set configVersion ""
set systemVersion ""
set fileVersion ""
set projName [lindex $args 1]
if {[llength $args] >= 5} {
set phaseName [lindex $args 3]
$parentOTVersionsOfPhaseDict contents [lindex $args 4]
}
if {[llength $args] >= 7} {
set systemName [lindex $args 5]
$parentOTVersionsOfSystemDict contents [lindex $args 6]
}
if {[llength $args] == 11 || [llength $args] == 12} {
set fileType [lindex $args 7]
set fileName [lindex $args 9]
$parentOTVersionsOfFileDict contents [lindex $args 10]
}
if {[llength $args] >= 15} {
set fileType [lindex $args 11]
set fileName [lindex $args 9]/[lindex $args 13]
$parentOTVersionsOfFileDict contents [lindex $args 14]
}
set configOptions ""
if [catch {set cc [ClientContext::global]}] {
set cc [ClientContext::global]
}
set corporate [$cc currentCorporate]
set proj [$corporate findProject $projName]
if [$proj isNil] {
wmtkerror "Project with name '$projName' does not exist"
.main popUp
return
}
$parentOTVersionsOfFileDict foreach fileVersion systemVersions {
foreach systemVersion $systemVersions {
foreach phaseV [$parentOTVersionsOfSystemDict set $systemVersion] {
foreach confVId [$parentOTVersionsOfPhaseDict set $phaseV] {
if {[lsearch $configOptions $confVId] == -1} {
lappend configOptions $confVId
}
}
}
}
}
require "diagramedi.tcl"
sourceOptional u_ude
set editorType $fileType
set type $fileType
if {[string length $fileType] != 3 && $fileType != "Attribute" && $fileType != "Operation"} {
set editorType [lindex $args 11]
}
require "${editorType}editor.tcl"
[string toupper $editorType]Editor new .main \
-caller "$caller"
set fileDict [Dictionary new]
proc selectFromObject {confV phaseV systemV itemName itemType } {
set workItem [$systemV findDeclaration $itemName cl $confV]
set item [$workItem item]
$item getDecompositions $phaseV $systemV decompComponents $editorType resultSystems resultFiles
set fileNames ""
foreach graph $resultFiles {
set fileName [[$graph file] name]
$fileDict set $fileName $graph
lappend fileNames $fileName
}
if {[llength $fileNames] == 0} {
wmtkinfo "$itemType $itemName does not exist in any $editorType diagram"
}
if {[llength $fileNames] == 1} {
fileSelected $confV $systemV [$fileDict set $fileNames]
}
if {[llength $fileNames] > 1} {
ListDialog new .main.selectFile \
-message "Select File Name/Version"\
-okPressed {
set selFileName [.main.selectFile selectedSet]
global fileVersion
set fileVersion [$fileDict set $selFileName]
#.main fileVersion $fileVersion
startEdit
}
.main.selectFile entrySet $fileNames
.main.selectFile popUp
}
global configVersion
set configVersion $confV
global systemVersion
set systemVersion $systemV
.main popUp
}
proc findFile { $proj configV } {
set configVList [split $configV .]
set confName [lindex $configVList 0]
set confVersion [lindex $configVList 1]
set configV [$proj findConfigVersion $confName $confVersion]
set phaseV [$configV findPhaseVersion $phaseName $phaseName]
set systemV [$phaseV findSystemVersion $systemName system]
if {[lsearch "Class UseCase" $fileType] != -1} {
selectFromObject $configV $phaseV $systemV $fileName $fileType
} else {
set fileV [$systemV findFileVersion $fileName $fileType]
if ![$fileV isNil] {
fileSelected $configV $systemV $fileV
} else {
global configVerison
global systemVersion
set configVersion $configV
set systemVersion $systemV
if {[string length $fileType] > 3} {
wmtkinfo "${fileType}s are not supported for navigation"
} else {
wmtkinfo "$fileType $fileName does not exist"
}
}
}
}
proc startEdit {} {
set cc [ClientContext::global]
set corp [$cc currentCorporate]
set proj [$configVersion project]
set phase [$configVersion findPhaseVersion -byPhase [$systemVersion phase]]
set str /[$corp identity]
append str /[$proj identity]
append str /[$configVersion identity]
append str /[$phase identity]
append str /[$systemVersion identity]
append str /[$fileVersion identity]
set file [$fileVersion file]
set type [$file type]
.main diagramType $type
.main startEdit $str
}
proc fileSelected { configV systemV fileV} {
global configVersion
global systemVersion
global fileVersion
set configVersion $configV
set systemVersion $systemV
set fileVersion $fileV
startEdit
}
if {[llength $configOptions] > 1 } {
ListDialog new .main.listDialog \
-message "Select Configuration Name/Version"\
-okPressed {
.main popUp
.main ready
findFile $proj [.main.listDialog selectedSet]
}
.main.listDialog entrySet $configOptions
.main.listDialog popUp
} else {
findFile $proj $configOptions
.main popUp
}