##############################################################################
# Program: JartGen (using the TslTemplateGenerator of JArtifex)
# Author: Thomas Schneider 12/2004
#
# JartGen lets you generate anything through templates and item
# maps, without implementing any code. The used Tags, Functions and Variables are
# fully customizeable inside the property file. For simple changes, you only need
# to edit the block 'specific properties', otherwise, read the comments for the
# several property blocks.
# The template files will be used as filesets for levels, defined by the
# item collection. For each item of the collection the generator will create
# new files (given by filesets) from the templates.
#
# For a detailed description, look at a standard-property-file:
# packages\beanexaminer\jartgen_beanex.properties
#
##############################################################################
##############################################################################
# Just another Template Generator ???
# I hope not! Because of its easyness, you don't have to learn another language (the kernel includes only some kilobytes).
# Only with some block-functions (foreach, case, include) and the well known variable replacing (${myvariable}), this generator
# is able to do the most useful things. If the base functions don't belong to your special desires, you can extend them
# by declaring your functions inside your property file. Of course, it's possible to declare and use anything through your property
# file. If you don't want to fix your template files to the proposal of this generator, it's no problem to change any formats.
# For example, if you use loops, the given property files define the following syntax:
# <<foreach value="table">>
# ...any text
# <</foreach>>
# you can change it to (for example):
# [[loop value="table"]]
# ...any text
# [[endloop]]
#
# This means, the templates are portable (perhaps import/export templates from/to other generators).
# Furthermore, you can use own variable formatting functions (by only declaring them inside your property file!). And you can define new
# tags (but I hope, in the most cases, you only need loops, cases and includes).
# The generator goes through an item tree (with defined levels). In this version, there are three objects, that will be mapped (by the
# ItemCreator) to a tree:
# databases (through Jdbc)
# directories (through dir and file structure)
# xml (any xml structure)
#
# If you need other mappings, write your own creator implementing IItemCreator and filling ITreeNodes.
# The reference implementation (or better example?) is able to generate a complete web application using JSF and Hibernate.
# The generation process is simplified by including xdoclet and ant.
# At the moment, this generator plus its reference implementation fulfills only a part of an MDA tool, but in future, perhaps ....
##############################################################################
##############################################################################
# Features
#
# - generates everything through a given fileset of templates
# - enables the attempt to go the MDA way (Todo: interpretation of xmi-files)
# - only one property file to edit, no special language to learn!
# - customizeable Tags
# - customizeable Variables
# - customizeable Functions
# - predefined Hierarchical Item Structures (xml, directory, database)
# - customizeable Hierarchical Item Structure (Java coding!)
# - Variable and regular expression replacing
# - uses ant
# - uses xdoclet
# - predefined templates to generate:
# jsf, eclipse project files, hibernation, ejb, jdo
# - is able to generate from xml, directory structures, relational databases
##############################################################################
##############################################################################
# The MyFaces sample
#
# The sample provides a very small relational database (using the HsqlDB) with
# three tables: Team --> Players --> Colors
# The default ItemCreator, providing the database informations in a hierarchical
# way, will be used to generate the following:
# 1. a project structure with build files, home and login page
# 2. a controller class, controlling views and persistency classes
# 3. for each table a business class
# 4. hibernation informations to persist the business classes
# 5. ejb informations to persist the business classes (NOT IMPLEMENTED YET!)
# 6. jdo informations to persist the business classes (NOT IMPLEMENTED YET!)
# 7. jsf pages (views) to edit the business classes
##############################################################################
##############################################################################
# Starting the sample Myfaces:
#
# Please set your java_home variable!
# To start an example generation, You have to do the following steps:
# 1. Start the sample database
# sample/runServer.bat
# 2. Edit the jartgen_myfaces.properties file: let 'deploy' point to your
# application server (e.g. JBoss)
# 3. Start the generation
# generate.bat
# 4. Start a browser with http://localhost:8080/IdvTestFaces
#
# This generates a JSF-Application through the content of the sample database.
# You will find the generated files inside the directory /IdvTestFaces
#
# To read more about the Generator, have a look inside the file
# jartgen_myfaces.properties
##############################################################################
##############################################################################
# Constraints, Bugs and ToDos:
#
# 1. myfaces+hibernate:
# - Bug: searching on selectMenus not possible (--> hibernate Example-Queries)
# - ToDo: handle composite ids!
# Each tables has to have exactly one primary key!
# The Hibernation guide DOES NOT recommend it's functionallity of
# Composite Identifiers (-->composite id).
# A Workaround is to create a new table, mapping the key-collection to
# one new key!
# - ToDo: hibernate mappings bidirect
# - ToDo: encapsulate controller.tml
# - ToDo: readable errormessages
# - ToDo: start build.bat internal
# - ToDo: insert a dtd-checker
# - ToDo: method invoking instead of explicit generation of controller methods?
# - ToDo: one-to-many --> navigation with child-links
# - ToDo: validation with regular expressions
# 2. generell:
# - ToDo: implement user code blocks!
# - ToDo: impl. eval(..)
# - ToDo: generate from xmi (extend ItemCreator)
# - ToDo: EJB/JSF project
# - ToDo: JDO/JSF project
# - ToDo: XmlMenu (GUI) for new projects
##############################################################################
##############################################################################
# Libraries
#
# build libraries:
#
Verzeichnis von D:\Java\jartgen\lib
23.02.2005 10:18 <DIR> .
23.02.2005 10:18 <DIR> ..
21.02.2005 16:41 <DIR> ant-1.6.2
02.02.2005 11:45 188.671 commons-beanutils-1.7.0.jar
02.02.2005 11:45 26.687 commons-dbutils-1.0.jar
02.02.2005 11:45 168.446 commons-digester-1.6.jar
23.02.2005 10:18 0 dir.log
24.11.2004 16:55 950.012 hibernate2.jar
07.07.2003 12:22 810.220 j2ee.jar
22.02.2005 10:32 10.193 jartgen.jar
09.02.2005 15:47 182.932 tslbase.jar
09.02.2005 15:47 188.138 tsltools.jar
21.02.2005 16:00 <DIR> xdoclet-1.2.2
9 Datei(en) 2.525.299 Bytes
# deploy libraries:
# Verzeichnis von D:\Java\jartgen\deploy\myfaces\WEB-INF\lib
#
23.02.2005 10:17 <DIR> .
23.02.2005 10:17 <DIR> ..
05.06.2004 00:51 118.726 commons-beanutils-1.6.1.jar
13.04.2004 09:57 29.029 commons-codec-1.2.jar
05.06.2004 00:51 518.641 commons-collections-3.0.jar
05.06.2004 00:51 109.096 commons-digester-1.5.jar
10.03.2004 14:05 112.341 commons-el.jar
16.07.2004 13:21 22.379 commons-fileupload-1.0.jar
10.12.2003 16:13 31.605 commons-logging.jar
20.11.2004 21:15 82.111 commons-validator.jar
23.02.2005 10:17 0 dir.log
23.11.2004 18:47 53.232 ehcache-0.9.jar
15.06.2004 12:55 65.368 jakarta-oro.jar
30.03.2004 14:54 49.510 jsp-2.0.jar
09.03.2004 18:20 16.923 jstl.jar
05.01.2005 15:54 669.661 myfaces-extensions.jar
05.01.2005 15:54 442.227 myfaces-impl.jar
05.01.2005 15:52 214.601 myfaces-jsf-api.jar
05.01.2005 15:56 111.066 myfaces-wap.jar
05.01.2005 15:55 11.239 myfaces-xdoclet.jar
05.01.2005 15:55 1.151.135 myfaces.jar
19 Datei(en) 3.808.890 Bytes
# database libraries:
# Verzeichnis von D:\Java\jartgen\hsqldb
23.10.2002 01:16 258.393 hsqldb.jar
##############################################################################
##############################################################################
# History
#
# Date Version Description
# ----------------------------------------------------------------------------
# 2005-02-23 0.5 First version with sample for MyFaces + Hibernation
# ----------------------------------------------------------------------------
##############################################################################
##############################################################################
# Short Description:
The ItemCreator has to provide a Tree (using interface ITreeNode). E.g.,
if you have a database, the root element of the Map contains one element:
key = <database name>
value = Map, containing the database tables
and this is the level <level_0> (e.g. level_0=database)
The table map has the following entries:
key = <table name>
value = Map, containing the table fields
and this is the level <level_1> (e.g. level_1=table)
Each of this maps has the following items:
key = <field name>
value = Map, containing the properties of the field
and this is the level <level_2> (e.g. level_2=field)
etc.....
This tree will be read by the generator. It reads the given property
file (including the properties of <include_bundle>. For each level, it looks
for a set of template files. It replaces the variables and the logic tags,
knowing the actual content, and writes the set of files to the files, given
by the set of filenames. For example:
fileset_0 =myfirstfile.tml => ${generated_name}.xml, \
mySecondfile.tml => my${anyvariable}Class.java
##############################################################################