UML to JEE : Configuration

From AcceleoWiki

Revision as of 12:48, 26 September 2008 by Glefur (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

Module configuration

A few words first: The right way to configure these properties is to create a ".properties" files alongside your ".chain" file(s).

Just overload the properties you need, the keys have sensible default values when it is possible.

Generic configuration

baseImports (String) - default value = fr.obeo

This key represents the base of the packages that will be generated. So it will probably look like "com.mycompany" or "org.myorganisation". The default value is "fr.obeo", so it is very likely you will want to change it.


projectName(String) - default value = sample

This key is used to define the name of your project. It is used to generate the package tree, just after the baseImports key. The default value is "sample", so once again you'll probably want to change it.


path.to.main.java (String) - default value = /src/main/java

This key represents the path to the main java source files, where most of the generated java classes will be located. The default value is compliant with the usual maven project setup, so you can let the default value if you don't know exactly what you're doing.


path.to.test.java (String) - default value = /src/test/java

This key represents the path to the test java source files, where the test classes will be generated. The default value is compliant with the usual maven project setup, so you can let the default value if you don't know exactly what you're doing.


path.to.main.resources (String) - default value = /src/main/resources

This key represents the path to the main resource files, where most of the resources (config files for instance) will be generated. The default value is compliant with the usual maven project setup, so you can let the default value if you don't know exactly what you're doing.


path.to.test.resources (String) - default value = /src/test/resources

This key represents the path to the test resource files, where the test resources (if any) will be generated. The default value is compliant with the usual maven project setup, so you can let the default value if you don't know exactly what you're doing.


use.functional.disposition (Boolean) - default value = false

This key is used to by the generators to compute the package tree. If false, the packages will look like this:

TODO

If true, the packages will look like that:

TODO

Configuring the struts module

Profile overriding

Screen=Acceleo::UI::Screen

Title=Acceleo::UI::Title

Text=Acceleo::UI::Text

Password=Acceleo::UI::Password

Textarea=Acceleo::UI::TextArea

Radio=Acceleo::UI::Radio

Combobox=Acceleo::UI::Combobox

List=Acceleo::UI::List

Table=Acceleo::UI::Table

Checkbox=Acceleo::UI::Checkbox


Configuring the spring module

Configuring the hibernate module

Naming

The following properties are useful to customize the names of the generated elements (classes, packages).

business.package=business

The name of the package that will contain the business classes (entities).


dto.package=dto

The name of the package that will contain the Data Transfer Object (DTO) classes.


dto.suffix=Dto

The Suffix that will be applied to the DTO classes. For instance, if you model a class "<<entity>> MyClass" or "<<dto>> MyClass", the associated DTO class will be called "MyClassDto". You can leave it blank, though this is dangerous for readability.


entity.suffix=

The Suffix that will be applied to the DTO classes. For instance, if you model a class "<<entity>> MyClass", and use entity.suffix=Entity the associated entity class will be called "MyClassEntity".

The default value is "", which means that no suffix is used by default for entity classes.


dao.package=dao

Name of the package that will hold the Data Access Object classes (DAO). You can leave it blank, though this is dangerous for readability.


dao.api.package=api

Name of the package that will hold the interfaces that describe the API modeled in your UML diagrams. You can leave it blank, though this is dangerous for readability.


dao.test.package=test

Name of the package where the test class skeletons will be generated. You can leave it blank, though this is dangerous for readability.


dao.impl.package=impl

Name of the package where DAO implementation classes will be generated.


default.impl.package=impl

Name of the package where default implementations will be generated.


dao.hibernate.package=hibernate

Name of the package where the hibernate classes will be generated. You can leave it blank, though this is dangerous for readability.


dao.hibernate.test.package=test

Name of the package where the hibernate test class skeletons will be generated. You can leave it blank, though this is dangerous for readability.


sql.dbname=dbname

Misc

default.pk.type=String

This key indicates the type to use for the Primary Key of an entity if it is not declared in the model.


The generated code declares DAO methods that throw an Exception. This exception is customizable, in case you want to reuse one that already exists for example.

daoException.package=fr.obeo.fwk.dao.exception

daoException.name=DaoException

This key daoException.package gives the full name of the package of this exception. (useful for generating the imports in the DAO classes)

The key daoException.name gives the name of the DAO Exception class.


The generated code uses a utility class to get the current session, for instance. This utility class is customizable, just like the DaoException, with the two following keys:

hibernateUtil.package=fr.obeo.fwk.dao.hibernate

hibernateUtil.name=HibernateUtil


generate.dto.per.entity=no

Use "yes" if you want to generate one DTO class (Data Transfer Object) for each entity in your UML model.

Type conversion

java.typeconversion.Integer=int

java.wrapper.int=Integer

sql.typeconversion.Integer=INT

Profile overriding

Entity=Acceleo::Business::Entity

find=Acceleo::Business::Find

pk=Acceleo::Business::PrimaryKey

Personal tools