Affichage des articles dont le libellé est migration. Afficher tous les articles
Affichage des articles dont le libellé est migration. Afficher tous les articles

mercredi 18 mars 2009

Migration notes for GraniteDS 2.0 beta 1

Hi,

GraniteDS 2.0 beta 1 has just been released. It contains a lot of changes and there are a few simple but important migration tips that must be followed in your projects to use this new version.

Packaging and deployment
The most visible change is the new packaging of the distribution. There is only one zip containing all jars/swcs in the build directory and an examples folder with all example projects that can be imported in an Eclipse workspace.
Many swcs have been removed thanks to a huge refactoring in the persistence code and there are only 2 swcs left:
- granite-essentials.swc is the core library and must be linked with -include-library
- granite.swc is the framework library and can be linked with normal Flex library linking (merge into code in Flex Builder) to reduce the final swf size

The Tide specific jars have been merged with the non-Tide jars, so server deployment now requires 2 or 3 jars depending only on the server framework and persistence provider used:
- granite.jar (the core library)
- one persistence jar (granite-hibernate.jar, granite-toplink.jar, granite-eclipselink.jar, granite-openjpa.jar, granite-datanucleus.jar)
- one server framework.jar (none, granite-spring.jar, granite-seam.jar, granite-guice.jar)

The next thing is to regenerate all your entities with the latest gas3 templates, with either the 2.0.0b1 builder or the 2.0.0b1 ant task. To check if your entities are up-to-date, just check that __laziness has been replaced by __detachedState and __initialized.

Other migration tips depend on the parts of GDS that you use:

Spring:
- The Spring service factory is now in the package org.granite.spring instead of org.granite.messaging.service. The change has to be done in services-config.xml.

Tide:
- Enable the following annotations:
Version,Name,In,Out,Observer,Destroy
Optionnally you can enable the Event annotation to try the new Tide event model.

- events dispatched upon user login/logout are org.granite.tide.login and org.granite.tide.logout instead of login/logout to avoid name conflict and handlers now get TideContextEvent instead of TideLoginEvent. TideLoginEvent has been removed.

- identity.forceLogout has been removed (identity.logout has been fixed with Flex JIRA BLZ-310 workaround)

Tide/Seam:
- JPA entities that will be managed by Tide must now be annotated with @EntityListener(org.granite.tide.data.DataListener.class). This can be done only once in an abstract base class or alternatively in the orm.xml configuration file.

- status messages are now available in context.statusMessages.messages instead of context.messages, and statusMessages can be injected as a client component with [In] public var statusMessages:StatusMessages.


A next post will describe the new features in this release in more details.

William