home *** CD-ROM | disk | FTP | other *** search
Wrap
# 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 : @(#)drsotprcon.tcl /main/hindenburg/3 23 Jan 1997 # Author : H. Broeze # Original date : 14 Januari 1997 # Description : DOORS integration class definitions # #--------------------------------------------------------------------------- # source [m4_path_name tcl libocl.tcl] set requiredEtcFiles "drsdiagra.mnu drsdesk.mnu " global argv #check arguments if { [llength $argv] != 1} { puts "ERROR: invalid number of arguments" puts "USAGE: otsh -f drsotprcon.tcl -- <OT project>" exit } #check the existance of the required custom files # foreach etcFile $requiredEtcFiles { set fullFileName [m4_path_name etc $etcFile] 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 } foreach etcFile $requiredEtcFiles { set installEtcFileName [CustomName $etcFile] if {$installEtcFileName == "drsdesk"} { set etcFileName "desk" } else { set etcFileName "diagram" } set customFileV [$project findCustomFileVersion \ $etcFileName [CustomType $etcFile]] if ![$customFileV isNil] { $customFileV edit $customFileV quit } } foreach etcFile $requiredEtcFiles { set concatTmpFile [args_file {}] set installEtcFileName [CustomName $etcFile] if {$installEtcFileName == "drsdesk"} { set etcFileName "desk" } else { set etcFileName "diagram" } set customFileV [$project findCustomFileVersion \ $etcFileName [CustomType $etcFile]] if [$customFileV isNil] { set customFileV [$project createCustomFileVersion \ $etcFileName [CustomType $etcFile] ] } else { $customFileV downLoad $concatTmpFile } append_text_file [m4_path_name etc $etcFile] $concatTmpFile $customFileV edit $customFileV upLoad $concatTmpFile $customFileV quit } puts "Installation of DOORS customization files finished.\nAfter reentering your project the DOORS menu will be visible in the ObjectTeam's browser menu"