home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)msexportco.tcl /main/hindenburg/5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)msexportco.tcl /main/hindenburg/5 15 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- #require "msrepchoos.tcl"
-
- Class MsExportControl : {MsRepChooser} {
- constructor
- method destructor
- method handleOk
- method export
- method createRep
- method installUML
- method UMLInstalled
- method enterModelName
- attribute systems
- }
-
- constructor MsExportControl {class this name userName password i_systems} {
- set this [MsRepChooser::constructor $class $this $name $userName $password]
- $this systems $i_systems
- # Start constructor user section
- $this config \
- -title "Repository to export to"
-
- # End constructor user section
- return $this
- }
-
- method MsExportControl::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this MsRepChooser::destructor
- }
-
- method MsExportControl::handleOk {this} {
- $this MsRepChooser::handleOk
-
- if ![$this repFound] {
- $this repFound [$this createRep]
- return
- }
- if ![$this repFound] {
- return
- }
- if ![$this hasUml] {
- $this installUML
- }
- $this enterModelName
-
- }
-
- method MsExportControl::export {this modelName} {
- wmtkmessage "Starting to export ..."
- set otprintScr "[m4_path_name bin otsh$EXE_EXT] -f \
- [quoteIf [m4_var get M4_home]/contrib/ObjectTeamMsRepUml/tcl/msumlexport.tcl] -- [$this repName] $modelName [$this systems]"
- .main startCommand mtool $otprintScr "" \
- "Exporting to MS Repository [$this repName]" {0 0} 0
- $this delete
-
- }
-
- method MsExportControl::createRep {this} {
- set box .main.msCreateRepQuestion
- if ![isCommand $box] {
- ClassMaker::extend QuestionDialog CreRepQuestionDialog control
- CreRepQuestionDialog new $box \
- -title "Repository Creation" \
- -message "Do you want to create an Access database?"\
- -okPressed {
- [%this control] installUML
- }
- }
- $box control $this
- $box popUp
- }
-
- method MsExportControl::installUML {this} {
- set newRep [OleAutoObject new Repository]
- regsub -all {\\} [$this repName] {/} repName
- if ![string match *.mdb $repName ] {
- set repName $repName.mdb
- }
- if ![file isfile $repName] {
- wmtkmessage "Creating $repName ..."
- $newRep Create $repName
- }
- set catched [catch {set umlInstall [OleAutoObject new UMLInstall.TIM]}]
- wmtkmessage "Installing UMLInstall.TIM ..."
- set catched [catch { $umlInstall Install $repName }]
- #$umlInstall Install $repName "" ""
- $newRep delete
- $umlInstall delete
- $this enterModelName
- }
-
- method MsExportControl::UMLInstalled {this} {
- # !! Implement this function !!
- }
-
- method MsExportControl::enterModelName {this} {
- set box .main.msModelNameEntry
- if ![isCommand $box] {
- ClassMaker::extend EntryDialog ModelEntryDialog control
- ModelEntryDialog new $box \
- -modal yes \
- -title "Model Name" \
- -message "Enter model name:" \
- -entry "ObjectTeam-Model" \
- -okPressed {
- [%this control] export [%this entry]
- }
- }
- $box control $this
- $box popUp
- }
-
- # Do not delete this line -- regeneration end marker
-
-