Jaffa Logo
Home Contact Us FAQs Site Map
Source Forge: Homepage Bugs @ Sourceforge Mailing Lists @ Sourceforge Task Manager @ Sourceforge CVS @ Sourceforge
Jaffa Site
Jaffa Runtime
Jaffa RAD
Getting Started with the Pattern Generator

This document explains the steps involved in generating an Object Finder and an Object Viewer. It explains the setting up of the directory structure and all the required files. It will end with the generation of a Part Finder and a Part Viewer.


  1. Getting Started
  2. IDE Setup
  3. Code Generation Setup
  4. Sample Domain Meta
  5. Generate Domain Classes
  6. Generate Object Finder and Object Viewer
  7. Execute
Getting Started

  1. Create the suggested directory structure. Note: For the purpose of this exercise, ignore the 'unittest' and 'httpunittest' folders
  2. Create the file source/java/jdbcengine/init.xml using the sample init.xml, providing the appropriate database hostname, databasename, user, password information. Note: For the purpose of this exercise, remove the elements defined within the 'preload' element
  3. Create the file source/java/log4j-config.xml using the sample log4j-config.xml
  4. Create the file source/html/WEB-INF/web.xml using the sample web.xml
  5. Create the file source/html/WEB-INF/struts-config.xml using sample the struts-config.xml
  6. Create the file source/html/config/components.xml using the sample components.xml
  7. Extract jaffa-html.zip into source/html
  8. Copy the lib/*.jar from jaffa-src.zip into the lib folder
  9. Copy the deliverables jaffa.jar, jaffa-tools.jar, jaffa-html.zip into the lib folder
  10. Copy an appropriate jdbc implementation jar (oracle12.zip - if using the Oracle database) into the lib folder
  11. Copy any other supporting jars into the lib folder
  12. Create build/build.xml using the sample build.xml
  13. Create build/MyApp.ant.properties using the sample MyApp.ant.properties

IDE Setup

  1. Mount the directory 'source/java'
  2. And then mount the jar files from 'lib', including jaffa-tools.jar & webmacro.jar (for code generation)

Code Generation Setup

  1. Copy the source/java/patterns/PatternGenerator.properties from jaffa-src.zip into the source/java/patterns folder.
  2. Modify the value of the property 'ProjectRootDirectory' in PatternGenerator.properties to 'C:\\Sandbox\\MyProject\\source'
  3. Copy the source/java/patterns/WebMacro.properties from jaffa-src.zip into the source/java/patterns folder.
  4. Create the folders 'C:\PatternGenerator\TempMetaData' and 'C:\PatternGenerator\Logs' to support the properties in PatternGenerator.properties and WebMacro.properties
  5. Create the folder source/java/resources/tools/patternengine/domain_creator_1_0
  6. Create the folder source/java/resources/tools/patternengine/object_finder_1_0
  7. Create the folder source/java/resources/tools/patternengine/object_viewer_1_0
  8. Copy the ant scripts source/java/resources/tools/patternengine/*.xml from jaffa-src.zip into the corresponding folder

Sample Domain Meta

Create the meta file source/java/resources/tools/patternengine/domain_creator_1_0/Part.xml using the sample meta file.

This meta file is used to generate domain classes, as explained in the next section

Generate Domain Classes

  1. Execute the ant script source/java/resources/tools/patternengine/executeDomainCreator_1_0.xml.
  2. Part.java, PartMeta.java and PartResources.properties will be generated in the source/java/com/example/applications/myapp/modules/catalog/domain folder
  3. Part.xml (mapping file) and Part.sql (create-table script) will be generated in the source/java/jdbcengine folder
Note: If using Netbeans/Forte you might see an error related to '.nbattrs'. Ignore it

Generate Object Finder and Object Viewer

Steps for creating Object Finder and Object Viewer for the Part Domain object

  1. Create source/java/resources/tools/patternengine/object_finder_1_0/PartFinder.xml using the sample finder meta
  2. Create source/java/resources/tools/patternengine/object_viewer_1_0/PartViewer.xml using the sample viewer meta
  3. Execute the ant script source/java/resources/tools/patternengine/executeObjectFinder_1_0.xml.
  4. Execute the ant script source/java/resources/tools/patternengine/executeObjectViewer_1_0.xml.
  5. Loads of files will be generated in source/java/com/example/applications/myapp/modules/catalog/components
  6. Create source/java/ApplicationResource.properties using the sample ApplicationResources.properties
Note: If using Netbeans/Forte you might see an error related to '.nbattrs'. Ignore it


  1. Create the Part table in the database using the sql script source/java/jdbcengine/Part.sql, and pre-populate it with some data
  2. Create source/html/index.htm using the sample index.html
  3. Execute the 'deploy-Tomcat4' task of the ant script build/build.xml
  4. Go to the URL http://localhost:8080/MyApp and click on the PartFinder... Use the logon guest/guest
Note: This assumes a Tomcat4 server running on localhost:8080. Modify the build script in case you have a different environment

File: gettingStarted.html, Last Modified: Tue Jul 15 2003 at 4:02:03pm. This site has been built using PPWIZARD