Topia-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 4806 discussions
Author: chatellier
Date: 2009-01-13 12:59:50 +0000 (Tue, 13 Jan 2009)
New Revision: 1296
Modified:
topia-service/trunk/pom.xml
Log:
back to older topia
Modified: topia-service/trunk/pom.xml
===================================================================
--- topia-service/trunk/pom.xml 2009-01-13 11:40:23 UTC (rev 1295)
+++ topia-service/trunk/pom.xml 2009-01-13 12:59:50 UTC (rev 1296)
@@ -83,7 +83,7 @@
<maven.test.testFailureIgnore>true</maven.test.testFailureIgnore>
<!-- topia version -->
- <topia.version>2.1.2</topia.version>
+ <topia.version>2.1.1</topia.version>
<!-- generator version -->
<generator.version>0.63</generator.version>
1
0
Author: chatellier
Date: 2009-01-13 11:40:23 +0000 (Tue, 13 Jan 2009)
New Revision: 1295
Modified:
topia-service/trunk/pom.xml
Log:
Update dependencies
Modified: topia-service/trunk/pom.xml
===================================================================
--- topia-service/trunk/pom.xml 2009-01-12 13:54:45 UTC (rev 1294)
+++ topia-service/trunk/pom.xml 2009-01-13 11:40:23 UTC (rev 1295)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
- <version>3.2</version>
+ <version>3.3</version>
</parent>
<artifactId>topia-service</artifactId>
@@ -83,13 +83,13 @@
<maven.test.testFailureIgnore>true</maven.test.testFailureIgnore>
<!-- topia version -->
- <topia.version>2.1.1</topia.version>
+ <topia.version>2.1.2</topia.version>
<!-- generator version -->
<generator.version>0.63</generator.version>
<!-- lutinutil version -->
- <lutinutil.version>1.0</lutinutil.version>
+ <lutinutil.version>1.0.2</lutinutil.version>
</properties>
2
1
r1294 - in topia/trunk: src/site src/site/fr/rst topia-persistence/src/main/resources topia-persistence/src/site topia-persistence/src/site/fr topia-persistence/src/site/fr/rst topia-persistence/src/site/resources topia-soa/src/main/java/org/codelutin/topia/service topia-soa/src/site topia-soa/src/site/fr topia-soa/src/site/fr/rst topia-ui/src/site topia-ui/src/site/fr topia-ui/src/site/fr/rst
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
12 Jan '09
Author: chatellier
Date: 2009-01-12 13:54:45 +0000 (Mon, 12 Jan 2009)
New Revision: 1294
Added:
topia/trunk/topia-persistence/src/main/resources/log4j.properties
topia/trunk/topia-persistence/src/site/fr/
topia/trunk/topia-persistence/src/site/fr/rst/
topia/trunk/topia-persistence/src/site/resources/
topia/trunk/topia-persistence/src/site/resources/ContactUseCases.png
topia/trunk/topia-persistence/src/site/resources/ServiceCall.png
topia/trunk/topia-persistence/src/site/resources/topia.zargo
topia/trunk/topia-soa/src/site/fr/
topia/trunk/topia-soa/src/site/fr/rst/
topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceGeneration.rst
topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceUsing.rst
topia/trunk/topia-soa/src/site/fr/rst/index.rst
topia/trunk/topia-soa/src/site/site.xml
topia/trunk/topia-ui/src/site/fr/
topia/trunk/topia-ui/src/site/fr/rst/
topia/trunk/topia-ui/src/site/fr/rst/UseCase.rst
topia/trunk/topia-ui/src/site/fr/rst/index.rst
topia/trunk/topia-ui/src/site/site.xml
Removed:
topia/trunk/topia-persistence/src/site/fr/rst/ContactUseCases.png
topia/trunk/topia-persistence/src/site/fr/rst/ServiceCall.png
topia/trunk/topia-persistence/src/site/fr/rst/UseCase.rst
topia/trunk/topia-persistence/src/site/fr/rst/topia.zargo
topia/trunk/topia-persistence/src/site/rst/
Modified:
topia/trunk/src/site/fr/rst/index.rst
topia/trunk/src/site/site.xml
topia/trunk/topia-persistence/src/site/site.xml
topia/trunk/topia-soa/src/main/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java
Log:
Ajout d'une doc sur ToPIA SOA
Mise ?\195?\160 jour du site
Modified: topia/trunk/src/site/fr/rst/index.rst
===================================================================
--- topia/trunk/src/site/fr/rst/index.rst 2009-01-12 10:40:22 UTC (rev 1293)
+++ topia/trunk/src/site/fr/rst/index.rst 2009-01-12 13:54:45 UTC (rev 1294)
@@ -1,5 +1,5 @@
-ToPIA
-=====
+Accueil
+=======
Présentation
------------
@@ -12,6 +12,10 @@
Il est actuellement composé de 3 modules :
- * topia-persistence : pour la gestion de la persistance sur hibernate
- * topia-soa : pour le développement orienté service
- * topia-ui : pour la génération des interfaces
\ No newline at end of file
+ * `ToPIA-persistence`_ : pour la gestion de la persistance sur hibernate
+ * `ToPIA-soa`_ : pour le développement orienté service
+ * `ToPIA-ui`_ : pour la génération des interfaces
+
+.. _ToPIA-persistence: topia-persistence
+.. _ToPIA-soa: topia-soa
+.. _ToPIA-ui: topia-ui
\ No newline at end of file
Modified: topia/trunk/src/site/site.xml
===================================================================
--- topia/trunk/src/site/site.xml 2009-01-12 10:40:22 UTC (rev 1293)
+++ topia/trunk/src/site/site.xml 2009-01-12 13:54:45 UTC (rev 1294)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
+<project name="ToPIA">
<publishDate format="dd/MM/yyyy"/>
@@ -33,7 +33,11 @@
<item name="Code Lutin" href="http://www.codelutin.com/"/>
</links>
- <menu ref="parent"/>
+ <menu name="Modules">
+ <item name="ToPIA-persistence" href="topia-persistence"/>
+ <item name="ToPIA-soa" href="topia-soa"/>
+ <item name="ToPIA-ui" href="topia-ui"/>
+ </menu>
</body>
</project>
Added: topia/trunk/topia-persistence/src/main/resources/log4j.properties
===================================================================
--- topia/trunk/topia-persistence/src/main/resources/log4j.properties (rev 0)
+++ topia/trunk/topia-persistence/src/main/resources/log4j.properties 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,11 @@
+#�This log is used to display trace in generation
+
+# Global logging configuration
+log4j.rootLogger=WARN, stdout
+# Console output...
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n
+# package level
+log4j.logger.org.codelutin.generator=INFO
+log4j.logger.org.codelutin.topia.generator=INFO
Copied: topia/trunk/topia-persistence/src/site/fr/rst (from rev 1290, topia/trunk/topia-persistence/src/site/rst)
Deleted: topia/trunk/topia-persistence/src/site/fr/rst/ContactUseCases.png
===================================================================
(Binary files differ)
Deleted: topia/trunk/topia-persistence/src/site/fr/rst/ServiceCall.png
===================================================================
(Binary files differ)
Deleted: topia/trunk/topia-persistence/src/site/fr/rst/UseCase.rst
===================================================================
--- topia/trunk/topia-persistence/src/site/rst/UseCase.rst 2009-01-09 09:01:36 UTC (rev 1290)
+++ topia/trunk/topia-persistence/src/site/fr/rst/UseCase.rst 2009-01-12 13:54:45 UTC (rev 1294)
@@ -1,207 +0,0 @@
-Topia Use Case
-==============
-
-ToPIA permet la génération de navigation à partir du modèle UML sous forme de
-diagrammes états/transitions.
-Le framework fournit de plus une implémentation de cette génération basée
-sur le framework MVC `Tapestry <http://tapestry.apache.org/tapestry5/>`_.
-
-Besoin
-------
-Le besoin initial était d'utiliser au maximum les différents état du système.
-Dans le cas d'un site internet par exemple, une même page peut être utilisée
-pour créer un contact, et plus tard pour modifier un contact.
-
-Cependant, un état à un utilisation différente suivant le cas d'utilisation
-utilisé.
-
-Ce framework permet donc de générer la navigation sous une forme quelconque, et
-de baser cette navigation sur un moteur gérant les cas d'utilisation.
-
-
-Générateur
-----------
-Les générateurs de code utilisés font partie de LutinGenerator. Celui-ci permet
-de charger le modèle en mémoire, mais ne fournit aucune implémentation
-spécifique.
-ToPIA fournit les templates de génération (notemment celui basé sur Tapestry).
-
-
-Modèle UML
-----------
-Le modèle UML de base doit respecter quelques conventions pour que la génération
-se passe bien.
-
-En voici un exemple (ArgoUML) :
-
-.. image:: ContactUseCases.png
-
-Voici les différents points à respecter :
-
- * Toutes les parties réutilisables doivent appartenir à sous cas d'utilisation
- spécifique.
- * Tout sous cas d'utilisation doit disposer d'un état initial et d'un moins un
- état final.
- * Les états étant des références à des sous-cas d'utilisation doivent être
- stéréotypés "UseCase"
-
-Comme on peut le voir sur l'image, le cas d'utilisation en bas utilise d'autre
-sous use case. Mais il ne dispose pas lui même d'état final. Il n'est donc pas
-réutilisable.
-
-
-Chargement du modele
---------------------
-LutinGenerator charge le modèle en mémoire sous la forme d'un modèle d'objets
-java et appelle le template de génération spécifié dans la configuration.
-Le template peut ensuite parcourir ce modèle aisément et générer les données
-dont il a besoin.
-
-Configuration
-+++++++++++++
-Voici la configuration maven de déclaration des templates:
-
-::
-
- <plugin>
- <groupId>lutinplugin</groupId>
- <artifactId>maven-generator-plugin</artifactId>
- <version>0.xx</version>
- <executions>
- <execution>
- <id>Generator</id>
- <phase>generate-sources</phase>
- <configuration>
- <!-- repertoire des modeles ArgoUML -->
- <srcDirZuml>src/xmi</srcDirZuml>
- <!-- destination des fichiers XMI -->
- <srcXmiDest>target/gen/xmi/</srcXmiDest>
- <!-- destination des fichiers XML StateModel -->
- <srcGenDest>target/gen/models/</srcGenDest>
- <!-- Fichiers XML StateModel utilises pour la generation -->
- <includes>**/*.*model</includes>
- <!-- templates a utiliser -->
- <templates>org.codelutin.topia.generator.TapestryWebGenerator</templates>
- <!-- destination du code genere -->
- <destDirGen>target/gen/java</destDirGen>
- </configuration>
- <goals>
- <!-- ArgoUML -> XMI -->
- <goal>zargo2xmi</goal>
- <!-- XMI -> StateModel -->
- <goal>xmi2statemodel</goal>
- <!-- StateModel -> Java (selon le template) -->
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>lutinlib</groupId>
- <artifactId>topia</artifactId>
- <version>2.0.xx</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
- </plugin>
-
-
-Nom de package
---------------
-
-Une convention est utilisée dans le nom de package pour déterminer quel est la
-racine de la structure (utilisée pour la génération basée sur tapestry par
-exemple).
-
-Le motif utilisé est "web". Il désigne la racine.
-
-Exemple:
- org.codelutin.chorem.web.projectManagement
-
-Ainsi, via tapestry l'url "/projectManagement" pourra être utilisée.
-
-
-Génération Tapestry
--------------------
-La génération sur Tapestry produit une classe abstraite par état déclaré dans le
-modèle.
-Ces classes abstraites :
-
- * déclare les autres pages(états) vers lesquelles elle peuvent naviguer.
- Ces sont des références traitées par tapestry (annotations).
- Chaque référence à pour type la classe concrête implémentée par le
- développeur.
- * gère l'entrée et la sortie des Use Case.
-
-Le developpeur doit donc developper l'implémentation tapestry en faisant
-référence aux méthodes fournies dans les classes abstraites à hériter pour
-naviguer.
-
-Exemple issue de la génération du modèle à l'image 1, voici la classe abstraite
-SocietyView générée à partir du modèle :
-
-::
-
- public abstract class AbstractSocietyView extends UseCasePage {
-
- public Object onActionFromOk() {
- return leaveUseCase();
- }
-
- @InjectPage
- private SocietyForm societyForm;
-
- protected SocietyForm getSocietyForm() {
- return societyForm;
- }
-
- public Object onActionFromEdit() {
- enterUseCase();
- return societyForm;
- }
-
- protected final String getUseCaseName() {
- return "sv";
- }
- }
-
-Conformément à la spécification :
- * cet état est lié à l'état SocietyForm (état initial du sous cas d'utilisation
- utilisé)
- * dispose d'une action "ok" quittant le use case courant
- * dispose d'une action "edit" entrant dans un nouveau use case
-
-Pour la partie développeur, voici un exemple consitant à appeler une action
-avant d'effectuer la réelle navigation :
-
-::
-
- public class SocietyView extends AbstractSocietyView {
-
- [...]
-
- @Override
- public Object onActionFromEdit() {
-
- // action
- getSocietyForm.setSociety(s);
-
- // appele de la super methode
- return super.onActionFromEdit();
- }
-
- [...]
- }
-
-Hiérarchie d'héritage
----------------------
-Comme on peut le voir, les classes implémentées par le développeur héritent des
-des classes abstraites générées, l'empêchant ainsi d'utiliser son propre
-héritage.
-
-Il est possible de spécifier une classe que toutes les classes abstraites
-devront hériter via le fichier de propriété associé au modèle.
-
-Le propriété :
- model.tagvalue.usecaseengineextendedclass=BasePage
-spécifie que toutes les classes générées hériteront de la classe BasePage.
\ No newline at end of file
Deleted: topia/trunk/topia-persistence/src/site/fr/rst/topia.zargo
===================================================================
(Binary files differ)
Copied: topia/trunk/topia-persistence/src/site/resources/ContactUseCases.png (from rev 1290, topia/trunk/topia-persistence/src/site/rst/ContactUseCases.png)
===================================================================
(Binary files differ)
Property changes on: topia/trunk/topia-persistence/src/site/resources/ContactUseCases.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: topia/trunk/topia-persistence/src/site/resources/ServiceCall.png (from rev 1290, topia/trunk/topia-persistence/src/site/rst/ServiceCall.png)
===================================================================
(Binary files differ)
Property changes on: topia/trunk/topia-persistence/src/site/resources/ServiceCall.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: topia/trunk/topia-persistence/src/site/resources/topia.zargo (from rev 1290, topia/trunk/topia-persistence/src/site/rst/topia.zargo)
===================================================================
(Binary files differ)
Property changes on: topia/trunk/topia-persistence/src/site/resources/topia.zargo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Modified: topia/trunk/topia-persistence/src/site/site.xml
===================================================================
--- topia/trunk/topia-persistence/src/site/site.xml 2009-01-12 10:40:22 UTC (rev 1293)
+++ topia/trunk/topia-persistence/src/site/site.xml 2009-01-12 13:54:45 UTC (rev 1294)
@@ -11,7 +11,6 @@
<bannerLeft>
<name>${project.name}</name>
- <!--src>http://buix.labs.libre-entreprise.org/lutinjaxx/jaxx.png</src-->
<href>index.html</href>
</bannerLeft>
@@ -38,8 +37,6 @@
<menu name="Utilisateur">
<item href="/index.html" name="Accueil"/>
- <!--item href="http://lutinbuilder.labs.libre-entreprise.org/maven2/org/codelutin/topia/"
- name="Téléchargement"/-->
</menu>
<menu name="Téléchargement">
Modified: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java
===================================================================
--- topia/trunk/topia-soa/src/main/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java 2009-01-12 10:40:22 UTC (rev 1293)
+++ topia/trunk/topia-soa/src/main/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java 2009-01-12 13:54:45 UTC (rev 1294)
@@ -58,16 +58,16 @@
public class TopiaApplicationServiceFactory {
/** Fichier de configuration par defaut */
- static final String DEFAULT_CONFIG_PROPERTIES = "TopiaContextImpl.properties";
+ public static final String DEFAULT_CONFIG_PROPERTIES = "TopiaContextImpl.properties";
/** Nom de la propriete de definition des services utilises */
- static final String TOPIA_APPLICATION_SERVICE_BEGIN = "topia.application.service.";
+ public static final String TOPIA_APPLICATION_SERVICE_BEGIN = "topia.application.service.";
/** Nom de la propriete de definition des services fournit */
- static final String TOPIA_APPLICATION_PROVIDE_BEGIN = "topia.application.provide.";
+ public static final String TOPIA_APPLICATION_PROVIDE_BEGIN = "topia.application.provide.";
/** Nom de la propriete de definition des ports suivant les protocoles */
- static final String TOPIA_APPLICATION_SERVER_PORT_BEGIN = "topia.application.server.port.";
+ public static final String TOPIA_APPLICATION_SERVER_PORT_BEGIN = "topia.application.server.port.";
/**
* Nom du dossier ou sont generer certains fichiers (doit etre dans le
@@ -76,10 +76,10 @@
public static String TOPIA_GENERATION_DIRECTORY = "topiagen";
/** Fichier de configuration */
- private static Properties config;
+ protected static Properties config;
/** Dispatcher (servers) */
- private static final TopiaServiceProvider mainDispatcher = new TopiaServiceProvider();
+ protected static final TopiaServiceProvider mainDispatcher = new TopiaServiceProvider();
/**
* Stockage des services deja instancies
@@ -90,7 +90,7 @@
private static final Log log = LogFactory
.getLog(TopiaApplicationServiceFactory.class);
- private static TopiaContext defaultServiceContext;
+ protected static TopiaContext defaultServiceContext;
/**
* Retourne la configuration. Charge le fichier s'il n'a pas deja ete
@@ -116,12 +116,14 @@
* le contexte pere des contextes fournis aux services
* @throws TopiaException
*/
- @SuppressWarnings("unchecked")
public static void loadServices(Properties config, TopiaContext context)
throws TopiaException {
- if (context == null)
+
+ if (context == null) {
throw new NullPointerException(
"I need a valid TopiaContext to initialise application services");
+ }
+
defaultServiceContext = context;
// lecture du fichier de configuration
if (config == null) {
@@ -166,11 +168,9 @@
mainDispatcher.setProtocolPort(protocol, port);
}
- Class serviceInterface = null;
- Class serviceImplement = null;
try {
- serviceInterface = Class.forName(serviceClassName);
- serviceImplement = Class.forName(serviceClassName
+ Class serviceInterface = Class.forName(serviceClassName);
+ Class serviceImplement = Class.forName(serviceClassName
+ "Impl");
try {
@@ -221,7 +221,6 @@
* @throws TopiaException
* si le service ne peut pas etre charge
*/
- @SuppressWarnings("unchecked")
public static <E extends TopiaApplicationService> E getService(
Class<E> serviceclazz) throws TopiaNotFoundException,
TopiaException {
@@ -316,9 +315,10 @@
}
}
} catch (URISyntaxException e) {
- log.warn("URI for service '" + serviceclazz.getCanonicalName()
+ if(log.isWarnEnabled()) {
+ log.warn("URI for service '" + serviceclazz.getCanonicalName()
+ "' is invalid !", e);
- return null;
+ }
}
}
@@ -330,9 +330,9 @@
* l'URI
*
* @param uriService
- * @return l'implementation ou null si le protocol n'est pas g�r�
+ * @return l'implementation ou null si le protocol n'est pas géré
*/
- private static TopiaProxy getProxyForURI(URI uriService) {
+ protected static TopiaProxy getProxyForURI(URI uriService) {
// result
TopiaProxy tProxy = null;
Added: topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceGeneration.rst
===================================================================
--- topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceGeneration.rst (rev 0)
+++ topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceGeneration.rst 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,92 @@
+Génération des services
+=======================
+
+Modèle
+------
+
+Stéréotype
+~~~~~~~~~~
+
+Topia founit des générateurs pour utiliser sa couche de
+services applicatifs.
+
+Pour cela, il faut ajouter le stéréotype ''<<service>>'' sur
+les interfaces qui seront utilisée pour fournir des services ou
+acceder à des services distants.
+
+
+Implémentation
+~~~~~~~~~~~~~~
+
+Vous pouvez choisir de nes générez que les interfaces des services
+et de développer vous meme les implémentations.
+
+Le générateur est aussi capable de générer une implémentation avec
+toutes les méthodes des DAO (voir topia-persistence) qui lui
+sont lié.
+
+Configuration Maven
+-------------------
+
+Les templates disponibles sont:
+``org.codelutin.topia.generator.ServiceInterfaceGenerator``
+ Meta générateur qui génere les interfaces.
+``org.codelutin.topia.generator.ServiceAbstractGenerator``
+ Meta générateur qui génere implémentation abstract.
+``org.codelutin.topia.generator.ServiceImplGenerator``
+ Meta générateur qui génere implémentation concrète.
+``org.codelutin.topia.generator.TopiaApplicationServiceMetaGenerator``
+ Meta générateur qui génere toutes les interfaces, abstract et Impl.
+
+Plugin de Génération
+~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ <plugins>
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-generator-plugin</artifactId>
+ <version>0.63</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <configuration>
+ <addCompileDirectory>true</addCompileDirectory>
+ <srcDirZuml>${maven.src.dir}/main/xmi</srcDirZuml>
+ <srcXmiDest>${maven.gen.dir}/xmi/</srcXmiDest>
+ <srcGenDest>${maven.gen.dir}/objectmodel/</srcGenDest>
+ <includes>**/*.objectmodel</includes>
+ <templates>org.codelutin.topia.generator.TopiaApplicationServiceMetaGenerator</templates>
+ <destDirGen>${maven.gen.dir}/java</destDirGen>
+ <defaultPackage>org.codelutin.chorem</defaultPackage>
+ </configuration>
+ <goals>
+ <goal>zargo2xmi</goal>
+ <goal>xmi2objectmodel</goal>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-soa</artifactId>
+ <version>2.1.3-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+
+Compilation
+~~~~~~~~~~~
+
+::
+
+ <dependency>
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-soa</artifactId>
+ <version>2.1.3-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
\ No newline at end of file
Added: topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceUsing.rst
===================================================================
--- topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceUsing.rst (rev 0)
+++ topia/trunk/topia-soa/src/site/fr/rst/ApplicationServiceUsing.rst 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,89 @@
+Utilisation des services
+========================
+
+En mode client
+--------------
+
+En mode client, vous n'avez besoin que des interfaces générées.
+
+Prenons l'exemple, d'une interface de service
+''org.codelutin.service.TestService'' comportant une méthode ''getHelloWorld()''.
+
+Configuration
+~~~~~~~~~~~~~
+
+Dans le fichier de configuration de ToPIA, il faudra ajouter la configuration suivante :
+
+::
+
+ topia.application.service.org.codelutin.service.TestService=xml-rpc://localhost:8888
+
+Cette configuration indique à ToPIA, que le service est accessible à l'adresse ''localhost:8888''
+sur le protocole xml-rpc.
+
+Les protocoles disponibles actuellement sont :
+ * ''soap'' : SOAP
+ * ''xml-rpc : XML-RPC
+ * ''rmi'' : Java RMI
+ * ''local'' : Utilisation directe d'une implémentation sans passer par un servceur distant
+ Utilise pour les tests.
+ Exemple : ''topia.application.service.org.codelutin.service.TestService=local://org.codelutin.service.TestServiceImpl/#new''
+ (Le #new ici signifie qu'une instance est contruite a chaque requete)
+
+
+Utilisation
+~~~~~~~~~~~
+
+Pour acceder au service distant ensuite, rien de plus simple, il suffit d'utiliser
+le code suivant :
+
+::
+
+ TestService service = TopiaApplicationServiceFactory.getService(TestService.class);
+ service.getHelloWorld();
+
+La methode getService() de ToPIA renvoie un ''proxy'' implémentant TestService
+sur le service distant.
+
+
+En mode serveur
+---------------
+
+En mode serveur, nous allons utiliser le même service ''org.codelutin.service.TestService''
+comportant une méthode ''getHelloWorld()''.
+
+Nous supposons que nous disposons également du implementation ''org.codelutin.service.TestServiceImpl''
+de ce service, soit implementée à la main, soit générée par ToPIA avec les méthodes des DAO.
+
+Configuration
+~~~~~~~~~~~~~
+
+ToPIA doit savoir comment il doit fournir les services.
+
+::
+
+ topia.application.provide.org.codelutin.service.TestService=xml-rpc
+ topia.application.server.port.xml-rpc=9090
+
+ToPIA va ici fournir le service ''org.codelutin.service.TestService'' en utilisant automatiquement
+l'implémentation ''org.codelutin.service.TestServiceImpl'' via ''xml-rpc''.
+On a ici aussi surchargée la configuration, pour pouvoir choisir sur quel
+port démarrer les serveurs.
+
+
+Utilisation
+~~~~~~~~~~~
+
+Une fois dans votre application, il suffira de dire à ToPIA de démarrer les
+serveur en utilisant la configuration.
+
+::
+
+ TopiaApplicationServiceFactory.loadServices(conf, context);
+
+On peut aussi ajouter manuellement les services que l'on souhaite démarrer:
+
+::
+
+ TopiaApplicationServiceFactory.addService(TestService.class,
+ TestServiceImpl.class, Protocol.SOAP);
\ No newline at end of file
Added: topia/trunk/topia-soa/src/site/fr/rst/index.rst
===================================================================
--- topia/trunk/topia-soa/src/site/fr/rst/index.rst (rev 0)
+++ topia/trunk/topia-soa/src/site/fr/rst/index.rst 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,10 @@
+Topia-SOA
+=========
+
+Couche d'abtraction des services applicatifs.
+
+ * `Generation des services`_
+ * `Utilisation des services`_
+
+.. _Generation des services: ApplicationServiceGeneration.html
+.. _Utilisation des services: ApplicationServiceUsing.html
\ No newline at end of file
Added: topia/trunk/topia-soa/src/site/site.xml
===================================================================
--- topia/trunk/topia-soa/src/site/site.xml (rev 0)
+++ topia/trunk/topia-soa/src/site/site.xml 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <publishDate format="dd/MM/yyyy"/>
+
+ <skin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-lutin-skin</artifactId>
+ <version>0.2.1</version>
+ </skin>
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>${project.organization.url}</href>
+ </bannerRight>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
+ <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText"
+ img="images/restructuredtext-logo.png"/>
+ </poweredBy>
+
+ <body>
+ <links>
+ <item name="ToPIA Service" href="http://topia.labs.libre-entreprise.org/topia-service"/>
+ <item name="Labs" href="http://labs.libre-entreprise.org/"/>
+ <item name="Code Lutin" href="http://www.codelutin.com/"/>
+ </links>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item href="/index.html" name="Accueil"/>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}"
+ name="Télécharger la dernière version"/>
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}"
+ name="Voir toutes les versions"/>
+ </menu>
+
+ <menu name="Developpeur">
+ <item name="Generation" href="ApplicationServiceGeneration.html"/>
+ <item name="Utilisation" href="ApplicationServiceUsing.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
Copied: topia/trunk/topia-ui/src/site/fr/rst/UseCase.rst (from rev 1290, topia/trunk/topia-persistence/src/site/rst/UseCase.rst)
===================================================================
--- topia/trunk/topia-ui/src/site/fr/rst/UseCase.rst (rev 0)
+++ topia/trunk/topia-ui/src/site/fr/rst/UseCase.rst 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,207 @@
+Topia Use Case
+==============
+
+ToPIA permet la génération de navigation à partir du modèle UML sous forme de
+diagrammes états/transitions.
+Le framework fournit de plus une implémentation de cette génération basée
+sur le framework MVC `Tapestry <http://tapestry.apache.org/tapestry5/>`_.
+
+Besoin
+------
+Le besoin initial était d'utiliser au maximum les différents état du système.
+Dans le cas d'un site internet par exemple, une même page peut être utilisée
+pour créer un contact, et plus tard pour modifier un contact.
+
+Cependant, un état à un utilisation différente suivant le cas d'utilisation
+utilisé.
+
+Ce framework permet donc de générer la navigation sous une forme quelconque, et
+de baser cette navigation sur un moteur gérant les cas d'utilisation.
+
+
+Générateur
+----------
+Les générateurs de code utilisés font partie de LutinGenerator. Celui-ci permet
+de charger le modèle en mémoire, mais ne fournit aucune implémentation
+spécifique.
+ToPIA fournit les templates de génération (notemment celui basé sur Tapestry).
+
+
+Modèle UML
+----------
+Le modèle UML de base doit respecter quelques conventions pour que la génération
+se passe bien.
+
+En voici un exemple (ArgoUML) :
+
+.. image:: ContactUseCases.png
+
+Voici les différents points à respecter :
+
+ * Toutes les parties réutilisables doivent appartenir à sous cas d'utilisation
+ spécifique.
+ * Tout sous cas d'utilisation doit disposer d'un état initial et d'un moins un
+ état final.
+ * Les états étant des références à des sous-cas d'utilisation doivent être
+ stéréotypés "UseCase"
+
+Comme on peut le voir sur l'image, le cas d'utilisation en bas utilise d'autre
+sous use case. Mais il ne dispose pas lui même d'état final. Il n'est donc pas
+réutilisable.
+
+
+Chargement du modele
+--------------------
+LutinGenerator charge le modèle en mémoire sous la forme d'un modèle d'objets
+java et appelle le template de génération spécifié dans la configuration.
+Le template peut ensuite parcourir ce modèle aisément et générer les données
+dont il a besoin.
+
+Configuration
++++++++++++++
+Voici la configuration maven de déclaration des templates:
+
+::
+
+ <plugin>
+ <groupId>lutinplugin</groupId>
+ <artifactId>maven-generator-plugin</artifactId>
+ <version>0.xx</version>
+ <executions>
+ <execution>
+ <id>Generator</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <!-- repertoire des modeles ArgoUML -->
+ <srcDirZuml>src/xmi</srcDirZuml>
+ <!-- destination des fichiers XMI -->
+ <srcXmiDest>target/gen/xmi/</srcXmiDest>
+ <!-- destination des fichiers XML StateModel -->
+ <srcGenDest>target/gen/models/</srcGenDest>
+ <!-- Fichiers XML StateModel utilises pour la generation -->
+ <includes>**/*.*model</includes>
+ <!-- templates a utiliser -->
+ <templates>org.codelutin.topia.generator.TapestryWebGenerator</templates>
+ <!-- destination du code genere -->
+ <destDirGen>target/gen/java</destDirGen>
+ </configuration>
+ <goals>
+ <!-- ArgoUML -> XMI -->
+ <goal>zargo2xmi</goal>
+ <!-- XMI -> StateModel -->
+ <goal>xmi2statemodel</goal>
+ <!-- StateModel -> Java (selon le template) -->
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>lutinlib</groupId>
+ <artifactId>topia</artifactId>
+ <version>2.0.xx</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+
+Nom de package
+--------------
+
+Une convention est utilisée dans le nom de package pour déterminer quel est la
+racine de la structure (utilisée pour la génération basée sur tapestry par
+exemple).
+
+Le motif utilisé est "web". Il désigne la racine.
+
+Exemple:
+ org.codelutin.chorem.web.projectManagement
+
+Ainsi, via tapestry l'url "/projectManagement" pourra être utilisée.
+
+
+Génération Tapestry
+-------------------
+La génération sur Tapestry produit une classe abstraite par état déclaré dans le
+modèle.
+Ces classes abstraites :
+
+ * déclare les autres pages(états) vers lesquelles elle peuvent naviguer.
+ Ces sont des références traitées par tapestry (annotations).
+ Chaque référence à pour type la classe concrête implémentée par le
+ développeur.
+ * gère l'entrée et la sortie des Use Case.
+
+Le developpeur doit donc developper l'implémentation tapestry en faisant
+référence aux méthodes fournies dans les classes abstraites à hériter pour
+naviguer.
+
+Exemple issue de la génération du modèle à l'image 1, voici la classe abstraite
+SocietyView générée à partir du modèle :
+
+::
+
+ public abstract class AbstractSocietyView extends UseCasePage {
+
+ public Object onActionFromOk() {
+ return leaveUseCase();
+ }
+
+ @InjectPage
+ private SocietyForm societyForm;
+
+ protected SocietyForm getSocietyForm() {
+ return societyForm;
+ }
+
+ public Object onActionFromEdit() {
+ enterUseCase();
+ return societyForm;
+ }
+
+ protected final String getUseCaseName() {
+ return "sv";
+ }
+ }
+
+Conformément à la spécification :
+ * cet état est lié à l'état SocietyForm (état initial du sous cas d'utilisation
+ utilisé)
+ * dispose d'une action "ok" quittant le use case courant
+ * dispose d'une action "edit" entrant dans un nouveau use case
+
+Pour la partie développeur, voici un exemple consitant à appeler une action
+avant d'effectuer la réelle navigation :
+
+::
+
+ public class SocietyView extends AbstractSocietyView {
+
+ [...]
+
+ @Override
+ public Object onActionFromEdit() {
+
+ // action
+ getSocietyForm.setSociety(s);
+
+ // appele de la super methode
+ return super.onActionFromEdit();
+ }
+
+ [...]
+ }
+
+Hiérarchie d'héritage
+---------------------
+Comme on peut le voir, les classes implémentées par le développeur héritent des
+des classes abstraites générées, l'empêchant ainsi d'utiliser son propre
+héritage.
+
+Il est possible de spécifier une classe que toutes les classes abstraites
+devront hériter via le fichier de propriété associé au modèle.
+
+Le propriété :
+ model.tagvalue.usecaseengineextendedclass=BasePage
+spécifie que toutes les classes générées hériteront de la classe BasePage.
\ No newline at end of file
Property changes on: topia/trunk/topia-ui/src/site/fr/rst/UseCase.rst
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Added: topia/trunk/topia-ui/src/site/fr/rst/index.rst
===================================================================
--- topia/trunk/topia-ui/src/site/fr/rst/index.rst (rev 0)
+++ topia/trunk/topia-ui/src/site/fr/rst/index.rst 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,4 @@
+Topia-UI
+========
+
+Aucune documentation n'est disponible.
\ No newline at end of file
Added: topia/trunk/topia-ui/src/site/site.xml
===================================================================
--- topia/trunk/topia-ui/src/site/site.xml (rev 0)
+++ topia/trunk/topia-ui/src/site/site.xml 2009-01-12 13:54:45 UTC (rev 1294)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <publishDate format="dd/MM/yyyy"/>
+
+ <skin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-lutin-skin</artifactId>
+ <version>0.2.1</version>
+ </skin>
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>${project.organization.url}</href>
+ </bannerRight>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
+ <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText"
+ img="images/restructuredtext-logo.png"/>
+ </poweredBy>
+
+ <body>
+ <links>
+ <item name="ToPIA Service" href="http://topia.labs.libre-entreprise.org/topia-service"/>
+ <item name="Labs" href="http://labs.libre-entreprise.org/"/>
+ <item name="Code Lutin" href="http://www.codelutin.com/"/>
+ </links>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item href="/index.html" name="Accueil"/>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}"
+ name="Télécharger la dernière version"/>
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}"
+ name="Voir toutes les versions"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
1
0
r1293 - topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
12 Jan '09
Author: chatellier
Date: 2009-01-12 10:40:22 +0000 (Mon, 12 Jan 2009)
New Revision: 1293
Removed:
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java
Log:
Replace "Taist" by "Example" :p
Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java 2009-01-12 10:39:50 UTC (rev 1292)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java 2009-01-12 10:40:22 UTC (rev 1293)
@@ -1,41 +0,0 @@
-/* *##% ToPIA - Tools for Portable and Independent Architecture
- * Copyright (C) 2004 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-
-package org.codelutin.topia.service;
-
-import org.codelutin.topia.TopiaException;
-
-/**
- * TestService.java
- * <p/>
- * Genere par Topia !
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$ By : $Author$
- */
-public interface TaistService extends TopiaApplicationService {
-
- /**
- * Declaration d'un service
- *
- * @param name le nom
- * @return hello
- */
- public String sayHello(String name) throws TopiaException;
-}
Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java 2009-01-12 10:39:50 UTC (rev 1292)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java 2009-01-12 10:40:22 UTC (rev 1293)
@@ -1,61 +0,0 @@
-/* *##% ToPIA - Tools for Portable and Independent Architecture
- * Copyright (C) 2004 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-
-package org.codelutin.topia.service;
-
-import org.codelutin.topia.service.TopiaApplicationServiceAbstract;
-
-/**
- * TestServiceImpl.java
- *
- * Developpe par le programmeur !
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$ By : $Author$
- */
-public class TaistServiceImpl extends TopiaApplicationServiceAbstract implements
- TaistService {
-
- private String prefix;
-
- private static int nb = 0;
-
- public TaistServiceImpl() {
- this.prefix = "Salut";
- nb = nb + 1;
- }
-
- /**
- *
- * @param prefix
- */
- public TaistServiceImpl(String prefix) {
- this();
- this.prefix = prefix;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see service.TaistService#sayHello(java.lang.String)
- */
- public String sayHello(String name) {
- return prefix + " " + name + " (instance " + nb + ")";
- }
-}
Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java 2009-01-12 10:39:50 UTC (rev 1292)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java 2009-01-12 10:40:22 UTC (rev 1293)
@@ -1,57 +0,0 @@
-/* *##% ToPIA - Tools for Portable and Independent Architecture
- * Copyright (C) 2004 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-
-package org.codelutin.topia.service;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * TopiaServiceServer.java
- * <p/>
- * Class main chargee de lire le fichier de configuration et de lancer les
- * serveurs, pour les protocoles definit.
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$ By : $Author$
- */
-public class TaistServiceServer {
-
- /** Logger (common logging) */
- private static final Log logger = LogFactory
- .getLog(TaistServiceServer.class);
-
- /**
- * Main. Demarre les serveurs.
- *
- * @param args arguments
- */
- public static void main(String... args) {
-
- // TaistService ts = new TaistServiceImpl("Bonjour");
- // TopiaServiceFactory.addService(TaistService.class, ts ,
- // Protocole.XML_RPC);
- //TopiaServiceFactory.addService(TaistService.class,
- // TaistServiceImpl.class, Protocole.XML_RPC);
- TopiaApplicationServiceFactory.addService(TaistService.class,
- TaistServiceImpl.class, Protocol.SOAP);
-
- logger.info("Service TaistService added...");
- }
-}
Deleted: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java 2009-01-12 10:39:50 UTC (rev 1292)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java 2009-01-12 10:40:22 UTC (rev 1293)
@@ -1,81 +0,0 @@
-/* *##% ToPIA - Tools for Portable and Independent Architecture
- * Copyright (C) 2004 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-
-package org.codelutin.topia.service;
-
-import org.codelutin.topia.TopiaException;
-import org.codelutin.topia.TopiaNotFoundException;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * TestServiceTestCase.java
- * <p/>
- * Test junit du service.
- * <p/>
- * Il faut lancer les serveurs avant ce test
- *
- * @author chatellier
- * @version $Revision$
- * <p/>
- * Last update : $Date$ By : $Author$
- * @see TaistServiceServer
- */
-public class TaistServiceTest extends Assert {
-
- @BeforeClass
- public static void beforeClass() {
- //one dayit will works :)
- //TaistServiceServer.main();
- }
-
- @Test
- public void HUMM() {
-
- }
- /** Test de la methode say hello */
- @Ignore
- //@Test
- public void testSayHello() {
-
- String reponse = null;
-
- TaistService testService;
- try {
- testService = TopiaApplicationServiceFactory
- .getService(TaistService.class);
-
- String myName = "eric";
-
- reponse = testService.sayHello(myName);
-
- System.out.println("TaistService says : " + reponse);
- } catch (TopiaNotFoundException e) {
- System.err
- .println("TopiaNotFoundException: erreur du fichier de configuration");
- } catch (TopiaException e) {
- System.err
- .println("TopiaException: impossible d'instancier le service");
- }
-
- assertNotNull(reponse);
- }
-}
1
0
r1292 - topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
12 Jan '09
Author: chatellier
Date: 2009-01-12 10:39:50 +0000 (Mon, 12 Jan 2009)
New Revision: 1292
Added:
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleService.java
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceImpl.java
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceServer.java
topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceTest.java
Log:
Replace "Taist" by "Example" :p
Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleService.java (from rev 1290, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistService.java)
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleService.java (rev 0)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleService.java 2009-01-12 10:39:50 UTC (rev 1292)
@@ -0,0 +1,41 @@
+/* *##% ToPIA - Tools for Portable and Independent Architecture
+ * Copyright (C) 2004 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
+
+package org.codelutin.topia.service;
+
+import org.codelutin.topia.TopiaException;
+
+/**
+ * TestService.java
+ * <p/>
+ * Genere par Topia !
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$ By : $Author$
+ */
+public interface ExampleService extends TopiaApplicationService {
+
+ /**
+ * Declaration d'un service
+ *
+ * @param name le nom
+ * @return hello
+ */
+ public String sayHello(String name) throws TopiaException;
+}
Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleService.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceImpl.java (from rev 1290, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceImpl.java)
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceImpl.java (rev 0)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceImpl.java 2009-01-12 10:39:50 UTC (rev 1292)
@@ -0,0 +1,63 @@
+/* *##% ToPIA - Tools for Portable and Independent Architecture
+ * Copyright (C) 2004 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
+
+package org.codelutin.topia.service;
+
+import org.codelutin.topia.service.TopiaApplicationServiceAbstract;
+import org.junit.Ignore;
+
+/**
+ * TestServiceImpl.java
+ *
+ * Developpe par le programmeur !
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$ By : $Author$
+ */
+@Ignore
+public class ExampleServiceImpl extends TopiaApplicationServiceAbstract implements
+ ExampleService {
+
+ private String prefix;
+
+ private static int nb = 0;
+
+ public ExampleServiceImpl() {
+ this.prefix = "Salut";
+ nb = nb + 1;
+ }
+
+ /**
+ *
+ * @param prefix
+ */
+ public ExampleServiceImpl(String prefix) {
+ this();
+ this.prefix = prefix;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see service.TaistService#sayHello(java.lang.String)
+ */
+ public String sayHello(String name) {
+ return prefix + " " + name + " (instance " + nb + ")";
+ }
+}
Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceServer.java (from rev 1290, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceServer.java)
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceServer.java (rev 0)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceServer.java 2009-01-12 10:39:50 UTC (rev 1292)
@@ -0,0 +1,59 @@
+/* *##% ToPIA - Tools for Portable and Independent Architecture
+ * Copyright (C) 2004 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
+
+package org.codelutin.topia.service;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Ignore;
+
+/**
+ * TopiaServiceServer.java
+ * <p/>
+ * Class main chargee de lire le fichier de configuration et de lancer les
+ * serveurs, pour les protocoles definit.
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$ By : $Author$
+ */
+@Ignore
+public class ExampleServiceServer {
+
+ /** Logger (common logging) */
+ private static final Log logger = LogFactory
+ .getLog(ExampleServiceServer.class);
+
+ /**
+ * Main. Demarre les serveurs.
+ *
+ * @param args arguments
+ */
+ public static void main(String... args) {
+
+ // TaistService ts = new TaistServiceImpl("Bonjour");
+ // TopiaServiceFactory.addService(TaistService.class, ts ,
+ // Protocole.XML_RPC);
+ //TopiaServiceFactory.addService(TaistService.class,
+ // TaistServiceImpl.class, Protocole.XML_RPC);
+ TopiaApplicationServiceFactory.addService(ExampleService.class,
+ ExampleServiceImpl.class, Protocol.SOAP);
+
+ logger.info("Service ExampleService added...");
+ }
+}
Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceServer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceTest.java (from rev 1290, topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/TaistServiceTest.java)
===================================================================
--- topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceTest.java (rev 0)
+++ topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceTest.java 2009-01-12 10:39:50 UTC (rev 1292)
@@ -0,0 +1,75 @@
+/* *##% ToPIA - Tools for Portable and Independent Architecture
+ * Copyright (C) 2004 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
+
+package org.codelutin.topia.service;
+
+import org.codelutin.topia.TopiaException;
+import org.codelutin.topia.TopiaNotFoundException;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+
+/**
+ * TestServiceTestCase.java
+ * <p/>
+ * Test junit du service.
+ * <p/>
+ * Il faut lancer les serveurs avant ce test
+ *
+ * @author chatellier
+ * @version $Revision$
+ * <p/>
+ * Last update : $Date$ By : $Author$
+ * @see ExampleServiceServer
+ */
+@Ignore
+public class ExampleServiceTest {
+
+ @BeforeClass
+ public static void beforeClass() {
+ //one dayit will works :)
+ //TaistServiceServer.main();
+ }
+
+ /** Test de la methode say hello */
+ @Test
+ public void testSayHello() {
+
+ String reponse = null;
+
+ ExampleService testService;
+ try {
+ testService = TopiaApplicationServiceFactory
+ .getService(ExampleService.class);
+
+ String myName = "test";
+
+ reponse = testService.sayHello(myName);
+
+ System.out.println("ExampleService says : " + reponse);
+ } catch (TopiaNotFoundException e) {
+ System.err
+ .println("TopiaNotFoundException: erreur du fichier de configuration");
+ } catch (TopiaException e) {
+ System.err
+ .println("TopiaException: impossible d'instancier le service");
+ }
+
+ Assert.assertNotNull(reponse);
+ }
+}
Property changes on: topia/trunk/topia-soa/src/test/java/org/codelutin/topia/service/ExampleServiceTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
1
0
r1291 - topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
by chatellier@users.labs.libre-entreprise.org 12 Jan '09
12 Jan '09
Author: chatellier
Date: 2009-01-12 09:46:58 +0000 (Mon, 12 Jan 2009)
New Revision: 1291
Modified:
topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityAbstractGenerator.java
topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityInterfaceGenerator.java
Log:
Correction des erreurs de nom et des types sur les classes d'associations
Modified: topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityAbstractGenerator.java
===================================================================
--- topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityAbstractGenerator.java 2009-01-09 09:01:36 UTC (rev 1290)
+++ topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityAbstractGenerator.java 2009-01-12 09:46:58 UTC (rev 1291)
@@ -514,8 +514,8 @@
/* (non-Javadoc)
* @see <%=clazz.getQualifiedName()%>#get<%=Util.capitalize(attr.getName())%>ByTopiaId(String)
*)
- public <%=attr.getType()%> get<%=Util.capitalize(attr.getName())%>ByTopiaId(String topiaId) {
- return org.codelutin.topia.persistence.util.TopiaEntityHelper.getEntityByTopiaId(<%=attr.getName()%>, topiaId);
+ public <%=attr.getAssociationClass().getQualifiedName()%> get<%=Util.capitalize(assocAttrName)%>ByTopiaId(String topiaId) {
+ return org.codelutin.topia.persistence.util.TopiaEntityHelper.getEntityByTopiaId(<%=assocAttrName%>, topiaId);
}
/* (non-Javadoc)
@@ -538,9 +538,9 @@
// addAll<%=Util.capitalize(assocAttrName)%>(values);
// FIXME
<%=collectionInterface%><<%=attr.getAssociationClass().getQualifiedName()%>> _oldValue = <%=Util.toLowerCaseFirstLetter(assocAttrName)%>;
- fireOnPreWrite("Util.toLowerCaseFirstLetter(assocAttrName)%>", _oldValue, values);
+ fireOnPreWrite("<%=Util.toLowerCaseFirstLetter(assocAttrName)%>", _oldValue, values);
<%=Util.toLowerCaseFirstLetter(assocAttrName)%> = values;
- fireOnPostWrite("Util.toLowerCaseFirstLetter(assocAttrName)%>", _oldValue, values);
+ fireOnPostWrite("<%=Util.toLowerCaseFirstLetter(assocAttrName)%>", _oldValue, values);
}
/* (non-Javadoc)
@@ -575,7 +575,7 @@
}
}*/
}
-/*{ <%=collectionInterface%><<%=attr.getType()%>> _oldValue = new <%=collectionObject%><<%=attr.getType()%>>(this.<%=Util.toLowerCaseFirstLetter(assocAttrName)%>);
+/*{ <%=collectionInterface%><<%=attr.getAssociationClass().getQualifiedName()%>> _oldValue = new <%=collectionObject%><<%=attr.getAssociationClass().getQualifiedName()%>>(this.<%=Util.toLowerCaseFirstLetter(assocAttrName)%>);
fireOnPreWrite("<%=Util.toLowerCaseFirstLetter(assocAttrName)%>", _oldValue, null);
this.<%=Util.toLowerCaseFirstLetter(assocAttrName)%>.clear();
fireOnPostWrite("<%=Util.toLowerCaseFirstLetter(assocAttrName)%>", _oldValue, null);
Modified: topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityInterfaceGenerator.java
===================================================================
--- topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityInterfaceGenerator.java 2009-01-09 09:01:36 UTC (rev 1290)
+++ topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityInterfaceGenerator.java 2009-01-12 09:46:58 UTC (rev 1291)
@@ -398,7 +398,7 @@
*
* @return l'attribut recherché, ou <code>null</code> s'il n'existe pas.
*)
- public <%=attr.getType()%> get<%=Util.capitalize(attr.getName())%>ByTopiaId(String topiaId);
+ public <%=attr.getAssociationClass().getQualifiedName()%> get<%=Util.capitalize(assocAttrName)%>ByTopiaId(String topiaId);
/**
* @return L'attribut <%=attr.getAssociationClass().getName()%> associé à la valeur <code>value</code> de l'attribut <%=attr.getName()%>.
1
0
r1290 - topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator
by chatellier@users.labs.libre-entreprise.org 09 Jan '09
by chatellier@users.labs.libre-entreprise.org 09 Jan '09
09 Jan '09
Author: chatellier
Date: 2009-01-09 09:01:36 +0000 (Fri, 09 Jan 2009)
New Revision: 1290
Added:
topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java
Modified:
topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java
Log:
Ajout d'un meta generateur pour les 3 generateurs des services
Modified: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java
===================================================================
--- topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java 2009-01-07 08:49:38 UTC (rev 1289)
+++ topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java 2009-01-09 09:01:36 UTC (rev 1290)
@@ -20,9 +20,7 @@
import java.io.File;
import java.io.IOException;
import java.io.Writer;
-import java.util.Collection;
import java.util.Iterator;
-import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -31,8 +29,6 @@
import org.codelutin.generator.models.object.ObjectModelClass;
import org.codelutin.generator.models.object.ObjectModelClassifier;
import org.codelutin.generator.models.object.ObjectModelInterface;
-import org.codelutin.generator.models.object.ObjectModelOperation;
-import org.codelutin.generator.models.object.ObjectModelParameter;
import org.codelutin.topia.service.TopiaApplicationServiceAbstract;
/**
Added: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java
===================================================================
--- topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java (rev 0)
+++ topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java 2009-01-09 09:01:36 UTC (rev 1290)
@@ -0,0 +1,80 @@
+/* *##% ToPIA - Tools for Portable and Independent Architecture
+ * Copyright (C) 2004 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
+
+package org.codelutin.topia.generator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.generator.ObjectModelGenerator;
+import org.codelutin.generator.models.object.ObjectModel;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Meta generateur des services.
+ */
+public class TopiaApplicationServiceMetaGenerator extends ObjectModelGenerator {
+
+ /** logger */
+ protected static Log log = LogFactory.getLog(TopiaApplicationServiceMetaGenerator.class);
+
+ /*
+ * @see org.codelutin.generator.ObjectModelGenerator#generate(org.codelutin.generator.models.object.ObjectModel, java.io.File)
+ */
+ @Override
+ public void generate(ObjectModel model, File destDir) throws IOException {
+
+ generateApplicationService(model, destDir);
+
+ }
+
+ /**
+ * Appel les autres generateu des services.
+ *
+ * @param model
+ * @param destDir
+ * @throws IOException
+ */
+ public void generateApplicationService(ObjectModel model, File destDir)
+ throws IOException {
+
+ ObjectModelGenerator gen = null;
+
+ // Genere les interfaces des services
+ if(log.isInfoEnabled()) {
+ log.info("Generating Service Interface");
+ }
+ gen = new ServiceInterfaceGenerator(this);
+ gen.generate(model, destDir);
+
+ // Genere les abstract des services
+ if(log.isInfoEnabled()) {
+ log.info("Generating Service Abstract");
+ }
+ gen = new ServiceAbstractGenerator(this);
+ gen.generate(model, destDir);
+
+ // Genere les impl des services
+ if(log.isInfoEnabled()) {
+ log.info("Generating Service Impl");
+ }
+ gen = new ServiceImplGenerator(this);
+ gen.generate(model, destDir);
+ }
+
+} //TopiaApplicationServiceMetaGenerator
1
0
r1289 - in topia/trunk: . topia-persistence topia-soa topia-ui
by tchemit@users.labs.libre-entreprise.org 07 Jan '09
by tchemit@users.labs.libre-entreprise.org 07 Jan '09
07 Jan '09
Author: tchemit
Date: 2009-01-07 08:49:38 +0000 (Wed, 07 Jan 2009)
New Revision: 1289
Modified:
topia/trunk/pom.xml
topia/trunk/topia-persistence/pom.xml
topia/trunk/topia-soa/pom.xml
topia/trunk/topia-ui/pom.xml
Log:
push back scm generic values
Modified: topia/trunk/pom.xml
===================================================================
--- topia/trunk/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
+++ topia/trunk/pom.xml 2009-01-07 08:49:38 UTC (rev 1289)
@@ -119,9 +119,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/?ro…</url>
+ <connection>${maven.scm.connection}</connection>
+ <developerConnection>${maven.scm.developerConnection}</developerConnection>
+ <url>${maven.scm.url}</url>
</scm>
</project>
Modified: topia/trunk/topia-persistence/pom.xml
===================================================================
--- topia/trunk/topia-persistence/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
+++ topia/trunk/topia-persistence/pom.xml 2009-01-07 08:49:38 UTC (rev 1289)
@@ -99,9 +99,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-persistence</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-persistence</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/top…</url>
+ <connection>${maven.scm.connection.child}</connection>
+ <developerConnection>${maven.scm.developerConnection.child}</developerConnection>
+ <url>${maven.scm.url.child}</url>
</scm>
Modified: topia/trunk/topia-soa/pom.xml
===================================================================
--- topia/trunk/topia-soa/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
+++ topia/trunk/topia-soa/pom.xml 2009-01-07 08:49:38 UTC (rev 1289)
@@ -115,9 +115,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-soa</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-soa</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/top…</url>
+ <connection>${maven.scm.connection.child}</connection>
+ <developerConnection>${maven.scm.developerConnection.child}</developerConnection>
+ <url>${maven.scm.url.child}</url>
</scm>
</project>
Modified: topia/trunk/topia-ui/pom.xml
===================================================================
--- topia/trunk/topia-ui/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
+++ topia/trunk/topia-ui/pom.xml 2009-01-07 08:49:38 UTC (rev 1289)
@@ -66,9 +66,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-ui</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-ui</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/top…</url>
+ <connection>${maven.scm.connection.child}</connection>
+ <developerConnection>${maven.scm.developerConnection.child}</developerConnection>
+ <url>${maven.scm.url.child}</url>
</scm>
</project>
1
0
r1288 - in topia/trunk: . topia-persistence topia-soa topia-ui
by tchemit@users.labs.libre-entreprise.org 07 Jan '09
by tchemit@users.labs.libre-entreprise.org 07 Jan '09
07 Jan '09
Author: tchemit
Date: 2009-01-07 08:35:30 +0000 (Wed, 07 Jan 2009)
New Revision: 1288
Modified:
topia/trunk/pom.xml
topia/trunk/topia-persistence/pom.xml
topia/trunk/topia-soa/pom.xml
topia/trunk/topia-ui/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: topia/trunk/pom.xml
===================================================================
--- topia/trunk/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
+++ topia/trunk/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
@@ -13,7 +13,7 @@
</parent>
<artifactId>topia</artifactId>
- <version>2.1.2</version>
+ <version>2.1.3-SNAPSHOT</version>
<modules>
<module>topia-persistence</module>
@@ -119,9 +119,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/?ro…</url>
</scm>
</project>
Modified: topia/trunk/topia-persistence/pom.xml
===================================================================
--- topia/trunk/topia-persistence/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
+++ topia/trunk/topia-persistence/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>topia</artifactId>
- <version>2.1.2</version>
+ <version>2.1.3-SNAPSHOT</version>
</parent>
<groupId>org.codelutin.topia</groupId>
@@ -99,9 +99,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-persistence</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-persistence</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-persistence</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-persistence</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/top…</url>
</scm>
Modified: topia/trunk/topia-soa/pom.xml
===================================================================
--- topia/trunk/topia-soa/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
+++ topia/trunk/topia-soa/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>topia</artifactId>
- <version>2.1.2</version>
+ <version>2.1.3-SNAPSHOT</version>
</parent>
<groupId>org.codelutin.topia</groupId>
@@ -115,9 +115,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-soa</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-soa</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-soa</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-soa</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/top…</url>
</scm>
</project>
Modified: topia/trunk/topia-ui/pom.xml
===================================================================
--- topia/trunk/topia-ui/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
+++ topia/trunk/topia-ui/pom.xml 2009-01-07 08:35:30 UTC (rev 1288)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>topia</artifactId>
- <version>2.1.2</version>
+ <version>2.1.3-SNAPSHOT</version>
</parent>
<groupId>org.codelutin.topia</groupId>
@@ -66,9 +66,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-ui</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-ui</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-ui</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/trunk/topia-ui</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/trunk/top…</url>
</scm>
</project>
1
0
r1287 - in topia/tags: . 2.1.2 2.1.2/topia-persistence 2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator 2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util 2.1.2/topia-soa 2.1.2/topia-ui
by tchemit@users.labs.libre-entreprise.org 07 Jan '09
by tchemit@users.labs.libre-entreprise.org 07 Jan '09
07 Jan '09
Author: tchemit
Date: 2009-01-07 08:35:25 +0000 (Wed, 07 Jan 2009)
New Revision: 1287
Added:
topia/tags/2.1.2/
topia/tags/2.1.2/pom.xml
topia/tags/2.1.2/topia-persistence/changelog.txt
topia/tags/2.1.2/topia-persistence/pom.xml
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java
topia/tags/2.1.2/topia-soa/pom.xml
topia/tags/2.1.2/topia-ui/pom.xml
Removed:
topia/tags/2.1.2/pom.xml
topia/tags/2.1.2/topia-persistence/changelog.txt
topia/tags/2.1.2/topia-persistence/pom.xml
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java
topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java
topia/tags/2.1.2/topia-soa/pom.xml
topia/tags/2.1.2/topia-ui/pom.xml
Log:
[maven-release-plugin] copy for tag 2.1.2
Copied: topia/tags/2.1.2 (from rev 1284, topia/trunk)
Deleted: topia/tags/2.1.2/pom.xml
===================================================================
--- topia/trunk/pom.xml 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <!-- ************************************************************* -->
- <!-- *** POM Relationships *************************************** -->
- <!-- ************************************************************* -->
- <parent>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinproject</artifactId>
- <version>3.2</version>
- </parent>
-
- <artifactId>topia</artifactId>
- <version>2.1.2-SNAPSHOT</version>
-
- <modules>
- <module>topia-persistence</module>
- <module>topia-soa</module>
- <module>topia-ui</module>
- </modules>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutingenerator</artifactId>
- <version>${generator.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinutil</artifactId>
- <version>${lutinutil.version}</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
- <name>ToPIA - Tools for Portable and Independent Architecture</name>
- <description>Framework de persistance et de distribution d'application.</description>
- <inceptionYear>2004</inceptionYear>
-
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
-
- <packaging>pom</packaging>
-
- <properties>
- <!-- id du projet du labs -->
- <labs.id>21</labs.id>
-
- <!-- nom du projet sur le labs -->
- <labs.project>topia</labs.project>
-
- <!-- Ignore failure test for now -->
- <maven.test.testFailureIgnore>true</maven.test.testFailureIgnore>
-
- <!-- generator version -->
- <generator.version>0.63</generator.version>
-
- <!-- processor version -->
- <processor.version>0.16</processor.version>
-
- <!-- lutinutil version -->
- <lutinutil.version>1.0</lutinutil.version>
-
- </properties>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-processor-plugin</artifactId>
- <version>${processor.version}</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>process</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <!-- You might change defaut directories -->
- <!-- srcDir>${basedir}/src/main/java</srcDir>
- <destDir>${basedir}/target/processed-sources/java</destDir-->
- <addCompileDirectory>true</addCompileDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- <filters>
- org.codelutin.processor.filters.GeneratorTemplatesFilter,
- org.codelutin.processor.filters.ActiveLogsCodeFilter
- </filters>
- <verbose>${maven.verbose}</verbose>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
-
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
-
- </plugins>
- </build>
-
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <scm>
- <connection>${maven.scm.connection}</connection>
- <developerConnection>${maven.scm.developerConnection}</developerConnection>
- <url>${maven.scm.url}</url>
- </scm>
-
-</project>
Copied: topia/tags/2.1.2/pom.xml (from rev 1286, topia/trunk/pom.xml)
===================================================================
--- topia/tags/2.1.2/pom.xml (rev 0)
+++ topia/tags/2.1.2/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+ <parent>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinproject</artifactId>
+ <version>3.2</version>
+ </parent>
+
+ <artifactId>topia</artifactId>
+ <version>2.1.2</version>
+
+ <modules>
+ <module>topia-persistence</module>
+ <module>topia-soa</module>
+ <module>topia-ui</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutingenerator</artifactId>
+ <version>${generator.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinutil</artifactId>
+ <version>${lutinutil.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+ <name>ToPIA - Tools for Portable and Independent Architecture</name>
+ <description>Framework de persistance et de distribution d'application.</description>
+ <inceptionYear>2004</inceptionYear>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>pom</packaging>
+
+ <properties>
+ <!-- id du projet du labs -->
+ <labs.id>21</labs.id>
+
+ <!-- nom du projet sur le labs -->
+ <labs.project>topia</labs.project>
+
+ <!-- Ignore failure test for now -->
+ <maven.test.testFailureIgnore>true</maven.test.testFailureIgnore>
+
+ <!-- generator version -->
+ <generator.version>0.63</generator.version>
+
+ <!-- processor version -->
+ <processor.version>0.16</processor.version>
+
+ <!-- lutinutil version -->
+ <lutinutil.version>1.0</lutinutil.version>
+
+ </properties>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ <version>${processor.version}</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- You might change defaut directories -->
+ <!-- srcDir>${basedir}/src/main/java</srcDir>
+ <destDir>${basedir}/target/processed-sources/java</destDir-->
+ <addCompileDirectory>true</addCompileDirectory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ <filters>
+ org.codelutin.processor.filters.GeneratorTemplatesFilter,
+ org.codelutin.processor.filters.ActiveLogsCodeFilter
+ </filters>
+ <verbose>${maven.verbose}</verbose>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ </scm>
+
+</project>
Deleted: topia/tags/2.1.2/topia-persistence/changelog.txt
===================================================================
--- topia/trunk/topia-persistence/changelog.txt 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-persistence/changelog.txt 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,14 +0,0 @@
-2.1.2 ??? 200901??
-* 20090104 [chemit] - utilisation foreach dans les générateurs
- - ajout de méthode getXXXByTopiaId pour les attributs à multiplicité dans les entités (interface et abstract)
- - fix generic dans les méthodes générées
- - ajout d'un tagValue i18n pour générer dans les entités abstraites les chaines i18n
- - ajout d'un paquetage org.codelutin.topia.persistence.util avec du code utile :) (javadoc a faire...)
-
-2.1.1 chemit 20081215
-* 20081215 [chemit] - new release for isis-fish :)
-* 20081212 [chemit] - add a InterfaceGenerator to generate simple with no stereotype interfaces.
-
-2.1.0 chemit 20081210
-* 20081205 [chemit] - improve poms, use lutinproject 3.2
- - add some usefull methods in TopiaUtil to help with regex on topiaId expression
\ No newline at end of file
Copied: topia/tags/2.1.2/topia-persistence/changelog.txt (from rev 1285, topia/trunk/topia-persistence/changelog.txt)
===================================================================
--- topia/tags/2.1.2/topia-persistence/changelog.txt (rev 0)
+++ topia/tags/2.1.2/topia-persistence/changelog.txt 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,21 @@
+2.1.2 ??? 200901??
+* 20090106 [chemit] - amélioration du générateur de mapping hibernate :
+ - génération des clefs metier dans le mapping hibernate via la tag value naturalId
+ - mise en constantes des tagValues utiliser dans le génératuer du mapping hibernate
+ - ajout du tagValue notNull pour le mapping hibernate
+ - changement du tagValue order-by en orderBy car sinon on récupère order au lieu de order-by
+ - ajout de la méthode obtainProgperties sur la classe Loador pour recuperer la map des propriétés à binder
+ (car pour les clef métiers on doit les ajouter à la création sinon hibernate pleure...)
+* 20090104 [chemit] - utilisation foreach dans les générateurs
+ - ajout de méthode getXXXByTopiaId pour les attributs à multiplicité dans les entités (interface et abstract)
+ - fix generic dans les méthodes générées
+ - ajout d'un tagValue i18n pour générer dans les entités abstraites les chaines i18n
+ - ajout d'un paquetage org.codelutin.topia.persistence.util avec du code utile :) (javadoc a faire...)
+
+2.1.1 chemit 20081215
+* 20081215 [chemit] - new release for isis-fish :)
+* 20081212 [chemit] - add a InterfaceGenerator to generate simple with no stereotype interfaces.
+
+2.1.0 chemit 20081210
+* 20081205 [chemit] - improve poms, use lutinproject 3.2
+ - add some usefull methods in TopiaUtil to help with regex on topiaId expression
\ No newline at end of file
Deleted: topia/tags/2.1.2/topia-persistence/pom.xml
===================================================================
--- topia/trunk/topia-persistence/pom.xml 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-persistence/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <!-- ************************************************************* -->
- <!-- *** POM Relationships *************************************** -->
- <!-- ************************************************************* -->
-
- <parent>
- <groupId>org.codelutin</groupId>
- <artifactId>topia</artifactId>
- <version>2.1.2-SNAPSHOT</version>
- </parent>
-
- <groupId>org.codelutin.topia</groupId>
- <artifactId>topia-persistence</artifactId>
-
- <dependencies>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinutil</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutingenerator</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.3.1.GA</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-ehcache</artifactId>
- <version>3.3.1.GA</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.4.GA</version>
- <scope>runtime</scope>
- </dependency>
- <!-- hibernate-core only include api, need core -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.2</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- BD H2 for testing -->
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>1.1.104</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
-
- <name>ToPIA - Persistence</name>
- <description>Hibernate based persistence module</description>
-
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
-
- <packaging>jar</packaging>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <plugins>
-
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-processor-plugin</artifactId>
- </plugin>
-
- </plugins>
- </build>
-
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <scm>
- <connection>${maven.scm.connection.child}</connection>
- <developerConnection>${maven.scm.developerConnection.child}</developerConnection>
- <url>${maven.scm.url.child}</url>
- </scm>
-
-
-</project>
Copied: topia/tags/2.1.2/topia-persistence/pom.xml (from rev 1286, topia/trunk/topia-persistence/pom.xml)
===================================================================
--- topia/tags/2.1.2/topia-persistence/pom.xml (rev 0)
+++ topia/tags/2.1.2/topia-persistence/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.codelutin</groupId>
+ <artifactId>topia</artifactId>
+ <version>2.1.2</version>
+ </parent>
+
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinutil</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutingenerator</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.3.1.GA</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-ehcache</artifactId>
+ <version>3.3.1.GA</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.4.GA</version>
+ <scope>runtime</scope>
+ </dependency>
+ <!-- hibernate-core only include api, need core -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- BD H2 for testing -->
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.1.104</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>ToPIA - Persistence</name>
+ <description>Hibernate based persistence module</description>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-persistence</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-persistence</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ </scm>
+
+
+</project>
Deleted: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java
===================================================================
--- topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,447 +0,0 @@
-/* *##% ToPIA - Tools for Portable and Independent Architecture
- * Copyright (C) 2004 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-
-/* *
-* EntityHibernateMappingGenerator.java
-*
-* Created: 12 déc. 2005
-*
-* @author Arnaud Thimel <thimel(a)codelutin.com>
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.topia.generator;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.generator.Generator;
-import org.codelutin.generator.ObjectModelGenerator;
-import org.codelutin.generator.Util;
-import org.codelutin.generator.models.object.ObjectModelAssociationClass;
-import org.codelutin.generator.models.object.ObjectModelAttribute;
-import org.codelutin.generator.models.object.ObjectModelClass;
-
-import static org.codelutin.topia.generator.GeneratorUtil.notEmpty;
-import static org.codelutin.topia.generator.GeneratorUtil.STEREOTYPE_ENTITY;
-import static org.codelutin.topia.generator.GeneratorUtil.TAG_ACCESS;
-import static org.codelutin.topia.generator.GeneratorUtil.PERSISTENCE_TYPE_HIBERNATE;
-import static org.codelutin.topia.generator.GeneratorUtil.hasUnidirectionalRelationOnAbstractType;
-
-/**
- * FIXME mettre les attributs node="..." sur tous les attributs
- * @author poussin
- *
- */
-public class EntityHibernateMappingGenerator extends ObjectModelGenerator {
-
- /**
- * Logger for this class
- */
- private static final Log log = LogFactory
- .getLog(EntityHibernateMappingGenerator.class);
-
- private Map<String, String[]> columnNamesMap = new HashMap<String, String[]>();
-
- public EntityHibernateMappingGenerator() {
- super();
- }
-
- public EntityHibernateMappingGenerator(Generator parent) {
- super(parent);
- }
-
- @Override
- public String getFilenameForClass(ObjectModelClass clazz) {
- String DOName = GeneratorUtil.getDOType(clazz, model);
- return DOName.replace('.', File.separatorChar) + ".hbm.xml";
- }
-
- @Override
- public void generateFromClass(Writer output, ObjectModelClass clazz) throws IOException {
- String persistenceType = GeneratorUtil.getPersistenceType(clazz);
- if (!clazz.hasStereotype(STEREOTYPE_ENTITY) && PERSISTENCE_TYPE_HIBERNATE.equals(persistenceType)) {
- return;
- }
-/*{<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping default-access="field" auto-import="true" package="<%=clazz.getPackageName()%>">
-}*/
- boolean haveSuper = clazz.getSuperclasses().size() > 0;
-
- if (haveSuper) {
- ObjectModelClass superClass = clazz.getSuperclasses().iterator().next();
- String superClassname = superClass.getQualifiedName();
- if (log.isDebugEnabled()) {log.debug("superClass for " + clazz.getQualifiedName() + " is " + superClassname);}
-/*{ <union-subclass }*/
-/*{name="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
-/*{extends="<%=GeneratorUtil.getDOType(superClassname, model)%>" }*/
-/*{table="<%=GeneratorUtil.getDBName(clazz)%>" }*/
- String schema = GeneratorUtil.getSchemaName(clazz, model);
- if (schema != null) {
-/*{schema="<%=schema%>" }*/
- }
-/*{node="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
-/*{abstract="<%=(clazz.isAbstract()?"true":"false")%>" }*/
- //On précise au proxy de quelle interface hérite l'objet
-/*{proxy="<%=clazz.getQualifiedName()%>" }*/
-/*{>
- <!--key column="topiaId"/-->
-}*/
- } else {
-/*{ <class }*/
-/*{name="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
-/*{table="<%=GeneratorUtil.getDBName(clazz)%>" }*/
- String schema = GeneratorUtil.getSchemaName(clazz, model);
- if (schema != null) {
-/*{schema="<%=schema%>" }*/
- }
-/*{node="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
-/*{abstract="<%=(clazz.isAbstract()?"true":"false")%>" }*/
- //On précise au proxy de quelle interface hérite l'objet
-/*{proxy="<%=clazz.getQualifiedName()%>" }*/
-/*{>
- <id name="topiaId" type="string" length="255" node="@topiaId"/>
- <version name="topiaVersion" type="long" node="@topiaVersion"/>
- <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/>
-}*/
- }
-
- for (Object o : clazz.getAttributes()) {
- ObjectModelAttribute attr = (ObjectModelAttribute) o;
- ObjectModelAttribute reverse = attr.getReverseAttribute();
-
- // pour les asso quoi qu'il arrive il faut les lier des 2 cotes
- // pour pouvoir supprimer en cascade l'asso lors de la suppression
- // d'un des cotes
- if (attr.isNavigable()
- || hasUnidirectionalRelationOnAbstractType(reverse, model)
- || attr.hasAssociationClass()) {
- if (!Util.isNMultiplicity(attr)) {
- if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(STEREOTYPE_ENTITY)) {
- if (Util.isNMultiplicity(attr.getReverseMaxMultiplicity()) && !attr.hasAssociationClass()) {
- generateHibernateManyToOne(output, attr);
- } else {
- generateHibernateOneToOne(output, attr);
- }
- } else {
- generateHibernateProperty(output, attr);
- }
- } else {
- if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(STEREOTYPE_ENTITY)) {
- if (Util.isNMultiplicity(attr.getReverseMaxMultiplicity()) && !attr.hasAssociationClass()) {
- generateHibernateManyToMany(output, attr);
- } else {
- generateHibernateOneToMany(output, attr);
- }
- } else {
- generateHibernateMany(output, attr);
- }
- }
- }
- }
-
- //Attributs pour les classes d'association
- if (clazz instanceof ObjectModelAssociationClass) {
- ObjectModelAssociationClass assoc = (ObjectModelAssociationClass)clazz;
- for (Object o : assoc.getParticipantsAttributes()) {
- ObjectModelAttribute attr = (ObjectModelAttribute) o;
- if (attr != null) {
-
-// Note(poussin) pour moi quoi qu'il arrive sur la classe d'association il faut
-// un many-to-one, sinon on a des problemes.
-// if ((!attr.getReverseAttribute().isNavigable()) || !Util.isNMultiplicity(attr.getReverseAttribute())) {
-// / *{ <one-to-one name="<%=getName(attr, true)%>" class="<%=getType(attr, true)%>"<%=(GeneratorUtil.notEmpty(attr.getTagValue(GeneratorUtil.TAG_LENGTH))?(" length=\"" + attr.getTagValue(GeneratorUtil.TAG_LENGTH) + "\""):"")%><%=(attr.isComposite()?" cascade=\"delete\"":"")%>/>
-// } */
-// } else {
-
-/*{ <many-to-one name="<%=getName(attr, true)%>" class="<%=getType(attr, true)%>" column="<%=GeneratorUtil.getDBName(attr)%>" node="<%=getName(attr, true)%>/@topiaId" embed-xml="false"/>
-}*/
-// }
- //Ne sert plus grâce à l'utilisation de la navigabilité
-// if (!attr.getReverseAttribute().isNavigable()) {
-// String type = GeneratorUtil.getDOType(((ObjectModelClassifier)attr.getDeclaringElement()).getQualifiedName(), model);
-// String name = Util.toLowerCaseFirstLetter(attr.getDeclaringElement().getName());
-// if (log.isTraceEnabled()) {log.trace("reverse: " + type + " " + name);}
-// if (!Util.isNMultiplicity(attr)) {
-//{<!-- <one-to-one name="<%=name%>" class="<%=type%>"/>
-//}
-// } else {
-//{ <many-to-one name="<%=name%>" class="<%=type%>" column="<%=name.toLowerCase()%>"/> -->
-//}
-// }
-// }
- }
- }
- }
-
- if (haveSuper) {
-/*{ </union-subclass>
-}*/
- } else {
-/*{ </class>
-}*/
- }
-/*{</hibernate-mapping>
-}*/
- }
-
- protected String getName(ObjectModelAttribute attr) {
- return getName(attr, false);
- }
-
- protected String getName(ObjectModelAttribute attr, boolean isAssoc) {
- String result = Util.toLowerCaseFirstLetter(attr.getName());
- if (attr.hasAssociationClass() && !isAssoc) {
- result = GeneratorUtil.getAssocAttrName(attr);
- }
- return result;
- }
-
- protected String getType(ObjectModelAttribute attr) {
- return getType(attr, false);
- }
-
- protected String getType(ObjectModelAttribute attr, boolean isAssoc) {
- String type = attr.getType();
- if (GeneratorUtil.notEmpty(model.getTagValue(type))) {
- String typeString = model.getTagValue(type);
- int bracketIndex = typeString.indexOf('(');
- if (bracketIndex != -1) {
- type = typeString.substring(0, bracketIndex);
- int bracketEndIndex = typeString.indexOf(')', bracketIndex + 1);
- String colmunList;
- if (bracketEndIndex != -1) {
- colmunList = typeString.substring(bracketIndex + 1, bracketEndIndex);
- } else {
- colmunList = typeString.substring(bracketIndex);
- }
- columnNamesMap.put(type, colmunList.split(","));
- } else {
- type = typeString;
- }
- }
- if (attr.hasAssociationClass() && !isAssoc) {
- type = attr.getAssociationClass().getQualifiedName();
- }
- return GeneratorUtil.getDOType(type, model);
- }
-
- protected void generateHibernateProperty(Writer output, ObjectModelAttribute attr) throws IOException {
- String type = getType(attr);
- if (type.trim().endsWith("[]")) {
- type = type.trim().substring(0, type.trim().length()-2);
-/*{ <primitive-array name="<%=getName(attr)%>" table="<%=GeneratorUtil.getDBName(attr.getDeclaringElement()) + "_" + getName(attr)%>" }*/
- String accessField = attr.getTagValue(TAG_ACCESS);
- if (notEmpty(accessField)) {
-/*{access="<%=accessField%>" }*/
- } else {
-/*{access="field" }*/
- }
- String schema = GeneratorUtil.getSchemaName(attr, model);
- if (schema != null) {
-/*{schema="<%=schema%>" }*/
- }
- if (attr.isIndexed()) {
-/*{index="<%=GeneratorUtil.getDBName(attr.getDeclaringElement()) + "_" + getName(attr)%>_idx" }*/
- }
-/*{>
- <key column="<%=GeneratorUtil.getDBName(attr.getDeclaringElement())%>"/>
- <list-index column="<%=getName(attr)%>_idx"/>
- <element type="<%=type%>"/>
- </primitive-array>
-}*/
- } else {
-/*{ <property name="<%=getName(attr)%>" type="<%=type%>" }*/
- String accessField = attr.getTagValue(TAG_ACCESS);
- if (notEmpty(accessField)) {
-/*{access="<%=accessField%>" }*/
- } else {
-/*{access="field" }*/
- }
- if (attr.isIndexed()) {
-/*{index="<%=GeneratorUtil.getDBName(attr.getDeclaringElement()) + "_" + getName(attr)%>_idx" }*/
- }
- String[] columnNames = this.columnNamesMap.get(type);
- if (columnNames == null || columnNames.length == 0) {
-/*{column="<%=GeneratorUtil.getDBName(attr)%>"<%=(GeneratorUtil.notEmpty(attr.getTagValue(GeneratorUtil.TAG_LENGTH))?(" length=\"" + attr.getTagValue(GeneratorUtil.TAG_LENGTH) + "\""):"")%> node="<%=getName(attr)%>"/>
-}*/
- } else {
-/*{>
-}*/
- for (String columnName : columnNames) {
- columnName = columnName.trim();
-/*{ <column name="<%=getName(attr) + "_" + columnName%>"/>
-}*/
- }
-/*{ </property>
-}*/
- }
- }
- }
-
- protected void generateHibernateOneToOne(Writer output, ObjectModelAttribute attr) throws IOException {
- generateHibernateManyToOne(output, attr, true);
-// boolean accessField = hasUnidirectionalRelationOnAbstractType(attr.getReverseAttribute(), model);
-/// *{ <one-to-one name="<%=getName(attr)%>" class="<%=getType(attr)%>"<%=(GeneratorUtil.notEmpty(attr.getTagValue(GeneratorUtil.TAG_LENGTH))?(" length=\"" + attr.getTagValue(GeneratorUtil.TAG_LENGTH) + "\""):"")%><%=((attr.isComposite() || attr.hasAssociationClass())?" cascade=\"delete\"":"")%><%=((accessField)?" access=\"field\"":"")%> node="<%=getName(attr)%>/@topiaId" embed-xml="false"/>
-//} */
- }
-
- protected void generateHibernateOneToMany(Writer output, ObjectModelAttribute attr) throws IOException {
- boolean needsIndex = attr.isIndexed();
- boolean isInverse = attr.getReverseAttribute().isNavigable();
- isInverse |= hasUnidirectionalRelationOnAbstractType(attr, model);
- String orderBy = attr.getTagValue("order-by");
- if (orderBy == null) {
- orderBy = "";
- } else {
- orderBy = "order-by=\"" + orderBy + "\"";
- }
-
- String cascade = "";
- if (attr.isComposite() || attr.hasAssociationClass()) {
- cascade += "cascade=\"all,delete-orphan\"";
- }
-
- String lazy = "lazy=\"";
- if (attr.getTagValue("lazy") != null){
- lazy += attr.getTagValue("lazy");
- }
- else {
- lazy += "true";
- }
- lazy += "\"";
-
- String fetch = "";
- if (attr.getTagValue("fetch") != null){
- fetch = "fetch=\"" + attr.getTagValue("fetch") + "\"";
- }
-
- String collType = GeneratorUtil.getNMultiplicityHibernateType(attr);
- if (!needsIndex) {
-/*{ <<%=collType%> name="<%=getName(attr)%>" <%=orderBy%> <%=((!isInverse)?"":"inverse=\"true\"")%> <%=fetch%> <%=lazy%> <%=cascade%> node="<%=getName(attr)%>" embed-xml="true">
- <key column="<%=GeneratorUtil.getReverseDBName(attr)%>"/>
- <one-to-many class="<%=getType(attr)%>" node="topiaId" embed-xml="false"/>
- </<%=collType%>>
-}*/
- }else {
-/*{ <<%=collType%> name="<%=getName(attr)%>"<%=((!isInverse)?"":" inverse=\"true\"")%> <%=lazy%> <%=cascade%> node="<%=getName(attr)%>" embed-xml="false">
- <key column="<%=GeneratorUtil.getReverseDBName(attr)%>"/>
- <list-index column="<%=GeneratorUtil.getReverseDBName(attr)%>_idx"/>
- <one-to-many class="<%=getType(attr)%>" node="topiaId" embed-xml="false"/>
- </<%=collType%>>
-}*/
- }
- }
-
- protected void generateHibernateMany(Writer output, ObjectModelAttribute attr) throws IOException {
- boolean needsIndex = attr.isIndexed();
- String collType = GeneratorUtil.getNMultiplicityHibernateType(attr);
- String lazy = "";
- if (attr.getTagValue("lazy") != null) {
- lazy = "lazy=\"" + attr.getTagValue("lazy") + "\"";
- }
-
-/*{ <<%=collType%> name="<%=getName(attr)%>" node="<%=getName(attr)%>" embed-xml="true" <%=lazy%>>
- <key column="OWNER"/>
-}*/
- if (needsIndex) {
-/*{ <list-index/>
-}*/
- }
-/*{ <element type="<%=getType(attr)%>" column="<%=GeneratorUtil.getDBName(attr)%>" node="id"/>
- </<%=collType%>>
-}*/
- }
-
- protected void generateHibernateManyToOne(Writer output, ObjectModelAttribute attr) throws IOException {
- generateHibernateManyToOne(output, attr, false);
- }
-
- protected void generateHibernateManyToOne(Writer output, ObjectModelAttribute attr, boolean isUnique) throws IOException {
-/*{ <many-to-one name="<%=getName(attr)%>" class="<%=getType(attr)%>" column="<%=GeneratorUtil.getDBName(attr)%>"}*/
- if (attr.isComposite() || attr.hasAssociationClass()) {
-/*{ cascade="delete"}*/
- }
- // Pour le test suivant, on verifie d'abord que l'attribut a un reverse.
- // S'il n'en a pas, cela signifie qu'il ne s'agit pas d'un entite
- // (au sens stereotype entity), donc a donc pas besoin de faire un access=field.
- if (attr.getReverseAttribute() != null && hasUnidirectionalRelationOnAbstractType(attr.getReverseAttribute(), model)) {
-/*{ access="field"}*/
- }
- if (isUnique) {
-/*{ unique="true"}*/
- }
-/*{ node="<%=getName(attr)%>/@topiaId" embed-xml="false"}*/
-
- // vérifier si le tag lazy est defini par defaut dans le fichier de proprietes
- if (attr.getTagValue("lazy") != null){
-/*{ lazy="<%=attr.getTagValue("lazy")%>"}*/
- }
-/*{/>
-}*/
- }
-
- protected void generateHibernateManyToMany(Writer output, ObjectModelAttribute attr) throws IOException {
- // On ne met le inverse="true" uniquement pour un seul coté de la relation.
- // Dans le cas contraire, les modifications dans la relation ne seront
- // pas sauvegardées. Ceci n'est vrai que si les deux coté sont navigable
- boolean isInverse = attr.isNavigable() && attr.getReverseAttribute().isNavigable();
- //isInverse |= !Util.isFirstAttribute(attr);
- //isInverse = false; // 20070117 poussin: pour du many, jamais de inverse
- isInverse &= Util.isFirstAttribute(attr);
-
- boolean needsIndex = attr.isIndexed();
- String cascade = "";
- if (attr.isComposite() || attr.hasAssociationClass()) {
- cascade += "cascade=\"delete,delete-orphan\"";
- }
- cascade += "";
-
- String lazy = "lazy=\"";
- if (attr.getTagValue("lazy") != null){
- lazy += attr.getTagValue("lazy");
- }
- else {
- lazy += "true";
- }
- lazy += "\"";
- String collType = GeneratorUtil.getNMultiplicityHibernateType(attr);
-
-/*{ <<%=collType%> name="<%=getName(attr)%>" table="<%=GeneratorUtil.getManyToManyTableName(attr)%>" <%=(isInverse?"inverse=\"true\" ":"")%> <%=lazy%> <%=cascade%> node="<%=getName(attr)%>" embed-xml="true">
- <key column="<%=GeneratorUtil.getReverseDBName(attr)%>"/>
-}*/
- if (needsIndex) {
-/*{ <list-index column="<%=GeneratorUtil.getReverseDBName(attr)%>_idx"/>
-}*/
- }
-/*{ <many-to-many class="<%=getType(attr)%>" column="<%=GeneratorUtil.getDBName(attr)%>" node="topiaId"/>
- </<%=collType%>>
-}*/
- }
-
-} //EntityHibernateMappingGenerator
Copied: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java (from rev 1285, topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java)
===================================================================
--- topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java (rev 0)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,486 @@
+/* *##% ToPIA - Tools for Portable and Independent Architecture
+ * Copyright (C) 2004 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
+
+/* *
+* EntityHibernateMappingGenerator.java
+*
+* Created: 12 déc. 2005
+*
+* @author Arnaud Thimel <thimel(a)codelutin.com>
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.codelutin.topia.generator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.generator.Generator;
+import org.codelutin.generator.ObjectModelGenerator;
+import org.codelutin.generator.Util;
+import org.codelutin.generator.models.object.ObjectModelAssociationClass;
+import org.codelutin.generator.models.object.ObjectModelAttribute;
+import org.codelutin.generator.models.object.ObjectModelClass;
+import static org.codelutin.topia.generator.GeneratorUtil.PERSISTENCE_TYPE_HIBERNATE;
+import static org.codelutin.topia.generator.GeneratorUtil.STEREOTYPE_ENTITY;
+import static org.codelutin.topia.generator.GeneratorUtil.TAG_ACCESS;
+import static org.codelutin.topia.generator.GeneratorUtil.hasUnidirectionalRelationOnAbstractType;
+import static org.codelutin.topia.generator.GeneratorUtil.notEmpty;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * FIXME mettre les attributs node="..." sur tous les attributs
+ * @author poussin
+ *
+ */
+public class EntityHibernateMappingGenerator extends ObjectModelGenerator {
+
+ /**
+ * Logger for this class
+ */
+ private static final Log log = LogFactory
+ .getLog(EntityHibernateMappingGenerator.class);
+
+ private Map<String, String[]> columnNamesMap = new HashMap<String, String[]>();
+
+ public EntityHibernateMappingGenerator() {
+ super();
+ }
+
+ public EntityHibernateMappingGenerator(Generator parent) {
+ super(parent);
+ }
+
+ @Override
+ public String getFilenameForClass(ObjectModelClass clazz) {
+ String DOName = GeneratorUtil.getDOType(clazz, model);
+ return DOName.replace('.', File.separatorChar) + ".hbm.xml";
+ }
+
+ @Override
+ public void generateFromClass(Writer output, ObjectModelClass clazz) throws IOException {
+ String persistenceType = GeneratorUtil.getPersistenceType(clazz);
+ if (!clazz.hasStereotype(STEREOTYPE_ENTITY) && PERSISTENCE_TYPE_HIBERNATE.equals(persistenceType)) {
+ return;
+ }
+/*{<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="<%=clazz.getPackageName()%>">
+}*/
+ boolean haveSuper = clazz.getSuperclasses().size() > 0;
+ List<ObjectModelAttribute> noneNaturalAttributes = new ArrayList<ObjectModelAttribute >();
+ if (haveSuper) {
+ ObjectModelClass superClass = clazz.getSuperclasses().iterator().next();
+ String superClassname = superClass.getQualifiedName();
+ if (log.isDebugEnabled()) {log.debug("superClass for " + clazz.getQualifiedName() + " is " + superClassname);}
+/*{ <union-subclass }*/
+/*{name="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
+/*{extends="<%=GeneratorUtil.getDOType(superClassname, model)%>" }*/
+/*{table="<%=GeneratorUtil.getDBName(clazz)%>" }*/
+ String schema = GeneratorUtil.getSchemaName(clazz, model);
+ if (schema != null) {
+/*{schema="<%=schema%>" }*/
+ }
+/*{node="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
+/*{abstract="<%=(clazz.isAbstract()?"true":"false")%>" }*/
+ //On précise au proxy de quelle interface hérite l'objet
+/*{proxy="<%=clazz.getQualifiedName()%>" }*/
+/*{>
+ <!--key column="topiaId"/-->
+}*/
+ } else {
+/*{ <class }*/
+/*{name="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
+/*{table="<%=GeneratorUtil.getDBName(clazz)%>" }*/
+ String schema = GeneratorUtil.getSchemaName(clazz, model);
+ if (schema != null) {
+/*{schema="<%=schema%>" }*/
+ }
+/*{node="<%=GeneratorUtil.getDOType(clazz, model)%>" }*/
+/*{abstract="<%=(clazz.isAbstract()?"true":"false")%>" }*/
+ //On précise au proxy de quelle interface hérite l'objet
+/*{proxy="<%=clazz.getQualifiedName()%>" }*/
+/*{>
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+}*/
+ List<String> attributes = GeneratorUtil.getNaturalId(clazz);
+ if (log.isDebugEnabled()) {
+ log.debug("natural-id for class "+clazz.getName()+" : "+attributes);
+ }
+
+ if (attributes.isEmpty()) {
+ // pas de clef metiers sur la classe
+ noneNaturalAttributes.addAll(clazz.getAttributes());
+ } else {
+ // une clef métier sur la classe a ete detectee
+ List<ObjectModelAttribute> naturalAttributes = new ArrayList<ObjectModelAttribute >(attributes.size());
+ for (ObjectModelAttribute attr : clazz.getAttributes()) {
+ if (attributes.contains(attr.getName())) {
+ naturalAttributes.add(attr);
+ } else {
+ noneNaturalAttributes.add(attr);
+ }
+ }
+/*{ <natural-id>
+}*/
+ generateAttributes(output, clazz, naturalAttributes," ");
+/*{ </natural-id>
+}*/
+ }
+
+/*{ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="date" node="@topiaCreateDate"/>
+}*/
+ }
+ generateAttributes(output, clazz, noneNaturalAttributes,"");
+
+ if (haveSuper) {
+/*{ </union-subclass>
+}*/
+ } else {
+/*{ </class>
+}*/
+ }
+/*{</hibernate-mapping>
+}*/
+ }
+
+ protected void generateAttributes(Writer output, ObjectModelClass clazz, List<ObjectModelAttribute> attributes,String prefix) throws IOException {
+ for (ObjectModelAttribute attr : attributes) {
+ ObjectModelAttribute reverse = attr.getReverseAttribute();
+
+ // pour les asso quoi qu'il arrive il faut les lier des 2 cotes
+ // pour pouvoir supprimer en cascade l'asso lors de la suppression
+ // d'un des cotes
+ if (attr.isNavigable()
+ || hasUnidirectionalRelationOnAbstractType(reverse, model)
+ || attr.hasAssociationClass()) {
+ if (!Util.isNMultiplicity(attr)) {
+ if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(STEREOTYPE_ENTITY)) {
+ if (Util.isNMultiplicity(attr.getReverseMaxMultiplicity()) && !attr.hasAssociationClass()) {
+ generateHibernateManyToOne(output, attr, prefix);
+ } else {
+ generateHibernateOneToOne(output, attr, prefix);
+ }
+ } else {
+ generateHibernateProperty(output, attr, prefix);
+ }
+ } else {
+ if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(STEREOTYPE_ENTITY)) {
+ if (Util.isNMultiplicity(attr.getReverseMaxMultiplicity()) && !attr.hasAssociationClass()) {
+ generateHibernateManyToMany(output, attr, prefix);
+ } else {
+ generateHibernateOneToMany(output, attr, prefix);
+ }
+ } else {
+ generateHibernateMany(output, attr, prefix);
+ }
+ }
+ }
+ }
+
+ //Attributs pour les classes d'association
+ if (clazz instanceof ObjectModelAssociationClass) {
+ ObjectModelAssociationClass assoc = (ObjectModelAssociationClass)clazz;
+ for (ObjectModelAttribute attr : assoc.getParticipantsAttributes()) {
+ if (attr != null) {
+
+// Note(poussin) pour moi quoi qu'il arrive sur la classe d'association il faut
+// un many-to-one, sinon on a des problemes.
+// if ((!attr.getReverseAttribute().isNavigable()) || !Util.isNMultiplicity(attr.getReverseAttribute())) {
+// / *{ <one-to-one name="<%=getName(attr, true)%>" class="<%=getType(attr, true)%>"<%=(GeneratorUtil.notEmpty(attr.getTagValue(GeneratorUtil.TAG_LENGTH))?(" length=\"" + attr.getTagValue(GeneratorUtil.TAG_LENGTH) + "\""):"")%><%=(attr.isComposite()?" cascade=\"delete\"":"")%>/>
+// } */
+// } else {
+ String notNull = attr.getTagValue(GeneratorUtil.TAG_NOT_NULL);
+ if (notNull!=null) {
+ notNull = "not-null=\""+notNull.trim()+"\"";
+ }
+/*{<%=prefix%> <many-to-one name="<%=getName(attr, true)%>" class="<%=getType(attr, true)%>" column="<%=GeneratorUtil.getDBName(attr)%>" node="<%=getName(attr, true)%>/@topiaId" embed-xml="false" <%=notNull%> />
+}*/
+// }
+ //Ne sert plus grâce à l'utilisation de la navigabilité
+// if (!attr.getReverseAttribute().isNavigable()) {
+// String type = GeneratorUtil.getDOType(((ObjectModelClassifier)attr.getDeclaringElement()).getQualifiedName(), model);
+// String name = Util.toLowerCaseFirstLetter(attr.getDeclaringElement().getName());
+// if (log.isTraceEnabled()) {log.trace("reverse: " + type + " " + name);}
+// if (!Util.isNMultiplicity(attr)) {
+//{<!-- <one-to-one name="<%=name%>" class="<%=type%>"/>
+//}
+// } else {
+//{ <many-to-one name="<%=name%>" class="<%=type%>" column="<%=name.toLowerCase()%>"/> -->
+//}
+// }
+// }
+ }
+ }
+ }
+
+ }
+ protected String getName(ObjectModelAttribute attr) {
+ return getName(attr, false);
+ }
+
+ protected String getName(ObjectModelAttribute attr, boolean isAssoc) {
+ String result = Util.toLowerCaseFirstLetter(attr.getName());
+ if (attr.hasAssociationClass() && !isAssoc) {
+ result = GeneratorUtil.getAssocAttrName(attr);
+ }
+ return result;
+ }
+
+ protected String getType(ObjectModelAttribute attr) {
+ return getType(attr, false);
+ }
+
+ protected String getType(ObjectModelAttribute attr, boolean isAssoc) {
+ String type = attr.getType();
+ if (GeneratorUtil.notEmpty(model.getTagValue(type))) {
+ String typeString = model.getTagValue(type);
+ int bracketIndex = typeString.indexOf('(');
+ if (bracketIndex != -1) {
+ type = typeString.substring(0, bracketIndex);
+ int bracketEndIndex = typeString.indexOf(')', bracketIndex + 1);
+ String colmunList;
+ if (bracketEndIndex != -1) {
+ colmunList = typeString.substring(bracketIndex + 1, bracketEndIndex);
+ } else {
+ colmunList = typeString.substring(bracketIndex);
+ }
+ columnNamesMap.put(type, colmunList.split(","));
+ } else {
+ type = typeString;
+ }
+ }
+ if (attr.hasAssociationClass() && !isAssoc) {
+ type = attr.getAssociationClass().getQualifiedName();
+ }
+ return GeneratorUtil.getDOType(type, model);
+ }
+
+ protected void generateHibernateProperty(Writer output, ObjectModelAttribute attr, String prefix) throws IOException {
+ String type = getType(attr);
+ if (type.trim().endsWith("[]")) {
+ type = type.trim().substring(0, type.trim().length()-2);
+/*{<%=prefix%> <primitive-array name="<%=getName(attr)%>" table="<%=GeneratorUtil.getDBName(attr.getDeclaringElement()) + "_" + getName(attr)%>" }*/
+ String accessField = attr.getTagValue(TAG_ACCESS);
+ if (notEmpty(accessField)) {
+/*{access="<%=accessField%>" }*/
+ } else {
+/*{access="field" }*/
+ }
+ String schema = GeneratorUtil.getSchemaName(attr, model);
+ if (schema != null) {
+/*{schema="<%=schema%>" }*/
+ }
+ if (attr.isIndexed()) {
+/*{index="<%=GeneratorUtil.getDBName(attr.getDeclaringElement()) + "_" + getName(attr)%>_idx" }*/
+ }
+/*{>
+<%=prefix%> <key column="<%=GeneratorUtil.getDBName(attr.getDeclaringElement())%>"/>
+<%=prefix%> <list-index column="<%=getName(attr)%>_idx"/>
+<%=prefix%> <element type="<%=type%>"/>
+<%=prefix%> </primitive-array>
+}*/
+ } else {
+/*{<%=prefix%> <property name="<%=getName(attr)%>" type="<%=type%>" }*/
+ String accessField = attr.getTagValue(TAG_ACCESS);
+ if (notEmpty(accessField)) {
+/*{access="<%=accessField%>" }*/
+ } else {
+/*{access="field" }*/
+ }
+ if (attr.isIndexed()) {
+/*{index="<%=GeneratorUtil.getDBName(attr.getDeclaringElement()) + "_" + getName(attr)%>_idx" }*/
+ }
+ String notNull = attr.getTagValue(GeneratorUtil.TAG_NOT_NULL);
+ if (notNull != null) {
+/*{ not-null="<%=notNull.trim()%>" }*/
+ }
+ String[] columnNames = this.columnNamesMap.get(type);
+ if (columnNames == null || columnNames.length == 0) {
+/*{column="<%=GeneratorUtil.getDBName(attr)%>"<%=(GeneratorUtil.notEmpty(attr.getTagValue(GeneratorUtil.TAG_LENGTH))?(" length=\"" + attr.getTagValue(GeneratorUtil.TAG_LENGTH) + "\""):"")%> node="<%=getName(attr)%>"/>
+}*/
+ } else {
+/*{>
+}*/
+ for (String columnName : columnNames) {
+ columnName = columnName.trim();
+/*{<%=prefix%> <column name="<%=getName(attr) + "_" + columnName%>"/>
+}*/
+ }
+/*{<%=prefix%> </property>
+}*/
+ }
+ }
+ }
+
+ protected void generateHibernateOneToOne(Writer output, ObjectModelAttribute attr, String prefix) throws IOException {
+ generateHibernateManyToOne(output, attr, true, prefix);
+// boolean accessField = hasUnidirectionalRelationOnAbstractType(attr.getReverseAttribute(), model);
+/// *{ <one-to-one name="<%=getName(attr)%>" class="<%=getType(attr)%>"<%=(GeneratorUtil.notEmpty(attr.getTagValue(GeneratorUtil.TAG_LENGTH))?(" length=\"" + attr.getTagValue(GeneratorUtil.TAG_LENGTH) + "\""):"")%><%=((attr.isComposite() || attr.hasAssociationClass())?" cascade=\"delete\"":"")%><%=((accessField)?" access=\"field\"":"")%> node="<%=getName(attr)%>/@topiaId" embed-xml="false"/>
+//} */
+ }
+
+ protected void generateHibernateOneToMany(Writer output, ObjectModelAttribute attr, String prefix) throws IOException {
+ boolean needsIndex = attr.isIndexed();
+ boolean isInverse = attr.getReverseAttribute().isNavigable();
+ isInverse |= hasUnidirectionalRelationOnAbstractType(attr, model);
+ String orderBy = attr.getTagValue(GeneratorUtil.TAG_ORDER_BY);
+ if (orderBy == null) {
+ orderBy = "";
+ } else {
+ orderBy = "order-by=\"" + orderBy + "\"";
+ }
+
+ String cascade = "";
+ if (attr.isComposite() || attr.hasAssociationClass()) {
+ cascade += "cascade=\"all,delete-orphan\"";
+ }
+
+ String lazy = "lazy=\"";
+ if (attr.getTagValue(GeneratorUtil.TAG_LAZY) != null){
+ lazy += attr.getTagValue(GeneratorUtil.TAG_LAZY);
+ }
+ else {
+ lazy += "true";
+ }
+ lazy += "\"";
+
+ String fetch = "";
+ if (attr.getTagValue(GeneratorUtil.TAG_FETCH) != null){
+ fetch = "fetch=\"" + attr.getTagValue(GeneratorUtil.TAG_FETCH) + "\"";
+ }
+
+ String collType = GeneratorUtil.getNMultiplicityHibernateType(attr);
+ if (!needsIndex) {
+/*{<%=prefix%> <<%=collType%> name="<%=getName(attr)%>" <%=orderBy%> <%=((!isInverse)?"":"inverse=\"true\"")%> <%=fetch%> <%=lazy%> <%=cascade%> node="<%=getName(attr)%>" embed-xml="true">
+<%=prefix%> <key column="<%=GeneratorUtil.getReverseDBName(attr)%>"/>
+<%=prefix%> <one-to-many class="<%=getType(attr)%>" node="topiaId" embed-xml="false"/>
+<%=prefix%> </<%=collType%>>
+}*/
+ }else {
+/*{<%=prefix%> <<%=collType%> name="<%=getName(attr)%>"<%=((!isInverse)?"":" inverse=\"true\"")%> <%=lazy%> <%=cascade%> node="<%=getName(attr)%>" embed-xml="false">
+<%=prefix%> <key column="<%=GeneratorUtil.getReverseDBName(attr)%>"/>
+<%=prefix%> <list-index column="<%=GeneratorUtil.getReverseDBName(attr)%>_idx"/>
+<%=prefix%> <one-to-many class="<%=getType(attr)%>" node="topiaId" embed-xml="false"/>
+<%=prefix%> </<%=collType%>>
+}*/
+ }
+ }
+
+ protected void generateHibernateMany(Writer output, ObjectModelAttribute attr, String prefix) throws IOException {
+ boolean needsIndex = attr.isIndexed();
+ String collType = GeneratorUtil.getNMultiplicityHibernateType(attr);
+ String lazy = "";
+ if (attr.getTagValue(GeneratorUtil.TAG_LAZY) != null) {
+ lazy = "lazy=\"" + attr.getTagValue(GeneratorUtil.TAG_LAZY) + "\"";
+ }
+
+/*{<%=prefix%> <<%=collType%> name="<%=getName(attr)%>" node="<%=getName(attr)%>" embed-xml="true" <%=lazy%>>
+<%=prefix%> <key column="OWNER"/>
+}*/
+ if (needsIndex) {
+/*{<%=prefix%> <list-index/>
+}*/
+ }
+/*{<%=prefix%> <element type="<%=getType(attr)%>" column="<%=GeneratorUtil.getDBName(attr)%>" node="id"/>
+<%=prefix%> </<%=collType%>>
+}*/
+ }
+
+ protected void generateHibernateManyToOne(Writer output, ObjectModelAttribute attr, String prefix) throws IOException {
+ generateHibernateManyToOne(output, attr, false, prefix);
+ }
+
+ protected void generateHibernateManyToOne(Writer output, ObjectModelAttribute attr, boolean isUnique, String prefix) throws IOException {
+/*{<%=prefix%> <many-to-one name="<%=getName(attr)%>" class="<%=getType(attr)%>" column="<%=GeneratorUtil.getDBName(attr)%>"}*/
+ if (attr.isComposite() || attr.hasAssociationClass()) {
+/*{ cascade="delete"}*/
+ }
+ // Pour le test suivant, on verifie d'abord que l'attribut a un reverse.
+ // S'il n'en a pas, cela signifie qu'il ne s'agit pas d'un entite
+ // (au sens stereotype entity), donc a donc pas besoin de faire un access=field.
+ if (attr.getReverseAttribute() != null && hasUnidirectionalRelationOnAbstractType(attr.getReverseAttribute(), model)) {
+/*{ access="field"}*/
+ }
+ if (isUnique) {
+/*{ unique="true"}*/
+ }
+/*{ node="<%=getName(attr)%>/@topiaId" embed-xml="false"}*/
+
+ // vérifier si le tag lazy est defini par defaut dans le fichier de proprietes
+ if (attr.getTagValue("lazy") != null){
+/*{ lazy="<%=attr.getTagValue("lazy")%>"}*/
+ }
+ String notNull = attr.getTagValue(GeneratorUtil.TAG_NOT_NULL);
+ if (notNull != null) {
+/*{ not-null="<%=notNull.trim()%>"}*/
+ }
+/*{/>
+}*/
+ }
+
+ protected void generateHibernateManyToMany(Writer output, ObjectModelAttribute attr, String prefix) throws IOException {
+ // On ne met le inverse="true" uniquement pour un seul coté de la relation.
+ // Dans le cas contraire, les modifications dans la relation ne seront
+ // pas sauvegardées. Ceci n'est vrai que si les deux coté sont navigable
+ boolean isInverse = attr.isNavigable() && attr.getReverseAttribute().isNavigable();
+ //isInverse |= !Util.isFirstAttribute(attr);
+ //isInverse = false; // 20070117 poussin: pour du many, jamais de inverse
+ isInverse &= Util.isFirstAttribute(attr);
+
+ boolean needsIndex = attr.isIndexed();
+ String cascade = "";
+ if (attr.isComposite() || attr.hasAssociationClass()) {
+ cascade += "cascade=\"delete,delete-orphan\"";
+ }
+ cascade += "";
+
+ String lazy = "lazy=\"";
+ if (attr.getTagValue("lazy") != null){
+ lazy += attr.getTagValue("lazy");
+ }
+ else {
+ lazy += "true";
+ }
+ lazy += "\"";
+ String collType = GeneratorUtil.getNMultiplicityHibernateType(attr);
+
+/*{<%=prefix%> <<%=collType%> name="<%=getName(attr)%>" table="<%=GeneratorUtil.getManyToManyTableName(attr)%>" <%=(isInverse?"inverse=\"true\" ":"")%> <%=lazy%> <%=cascade%> node="<%=getName(attr)%>" embed-xml="true">
+<%=prefix%> <key column="<%=GeneratorUtil.getReverseDBName(attr)%>"/>
+}*/
+ if (needsIndex) {
+/*{<%=prefix%> <list-index column="<%=GeneratorUtil.getReverseDBName(attr)%>_idx"/>
+}*/
+ }
+/*{<%=prefix%> <many-to-many class="<%=getType(attr)%>" column="<%=GeneratorUtil.getDBName(attr)%>" node="topiaId"/>
+<%=prefix%> </<%=collType%>>
+}*/
+ }
+
+} //EntityHibernateMappingGenerator
Deleted: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java
===================================================================
--- topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,601 +0,0 @@
-/* *##% ToPIA - Tools for Portable and Independent Architecture
- * Copyright (C) 2004 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
-
-/*******************************************************************************
- * GeneratorUtil.java
- *
- * Created: 13 déc. 2005
- *
- * @author Arnaud Thimel <thimel(a)codelutin.com>
- *
- * @version $Revision$
- *
- * Mise a jour: $Date$ par : $Author$
- */
-
-package org.codelutin.topia.generator;
-
-import org.apache.commons.lang.StringUtils;
-import org.codelutin.generator.Generator;
-import org.codelutin.generator.Util;
-import org.codelutin.generator.models.Model;
-import org.codelutin.generator.models.object.ObjectModel;
-import org.codelutin.generator.models.object.ObjectModelAttribute;
-import org.codelutin.generator.models.object.ObjectModelClass;
-import org.codelutin.generator.models.object.ObjectModelElement;
-import org.codelutin.generator.models.object.ObjectModelInterface;
-import org.codelutin.generator.models.object.ObjectModelOperation;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-/** Classe regroupant divers méthodes utiles pour la génération des entités */
-public class GeneratorUtil extends Util {
-
- /** Stéréotype pour les interfaces devant être générées sous forme de facades */
- public final static String STEREOTYPE_FACADE = "facade";
-
- /** Stéréotype pour les objets devant être générées sous forme d'entités */
- public static final String STEREOTYPE_ENTITY = "entity";
-
- /** Stéréotype pour les objets devant être générées sous forme de DTO */
- public static final String STEREOTYPE_DTO = "dto";
-
- /**
- * Stéréotype pour les interfaces devant être générées sous forme de
- * services
- */
- public static final String STEREOTYPE_SERVICE = "service";
-
- /** Stéréotype pour les interfaces devant être générées sous forme de DAO */
- public static final String STEREOTYPE_DAO = "dao";
-
- /** Stéréotype pour les attributs à indexer en base */
- public static final String STEREOTYPE_INDEXED = "indexed";
-
- /** Stéréotype pour les collections avec unicité */
- public static final String STEREOTYPE_UNIQUE = "unique";
-
- /** Stéréotype pour les attributs étant des clés primaires */
- public static final String STEREOTYPE_PRIMARYKAY = "primaryKey";
-
- /** Tag pour le type de persistence */
- public static final String TAG_PERSISTENCE_TYPE = "persistenceType";
-
- /** Tag pour le nom du champ / entité en BD */
- public static final String TAG_DB_NAME = "dbName";
-
- /** Tag pour le nom du schema en BD */
- public static final String TAG_SCHEMA_NAME = "dbSchema";
-
- /** Tag pour la taille du champ en BD */
- public static final String TAG_LENGTH = "length";
-
- /** Tag pour ajouter une annotation à un champ */
- public static final String TAG_ANNOTATION = "annotation";
-
- /** Tag pour ajouter specifier le copyright d'un fichier */
- public static final String TAG_COPYRIGHT = "copyright";
-
- /** Tag pour specfier le type d'acces a un champ */
- public static final String TAG_ACCESS = "access";
-
- /** Tag pour specfier si on doit générer i18n */
- public static final String TAG_I18N_PREFIX = "i18n";
-
- /** Type de persistence Hibernate */
- public static final String PERSISTENCE_TYPE_HIBERNATE = "hibernate";
-
- /** Type de persistence LDAP */
- public static final String PERSISTENCE_TYPE_LDAP = "ldap";
-
- /** Type de persistence par défaut (si aucun précisé) */
- public static final String PERSISTENCE_TYPE_DEFAULT = PERSISTENCE_TYPE_HIBERNATE;
-
- /** Propriété des générateurs indiquant le package par défaut */
- public static final String PROPERTY_DEFAULT_PACKAGE = "defaultPackage";
-
- /** Le package par défaut si aucun n'est spécifié */
- public static final String DEFAULT_PACKAGE = "org.codelutin.malo";
-
- /**
- * Renvoie le package par défaut pour le générateur donné
- *
- * @param generator le générateur donné
- * @return le package par défaut du générator donné
- */
- public static String getDefaultPackage(Generator generator) {
- String packageName = generator.getProperty(PROPERTY_DEFAULT_PACKAGE);
- if (packageName == null || "".equals(packageName)) {
- packageName = DEFAULT_PACKAGE;
- }
- return packageName;
- }
-
- /**
- * Indique si l'élément spécifié dispose de documentation
- *
- * @param element l'élément à tester
- * @return true s'il y a documentation, false sinon
- */
- public static boolean hasDocumentation(ObjectModelElement element) {
- return notEmpty(element.getDocumentation());
- }
-
- /**
- * Indique si la chaine de caratère n'est pas vide (null ou "")
- *
- * @param s la chaine de caractères à tester
- * @return true si <code>s</code> n'est pas vide
- */
- public static boolean notEmpty(String s) {
- return (s != null && !"".equals(s));
- }
-
- /**
- * Renvoie l'interface DAO associée à la classe passée en paramètre
- *
- * @param clazz la classe à tester
- * @param model le modele utilisé
- * @return l'interface trouvée ou null sinon
- */
- public static ObjectModelInterface getDAOInterface(ObjectModelClass clazz,
- ObjectModel model) {
- for (Object o : model.getInterfaces()) {
- ObjectModelInterface daoInterface = (ObjectModelInterface) o;
- if (daoInterface.getName().equals(clazz.getName() + "DAO")) {
- if (daoInterface.hasStereotype(STEREOTYPE_DAO)) {
- return daoInterface;
- }
- }
- }
- return null;
- }
-
- /**
- * Renvoie le type de persistence pour l'élément donné. Si aucun n'est
- * trouvé, le type par défaut est utilisé
- *
- * @param element l'élément à tester
- * @return le type de persitence pour l'élément donné.
- */
- public static String getPersistenceType(ObjectModelElement element) {
- String tag = element.getTagValue(TAG_PERSISTENCE_TYPE);
- if (tag == null) {
- tag = PERSISTENCE_TYPE_DEFAULT;
- }
- return tag;
- }
-
- public static String getReverseDBName(ObjectModelAttribute attr) {
- if (attr.getReverseAttribute() != null) {
- return getDBName(attr.getReverseAttribute());
- } else {
- return getDBName(attr) + "_id";
- }
- }
-
- /**
- * Renvoie le nom BD de l'élement passé en paramètre. Elle se base sur le
- * tag associé si il existe, sinon sur le nom de l'élément
- *
- * @param element l'élément à tester
- * @return le nom de table
- */
- public static String getDBName(ObjectModelElement element) {
- if (element == null) {
- return null;
- }
- if (notEmpty(element.getTagValue(TAG_DB_NAME))) {
- return element.getTagValue(TAG_DB_NAME);
- }
- return toLowerCaseFirstLetter(element.getName());
- }
-
- /**
- * Cherche et renvoie le schema a utiliser sur cet element, sinon sur le model.
- *
- * @param element l'élément à tester
- * @param model le modele utilisé
- * @return le nom du schema ou null
- */
- public static String getSchemaName(ObjectModelElement element,
- ObjectModel model) {
- return findTagValue(TAG_SCHEMA_NAME, element, model);
- }
-
- /**
- * Cherche et renvoie le prefixe i18n à utiliser sur cet element, sinon sur le model.
- *
- * @param element l'élément à tester
- * @param model le modele utilisé
- * @return le prefix i18n ou <code>null</code> si non spécifié
- */
- public static String getI18nPrefix(ObjectModelElement element,
- ObjectModel model) {
- return findTagValue(TAG_I18N_PREFIX, element, model);
- }
-
- /**
- * Cherches et renvoie le copyright a utiliser sur le model.
- *
- * @param model le modele utilisé
- * @return le texte du copyright ou null
- */
- public static String getCopyright(Model model) {
- return findTagValue(TAG_COPYRIGHT, null, model);
- }
-
- /**
- * Cherches et renvoie la valeur du tagvalue indique sur cet element,
- * sinon sur le model.
- *
- * @param tagName le nom du tag
- * @param element l'élément à tester
- * @param model le modele utilisé
- * @return la valeur du tagValue ou null
- */
- public static String findTagValue(String tagName,
- ObjectModelElement element, Model model) {
- if (element == null) {
- if (model != null) {
- if (notEmpty(model.getTagValue(tagName))) {
- return model.getTagValue(tagName);
- }
- }
- return null;
- }
- if (notEmpty(element.getTagValue(tagName))) {
- return element.getTagValue(tagName);
- }
- //On va chercher sur l'element declarant
- return findTagValue(tagName, element.getDeclaringElement(), model);
- }
-
- public static <Type extends ObjectModelElement> Collection<Type> getElementsWithStereotype(
- Collection<Type> elements, String... stereotypes) {
- Collection<Type> result = new ArrayList<Type>();
- for (Type element : elements) {
- if (hasStereotypes(element, stereotypes)) {
- result.add(element);
- }
- }
- return result;
- }
-
- public static boolean hasStereotypes(ObjectModelElement element,
- String... stereotypes) {
- for (String stereotype : stereotypes) {
- if (!element.hasStereotype(stereotype)) {
- return false;
- }
- }
- return true;
- }
-
- public static String getPrimaryKeyAttributesListDeclaration(
- ObjectModelClass clazz, boolean includeName) {
- String attributes = "";
- for (ObjectModelAttribute attr : getElementsWithStereotype(clazz
- .getAttributes(), STEREOTYPE_PRIMARYKAY)) {
- attributes += attr.getType();
- if (includeName) {
- attributes += " " + attr.getName();
- }
- attributes += ", ";
- }
- if (attributes.length() > 0) {
- attributes = attributes.substring(0, attributes.length() - 2);
- }
- return attributes;
- }
-
- public static String capitalize(String s) {
- return StringUtils.capitalize(s);
- }
-
- public static boolean isAssociationClassDoublon(ObjectModelAttribute attr) {
- return (attr.getReverseAttribute() != null)
- && (attr.getDeclaringElement().equals(attr
- .getReverseAttribute().getDeclaringElement()))
- && (!Util.isFirstAttribute(attr));
- }
-
- /**
- * Renvoie le nom de l'attribut de classe d'association en fonction des cas:
- * Si l'attribut porte le même nom que le type (extrémité inverse de
- * l'association), on lui ajoute le nom de la classe d'association
- *
- * @param attr l'attribut a traiter
- * @return le nom de l'attribut de classe d'association
- */
- public static String getAssocAttrName(ObjectModelAttribute attr) {
- String typeName = attr.getType().substring(
- attr.getType().lastIndexOf(".") + 1);
- String result = attr.getName();
- if (attr.getName().equalsIgnoreCase(typeName)) {
- result += GeneratorUtil.capitalize(attr.getAssociationClass()
- .getName());
- }
- return result;
- }
-
- public static String getDOType(ObjectModelElement elem, ObjectModel model) {
- String type = elem.getName();
- if (elem instanceof ObjectModelAttribute) {
- type = ((ObjectModelAttribute) elem).getType();
- }
- if (elem instanceof ObjectModelClass) {
- type = ((ObjectModelClass) elem).getQualifiedName();
- }
- return getDOType(type, model);
- }
-
- public static String getDOType(String type, ObjectModel model) {
- if (!model.hasClass(type)) {
- return type;
- }
- ObjectModelClass clazz = model.getClass(type);
- if (clazz.hasStereotype(STEREOTYPE_ENTITY)) {
- if (shouldBeAbstract(clazz)) {
- type += "Abstract";
- } else {
- type += "Impl";
- }
- }
- return type;
- }
-
- private static Set<String> numberTypes = new HashSet<String>();
-
- static {
- numberTypes.add("byte");
- numberTypes.add("java.lang.Byte");
- numberTypes.add("short");
- numberTypes.add("java.lang.Short");
- numberTypes.add("int");
- numberTypes.add("java.lang.Integer");
- numberTypes.add("long");
- numberTypes.add("java.lang.Long");
- numberTypes.add("float");
- numberTypes.add("java.lang.Float");
- numberTypes.add("double");
- numberTypes.add("java.lang.Double");
- }
-
- public static boolean isNumericType(ObjectModelAttribute attr) {
- return numberTypes.contains(attr.getType());
- }
-
- private static Set<String> textTypes = new HashSet<String>();
-
- static {
- textTypes.add("char");
- textTypes.add("java.lang.Char");
- textTypes.add("java.lang.String");
- }
-
- public static boolean isTextType(ObjectModelAttribute attr) {
- return textTypes.contains(attr.getType());
- }
-
- public static boolean isDateType(ObjectModelAttribute attr) {
- return "java.util.Date".equals(attr.getType());
- }
-
- public static boolean isBooleanType(ObjectModelAttribute attr) {
- return ("boolean".equals(attr.getType()) || "java.lang.Boolean"
- .equals(attr.getType()));
- }
-
- /**
- * Indique si la classe specifiee n'a aucune ou que des methodes abstraites
- *
- * @param clazz l'instance de ObjectModelClass
- * @return true si la classe n'a que des operations abstraite ou aucune
- * operation
- */
- public static boolean hasNothingOrAbstractMethods(ObjectModelClass clazz) {
- boolean result = true;
- Iterator operations = clazz.getOperations().iterator();
- while (result && operations.hasNext()) {
- ObjectModelOperation op = (ObjectModelOperation) operations.next();
- result = op.isAbstract();
- }
- return result;
- }
-
- /**
- * Indique si la classe specifiee devrait etre abstraite
- *
- * @param clazz l'instance de ObjectModelClass
- * @return true dans ce cas, false sinon
- */
- public static boolean shouldBeAbstract(ObjectModelClass clazz) {
- return clazz != null
- && (clazz.isAbstract() && hasNothingOrAbstractMethods(clazz));
- }
-
- /**
- * <p>
- * Cette méthode permet de détecter si
- * - l'attribut représente une relation 1-n
- * - cette relation est unidirectionnelle
- * - le type de l'attribut représente un entité
- * - cette entité a des sous-classes dans le modèle
- * <p/>
- * Ce cas correspond à une incompatibilité d'Hibernate qui nous oblige a
- * adopter un comportement particulier.
- * </p>
- *
- * @param attr l'attribut a tester
- * @param model le model
- * @return true si et seulement si il s'agit bien de ce type de relation
- */
- public static boolean hasUnidirectionalRelationOnAbstractType(
- ObjectModelAttribute attr, ObjectModel model) {
- ObjectModelAttribute reverse = attr.getReverseAttribute();
- //relation 1-n
- if (reverse != null && isNMultiplicity(attr)
- && !isNMultiplicity(reverse)) {
- //Pas de navigabilité
- if (!reverse.isNavigable()) {
- //Il s'agit d'une entity
- ObjectModelClass clazz = model.getClass(attr.getType());
- if (clazz != null && clazz.hasStereotype(STEREOTYPE_ENTITY)) {
- //Cette classe a des sous-classes dans le modèle
- for (ObjectModelClass subClass : model.getClasses()) {
- if (subClass.getSuperclasses().contains(clazz)) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Renvoie le nom unique de table pour une relation ManyToMany en fonction
- * de l'attribut <code>attr</code>
- * <p/>
- * Plusieurs cas de figure:
- * <li>
- *
- * @param attr l'attribut servant de base au calcul du nom
- * @return le nom de la table
- */
- public static String getManyToManyTableName(ObjectModelAttribute attr) {
- String result;
-
- if (attr.hasAssociationClass()) {
- result = GeneratorUtil.getDBName(attr.getAssociationClass());
- } else {
- String name = attr.getName();
- String revers = attr.getReverseAttributeName();
-
- if (name.compareToIgnoreCase(revers) < 0) {
- result = name + "_" + revers;
- } else {
- result = revers + "_" + name;
- }
- }
- // String result;
- // if (!Util.isFirstAttribute(attr)) {
- // result = attr.getDeclaringElement().getName() + "_" + attr.getReverseAttribute().getDeclaringElement().getName();
- // } else {
- // result = attr.getReverseAttribute().getDeclaringElement().getName() + "_" + attr.getDeclaringElement().getName();
- // }
- return result.toLowerCase();
- }
-
- /**
- * Renvoie le type d'interface à utiliser en fonction de l'attribut
- *
- * @param attr l'attribut a traiter
- * @return String
- */
- public static String getNMultiplicityInterfaceType(ObjectModelAttribute attr) {
- if (attr.hasStereotype(STEREOTYPE_UNIQUE)) {
- return Set.class.getName();
- } else if (attr.isIndexed() || attr.isOrdered()) {
- return List.class.getName();
- }
- return Collection.class.getName();
- }
-
- /**
- * Renvoie le type d'objet (instance) à utiliser en fonction de l'attribut
- *
- * @param attr l'attribut a traiter
- * @return String
- */
- public static String getNMultiplicityObjectType(ObjectModelAttribute attr) {
- if (attr.hasStereotype(STEREOTYPE_UNIQUE)) {
- return HashSet.class.getName();
- } else if (attr.isIndexed() || attr.isOrdered()) {
- //On considère qu'on ne sait pas traiter vraiment l'attribut "ordered"
- // puisqu'on va conserver l'ordre d'insertion, et non un ordre en
- // fonction d'un élément donné. Donc on renvoi une ArrayList
- return ArrayList.class.getName();
- }
- LinkedList.class.getName();
- return ArrayList.class.getName();
- }
-
- /**
- * Renvoie le type d'interface à utiliser en fonction de l'attribut
- *
- * @param attr l'attribut a traiter
- * @return String
- */
- public static String getNMultiplicityHibernateType(ObjectModelAttribute attr) {
- if (attr.hasStereotype(STEREOTYPE_UNIQUE)) {
- return "set";
- } else if (attr.isIndexed()) {
- return "list";
- }
- //attr.isOrdered() - On génère le ordered en bag
- return "bag";
- }
-
- /**
- * Obtain the list of entities classes with the possibility to sort the result.
- *
- * @param model the current model to scan
- * @param sort flag to allow sort the result
- * @return the list of filtred classes by their stereotype
- */
- public static List<ObjectModelClass> getEntityClasses(ObjectModel model,
- boolean sort) {
- return getClassesByStereotype(STEREOTYPE_ENTITY, model, sort);
- }
-
- /**
- * Obtain the list of classes for a given stereotype with the possibility to sort the result.
- *
- * @param stereotype filter stereotype
- * @param model the current model to scan
- * @param sort flag to allow sort the result
- * @return the list of filtred classes by their stereotype
- */
- public static List<ObjectModelClass> getClassesByStereotype(
- String stereotype, ObjectModel model, boolean sort) {
- List<ObjectModelClass> classes = new ArrayList<ObjectModelClass>();
- for (ObjectModelClass clazz : model.getClasses()) {
- if (clazz.hasStereotype(stereotype)) {
- classes.add(clazz);
- }
- }
- if (sort && !classes.isEmpty()) {
- java.util.Collections.sort(classes,
- new java.util.Comparator<ObjectModelClass>() {
- public int compare(ObjectModelClass o1,
- ObjectModelClass o2) {
- return o1.getQualifiedName().compareTo(
- o2.getQualifiedName());
- }
- });
- }
- return classes;
- }
-} // GeneratorUtil
Copied: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java (from rev 1285, topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java)
===================================================================
--- topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java (rev 0)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/generator/GeneratorUtil.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,635 @@
+/* *##% ToPIA - Tools for Portable and Independent Architecture
+ * Copyright (C) 2004 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/
+
+/*******************************************************************************
+ * GeneratorUtil.java
+ *
+ * Created: 13 déc. 2005
+ *
+ * @author Arnaud Thimel <thimel(a)codelutin.com>
+ *
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$ par : $Author$
+ */
+
+package org.codelutin.topia.generator;
+
+import org.apache.commons.lang.StringUtils;
+import org.codelutin.generator.Generator;
+import org.codelutin.generator.Util;
+import org.codelutin.generator.models.Model;
+import org.codelutin.generator.models.object.ObjectModel;
+import org.codelutin.generator.models.object.ObjectModelAttribute;
+import org.codelutin.generator.models.object.ObjectModelClass;
+import org.codelutin.generator.models.object.ObjectModelElement;
+import org.codelutin.generator.models.object.ObjectModelInterface;
+import org.codelutin.generator.models.object.ObjectModelOperation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+/** Classe regroupant divers méthodes utiles pour la génération des entités */
+public class GeneratorUtil extends Util {
+
+ /** Stéréotype pour les interfaces devant être générées sous forme de facades */
+ public final static String STEREOTYPE_FACADE = "facade";
+
+ /** Stéréotype pour les objets devant être générées sous forme d'entités */
+ public static final String STEREOTYPE_ENTITY = "entity";
+
+ /** Stéréotype pour les objets devant être générées sous forme de DTO */
+ public static final String STEREOTYPE_DTO = "dto";
+
+ /**
+ * Stéréotype pour les interfaces devant être générées sous forme de
+ * services
+ */
+ public static final String STEREOTYPE_SERVICE = "service";
+
+ /** Stéréotype pour les interfaces devant être générées sous forme de DAO */
+ public static final String STEREOTYPE_DAO = "dao";
+
+ /** Stéréotype pour les attributs à indexer en base */
+ public static final String STEREOTYPE_INDEXED = "indexed";
+
+ /** Stéréotype pour les collections avec unicité */
+ public static final String STEREOTYPE_UNIQUE = "unique";
+
+ /** Stéréotype pour les attributs étant des clés primaires */
+ public static final String STEREOTYPE_PRIMARYKAY = "primaryKey";
+
+ /** Tag pour le type de persistence */
+ public static final String TAG_PERSISTENCE_TYPE = "persistenceType";
+
+ /** Tag pour le nom du champ / entité en BD */
+ public static final String TAG_DB_NAME = "dbName";
+
+ /** Tag pour le nom du schema en BD */
+ public static final String TAG_SCHEMA_NAME = "dbSchema";
+
+ /** Tag pour la taille du champ en BD */
+ public static final String TAG_LENGTH = "length";
+
+ /** Tag pour ajouter une annotation à un champ */
+ public static final String TAG_ANNOTATION = "annotation";
+
+ /** Tag pour ajouter specifier le copyright d'un fichier */
+ public static final String TAG_COPYRIGHT = "copyright";
+
+ /** Tag pour specfier le type d'acces a un champ */
+ public static final String TAG_ACCESS = "access";
+
+ /** Tag pour specfier si on doit générer i18n */
+ public static final String TAG_I18N_PREFIX = "i18n";
+
+ /** Tag pour ajouter un attribut dans une clef métier */
+ public static final String TAG_NATURAL_ID = "naturalId";
+
+ /** Tag pour spécifier la caractèrelazy d'une association multiple */
+ public static final String TAG_LAZY = "lazy";
+
+ /** Tag pour spécifier la caractère fetch d'une association multiple */
+ public static final String TAG_FETCH = "fetch";
+
+ /** Tag pour spécifier la caractère order-by d'une association multiple */
+ public static final String TAG_ORDER_BY = "orderBy";
+
+ /** Tag pour spécifier la caractère not-null d'un attribut */
+ public static final String TAG_NOT_NULL = "notNull";
+
+ /** Type de persistence Hibernate */
+ public static final String PERSISTENCE_TYPE_HIBERNATE = "hibernate";
+
+ /** Type de persistence LDAP */
+ public static final String PERSISTENCE_TYPE_LDAP = "ldap";
+
+ /** Type de persistence par défaut (si aucun précisé) */
+ public static final String PERSISTENCE_TYPE_DEFAULT = PERSISTENCE_TYPE_HIBERNATE;
+
+ /** Propriété des générateurs indiquant le package par défaut */
+ public static final String PROPERTY_DEFAULT_PACKAGE = "defaultPackage";
+
+ /** Le package par défaut si aucun n'est spécifié */
+ public static final String DEFAULT_PACKAGE = "org.codelutin.malo";
+
+ /**
+ * Renvoie le package par défaut pour le générateur donné
+ *
+ * @param generator le générateur donné
+ * @return le package par défaut du générator donné
+ */
+ public static String getDefaultPackage(Generator generator) {
+ String packageName = generator.getProperty(PROPERTY_DEFAULT_PACKAGE);
+ if (packageName == null || "".equals(packageName)) {
+ packageName = DEFAULT_PACKAGE;
+ }
+ return packageName;
+ }
+
+ /**
+ * Indique si l'élément spécifié dispose de documentation
+ *
+ * @param element l'élément à tester
+ * @return true s'il y a documentation, false sinon
+ */
+ public static boolean hasDocumentation(ObjectModelElement element) {
+ return notEmpty(element.getDocumentation());
+ }
+
+ /**
+ * Indique si la chaine de caratère n'est pas vide (null ou "")
+ *
+ * @param s la chaine de caractères à tester
+ * @return true si <code>s</code> n'est pas vide
+ */
+ public static boolean notEmpty(String s) {
+ return (s != null && !"".equals(s));
+ }
+
+ /**
+ * Renvoie l'interface DAO associée à la classe passée en paramètre
+ *
+ * @param clazz la classe à tester
+ * @param model le modele utilisé
+ * @return l'interface trouvée ou null sinon
+ */
+ public static ObjectModelInterface getDAOInterface(ObjectModelClass clazz,
+ ObjectModel model) {
+ for (Object o : model.getInterfaces()) {
+ ObjectModelInterface daoInterface = (ObjectModelInterface) o;
+ if (daoInterface.getName().equals(clazz.getName() + "DAO")) {
+ if (daoInterface.hasStereotype(STEREOTYPE_DAO)) {
+ return daoInterface;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Renvoie le type de persistence pour l'élément donné. Si aucun n'est
+ * trouvé, le type par défaut est utilisé
+ *
+ * @param element l'élément à tester
+ * @return le type de persitence pour l'élément donné.
+ */
+ public static String getPersistenceType(ObjectModelElement element) {
+ String tag = element.getTagValue(TAG_PERSISTENCE_TYPE);
+ if (tag == null) {
+ tag = PERSISTENCE_TYPE_DEFAULT;
+ }
+ return tag;
+ }
+
+ public static String getReverseDBName(ObjectModelAttribute attr) {
+ if (attr.getReverseAttribute() != null) {
+ return getDBName(attr.getReverseAttribute());
+ } else {
+ return getDBName(attr) + "_id";
+ }
+ }
+
+ /**
+ * Renvoie le nom BD de l'élement passé en paramètre. Elle se base sur le
+ * tag associé si il existe, sinon sur le nom de l'élément
+ *
+ * @param element l'élément à tester
+ * @return le nom de table
+ */
+ public static String getDBName(ObjectModelElement element) {
+ if (element == null) {
+ return null;
+ }
+ if (notEmpty(element.getTagValue(TAG_DB_NAME))) {
+ return element.getTagValue(TAG_DB_NAME);
+ }
+ return toLowerCaseFirstLetter(element.getName());
+ }
+
+ /**
+ * Cherche et renvoie le schema a utiliser sur cet element, sinon sur le model.
+ *
+ * @param element l'élément à tester
+ * @param model le modele utilisé
+ * @return le nom du schema ou null
+ */
+ public static String getSchemaName(ObjectModelElement element,
+ ObjectModel model) {
+ return findTagValue(TAG_SCHEMA_NAME, element, model);
+ }
+
+ /**
+ * Cherche et renvoie le prefixe i18n à utiliser sur cet element, sinon sur le model.
+ *
+ * @param element l'élément à tester
+ * @param model le modele utilisé
+ * @return le prefix i18n ou <code>null</code> si non spécifié
+ */
+ public static String getI18nPrefix(ObjectModelElement element,
+ ObjectModel model) {
+ return findTagValue(TAG_I18N_PREFIX, element, model);
+ }
+
+ /**
+ * Cherche et renvoie la liste des attributs constituant la clef metier d'une classe.
+ *
+ * @param clazz la classe à tester
+ * @return la liste des attributs de la clef métier ou null si pas de clef métier.
+ */
+ public static List<String> getNaturalId(ObjectModelClass clazz) {
+
+ String value = clazz.getTagValue(TAG_NATURAL_ID);
+ if (value == null || value.trim().isEmpty()) {
+ return java.util.Collections.emptyList();
+ }
+ List<String> result = new ArrayList<String>();
+ for (String attribute : value.split(",")) {
+ result.add(attribute.trim());
+ }
+ return result;
+ }
+
+ /**
+ * Cherches et renvoie le copyright a utiliser sur le model.
+ *
+ * @param model le modele utilisé
+ * @return le texte du copyright ou null
+ */
+ public static String getCopyright(Model model) {
+ return findTagValue(TAG_COPYRIGHT, null, model);
+ }
+
+ /**
+ * Cherches et renvoie la valeur du tagvalue indique sur cet element,
+ * sinon sur le model.
+ *
+ * @param tagName le nom du tag
+ * @param element l'élément à tester
+ * @param model le modele utilisé
+ * @return la valeur du tagValue ou null
+ */
+ public static String findTagValue(String tagName,
+ ObjectModelElement element, Model model) {
+ if (element == null) {
+ if (model != null) {
+ if (notEmpty(model.getTagValue(tagName))) {
+ return model.getTagValue(tagName);
+ }
+ }
+ return null;
+ }
+ if (notEmpty(element.getTagValue(tagName))) {
+ return element.getTagValue(tagName);
+ }
+ //On va chercher sur l'element declarant
+ return findTagValue(tagName, element.getDeclaringElement(), model);
+ }
+
+ public static <Type extends ObjectModelElement> Collection<Type> getElementsWithStereotype(
+ Collection<Type> elements, String... stereotypes) {
+ Collection<Type> result = new ArrayList<Type>();
+ for (Type element : elements) {
+ if (hasStereotypes(element, stereotypes)) {
+ result.add(element);
+ }
+ }
+ return result;
+ }
+
+ public static boolean hasStereotypes(ObjectModelElement element,
+ String... stereotypes) {
+ for (String stereotype : stereotypes) {
+ if (!element.hasStereotype(stereotype)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static String getPrimaryKeyAttributesListDeclaration(
+ ObjectModelClass clazz, boolean includeName) {
+ String attributes = "";
+ for (ObjectModelAttribute attr : getElementsWithStereotype(clazz
+ .getAttributes(), STEREOTYPE_PRIMARYKAY)) {
+ attributes += attr.getType();
+ if (includeName) {
+ attributes += " " + attr.getName();
+ }
+ attributes += ", ";
+ }
+ if (attributes.length() > 0) {
+ attributes = attributes.substring(0, attributes.length() - 2);
+ }
+ return attributes;
+ }
+
+ public static String capitalize(String s) {
+ return StringUtils.capitalize(s);
+ }
+
+ public static boolean isAssociationClassDoublon(ObjectModelAttribute attr) {
+ return (attr.getReverseAttribute() != null)
+ && (attr.getDeclaringElement().equals(attr
+ .getReverseAttribute().getDeclaringElement()))
+ && (!Util.isFirstAttribute(attr));
+ }
+
+ /**
+ * Renvoie le nom de l'attribut de classe d'association en fonction des cas:
+ * Si l'attribut porte le même nom que le type (extrémité inverse de
+ * l'association), on lui ajoute le nom de la classe d'association
+ *
+ * @param attr l'attribut a traiter
+ * @return le nom de l'attribut de classe d'association
+ */
+ public static String getAssocAttrName(ObjectModelAttribute attr) {
+ String typeName = attr.getType().substring(
+ attr.getType().lastIndexOf(".") + 1);
+ String result = attr.getName();
+ if (attr.getName().equalsIgnoreCase(typeName)) {
+ result += GeneratorUtil.capitalize(attr.getAssociationClass()
+ .getName());
+ }
+ return result;
+ }
+
+ public static String getDOType(ObjectModelElement elem, ObjectModel model) {
+ String type = elem.getName();
+ if (elem instanceof ObjectModelAttribute) {
+ type = ((ObjectModelAttribute) elem).getType();
+ }
+ if (elem instanceof ObjectModelClass) {
+ type = ((ObjectModelClass) elem).getQualifiedName();
+ }
+ return getDOType(type, model);
+ }
+
+ public static String getDOType(String type, ObjectModel model) {
+ if (!model.hasClass(type)) {
+ return type;
+ }
+ ObjectModelClass clazz = model.getClass(type);
+ if (clazz.hasStereotype(STEREOTYPE_ENTITY)) {
+ if (shouldBeAbstract(clazz)) {
+ type += "Abstract";
+ } else {
+ type += "Impl";
+ }
+ }
+ return type;
+ }
+
+ private static Set<String> numberTypes = new HashSet<String>();
+
+ static {
+ numberTypes.add("byte");
+ numberTypes.add("java.lang.Byte");
+ numberTypes.add("short");
+ numberTypes.add("java.lang.Short");
+ numberTypes.add("int");
+ numberTypes.add("java.lang.Integer");
+ numberTypes.add("long");
+ numberTypes.add("java.lang.Long");
+ numberTypes.add("float");
+ numberTypes.add("java.lang.Float");
+ numberTypes.add("double");
+ numberTypes.add("java.lang.Double");
+ }
+
+ public static boolean isNumericType(ObjectModelAttribute attr) {
+ return numberTypes.contains(attr.getType());
+ }
+
+ private static Set<String> textTypes = new HashSet<String>();
+
+ static {
+ textTypes.add("char");
+ textTypes.add("java.lang.Char");
+ textTypes.add("java.lang.String");
+ }
+
+ public static boolean isTextType(ObjectModelAttribute attr) {
+ return textTypes.contains(attr.getType());
+ }
+
+ public static boolean isDateType(ObjectModelAttribute attr) {
+ return "java.util.Date".equals(attr.getType());
+ }
+
+ public static boolean isBooleanType(ObjectModelAttribute attr) {
+ return ("boolean".equals(attr.getType()) || "java.lang.Boolean"
+ .equals(attr.getType()));
+ }
+
+ /**
+ * Indique si la classe specifiee n'a aucune ou que des methodes abstraites
+ *
+ * @param clazz l'instance de ObjectModelClass
+ * @return true si la classe n'a que des operations abstraite ou aucune
+ * operation
+ */
+ public static boolean hasNothingOrAbstractMethods(ObjectModelClass clazz) {
+ boolean result = true;
+ Iterator operations = clazz.getOperations().iterator();
+ while (result && operations.hasNext()) {
+ ObjectModelOperation op = (ObjectModelOperation) operations.next();
+ result = op.isAbstract();
+ }
+ return result;
+ }
+
+ /**
+ * Indique si la classe specifiee devrait etre abstraite
+ *
+ * @param clazz l'instance de ObjectModelClass
+ * @return true dans ce cas, false sinon
+ */
+ public static boolean shouldBeAbstract(ObjectModelClass clazz) {
+ return clazz != null
+ && (clazz.isAbstract() && hasNothingOrAbstractMethods(clazz));
+ }
+
+ /**
+ * <p>
+ * Cette méthode permet de détecter si
+ * - l'attribut représente une relation 1-n
+ * - cette relation est unidirectionnelle
+ * - le type de l'attribut représente un entité
+ * - cette entité a des sous-classes dans le modèle
+ * <p/>
+ * Ce cas correspond à une incompatibilité d'Hibernate qui nous oblige a
+ * adopter un comportement particulier.
+ * </p>
+ *
+ * @param attr l'attribut a tester
+ * @param model le model
+ * @return true si et seulement si il s'agit bien de ce type de relation
+ */
+ public static boolean hasUnidirectionalRelationOnAbstractType(
+ ObjectModelAttribute attr, ObjectModel model) {
+ ObjectModelAttribute reverse = attr.getReverseAttribute();
+ //relation 1-n
+ if (reverse != null && isNMultiplicity(attr)
+ && !isNMultiplicity(reverse)) {
+ //Pas de navigabilité
+ if (!reverse.isNavigable()) {
+ //Il s'agit d'une entity
+ ObjectModelClass clazz = model.getClass(attr.getType());
+ if (clazz != null && clazz.hasStereotype(STEREOTYPE_ENTITY)) {
+ //Cette classe a des sous-classes dans le modèle
+ for (ObjectModelClass subClass : model.getClasses()) {
+ if (subClass.getSuperclasses().contains(clazz)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Renvoie le nom unique de table pour une relation ManyToMany en fonction
+ * de l'attribut <code>attr</code>
+ * <p/>
+ * Plusieurs cas de figure:
+ * <li>
+ *
+ * @param attr l'attribut servant de base au calcul du nom
+ * @return le nom de la table
+ */
+ public static String getManyToManyTableName(ObjectModelAttribute attr) {
+ String result;
+
+ if (attr.hasAssociationClass()) {
+ result = GeneratorUtil.getDBName(attr.getAssociationClass());
+ } else {
+ String name = attr.getName();
+ String revers = attr.getReverseAttributeName();
+
+ if (name.compareToIgnoreCase(revers) < 0) {
+ result = name + "_" + revers;
+ } else {
+ result = revers + "_" + name;
+ }
+ }
+ // String result;
+ // if (!Util.isFirstAttribute(attr)) {
+ // result = attr.getDeclaringElement().getName() + "_" + attr.getReverseAttribute().getDeclaringElement().getName();
+ // } else {
+ // result = attr.getReverseAttribute().getDeclaringElement().getName() + "_" + attr.getDeclaringElement().getName();
+ // }
+ return result.toLowerCase();
+ }
+
+ /**
+ * Renvoie le type d'interface à utiliser en fonction de l'attribut
+ *
+ * @param attr l'attribut a traiter
+ * @return String
+ */
+ public static String getNMultiplicityInterfaceType(ObjectModelAttribute attr) {
+ if (attr.hasStereotype(STEREOTYPE_UNIQUE)) {
+ return Set.class.getName();
+ } else if (attr.isIndexed() || attr.isOrdered()) {
+ return List.class.getName();
+ }
+ return Collection.class.getName();
+ }
+
+ /**
+ * Renvoie le type d'objet (instance) à utiliser en fonction de l'attribut
+ *
+ * @param attr l'attribut a traiter
+ * @return String
+ */
+ public static String getNMultiplicityObjectType(ObjectModelAttribute attr) {
+ if (attr.hasStereotype(STEREOTYPE_UNIQUE)) {
+ return HashSet.class.getName();
+ } else if (attr.isIndexed() || attr.isOrdered()) {
+ //On considère qu'on ne sait pas traiter vraiment l'attribut "ordered"
+ // puisqu'on va conserver l'ordre d'insertion, et non un ordre en
+ // fonction d'un élément donné. Donc on renvoi une ArrayList
+ return ArrayList.class.getName();
+ }
+ LinkedList.class.getName();
+ return ArrayList.class.getName();
+ }
+
+ /**
+ * Renvoie le type d'interface à utiliser en fonction de l'attribut
+ *
+ * @param attr l'attribut a traiter
+ * @return String
+ */
+ public static String getNMultiplicityHibernateType(ObjectModelAttribute attr) {
+ if (attr.hasStereotype(STEREOTYPE_UNIQUE)) {
+ return "set";
+ } else if (attr.isIndexed()) {
+ return "list";
+ }
+ //attr.isOrdered() - On génère le ordered en bag
+ return "bag";
+ }
+
+ /**
+ * Obtain the list of entities classes with the possibility to sort the result.
+ *
+ * @param model the current model to scan
+ * @param sort flag to allow sort the result
+ * @return the list of filtred classes by their stereotype
+ */
+ public static List<ObjectModelClass> getEntityClasses(ObjectModel model,
+ boolean sort) {
+ return getClassesByStereotype(STEREOTYPE_ENTITY, model, sort);
+ }
+
+ /**
+ * Obtain the list of classes for a given stereotype with the possibility to sort the result.
+ *
+ * @param stereotype filter stereotype
+ * @param model the current model to scan
+ * @param sort flag to allow sort the result
+ * @return the list of filtred classes by their stereotype
+ */
+ public static List<ObjectModelClass> getClassesByStereotype(
+ String stereotype, ObjectModel model, boolean sort) {
+ List<ObjectModelClass> classes = new ArrayList<ObjectModelClass>();
+ for (ObjectModelClass clazz : model.getClasses()) {
+ if (clazz.hasStereotype(stereotype)) {
+ classes.add(clazz);
+ }
+ }
+ if (sort && !classes.isEmpty()) {
+ java.util.Collections.sort(classes,
+ new java.util.Comparator<ObjectModelClass>() {
+ public int compare(ObjectModelClass o1,
+ ObjectModelClass o2) {
+ return o1.getQualifiedName().compareTo(
+ o2.getQualifiedName());
+ }
+ });
+ }
+ return classes;
+ }
+} // GeneratorUtil
Deleted: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java
===================================================================
--- topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,154 +0,0 @@
-package org.codelutin.topia.persistence.util;
-
-import org.apache.commons.beanutils.MethodUtils;
-
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-import java.util.List;
-
-/** @author chemit */
-public class BeanPropertyLoador<E> implements Loador<E> {
-
- public static <E> BeanPropertyLoador<E> newLoador(Class<E> klass, String... properties) {
- return new BeanPropertyLoador<E>(klass, properties);
- }
-
- private static final long serialVersionUID = 1L;
-
- protected static final Integer ZERO = 0;
- protected static final Float ZEROF = 0f;
- protected static final Long ZEROL = 0l;
- protected static final Double ZEROD = 0.;
- protected static final Byte ZEROB = 0;
-
- protected List<String> properties;
- protected transient PropertyDescriptor[] descriptors;
- protected Class<E> klass;
-
- protected BeanPropertyLoador(Class<E> klass, String... properties) {
- this.properties = java.util.Collections.unmodifiableList(Arrays.asList(properties));
- this.klass = klass;
- }
-
- public List<String> getProperties() {
- return properties;
- }
-
- public PropertyDescriptor[] getDescriptors() {
- if (descriptors == null) {
- try {
- descriptors = new PropertyDescriptor[properties.size()];
- for (PropertyDescriptor propertydescriptor : Introspector.getBeanInfo(klass).getPropertyDescriptors()) {
- int index = properties.indexOf(propertydescriptor.getName());
- if (index != -1) {
- descriptors[index] = propertydescriptor;
- }
- }
- } catch (IntrospectionException e) {
- throw new RuntimeException(e);
- }
- }
- return descriptors;
- }
-
- @Override
- public void load(E from, E dst, boolean tech) {
- if (from == null) {
- // reset all fields
- for (PropertyDescriptor descriptor : getDescriptors()) {
- Object read = getNullValue(descriptor.getPropertyType());
- setProperty(dst, descriptor, read);
- }
- } else {
- // set all fields from
- for (PropertyDescriptor descriptor : getDescriptors()) {
- try {
- Object value = descriptor.getReadMethod().invoke(from);
- setProperty(dst, descriptor, value);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- }
- }
- }
- }
-
- protected void setProperty(E dst, PropertyDescriptor descriptor, Object value) {
- try {
- descriptor.getWriteMethod().invoke(dst, value);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- protected static Object getNullValue(Class<?> type) {
- if (type.isPrimitive()) {
- type = MethodUtils.getPrimitiveWrapper(type);
- if (Boolean.class.isAssignableFrom(type)) {
- return Boolean.FALSE;
- }
- if (Integer.class.isAssignableFrom(type)) {
- return ZERO;
- }
- if (Float.class.isAssignableFrom(type)) {
- return ZEROF;
- }
- if (Long.class.isAssignableFrom(type)) {
- return ZEROL;
- }
- if (Double.class.isAssignableFrom(type)) {
- return ZEROD;
- }
- if (Byte.class.isAssignableFrom(type)) {
- return ZEROB;
- }
- }
- return null;
- }
-
- public static boolean isNullValue(Object value) {
- if (value == null) {
- return true;
- }
- Class<?> type = value.getClass();
- if (type.isPrimitive()) {
- type = MethodUtils.getPrimitiveWrapper(type);
- }
- if (Boolean.class.isAssignableFrom(type)) {
- return Boolean.FALSE.equals(value);
- }
- if (Integer.class.isAssignableFrom(type)) {
- return ZERO.equals(value);
- }
- if (Float.class.isAssignableFrom(type)) {
- return ZEROF.equals(value);
- }
- if (Long.class.isAssignableFrom(type)) {
- return ZEROL.equals(value);
- }
- if (Double.class.isAssignableFrom(type)) {
- return ZEROD.equals(value);
- }
- return Byte.class.isAssignableFrom(type) && ZEROB.equals(value);
- }
-
- protected void checkProperties() {
- PropertyDescriptor[] descriptors = getDescriptors();
- for (int i = 0; i < descriptors.length; i++) {
- PropertyDescriptor descriptor = descriptors[i];
- if (descriptor == null) {
- throw new IllegalStateException("could not find descriptor for property " + properties.get(i) + " on " + klass);
- }
- if (descriptor.getReadMethod() == null) {
- throw new IllegalStateException("property " + properties.get(i) + " is not readable on " + klass);
- }
- if (descriptor.getWriteMethod() == null) {
- throw new IllegalStateException("property " + properties.get(i) + " is not writable on " + klass);
- }
- }
- }
-}
Copied: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java (from rev 1285, topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java)
===================================================================
--- topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java (rev 0)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/BeanPropertyLoador.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,178 @@
+package org.codelutin.topia.persistence.util;
+
+import org.apache.commons.beanutils.MethodUtils;
+
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** @author chemit */
+public class BeanPropertyLoador<E> implements Loador<E> {
+
+ public static <E> BeanPropertyLoador<E> newLoador(Class<E> klass, String... properties) {
+ return new BeanPropertyLoador<E>(klass, properties);
+ }
+
+ private static final long serialVersionUID = 1L;
+
+ protected static final Integer ZERO = 0;
+ protected static final Float ZEROF = 0f;
+ protected static final Long ZEROL = 0l;
+ protected static final Double ZEROD = 0.;
+ protected static final Byte ZEROB = 0;
+
+ protected List<String> properties;
+ protected transient PropertyDescriptor[] descriptors;
+ protected Class<E> klass;
+
+ protected BeanPropertyLoador(Class<E> klass, String... properties) {
+ this.properties = java.util.Collections.unmodifiableList(Arrays.asList(properties));
+ this.klass = klass;
+ }
+
+ public List<String> getProperties() {
+ return properties;
+ }
+
+ public PropertyDescriptor[] getDescriptors() {
+ if (descriptors == null) {
+ try {
+ descriptors = new PropertyDescriptor[properties.size()];
+ for (PropertyDescriptor propertydescriptor : Introspector.getBeanInfo(klass).getPropertyDescriptors()) {
+ int index = properties.indexOf(propertydescriptor.getName());
+ if (index != -1) {
+ descriptors[index] = propertydescriptor;
+ }
+ }
+ } catch (IntrospectionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return descriptors;
+ }
+
+ public Map<String, Object> obtainProgperties(E from) {
+ if (from == null) {
+ return java.util.Collections.emptyMap();
+ }
+ Map<String, Object> result = new HashMap<String, Object>();
+ for (PropertyDescriptor descriptor : getDescriptors()) {
+ Object read = null;
+ try {
+ read = descriptor.getReadMethod().invoke(from);
+ if (read != null) {
+ result.put(descriptor.getName(), read);
+ }
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+ return result;
+ }
+
+ @Override
+ public void load(E from, E dst, boolean tech) {
+ if (from == null) {
+ // reset all fields
+ for (PropertyDescriptor descriptor : getDescriptors()) {
+ Object read = getNullValue(descriptor.getPropertyType());
+ setProperty(dst, descriptor, read);
+ }
+ } else {
+ // set all fields from
+ for (PropertyDescriptor descriptor : getDescriptors()) {
+ try {
+ Object value = descriptor.getReadMethod().invoke(from);
+ setProperty(dst, descriptor, value);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ }
+
+ protected void setProperty(E dst, PropertyDescriptor descriptor, Object value) {
+ try {
+ descriptor.getWriteMethod().invoke(dst, value);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected static Object getNullValue(Class<?> type) {
+ if (type.isPrimitive()) {
+ type = MethodUtils.getPrimitiveWrapper(type);
+ if (Boolean.class.isAssignableFrom(type)) {
+ return Boolean.FALSE;
+ }
+ if (Integer.class.isAssignableFrom(type)) {
+ return ZERO;
+ }
+ if (Float.class.isAssignableFrom(type)) {
+ return ZEROF;
+ }
+ if (Long.class.isAssignableFrom(type)) {
+ return ZEROL;
+ }
+ if (Double.class.isAssignableFrom(type)) {
+ return ZEROD;
+ }
+ if (Byte.class.isAssignableFrom(type)) {
+ return ZEROB;
+ }
+ }
+ return null;
+ }
+
+ public static boolean isNullValue(Object value) {
+ if (value == null) {
+ return true;
+ }
+ Class<?> type = value.getClass();
+ if (type.isPrimitive()) {
+ type = MethodUtils.getPrimitiveWrapper(type);
+ }
+ if (Boolean.class.isAssignableFrom(type)) {
+ return Boolean.FALSE.equals(value);
+ }
+ if (Integer.class.isAssignableFrom(type)) {
+ return ZERO.equals(value);
+ }
+ if (Float.class.isAssignableFrom(type)) {
+ return ZEROF.equals(value);
+ }
+ if (Long.class.isAssignableFrom(type)) {
+ return ZEROL.equals(value);
+ }
+ if (Double.class.isAssignableFrom(type)) {
+ return ZEROD.equals(value);
+ }
+ return Byte.class.isAssignableFrom(type) && ZEROB.equals(value);
+ }
+
+ protected void checkProperties() {
+ PropertyDescriptor[] descriptors = getDescriptors();
+ for (int i = 0; i < descriptors.length; i++) {
+ PropertyDescriptor descriptor = descriptors[i];
+ if (descriptor == null) {
+ throw new IllegalStateException("could not find descriptor for property " + properties.get(i) + " on " + klass);
+ }
+ if (descriptor.getReadMethod() == null) {
+ throw new IllegalStateException("property " + properties.get(i) + " is not readable on " + klass);
+ }
+ if (descriptor.getWriteMethod() == null) {
+ throw new IllegalStateException("property " + properties.get(i) + " is not writable on " + klass);
+ }
+ }
+ }
+}
Deleted: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java
===================================================================
--- topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,7 +0,0 @@
-package org.codelutin.topia.persistence.util;
-
-/** @author chemit */
-public interface Loador<E> extends java.io.Serializable {
-
- void load(E from, E dst, boolean tech);
-}
Copied: topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java (from rev 1285, topia/trunk/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java)
===================================================================
--- topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java (rev 0)
+++ topia/tags/2.1.2/topia-persistence/src/main/java/org/codelutin/topia/persistence/util/Loador.java 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,11 @@
+package org.codelutin.topia.persistence.util;
+
+import java.util.Map;
+
+/** @author chemit */
+public interface Loador<E> extends java.io.Serializable {
+
+ Map<String, Object> obtainProgperties(E from);
+
+ void load(E from, E dst, boolean tech);
+}
Deleted: topia/tags/2.1.2/topia-soa/pom.xml
===================================================================
--- topia/trunk/topia-soa/pom.xml 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-soa/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <!-- ************************************************************* -->
- <!-- *** POM Relationships *************************************** -->
- <!-- ************************************************************* -->
-
- <parent>
- <groupId>org.codelutin</groupId>
- <artifactId>topia</artifactId>
- <version>2.1.2-SNAPSHOT</version>
- </parent>
-
- <groupId>org.codelutin.topia</groupId>
- <artifactId>topia-soa</artifactId>
-
- <dependencies>
-
- <dependency>
- <groupId>org.codelutin.topia</groupId>
- <artifactId>topia-persistence</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinutil</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutingenerator</artifactId>
- </dependency>
-
- <!-- Dependencies for services -->
- <dependency>
- <groupId>org.apache.xmlrpc</groupId>
- <artifactId>xmlrpc-server</artifactId>
- <version>3.1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.xmlrpc</groupId>
- <artifactId>xmlrpc-client</artifactId>
- <version>3.1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.xfire</groupId>
- <artifactId>xfire-java5</artifactId>
- <version>1.2.6</version>
- <exclusions>
- <!-- Fix org.apache.ant conflict) -->
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- branch 5.1 : ne fonctionne pas en 6+ -->
- <dependency>
- <groupId>jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>5.1.10</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Dependencies for class generation -->
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>1.5.3</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
-
- <name>ToPIA - SOA</name>
- <description>Service Oriented Architecture module</description>
-
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
-
- <packaging>jar</packaging>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <plugins>
-
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-processor-plugin</artifactId>
- </plugin>
-
- </plugins>
- </build>
-
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <scm>
- <connection>${maven.scm.connection.child}</connection>
- <developerConnection>${maven.scm.developerConnection.child}</developerConnection>
- <url>${maven.scm.url.child}</url>
- </scm>
-
-</project>
Copied: topia/tags/2.1.2/topia-soa/pom.xml (from rev 1286, topia/trunk/topia-soa/pom.xml)
===================================================================
--- topia/tags/2.1.2/topia-soa/pom.xml (rev 0)
+++ topia/tags/2.1.2/topia-soa/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.codelutin</groupId>
+ <artifactId>topia</artifactId>
+ <version>2.1.2</version>
+ </parent>
+
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-soa</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinutil</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutingenerator</artifactId>
+ </dependency>
+
+ <!-- Dependencies for services -->
+ <dependency>
+ <groupId>org.apache.xmlrpc</groupId>
+ <artifactId>xmlrpc-server</artifactId>
+ <version>3.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.xmlrpc</groupId>
+ <artifactId>xmlrpc-client</artifactId>
+ <version>3.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.xfire</groupId>
+ <artifactId>xfire-java5</artifactId>
+ <version>1.2.6</version>
+ <exclusions>
+ <!-- Fix org.apache.ant conflict) -->
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- branch 5.1 : ne fonctionne pas en 6+ -->
+ <dependency>
+ <groupId>jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>5.1.10</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Dependencies for class generation -->
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ <version>1.5.3</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>ToPIA - SOA</name>
+ <description>Service Oriented Architecture module</description>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-soa</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-soa</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ </scm>
+
+</project>
Deleted: topia/tags/2.1.2/topia-ui/pom.xml
===================================================================
--- topia/trunk/topia-ui/pom.xml 2009-01-05 08:40:44 UTC (rev 1284)
+++ topia/tags/2.1.2/topia-ui/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <!-- ************************************************************* -->
- <!-- *** POM Relationships *************************************** -->
- <!-- ************************************************************* -->
-
- <parent>
- <groupId>org.codelutin</groupId>
- <artifactId>topia</artifactId>
- <version>2.1.2-SNAPSHOT</version>
- </parent>
-
- <groupId>org.codelutin.topia</groupId>
- <artifactId>topia-ui</artifactId>
-
- <dependencies>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinutil</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutingenerator</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tapestry</groupId>
- <artifactId>tapestry-core</artifactId>
- <version>5.0.7</version>
- <scope>compile</scope>
- </dependency>
-
- </dependencies>
-
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
-
- <name>ToPIA - UI</name>
- <description>User interface module</description>
-
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
-
- <packaging>jar</packaging>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <plugins>
-
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-processor-plugin</artifactId>
- </plugin>
-
- </plugins>
- </build>
-
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <scm>
- <connection>${maven.scm.connection.child}</connection>
- <developerConnection>${maven.scm.developerConnection.child}</developerConnection>
- <url>${maven.scm.url.child}</url>
- </scm>
-
-</project>
Copied: topia/tags/2.1.2/topia-ui/pom.xml (from rev 1286, topia/trunk/topia-ui/pom.xml)
===================================================================
--- topia/tags/2.1.2/topia-ui/pom.xml (rev 0)
+++ topia/tags/2.1.2/topia-ui/pom.xml 2009-01-07 08:35:25 UTC (rev 1287)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.codelutin</groupId>
+ <artifactId>topia</artifactId>
+ <version>2.1.2</version>
+ </parent>
+
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-ui</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinutil</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutingenerator</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-core</artifactId>
+ <version>5.0.7</version>
+ <scope>compile</scope>
+ </dependency>
+
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>ToPIA - UI</name>
+ <description>User interface module</description>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-ui</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/topia/topia/tags/2.1.2/topia-ui</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/topia/tags/2.1.…</url>
+ </scm>
+
+</project>
1
0