home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
msumlinsta.tcl
< prev
next >
Wrap
Text File
|
1997-06-03
|
4KB
|
120 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 : @(#)msumlinsta.tcl /main/hindenburg/2
# Author : H. Broeze
# Original date : 12 Febuary 1997
# Description : MS Repository project configuration
#
#---------------------------------------------------------------------------
#
source [m4_path_name tcl libocl.tcl]
set requiredEtcFiles "msumldesk.mnu"
#check arguments
if { [llength $argv] != 1} {
puts "ERROR: invalid number of arguments"
puts "USAGE: otsh -f <M4_home>/contrib/ObjectTeamMsRepUml/tcl/msumlinsta.tcl -- <OT project name>"
exit
}
# check the existance of the required custom files
#
set M4home [m4_var get M4_home]
set fullFileName [path_name concat $M4home contrib]
set fullFileName [path_name concat $fullFileName ObjectTeamMsRepUml]
set fullFileName [path_name concat $fullFileName etc]
set fullFileName [path_name concat $fullFileName msumldesk.mnu]
if ![file isfile $fullFileName] {
puts "Required etc-file $fullFileName does not exist"
exit
}
# Just some help features
#
proc CustomName {name} {
set entries [split $name '.']
return [lindex $entries 0]
}
proc CustomType {name} {
set entries [split $name '.']
return [lindex $entries 1]
}
# Append a file
#
proc append_text_file {from to } {
set max 8092
set in [open $from r]
set out [open $to a]
while {[set result [read $in $max]] != ""} {
puts $out $result nonewline
}
close $in
close $out
}
set cont [ClientContext::global]
set corp [$cont currentCorporate]
if [$corp isNil] {
puts "LevelPath [$cont currentLevelString] has no corporate"
exit
}
set projName [lindex $argv 0]
set project [$corp findProject $projName]
if [$project isNil] {
puts "Project $projName does not exist"
exit
}
set etcFile $requiredEtcFiles
#for
set installEtcFileName [CustomName $etcFile]
set etcFileName "desk"
set customFileV [$project findCustomFileVersion \
$etcFileName [CustomType $etcFile]]
if ![$customFileV isNil] {
$customFileV edit
$customFileV quit
}
set etcFile $requiredEtcFiles
# for loop
set concatTmpFile [args_file {}]
set installEtcFileName [CustomName $etcFile]
set etcFileName "desk"
set customFileV [$project findCustomFileVersion \
$etcFileName [CustomType $etcFile]]
if [$customFileV isNil] {
set customFileV [$project createCustomFileVersion \
$etcFileName [CustomType $etcFile] ]
} else {
$customFileV downLoad $concatTmpFile
}
append_text_file $fullFileName $concatTmpFile
$customFileV edit
$customFileV upLoad $concatTmpFile
$customFileV quit
puts "Installation of MSRepository integration menu extension finished."
puts "After reentering your project in ObjectTeam the Utilities menu will be extended when you are at config or phase level"