<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Extension Points</title>
</head>
<body>
<h1>Extension Points</h1>
<p>This section shows where in the plug-in the extension points are
used to extend the functionality and thereby also function as a
reference.</p>
<ul>
<li>ch.sahits.codegen.java.generator: The classes <a href="../reference/doc/ch/sahits/codegen/java/generator/jettemplate/InitializableDbBeanGenerator.html">InitializableDbBeanGenerator</a>,
<a href="../reference/doc/ch/sahits/codegen/java/generator/ast/PureASTOracleDAOGenerator.html">PureASTOracleDAOGenerator</a>,
<a href="../reference/doc/ch/sahits/codegen/java/generator/ast/ASTBeanWithDelete.html">ASTBeanWithDelete</a>
and <a href="../reference/doc/ch/sahits/codegen/java/generator/ast/JETASTGenerator.html">JETASTGenerator</a>
are extensions. The sources can be viewed at <a href="http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/trunk">Sourceforge.net</a>.
The definition of the extension is as follows:<pre> <extension
point="ch.sahits.codegen.java.generator">
<generator
class="ch.sahits.codegen.java.generator.jettemplate.InitializableDbBeanGenerator"
display="DB Bean with constructor and init method"
helpContext="ch.sahits.codegen.help.GenInitializableBean">
</generator>
<generator
class="ch.sahits.codegen.java.generator.ast.PureASTOracleDAOGenerator"
display="Data Access Object for Oracle"
helpContext="ch.sahits.codegen.help.GenPureAST">
</generator>
<generator
class="ch.sahits.codegen.java.generator.ast.ASTBeanWithDelete"
display="DB Bean with remove method"
helpContext="ch.sahits.codegen.help.GenBeanInsertRemove">
</generator>
<generator
class="ch.sahits.codegen.java.generator.ast.JETASTGenerator"
display="Improve JET template with Constructor and init method"
helpContext="ch.sahits.codegen.help.GenUniqueConstructor">
</generator>
</extension>
</pre>The class attribute defines the actual generator class and is mandatory. The display attribute
provides a short user friendly description of what the generator does. Further informations
such as the needed input model format, input file, database informations ... can be added on a
context help page, which's context ID is supplied in the attribute helpContext. This page is
displayed when this generator is selected and the help button is hit.</li>
<li>ch.sahits.codegen.java.inputdbconnection: The
class <a href="../reference/doc/ch/sahits/codegen/java/input/db/MySQLConnectionModelGenerator.html">MySQLConnectionModelGenerator</a>
implements this extension point. The source code can be viewed at <a href="http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/trunk">Sourceforge.net</a>.
The definition of the extension is as follows:<pre> <extension point="ch.sahits.codegen.java.inputdbconnection">
<dbconnection
class="ch.sahits.codegen.java.input.db.MySQLConnectionModelGenerator"
dbproduct="MySQL">
</dbconnection>
</extension>
</pre></li>
<li>ch.sahits.codegen.java.inputdbparser: The class <a href="../reference/doc/ch/sahits/codegen/java/input/OracleSQLCreateScriptInputParser.html">OracleSQLCreateScriptInputParser</a>
is the extension. The source code can be reviewed at <a href="http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/trunk">Sourceforge.net</a>.
The definition of the extension is as follows: <pre> <extension point="ch.sahits.codegen.java.inputdbparser">
<dbproduct name="oracle"
parserClass="ch.sahits.codegen.java.input.OracleSQLCreateScriptInputParser">
</dbproduct>
</extension>
</pre></li>
<li>ch.sahits.codegen.java.inputparser: The class
<a href="../reference/doc/ch/sahits/codegen/java/gui/input/XHTMLModelParser.html">XHTMLModelParser</a>
implements this extension. The source can be viewed at <a href="http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/trunk">Sourceforge.net</a>.
The definition of the extension is as follows:<pre>
<extension
point="ch.sahits.codegen.java.inputparser">
<inputParser
class="ch.sahits.codegen.java.gui.input.XHTMLModelParser">
</inputParser>
</extension>
</pre>
The class
<a href="../reference/doc/ch/sahits/codegen/java/input/CSVInputFileParser.html">CSVInputFileParser</a> is another implementation of this extension. Through this extension *.csv files can be parsed
into a DataBaseTable model. The source can be viewed at <a href="http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/trunk">Sourceforge.net</a>.
the definition of the extension is as follows:<pre>
<extension
point="ch.sahits.codegen.java.inputparser">
<inputParser
class="ch.sahits.codegen.java.input.CSVInputFileParser">
</inputParser>
</extension>
</pre>
</li>
<li>ch.sahits.codegen.java.jettemplate: The
dbbean.javajet Java Emitter template is realised through this extension
point. The definition of the extension is as follows:<pre> <extension
point="ch.sahits.codegen.java.jettemplate">
<template
display="DB based data object with getter and setter"
fileextension="java"
helpContext="ch.sahits.codegen.help.JetDBBean"
location="jet_templates"
name="dbbean.javajet">
</template>
</extension></pre>
The display attribute provides a short user friendly description of what the generator does. Further informations
such as the needed input model format, input file, database informations ... can be added on a
context help page, which's context ID is supplied in the attribute helpContext. This page is
displayed when this generator is selected and the help button is hit. To be consistent with the
extension point ch.sahits.codegen.generator the fileextension is supplied which will always be java.<br/>
The daoInsertUnique.javajet Java Emitter template is a further example. It can generate a DAO class based on a Database Table model
with a unique load method if a unique key is defined<br/>
The loginServiceInterface.javajet is a very specialized Java Emitter template that generates an interface
that is based on a database table of a user definition.<br/>
The dbbeanConverter.javajet is a Java Emitter template that takes a database table model and generates a
bean class of it, just like dbBean.javajet. Additionaly there is a constrouctor that takes the first
interface the resultig class implements as an argument for its constructor and makes a copy of said interface for
this instance.
</li>
<li>ch.sahits.codegen.inputxmlparser: The class
<a href="../reference/doc/ch/sahits/codegen/xml/XMLParserWithoutDB.html">XMLParserWithoutDB</a>
is an example implementation for an input XML file parser. Another example ist the class
<a href="../reference/doc/ch/sahits/codegen/java/input/XMLTableParser.html">XMLTableParser</a>
Before an XML parser can be defined
in an XML file it must be registered through this parser. The source can be viewed at <a href="http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/trunk">Sourceforge.net</a>.
The definition of the extension is as follows:<pre>
<extension
point="ch.sahits.codegen.inputxmlparser">
<xmlparser
class="ch.sahits.codegen.xml.XMLParserWithoutDB">
</xmlparser>
</extension>
</pre>
</li>
<li>ch.sahits.codegen.java.connectionpage: Define the way how the database connection
data are retrieved. There are two implemented extensions. The default implementation for
the connection data <a href="../reference/doc/ch/sahits/codegen/internal/wizards/DBDefinitionPage.html">DBDefinitionPage</a>
and the alternative through the datatools project
<a href="../reference/doc/ch/sahits/codegen/java/internal/wizards/DTPConnectionDefinitionPage.html">DTPConnectionDefinitionPage</a>.
The source can be viewed at <a href="http://codegenjava.svn.sourceforge.net/viewvc/codegenjava/trunk">Sourceforge.net</a>.
The definition of the extension is as follows:<pre>
<extension
point="ch.sahits.codegen.java.connectionpage">
<dbDefinition
btnText="DB with connection"
btnTooltip="Create the class DB relations gathered from the connection"
className="ch.sahits.codegen.java.internal.wizards.DBDefinitionPage"
pageTitle="Java Code Generator">
</dbDefinition>
</extension>
</pre></li>
<li class="list">ch.sahits.codegen.generator: You define either a JETemplate location and file extension
of the resulting file or a generator class with the class name and file extension.
<pre>
<extension point="ch.sahits.codegen.generator">
<jetemplate
display="%jetemplate.selectSQL.display"
fileextension="sql"
helpContext="ch.sahits.codegen.help.SQLSelectGenerator"
location="jet_templates/selectSQL.sqljet"
withDB="true"
withFileExtension="sql"
withXML="true"
withXMLParser="ch.sahits.codegen.java.input.XMLTableParser">
</jetemplate>
</extension>
<extension point="ch.sahits.codegen.generator">
<generatorClass
class="ch.sahits.codegen.generator.HibernateConfigurationCreator"
display="%generatorClass.HibernateCreator.display"
fileextension="xml"
helpContext="ch.sahits.codegen.help.HibernateGenerator"
withDB="true"
withFileExtension="sql"
withXML="true"
withXMLParser="ch.sahits.codegen.java.input.XMLTableParser">
</generatorClass></pre>
The display attribute provides a short user friendly description of what the generator does. Further informations
such as the needed input model format, input file, database informations ... can be added on a
context help page, which's context ID is supplied in the attribute helpContext. This page is
displayed when this generator is selected and the help button is hit. The attribute withDB gives
an additional hint if the generator is database related. If this attribute is set to true the
selection of "Without database" is not allowed. If the generator is based on an input file the
file extension of the input file and thereby the input model generator can be specified through
withFileExtension. If the input file is an XML file the withXML attribute can be set to true. The
appropriate parser must be supplied. These last four attributes are optional and provide guidance for
the user should he select first the generator.
</li>
<li class="list">ch.sahits.codegen.java.refimplementation: The same way you can define a generator
class for your configuration you can add a reference implementation to the selected generator.
A reference implementation is basically class that is available with the source file from which
code fragments are copied into your resulting class:
<pre>
<refImplClass
class="ch.sahits.codegen.java.generator.ast.CRUDOracleReference"
display="Add getConnection and delete methods"
helpContext="ch.sahits.codegen.help.RefOracleDelete"
srcFolder="src">
</refImplClass></pre>
The class attribute defines the actual generator class and is mandatory. The display attribute
provides a short user friendly description of what the generator does. Further informations
such as the needed input model format, input file, database informations ... can be added on a
context help page, which's context ID is supplied in the attribute helpContext. This page is
displayed when this generator is selected and the help button is hit. In the attribute srcFolder
you specify where the source file for the class can be found within the same bundle.
</li>
<li class="list">ch.sahits.codegen.sql.manipulation: You can define a manipulation class for
your data that is read from database A. The manipulation takes place before the insert script is
generated.
<pre> <extension
point="ch.sahits.codegen.sql.manipulation">
<manipulationClass
class="ch.sahits.codegen.example.CountryChanger">
</manipulationClass>
</extension>
</pre>
</li>
</ul>
</body>
</html>