Jaffa Logo
 
SourceForge.net
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
Sub-Projects
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

  1. Getting Started
  2. IDE Setup
  3. Code Generation Setup
  4. Generate 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/domainmeta/uniface
  6. Create the folder source/java/resources/tools/patternengine/domain_creator_1_0
  7. Create the folder source/java/resources/tools/patternengine/object_finder_1_0
  8. Create the folder source/java/resources/tools/patternengine/object_viewer_1_0
  9. Copy the ant scripts source/java/resources/tools/patternengine/*.xml from jaffa-src.zip into the corresponding folder

Generate Domain Meta

This is where we create domain meta (xml) files from an existing Uniface schema. These files are used to generate domain classes, as explained in the next section.

The most important file in this process is source/java/resources/tools/domainmeta/uniface/TableInfo_1_0.xml. This is where all the Uniface schema entities and corresponding domain classnames/packages are specified.

For the purpose of this exercise, we'll create the meta file source/java/resources/tools/patternengine/domain_creator_1_0/Part.xml from the supplied Uniface Schema.

  1. Import the schema, which will create the entity 'CAT1' in the schema 'G5'
  2. Copy the source/java/resources/tools/domainmeta/uniface/*.xml file from jaffa-src.zip into the corresponding folder
  3. Modify the DomainMetaInfoGenerator_1_0.xml property 'OutputDir' to 'C:\\Sandbox\\MyProject\\source\\java\\resources\\tools\\patternengine\\domain_creator_1_0'
  4. Modify the DomainMetaInfoGenerator_1_0.xml property 'Database' with appropriate database parameters
  5. Modify the RelationshipInfo_1_0.xml file, so that it has no relationships
  6. Modify the TableInfo_1_0.xml file, so that it only has the table info for CAT1. Fix the 'DomainPackage' value to 'com.example.applications.myapp.modules.catalog.domain'
  7. Execute the ant script 'execute.xml'. This will create source/java/resources/tools/patternengine/domain_creator_1_0/Part.xml

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

Execute

  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


Note: Uniface(TM) is a registered trademark of Compuware Corporation.

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