home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
stimporter.tcl
< prev
next >
Wrap
Text File
|
1997-06-19
|
3KB
|
123 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)stimporter.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)stimporter.tcl /main/titanic/2 19 Jun 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require st_msg.tcl
require stgclasses.tcl
require stgrammar.tcl
require stgentor.tcl
# End user added include file section
require "importer.tcl"
Class StImporter : {Importer} {
constructor
method destructor
method generateOopl
method getFileNamesNotToGenerateFor
method getOoplFileTypesToGenerateFor
}
constructor StImporter {class this} {
set this [Importer::constructor $class $this]
# Start constructor user section
# End constructor user section
return $this
}
method StImporter::destructor {this} {
# Start destructor user section
# End destructor user section
$this Importer::destructor
}
method StImporter::generateOopl {this classes} {
set fileHandler [STFileHandler new]
$fileHandler sourceTclFiles
set selectedClasses [List new]
foreach class $classes {
if [$class isExternal] {
continue
}
if {[$class getName] == ""} {
m4_warning $W_CLASS_WITHOUT_NAME
continue
}
set externalSource [List new]
$externalSource contents [string trim [$class getPropertyValue \
class_source]]
if {![$externalSource empty]} {
$externalSource foreach fileName {
$fileHandler importExternal $class [$fileHandler stType] \
$fileName
}
continue
}
$selectedClasses append $class
}
$fileHandler checkUniqueFiles $selectedClasses
set generator [STGenerator new]
$selectedClasses foreach class {
set l [List new]
$l append $class
set generatedSections [$generator generate $l]
$generatedSections foreach type classToSection {
$classToSection foreach class section {
$fileHandler writeSectionToFile $section $class $type
}
set classToSection ""
}
set generatedSections ""
}
#
# Special files
#
if [lempty [$this targetObjects]] {
#
# Import all or import new
#
set specialFiles [$fileHandler getSpecialFiles]
} else {
#
# Import selected
#
set specialFiles [List new]
set selectedFiles [$this targetObjects]
[$fileHandler getSpecialFiles] foreach specialFile {
if {[lsearch $selectedFiles $specialFile] != -1} {
$specialFiles append $specialFile
}
}
}
if {![$specialFiles empty]} {
if {[M4CheckManager::getErrorCount] > 0} {
m4_warning $WST_NOGENSPECFLS
} else {
$generator generateSpecialFiles [$this ooplModel] $specialFiles
}
}
}
method StImporter::getFileNamesNotToGenerateFor {this} {
return "vwimport vwexport"
}
method StImporter::getOoplFileTypesToGenerateFor {this} {
return "st"
}
# Do not delete this line -- regeneration end marker