***** Customizating Code Generation Templates ***** The following file provides a brief description of the steps involved in customizing the generated code. Please contact support@thinkui.com if you have any questions or comments. ***** SETUP ***** Please download and install the ThinkUI SQL Client software (version 1.0.8 or later). Follow the instructions in the README.TXT and check that you are able to access your database. ***** STEPS ***** To customize an existing template file, please follow the following steps: 1. Locate the desired Apache Velocity template file (.vm file extenstion) for the code generation command that you wish to customize under the "template" folder. Tip: After you execute a code generation command in the GUI, the template file used will be displayed in the header. You can edit the template file by pressing the "..." button or open the file with your favorite text editor. 2. Review the list of available variables for the templates. The list of available variables for the templates is documented at the top of the template file. Tip: If you wish to employ your own "helper" method, you can simply add your code to the application classpath and instantiate the required helper object class as follows. Your helper class should have a no-arg public constructor. e.g. #set( $myHelper = $codeGen.create("my.domain.package.MyHelper") ) 3. If you are not familiar with Apache Template engine, please visit http://velocity.apache.org to learn more about the API. 4. Please refer to the Javadoc for a complete list of available code generation commands and their parameters. Tip: You may want to familiarize with the behaviour of the various parameters by playing with the code generation GUI. Once you are familiar, you can use the "batch" code generation mode using Ant. This approach will allow you to repeatedly generate code as needed whenever your data model changes. 5. If you wish to create customize commands, you will need to extend the thinkui.sqlclient.AbstractGenerateCommand class and implement the execute() method. The TemplateService should be use to evalute the template (the Apache Template Engine .vm file) and the displayGeneratedCode() method should be used to display the generated code. Note: Currently, you can only create custom code generation commands for use in "batch" mode. You cannot add your custom command to the GUI. You will need to add your custom code geneneration commands to the Ant build.xml "classpath.run" path. Please refer the README.TXT file in the "batch" folder for details.