|
HistoryGeneratorTool
Tool to generate files with freemarker for a catalogdescription and a history configuration
IntroductionUsagejava com.agimatec.dbhistory.HistoryGeneratorTool -conf historyConfig.xml -catalog catalog.xml -ftldir templates -dbms dbms -ftl templateBaseName -destdir targetDirectory Options
Example: +tablespace=TEMP in template: ${tablespace} You can provide multiple properties to the template this way. Accessing static methods inside the freemarker templateThe template can access a predefined property "statics" to invoke static methods. See freemarker documentation for further details. Example: prints milliseconds into template by invoking System.currentTimeMillis(); ${statics["java.lang.System"].currentTimeMillis()}Property statics is BeansWrapper.getDefaultInstance().getStaticModels(). ExampleThe example syntax demonstrates the invocation of the HistoryGeneratorTool from the InvokerTool with ant (or the maven-antrun-plugin). You can imagine the native java call, can't you? <java fork="true" failonerror="true"
classname="com.agimatec.database.InvokerTool"
classpathref="maven.compile.classpath">
<jvmarg value="-Dfile.encoding=UTF-8"/>
<arg line="{ com.agimatec.dbhistory.HistoryGeneratorTool "/>
<arg line="-conf historyconfig.xml"/>
<arg line="-catalog target/my-catalog-postgres.xml"/>
<arg line="-dbms postgres -destdir postgres/setup "/>
<arg line="-ftldir templates"/>
<arg line="-ftl history-schema -ftl history-triggers }"/>
</java>This generates the history-schema.sql and the history-triggers.sql file for the catalog "my-catalog-postgres.xml". To do the same for oracle, just use -dbms oracle instead and provide the catalog of your oracle database. |
► Sign in to add a comment