home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: %W%
- # Author: edri
- # Description: Instantiation of the Repository Tool and its views.
- #---------------------------------------------------------------------------
- # SccsId = %W% %G% Copyright 1996 Cadre Technologies Inc.
-
- OtkRegister::extGui
-
- source [m4_path_name tcl libocl.tcl]
-
- require platform.tcl
- require procs.tcl
- require systemutil.tcl
- require messagehdl.tcl
- require options.tcl
-
- # Options common to tool and views.
- #
- set reptoolOptions(-caller) {caller arg "" "caller of this tool"}
- set reptoolOptions(-levelPath) {levelPath arg "" "level path to use"}
- set reptoolOptions(-levelPathIds) {levelPathIds arg "" "level path ids to use"}
-
- if [catch {Options::parse reptool reptoolOptions argv} argError] {
- puts stderr $argError
- exit 1
- }
-
- # Clear levelpath variables because we don't want the connection
- # with the dbserver made now. Only after the tool's main window
- # has been exposed we want that.
- #
- if {$levelPath == ""} {
- set levelPath [m4_var get M4_levelpath]
- m4_var set M4_levelpath ""
- }
-
- if {$levelPathIds == ""} {
- set levelPathIds [m4_var get M4_levelpath_ids]
- m4_var set M4_levelpath_ids ""
- }
-
- if [lempty $argv] {
- # Main tool should be started.
- #
- require reptool.tcl
- set repTool RepTool
- } else {
- # The view specified by $argv should be started.
- # Allow unique abbreviations of the Tcl file name.
- #
- set tool [lindex $argv 0]
- switch -glob -- $tool {
- co* { set tool corpmanvie.tcl }
- u* { set tool userenvvie.tcl }
- lo* { set tool lockmanvie.tcl }
- cs* { set tool csconfigvi.tcl }
- default { error "To start a specific tool, use one of\
- 'corp', 'user', 'lock' or 'cs'." }
- }
- require $tool
-
- # Sourced view file defines a static proc repToolClass which returns the
- # class name of the view.
- #
- set repTool [[info commands *::repToolClass]]
- }
-
- sourceOptional u_reptool
-
- $repTool new .main \
- -caller $caller \
- -levelPath $levelPath \
- -levelPathIds $levelPathIds
-
- .main popUp
- .main ready
-