In release 6.0, the DODS accepts new options
for generating code.
Starting DODS Generator
There
are two different ways to run dods generator. If you
want to start generator quickly, you can start wizard by
typing:
dods
without any
parameter. Those files are located in :
- <enhydra_home>/bin
folder, for DODS in Enhydra.
- <dods_home>/bin folder,
for independent DODS.
Note: <enhydra_home>/bin (in the case DODS
is used in Enhydra), or <dods_home>/bin folder
(for independent DODS) should be added in the system
path. Then, DODS can be started from any directory (by
typing dods).
In
case you want to generate Java and SQL code manually,
type dods in the command line with desired parameters.
Command line:
dods [-?/help] [-a action] [-t templateset] [-b/-database] [-c confPath]
[-f/force] [-h/html] [-p/pdf] [-x/xmi] [-r/ptl] domlfile outputdir
where:
·
outputdir is
full path to output directory that will be used.
·
domlfile is
full path to .doml file for generating code.
options:
[-?
-help] shows
help.
[-a
action] - ant task parameter for code generation:
·
dods:build_all - to create all sql files and java classes (default).
·
dods:sql - to create only sql files.
·
dods:java - to create only java files and to compile them.
·
dods:javaNoCompile - to create only java files and not to compile them.
·
dods:noCompile - to create SQL files and java files and not to compile
them.
·
dods:build_all_split - to create all sql files and java classes and to compile
it. SQL files will be divided into separate files using
SQLSplitter .
·
dods:sqlsplit - to create only sql files and separate in different files
using SQLSplitter.
·
dods:noCompileSplit - to create SQL files and separate sql commands using
SQLSplitter and java files and not to compile them.
·
dods:generatorOff - to disable generating and compiling of java source code,
for generating documentation only (you stil need to set documentation property:
html, pdf, ptl, xmi).
[-t templateset] - template set for generating
java and sql code:
·
standard - generate standard java code (default).
·
<user defined> - any user defined template set.
[-b/-database] - sets
database vendor for generating sql
[-c
confPath] - sets folder with dodsConf.xml
file
[-f/-force]
- with this switch, code will be always generated,
without it, only changes will be regenerated.
[-h/-html] - generates DODS html
documentation from .doml file.
[-p/-pdf] - generates DODS pdf
documentation from .doml file.
[-x/-xmi] - generates DODS xmi
documentation from .doml file.
[-r/-ptl] - generates DODS ptl (Rational
Rose) documentation from .doml file.
DODS Ant Task
Invokes
DODS to generate a set of java classes from a doml
file.The files will only be regenerated/compiled if the
date on the doml file is newer than at least one of the
generated files. This task extends Ant's ask.
Typically
made visible to an Ant build file (build.xml)
with the following declaration:
<taskdef
name="dods" classname="org.enhydra.ant.taskdefs.Dods"/>
Parameters:
- domlfile-
the doml input file describing data object mapping.
Required = Yes.
- outputDir
- target for generated classes, expressed as a
directory path. Required = Yes.
- force
- forces DODS always to regenerate source files.
Possible values: ("true", "false"(default)).
Required = No.
- action
- name of Ant task from generate.xml.
Required = No.
- templateDir
- name of folder for template set for generating
java code, expressed as a directory path. Required =
No
- templateSet
- template template set for generating java code.
Required = No.
- confDir
- path to custom configuration folder (If the path
is set to any other path than default (offered), in
the application's configuration file shoul be set
parameter: DatabaseManager.ConfigurationDir
to new path of the custom configuration folder).
Required = No.
- database
- sets database vendor for generating sql. Required
= No.
- html
- indicates DODS to generate html documentation from
.doml file. Possible values: ("true",
"false"(default)). Required = No.
- pdf
- indicates DODS to generate pdf documentation from
.doml file. Possible values: ("true",
"false"(default)). Required = No.
- xmi
- Indicates DODS to generate xmi documentation from
.doml file. Possible values: ("true",
"false"(default)). Required = No.
- ptl
- indicates DODS to generate ptl (Rational Rose)
documentation from .doml file. Possible values:
("true", "false"(default)).
Required = No.
action
parameters:
- without
parameters
- to create all sql files and java classes and to
compile it.
- dods:build_all
- to create all sql files and java classes.
- dods:sql
- to create only sql files.
- dods:java
-to create only java files and to compile them.
- dods:javaNoCompile
-To create only java files and not to compile them.
- dods:noCompile
-To create SQL files and java files and not to
compile them.
- dods:build_all_split
- to create all sql files and java classes and to
compile it. SQL files will be divided into separate
files using SQLSplitter
- dods:sqlsplit
- to create only sql files and separate in different
files using SQLSplitter.
- dods:noCompileSplit
- To create SQL files and separate sql commands
using SQLSplitter and java files and not to compile
them.
- dods:generatorOff
- to disable generating and compiling of java source code,
for generating documentation only (you stil need to set documentation property:
html, pdf, ptl, xmi).
templateset
parameters:
- standard
- generate standard java code.
- <user_defined>
- any user defined template set.
Example:
<dods doml="${basedir}/discRack.doml"
outputDir="${basedir}/src"
templateSet="standard"/>
|