Seam 2.0 Migration Guide
========================
Before you get started with Seam2, you'll need to make a few changes to 
your existing code and configuration. This process should not be too
painful - if you get stuck, just refer back to the updated Seam examples.

Migration to JSF 1.2
--------------------
Seam 2.0 requires JSF 1.2. We now recommend Sun's JSF RI as the most 
mature JSF implementation, and this is the version that ships with most 
EE 5 application servers, including JBoss 4.2. To switch to the JSF RI, 
you'll need to make some changes to web.xml:

* remove the MyFaces StartupServletContextListener
* remove the Ajax4JSF filter and mappings
* rename org.jboss.seam.web.SeamFilter to 
             org.jboss.seam.servlet.SeamFilter

Also note that for the JSF RI, client-side state saving is not required.

You'll also need to make some changes to faces-config.xml:

* Remove the (Tranactional)SeamPhaseListener declaration
* Remove the SeamELResolver declaration, if you have one
* Change the declaration of SeamFaceletViewHandler to the standard 
             com.sun.facelets.FaceletViewHandler

Since Seam 1.2, you didn't need any declarations of SeamExceptionFilter
or SeamRedirectFilter in web.xml, just a single declaration of SeamFilter. 
Make sure you've already made that change.

Code migration
--------------
Seam's built-in components have undergone a major reorganization designed 
to organize them for easier learning, and to isolate dependencies upon 
particular technologies like JSF into specific packages.

* Persistence-related components moved to org.jboss.seam.persistence
* jBPM related components moved to org.jboss.seam.bpm
* JSF-related components moved org.jboss.seam.faces
* Servlet-related components have moved to org.jboss.seam.web
* Components related to asynchronicity moved to org.jboss.seam.async
* i18n-related components moved to org.jboss.seam.international
* The Pageflow component moved to org.jboss.seam.pageflow
* The Pages component moved to org.jboss.seam.navigation

Code which depends on these APIs will need to be changed to reflect the 
new Java package names.

Annotations have also been reorganized:

* BPM-related annotations moved to org.jboss.seam.annotations.bpm
* JSF-related annotations moved to org.jboss.seam.annotations.faces
* Interceptor annotations moved to 
          org.jboss.seam.annotations.intercept
* Annotations related to asynchronicity moved to 
          org.jboss.seam.annotations.async
* @RequestParameter moved to org.jboss.seam.annotations.web
* @WebRemote moved to org.jboss.seam.annotations.remoting
* @Restrict moved to org.jboss.seam.annotations.security
* Exception handling annotations moved to 
          org.jboss.seam.annotations.exception
* Use @BypassInterceptors instead of @Intercept(NEVER)

Migration of components.xml
---------------------------
The new packaging comes with new namespaces and new schemas for 
components.xml. The namespace for components in package

    org.jboss.seam.foobar
    
Is now:

    http://jboss.com/products/seam/foobar
    
And the schema is:

    http://jboss.com/products/seam/foobar-2.0.xsd

You'll need to update your components.xml file to reflect the new schemas 
and namespaces. Take a look at the Seam examples if you're unsure of 
exactly what you need to do.

Finally, some declarations must be removed completely:

* remove <conversation-is-long-running-parameter> from <core:init/>
* remove <core:ejb/>
* remove <core:microcontainer/>
* replace <core:transaction-listener/> with 
          <transaction:ejb-transaction/>
* replace <core:resource-bundle/> with <core:resource-loader/>
          
Note: Seam transaction management is now enabled by default. If you want
      to disable use of Seam-managed transactions, use the following:
      
      <core:init transaction-management-enabled="false"/>
      
Note: The expression attribute on event action's has been deprecated in favor of
      execute e.g.:

      <event type="org.jboss.seam.notLoggedIn">
          <action execute="#{redirect.captureCurrentView}"/>
      </event>

Migration to JBPM 3.2
---------------------
If you are using JBPM for business processes (not just pageflows), you need 
to add the tx service to jbpm.cfg.xml: 
  <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
  
Migration to RichFaces 3.1
--------------------------
If you are using RichFaces or Ajax4jsf, a major reorganisation of the codebase
has occurred.  ajax4jsf.jar and richfaces.jar have been replaced by 
richfaces-api.jar (which should go in your ear lib/ directory) and 
richfaces-impl.jar and richfaces-ui.jar (both of which go in WEB-INF/lib).

s:selectDate has been deprecated in favor of rich:calendar.  No more 
development will be done on s:selectDate.

You should check the RichFaces documentation for more information on parameter
name changes and namespace changes.

Packaging changes
-----------------
You should place all the dependencies which you previously declared as modules
in application.xml in the lib/ directory of your ear *except* jboss-seam.jar
which should be declared as an ejb module in application.xml

Changes to Seam UI
------------------

* s:decorate has become a naming container.  Therefore client ids have changed 
  from fooForm:fooInput to fooForm:foo:fooInput (assuming your s:decorate has
  foo as an id.

Changes to seam-gen
-------------------

There was a change in seam-gen starting with Seam 2.0.0.CR2 regarding
how the generated classes are organized when generate-entities is
executed.

Old way:

  src/model/com/domain/projectname/model/EntityName.java
  src/action/com/domain/projectname/model/EntityNameHome.java
  src/action/com/domain/projectname/model/EntityNameList.java

New way:

  src/model/com/domain/projectname/model/EntityName.java
  src/action/com/domain/projectname/action/EntityNameHome.java
  src/action/com/domain/projectname/action/EntityNameList.java

Home and Query objects are "action" components, not "model" components
and are therefore placed in the action package. This change makes the
convensions followed by generate-entities consistent with the convensions
used in the new-entity command.

Remember, model classes are kept separate because they cannot be hot reloaded.
