Tools / Patterns / Domain / Uniface |
jump start from Uniface(TM)
If you have a Uniface application, the Jaffa tools will allow you to extract the entity definitions from
the Uniface DICT model, and create domain objects from them. In addition to this you can the use other
tools like the pattern generator to create Finders and Viewers for these domain objects.
This document covers how to extract one table from the Uniface DICT, build a domain object for it
and then create an Inquiry Component so you can query the object and see its contents.
This document explains the steps involved in reading an existing Uniface schema,
to create domain objects. It then explains how to generate an Object Finder and an
Object Viewer for the domain classes. This starts by explaining the directory structure
and all the required files. At the end of this exercise, we will have a PartFinder and
a PartViewer.
This document is an extension of the basic Pattern Generator - Getting Started guide,
with the Uniface specific amendment highlighted in bold
Contents
- Getting Started
- IDE Setup
- Code Generation Setup
- Generate Domain Meta
- Generate Domain Classes
- Generate Object Finder and Object Viewer
- Execute
|
Getting Started |
- Create the suggested directory structure. Note: For the purpose of this exercise, ignore the 'unittest' and 'httpunittest' folders
- 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
- Create the file source/java/log4j-config.xml using the sample log4j-config.xml
- Create the file source/html/WEB-INF/web.xml using the sample web.xml
- Create the file source/html/WEB-INF/struts-config.xml using sample the struts-config.xml
- Create the file source/html/config/components.xml using the sample components.xml
- Extract jaffa-html.zip into source/html
- Copy the lib/*.jar from jaffa-src.zip into the lib folder
- Copy the deliverables jaffa.jar, jaffa-tools.jar, jaffa-html.zip into the lib folder
- Copy an appropriate jdbc implementation jar (oracle12.zip - if using the Oracle database) into the lib folder
- Copy any other supporting jars into the lib folder
- Create build/build.xml using the sample build.xml
- Create build/MyApp.ant.properties using the sample MyApp.ant.properties
|
IDE Setup |
- Mount the directory 'source/java'
- And then mount the jar files from 'lib', including jaffa-tools.jar & webmacro.jar (for code generation)
|
Code Generation Setup |
- Copy the source/java/patterns/PatternGenerator.properties from jaffa-src.zip into the source/java/patterns folder.
- Modify the value of the property 'ProjectRootDirectory' in PatternGenerator.properties to 'C:\\Sandbox\\MyProject\\source'
- Copy the source/java/patterns/WebMacro.properties from jaffa-src.zip into the source/java/patterns folder.
- Create the folders 'C:\PatternGenerator\TempMetaData' and 'C:\PatternGenerator\Logs' to support the properties in PatternGenerator.properties and WebMacro.properties
- Create the folder source/java/resources/tools/domainmeta/uniface
- Create the folder source/java/resources/tools/patternengine/domain_creator_1_0
- Create the folder source/java/resources/tools/patternengine/object_finder_1_0
- Create the folder source/java/resources/tools/patternengine/object_viewer_1_0
- Copy the ant scripts source/java/resources/tools/patternengine/*.xml from jaffa-src.zip into the corresponding folder
|
Generate Domain Classes |
- Execute the ant script source/java/resources/tools/patternengine/executeDomainCreator_1_0.xml.
- Part.java, PartMeta.java and PartResources.properties will be generated in the source/java/com/example/applications/myapp/modules/catalog/domain folder
- 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
- Create source/java/resources/tools/patternengine/object_finder_1_0/PartFinder.xml using the sample finder meta
- Create source/java/resources/tools/patternengine/object_viewer_1_0/PartViewer.xml using the sample viewer meta
- Execute the ant script source/java/resources/tools/patternengine/executeObjectFinder_1_0.xml.
- Execute the ant script source/java/resources/tools/patternengine/executeObjectViewer_1_0.xml.
- Loads of files will be generated in source/java/com/example/applications/myapp/modules/catalog/components
- 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
|
Execute |
- Create the Part table in the database using the sql script source/java/jdbcengine/Part.sql, and pre-populate it with some data
- Create source/html/index.htm using the sample index.html
- Execute the 'deploy-Tomcat4' task of the ant script build/build.xml
- 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
|