[richfaces-svn-commits] JBoss Rich Faces SVN: r5576 - in branches/3.1.x: .externalToolBuilders and 56 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Jan 23 21:04:37 EST 2008


Author: alexsmirnov
Date: 2008-01-23 21:04:36 -0500 (Wed, 23 Jan 2008)
New Revision: 5576

Added:
   branches/3.1.x/.externalToolBuilders/
   branches/3.1.x/.externalToolBuilders/org.jboss.ide.eclipse.archives.core.archivesBuilder.launch
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletSession.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/SeamExceptionHandlerImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/RenderPortletExternalContextImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/util/
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/util/LRUMap.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java
   branches/3.1.x/samples/ajaxPortlet/src/main/resources/
   branches/3.1.x/samples/ajaxPortlet/src/main/resources/META-INF/
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxrepeaterportlet-object.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml
   branches/3.1.x/samples/seamPortletEar/ear/
   branches/3.1.x/samples/seamPortletEar/ear/pom.xml
   branches/3.1.x/samples/seamPortletEar/ear/src/
   branches/3.1.x/samples/seamPortletEar/pom.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/
   branches/3.1.x/samples/seamPortletEar/seamBooking/pom.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/components.properties
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/import.sql
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/seam.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.exadelproject
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.xdoclet
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/pom.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/seam.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/btn.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-next.png
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-prev.png
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/dtpick.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.title.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/header_line.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/input.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/spinner.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/th.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/test/
Removed:
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java
   branches/3.1.x/samples/ajaxPortlet/src/main/resources/META-INF/
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml
   branches/3.1.x/samples/seamPortletEar/ear/pom.xml
   branches/3.1.x/samples/seamPortletEar/ear/src/
   branches/3.1.x/samples/seamPortletEar/seamBooking/pom.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/components.properties
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/import.sql
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties
   branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/seam.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.exadelproject
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.xdoclet
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/pom.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/seam.properties
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/btn.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-next.png
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-prev.png
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/dtpick.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.title.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/header_line.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/input.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/spinner.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/th.bg.gif
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml
   branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/test/
Modified:
   branches/3.1.x/extensions/portletbridge/pom.xml
   branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/Bridge.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/GenericFacesPortlet.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/javax/portlet/faces/GenericPortletTest.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/AbstractAjax4jsfPortletTestCase.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockActionRequest.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletContext.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletRequest.java
   branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockRenderRequest.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/pom.xml
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/ExceptionHandlerImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/ContextFactoryTest.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/FacesContextImplTest.java
   branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/PortletExternalContextTest.java
   branches/3.1.x/samples/ajaxPortlet/pom.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-app.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml
   branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/web.xml
   branches/3.1.x/samples/pom.xml
   branches/3.1.x/samples/scrollableDataTableDemo/pom.xml
   branches/3.1.x/samples/tooltip-sample/pom.xml
Log:
Merge portlet bridge and samples from trunk

Added: branches/3.1.x/.externalToolBuilders/org.jboss.ide.eclipse.archives.core.archivesBuilder.launch
===================================================================
--- branches/3.1.x/.externalToolBuilders/org.jboss.ide.eclipse.archives.core.archivesBuilder.launch	                        (rev 0)
+++ branches/3.1.x/.externalToolBuilders/org.jboss.ide.eclipse.archives.core.archivesBuilder.launch	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.jboss.ide.eclipse.archives.core.archivesBuilder"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+</launchConfiguration>


Property changes on: branches/3.1.x/.externalToolBuilders/org.jboss.ide.eclipse.archives.core.archivesBuilder.launch
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/3.1.x/extensions/portletbridge/pom.xml
===================================================================
--- branches/3.1.x/extensions/portletbridge/pom.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -22,6 +22,23 @@
 			</plugin>
 		</plugins>
 	</build>
+   <repositories>
+      <repository>
+         <releases>
+            <enabled>true</enabled>
+         </releases>
+         <snapshots>
+            <enabled>false</enabled>
+            <updatePolicy>never</updatePolicy>
+         </snapshots>
+         <id>repository.jboss.com</id>
+         <name>Jboss Repository for Maven</name>
+         <url>
+            http://repository.jboss.com/maven2/
+         </url>
+         <layout>default</layout>
+      </repository>
+   </repositories>
 	<dependencies>
 		<dependency>
 			<groupId>junit</groupId>
@@ -38,13 +55,13 @@
 		<dependency>
 			<groupId>javax.faces</groupId>
 			<artifactId>jsf-api</artifactId>
-			<version>1.2_05</version>
+			<version>1.2_07</version>
 			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>javax.faces</groupId>
 			<artifactId>jsf-impl</artifactId>
-			<version>1.2_05</version>
+			<version>1.2_07</version>
 			<scope>provided</scope>
 		</dependency>
 		<dependency>

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,37 +1,30 @@
-<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">
-	<parent>
-		<artifactId>portletbridge</artifactId>
-		<groupId>org.richfaces.extensions</groupId>
-		<version>3.1.4-SNAPSHOT</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.richfaces.extensions.portletbridge</groupId>
-	<artifactId>portletbridge-api</artifactId>
-	<version>3.1.4-SNAPSHOT</version>
-	<name>JSR-301 jsf-portlet brige api</name>
-	<url>http://labs.jboss.com/wiki/Ajax4jsf/a4j-portlet</url>
-	  <build>
-    <plugins>
-     <plugin>
-       <groupId>org.apache.maven.plugins</groupId>
-       <artifactId>maven-jar-plugin</artifactId>
-       <executions>
-         <execution>
-           <goals>
-             <goal>test-jar</goal>
-           </goals>
-         </execution>
-       </executions>
-     </plugin>
-	<plugin>
-		<groupId>org.apache.maven.plugins</groupId>
-		<artifactId>maven-surefire-plugin</artifactId>
-		<configuration>
-			<excludes>
-				<exclude>**/AbstractAjax4jsfPortletTestCase.java</exclude>
-			</excludes>
-		</configuration>
-	</plugin>
-	</plugins>
-  </build>
-</project>
+<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">
+	<parent>
+		<artifactId>portletbridge</artifactId>
+		<groupId>org.richfaces.extensions</groupId>
+		<version>3.1.4-SNAPSHOT</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.richfaces.extensions.portletbridge</groupId>
+	<artifactId>portletbridge-api</artifactId>
+	<version>3.1.4-SNAPSHOT</version>
+	<name>JSR-301 jsf-portlet brige api</name>
+	<url>http://labs.jboss.com/wiki/Ajax4jsf/a4j-portlet</url>
+	  <build>
+    <plugins>
+     <plugin>
+       <groupId>org.apache.maven.plugins</groupId>
+       <artifactId>maven-jar-plugin</artifactId>
+       <executions>
+         <execution>
+           <goals>
+             <goal>test-jar</goal>
+           </goals>
+         </execution>
+       </executions>
+     </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/Bridge.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/Bridge.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/Bridge.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -96,7 +96,10 @@
 	 * Per-portlet extensions attributes prefix ( this implementation-specific ),
 	 * for additional parameters, as described in the JSR 301 PLT 3.2
 	 */
-	public static final String EXYENDED_PORTLET_ATTR_PREFIX = "javax.portlet.faces.extension.";
+	public static final String EXTENDED_PORTLET_ATTR_PREFIX = "javax.portlet.faces.extension.";
+	  // allows a portlet to which request attributes the bridge excludes from its
+	  // managed request scope.
+    public static final String EXCLUDED_REQUEST_ATTRIBUTES    = "excludedRequestAttributes";
 	public static final String PRESERVE_ACTION_PARAM_ATTR_SUFFIX = ".preserveActionParams";
 	public static final String RENDER_POLICY_PARAM_ATTR_SUFFIX = ".renderPolicy";
 	/**

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/GenericFacesPortlet.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/GenericFacesPortlet.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/GenericFacesPortlet.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -8,11 +8,14 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletRequest;
@@ -30,14 +33,15 @@
 public class GenericFacesPortlet extends GenericPortlet {
 
 	private static final String BRIDGE_SERVICE_CLASSPATH = "META-INF/services/javax.portlet.faces.Bridge";
-	public static final String BRIDGE_CLASS = "javax.portlet.faces.BridgeClassName";
+	public static final String BRIDGE_CLASS = "javax.portlet.faces.BridgeImplClass";
 	
 	private volatile String bridgeClassName = null;
 	private volatile Bridge facesPortletBrige = null;
 
 	public void init(PortletConfig config) throws PortletException {
 		super.init(config);
-		bridgeClassName = this.getPortletContext().getInitParameter(
+		PortletContext portletContext = this.getPortletContext();
+		bridgeClassName = portletContext.getInitParameter(
 				BRIDGE_CLASS);
 		if (bridgeClassName == null) {
 			ClassLoader loader = getClassLoader();
@@ -75,18 +79,34 @@
 		if (null == bridgeClassName) {
 			throw new PortletException("Can't detect bridge implementation class name");
 		}
-        String renderPolicy = 
-            this.getPortletConfig().getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX + Bridge.RENDER_POLICY);
+		String renderPolicy = 
+            config.getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX + Bridge.RENDER_POLICY);
         if (renderPolicy != null)        
-            this.getPortletContext().setAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + 
-                                                  this.getPortletName() + "." + Bridge.RENDER_POLICY,
+            portletContext.setAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + 
+                                                  this.getPortletName() + Bridge.RENDER_POLICY_PARAM_ATTR_SUFFIX,
                                                   Bridge.BridgeRenderPolicy.valueOf(renderPolicy));
         String preserveActionParams = 
-            this.getPortletConfig().getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX + Bridge.PRESERVE_ACTION_PARAMS);
+            config.getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX + Bridge.PRESERVE_ACTION_PARAMS);
         if (preserveActionParams != null)        
-            this.getPortletContext().setAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + 
+            portletContext.setAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + 
                                                   this.getPortletName() + "." + Bridge.PRESERVE_ACTION_PARAMS,
                                                   Boolean.valueOf(preserveActionParams));
+        String excludedAttrs = getPortletConfig()
+        .getInitParameter(
+          Bridge.BRIDGE_PACKAGE_PREFIX
+          + Bridge.EXCLUDED_REQUEST_ATTRIBUTES);
+        if(null != excludedAttrs){
+        	String[] atrs = excludedAttrs.split(",");
+        	List<String> attrsList = new ArrayList<String>(atrs.length);
+        	for (String string : atrs) {
+				attrsList.add(string);
+			}
+            portletContext.setAttribute(
+                    Bridge.BRIDGE_PACKAGE_PREFIX + getPortletName() + "."
+                    + Bridge.EXCLUDED_REQUEST_ATTRIBUTES,
+                    attrsList);
+        }
+
 	}
 
 	protected void doDispatch(RenderRequest request, RenderResponse response)

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation (from rev 5573, trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation)

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,11 +0,0 @@
-package javax.portlet.faces.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.METHOD})
-public @interface BridgePreDestroy {
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgePreDestroy.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,11 @@
+package javax.portlet.faces.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD})
+public @interface BridgePreDestroy {
+}

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,12 +0,0 @@
-package javax.portlet.faces.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.METHOD})
-public @interface BridgeRequestScopeAttributeAdded {
-}
-

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/BridgeRequestScopeAttributeAdded.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,12 @@
+package javax.portlet.faces.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD})
+public @interface BridgeRequestScopeAttributeAdded {
+}
+

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,11 +0,0 @@
-package javax.portlet.faces.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.TYPE})
-public @interface ExcludeFromManagedRequestScope {
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/ExcludeFromManagedRequestScope.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,11 @@
+package javax.portlet.faces.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.TYPE})
+public @interface ExcludeFromManagedRequestScope {
+}

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,11 +0,0 @@
-package javax.portlet.faces.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.TYPE})
-public @interface PortletNamingContainer {
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/main/java/javax/portlet/faces/annotation/PortletNamingContainer.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,11 @@
+package javax.portlet.faces.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.TYPE})
+public @interface PortletNamingContainer {
+}

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/javax/portlet/faces/GenericPortletTest.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/javax/portlet/faces/GenericPortletTest.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/javax/portlet/faces/GenericPortletTest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -83,7 +83,7 @@
 	public void testDestroy() throws PortletException, IOException {
 		setupActionRequest();
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portlet.init(portletConfig);
 		MockBridge facesPortletBrige = (MockBridge) portlet
@@ -108,7 +108,7 @@
 		portletConfig.addInitParameter("javax.portlet.faces.renderPolicy",
 				Bridge.BridgeRenderPolicy.NEVER_DELEGATE.toString());
 		portletConfig.setPortletName("foo");
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
 		portlet.init(portletConfig);
@@ -129,7 +129,7 @@
 			throws PortletException, IOException {
 		setupRenderRequest();
 		GenericFacesPortletExtension portlet = new GenericFacesPortletExtension();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletConfig.addInitParameter(
 				"javax.portlet.faces.defaultViewId.view", "index.jsf");
@@ -152,7 +152,7 @@
 			throws PortletException, IOException {
 		setupRenderRequest();
 		GenericFacesPortletExtension portlet = new GenericFacesPortletExtension();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletConfig.addInitParameter(
 				"javax.portlet.faces.defaultViewId.edit", "index.jsf");
@@ -176,7 +176,7 @@
 			throws PortletException, IOException {
 		setupRenderRequest();
 		GenericFacesPortletExtension portlet = new GenericFacesPortletExtension();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletConfig.addInitParameter(
 				"javax.portlet.faces.defaultViewId.view", "index.jsf");
@@ -200,7 +200,7 @@
 			throws PortletException, IOException {
 		setupRenderRequest();
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletConfig.addInitParameter(
 				"javax.portlet.faces.defaultViewId.view", "index.jsf");
@@ -229,7 +229,7 @@
 			throws PortletException, IOException {
 		setupRenderRequest();
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletConfig.addInitParameter(
 				"javax.portlet.faces.defaultViewId.view", "index.jsf");
@@ -249,7 +249,7 @@
 			throws PortletException, IOException {
 		setupActionRequest();
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletConfig.addInitParameter(
 				"javax.portlet.faces.defaultViewId.view", "index.jsf");
@@ -267,7 +267,7 @@
 	public void testGetBrigeClassName() throws PortletException {
 		setupActionRequest();
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletContext.setInitParameter(
 				"javax.portlet.faces.defaultViewId.view", "index.jsf");
@@ -333,7 +333,7 @@
 	public void testGetDefaultViewId() throws PortletException {
 		setupActionRequest();
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portletConfig.addInitParameter(
 				"javax.portlet.faces.defaultViewId.view", "index.jsf");
@@ -351,7 +351,7 @@
 	public void testGetFacesPortletBrige() throws PortletException {
 		setupActionRequest();
 		GenericFacesPortlet portlet = new GenericFacesPortlet();
-		portletContext.setInitParameter("javax.portlet.faces.BridgeClassName",
+		portletContext.setInitParameter("javax.portlet.faces.BridgeImplClass",
 				MockBridge.class.getName());
 		portlet.init(portletConfig);
 		MockBridge facesPortletBrige = (MockBridge) portlet

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/AbstractAjax4jsfPortletTestCase.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/AbstractAjax4jsfPortletTestCase.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/AbstractAjax4jsfPortletTestCase.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -24,7 +24,7 @@
     
     public void setUp() throws Exception {
         super.setUp();
-    	portletContext = new MockPortletContext();
+    	portletContext = new MockPortletContext(servletContext);
     	portletConfig = new MockPortletConfig(portletContext);
     }
     
@@ -42,7 +42,7 @@
      * 
      */
     protected void setupActionRequest() {
-        actionRequest = new MockActionRequest();
+        actionRequest = new MockActionRequest(portletContext);
 	actionResponse = new MockActionResponse();
 	externalContext.setRequest(actionRequest);
         externalContext.setResponse(actionResponse);
@@ -52,7 +52,7 @@
      * 
      */
     protected void setupRenderRequest() {
-        renderRequest = new MockRenderRequest();
+        renderRequest = new MockRenderRequest(portletContext);
 	renderResponse = new MockRenderResponse();
 	externalContext.setRequest(renderRequest);
         externalContext.setResponse(renderResponse);

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockActionRequest.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockActionRequest.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockActionRequest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -8,6 +8,7 @@
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import javax.portlet.ActionRequest;
+import javax.portlet.PortletContext;
 
 /**
  * @author asmirnov
@@ -15,7 +16,12 @@
  */
 public class MockActionRequest extends MockPortletRequest implements
 	ActionRequest {
-    /* (non-Javadoc)
+    public MockActionRequest(PortletContext portletContext) {
+		super(portletContext);
+		// TODO Auto-generated constructor stub
+	}
+
+	/* (non-Javadoc)
      * @see javax.portlet.ActionRequest#getCharacterEncoding()
      */
     public String getCharacterEncoding() {

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletContext.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletContext.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletContext.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -14,6 +14,8 @@
 import javax.portlet.PortletContext;
 import javax.portlet.PortletRequestDispatcher;
 
+import org.apache.shale.test.mock.MockServletContext;
+
 /**
  * @author asmirnov
  *
@@ -22,42 +24,39 @@
     public static final String PORTLET_INIT_VALUE = "portlet_init_value";
     public static final String INIT_PARAMETER = "init_parameter";
     
-    private Map<String, String> initParameters;
     
-    private Map<String, Object> attributes;
+    private MockServletContext servletContext;
     
 
-    public MockPortletContext() {
-		initParameters = new HashMap<String, String>();
-		initParameters.put(INIT_PARAMETER, PORTLET_INIT_VALUE);
-		attributes = new HashMap<String, Object>();
+    public MockPortletContext(MockServletContext sc) {
+    	servletContext = sc;
 	}
     /* (non-Javadoc)
      * @see javax.portlet.PortletContext#getAttribute(java.lang.String)
      */
     public Object getAttribute(String arg0) {
-	return attributes.get(arg0);
+	return servletContext.getAttribute(arg0);
     }
 
     /* (non-Javadoc)
      * @see javax.portlet.PortletContext#getAttributeNames()
      */
     public Enumeration getAttributeNames() {
-	return Collections.enumeration(attributes.keySet());
+	return servletContext.getAttributeNames();
     }
 
     /* (non-Javadoc)
      * @see javax.portlet.PortletContext#getInitParameter(java.lang.String)
      */
     public String getInitParameter(String arg0) {
-	return initParameters.get(arg0);
+	return servletContext.getInitParameter(arg0);
     }
 
     /* (non-Javadoc)
      * @see javax.portlet.PortletContext#getInitParameterNames()
      */
     public Enumeration getInitParameterNames() {
-	return Collections.enumeration(initParameters.keySet());
+	return servletContext.getInitParameterNames();
     }
 
     /* (non-Javadoc)
@@ -72,8 +71,8 @@
      * @see javax.portlet.PortletContext#getMimeType(java.lang.String)
      */
     public String getMimeType(String arg0) {
-	// TODO Auto-generated method stub
-	return null;
+    	// TODO Auto-generated method stub
+    	return servletContext.getMimeType(arg0);
     }
 
     /* (non-Javadoc)
@@ -97,7 +96,7 @@
      */
     public String getPortletContextName() {
 	// TODO Auto-generated method stub
-	return null;
+	return "testPortlet";
     }
 
     /* (non-Javadoc)
@@ -105,7 +104,7 @@
      */
     public String getRealPath(String arg0) {
 	// TODO Auto-generated method stub
-	return null;
+	return servletContext.getRealPath(arg0);
     }
 
     /* (non-Javadoc)
@@ -121,7 +120,7 @@
      */
     public URL getResource(String arg0) throws MalformedURLException {
 	// TODO Auto-generated method stub
-	return null;
+	return servletContext.getResource(arg0);
     }
 
     /* (non-Javadoc)
@@ -129,7 +128,7 @@
      */
     public InputStream getResourceAsStream(String arg0) {
 	// TODO Auto-generated method stub
-	return null;
+	return servletContext.getResourceAsStream(arg0);
     }
 
     /* (non-Javadoc)
@@ -137,7 +136,7 @@
      */
     public Set getResourcePaths(String arg0) {
 	// TODO Auto-generated method stub
-	return null;
+	return servletContext.getResourcePaths(arg0);
     }
 
     /* (non-Javadoc)
@@ -145,7 +144,7 @@
      */
     public String getServerInfo() {
 	// TODO Auto-generated method stub
-	return null;
+	return servletContext.getServerInfo();
     }
 
     /* (non-Javadoc)
@@ -153,6 +152,7 @@
      */
     public void log(String arg0) {
 	// TODO Auto-generated method stub
+    	servletContext.log(arg0);
     }
 
     /* (non-Javadoc)
@@ -160,23 +160,24 @@
      */
     public void log(String arg0, Throwable arg1) {
 	// TODO Auto-generated method stub
+    	servletContext.log(arg0, arg1);
     }
 
     /* (non-Javadoc)
      * @see javax.portlet.PortletContext#removeAttribute(java.lang.String)
      */
     public void removeAttribute(String arg0) {
-	attributes.remove(arg0);
+	servletContext.removeAttribute(arg0);
     }
 
     /* (non-Javadoc)
      * @see javax.portlet.PortletContext#setAttribute(java.lang.String, java.lang.Object)
      */
     public void setAttribute(String arg0, Object arg1) {
-	attributes.put(arg0, arg1);
+	servletContext.setAttribute(arg0, arg1);
     }
     
     public void setInitParameter(String name, String value) {
-		initParameters.put(name, value);
+    	servletContext.addInitParameter(name, value);
 	}
 }

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletRequest.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletRequest.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletRequest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -11,6 +11,7 @@
 import java.util.Locale;
 import java.util.Map;
 import javax.portlet.PortalContext;
+import javax.portlet.PortletContext;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletPreferences;
 import javax.portlet.PortletRequest;
@@ -32,8 +33,10 @@
     public Map attributes = new HashMap();
     public PortletMode mode = PortletMode.VIEW;
     public WindowState windowState = WindowState.NORMAL;
+    public MockPortletSession portletSession = null;
+	private PortletContext portletContext;
     
-    public MockPortletRequest() {
+    public MockPortletRequest(PortletContext portletContext) {
 	parameters.put(PARAMETER, new String[]{PARAMETER_VALUE1,PARAMETER_VALUE2});
     }
     /* (non-Javadoc)
@@ -139,15 +142,17 @@
      */
     public PortletSession getPortletSession() {
 	// TODO Auto-generated method stub
-	return null;
+	return getPortletSession(true);
     }
 
     /* (non-Javadoc)
      * @see javax.portlet.PortletRequest#getPortletSession(boolean)
      */
     public PortletSession getPortletSession(boolean arg0) {
-	// TODO Auto-generated method stub
-	return null;
+	if(arg0 && null == portletSession){
+		portletSession = new MockPortletSession(portletContext);
+	} 
+		return portletSession;
     }
 
     /* (non-Javadoc)

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletSession.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletSession.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletSession.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockPortletSession.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,168 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet;
+
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletSession;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class MockPortletSession implements PortletSession {
+	
+	private static final String ID = "foobar";
+
+	private Map<String, Object> portletScopeAttributes;
+	
+	private Map<String, Object> appScopeAttributes;
+
+	private long created;
+
+	private PortletContext portletContext;
+
+	private int maxInactive = 0;
+
+	public MockPortletSession(PortletContext pc) {
+		portletContext = pc;
+		portletScopeAttributes = new HashMap<String, Object>();
+		appScopeAttributes = new HashMap<String, Object>();
+		created = System.currentTimeMillis();
+	}
+	
+	private Map<String,Object> getAttributesMap(int scope) {
+		return scope == PORTLET_SCOPE?portletScopeAttributes:appScopeAttributes;
+	}
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getAttribute(java.lang.String)
+	 */
+	public Object getAttribute(String arg0) {
+		// TODO Auto-generated method stub
+		return getAttribute(arg0, PORTLET_SCOPE);
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getAttribute(java.lang.String, int)
+	 */
+	public Object getAttribute(String arg0, int arg1) {		
+		return getAttributesMap(arg1).get(arg0);
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getAttributeNames()
+	 */
+	public Enumeration getAttributeNames() {
+		// TODO Auto-generated method stub
+		return getAttributeNames(PORTLET_SCOPE);
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getAttributeNames(int)
+	 */
+	public Enumeration getAttributeNames(int arg0) {
+		// TODO Auto-generated method stub
+		return Collections.enumeration(getAttributesMap(arg0).keySet());
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getCreationTime()
+	 */
+	public long getCreationTime() {
+		// TODO Auto-generated method stub
+		return created;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getId()
+	 */
+	public String getId() {
+		// TODO Auto-generated method stub
+		return ID;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getLastAccessedTime()
+	 */
+	public long getLastAccessedTime() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getMaxInactiveInterval()
+	 */
+	public int getMaxInactiveInterval() {
+		// TODO Auto-generated method stub
+		return maxInactive;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#getPortletContext()
+	 */
+	public PortletContext getPortletContext() {
+		// TODO Auto-generated method stub
+		return portletContext;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#invalidate()
+	 */
+	public void invalidate() {
+		// TODO Auto-generated method stub
+
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#isNew()
+	 */
+	public boolean isNew() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#removeAttribute(java.lang.String)
+	 */
+	public void removeAttribute(String arg0) {
+		removeAttribute(arg0, PORTLET_SCOPE);
+
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#removeAttribute(java.lang.String, int)
+	 */
+	public void removeAttribute(String arg0, int arg1) {
+		getAttributesMap(arg1).remove(arg0);
+
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#setAttribute(java.lang.String, java.lang.Object)
+	 */
+	public void setAttribute(String arg0, Object arg1) {
+		setAttribute(arg0, arg1, PORTLET_SCOPE);
+
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#setAttribute(java.lang.String, java.lang.Object, int)
+	 */
+	public void setAttribute(String arg0, Object arg1, int arg2) {
+		getAttributesMap(arg2).put(arg0, arg1);
+
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.portlet.PortletSession#setMaxInactiveInterval(int)
+	 */
+	public void setMaxInactiveInterval(int arg0) {
+		maxInactive  = arg0;
+	}
+
+}

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockRenderRequest.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockRenderRequest.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-api/src/test/java/org/ajax4jsf/portlet/MockRenderRequest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -3,6 +3,7 @@
  */
 package org.ajax4jsf.portlet;
 
+import javax.portlet.PortletContext;
 import javax.portlet.RenderRequest;
 
 /**
@@ -11,4 +12,9 @@
  */
 public class MockRenderRequest extends MockPortletRequest implements
 	RenderRequest {
+
+	public MockRenderRequest(PortletContext portletContext) {
+		super(portletContext);
+		// TODO Auto-generated constructor stub
+	}
 }

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/pom.xml
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/pom.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,4 +1,6 @@
-<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">
+<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">
 	<parent>
 		<artifactId>portletbridge</artifactId>
 		<groupId>org.richfaces.extensions</groupId>
@@ -35,5 +37,44 @@
 			<classifier>tests</classifier>
 			<scope>test</scope>
 		</dependency>
+		<dependency>
+			<groupId>org.jboss.seam</groupId>
+			<artifactId>jboss-seam</artifactId>
+			<version>2.0.1.CR2</version>
+			<optional>true</optional>
+		</dependency>
+		<dependency>
+			<groupId>javax.annotation</groupId>
+			<artifactId>jsr250-api</artifactId>
+			<version>1.0</version>
+			<optional>true</optional>
+		</dependency>
+		<dependency>
+			<groupId>javax.persistence</groupId>
+			<artifactId>persistence-api</artifactId>
+			<version>1.0</version>
+			<optional>true</optional>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-commons-annotations</artifactId>
+			<version>3.3.0.ga</version>
+			<optional>true</optional>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-annotations</artifactId>
+			<version>3.2.0.ga</version>
+			<optional>true</optional>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.transaction</groupId>
+			<artifactId>jta</artifactId>
+			<version>1.0.1B</version>
+			<optional>true</optional>
+		</dependency>
+
 	</dependencies>
 </project>
\ No newline at end of file

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -5,6 +5,10 @@
 
 import java.io.PrintWriter;
 import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
 
@@ -18,6 +22,7 @@
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
 import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.faces.Bridge;
@@ -27,7 +32,10 @@
 import org.ajax4jsf.context.AjaxContext;
 import org.ajax4jsf.portlet.application.PortletStateHolder;
 import org.ajax4jsf.portlet.application.PortletViewState;
+import org.ajax4jsf.portlet.application.PortletStateHolder.WindowIDRetriver;
 import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.ajax4jsf.portlet.context.PortalActionURL;
+import org.ajax4jsf.portlet.context.PortletExternalContextImpl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -61,20 +69,21 @@
 	 * @see javax.portlet.faces.Bridge#init(javax.portlet.PortletConfig)
 	 */
 	public void init(PortletConfig config) throws PortletException {
+		this.portletConfig = config;
+		PortletContext portletContext = config.getPortletContext();
 		try {
 			if (log.isDebugEnabled()) {
 				log.debug("Start portlet initialisation for "
 						+ config.getPortletName());
 			}
-			this.portletConfig = config;
-			PortletContext portletContext = config.getPortletContext();
 			synchronized (portletContext) {
 				init();
+				PortletStateHolder.init(portletContext);
 			}
 		} catch (FacesException e) {
 			throw new PortletException("Initialization error", e);
 		}
-		exceptionHandler = createExceptionHandler(config);
+		exceptionHandler = createExceptionHandler(portletContext);
 		if (log.isDebugEnabled()) {
 			log.debug("Done portlet initialisation for "
 					+ config.getPortletName());
@@ -82,8 +91,8 @@
 		// getPortletContext().setAttribute(PORTLET_CONFIG, config);
 	}
 
-	protected ExceptionHandler createExceptionHandler(PortletConfig config) {
-		String exceptionHandlerClassName = config.getInitParameter(EXCEPTION_HANDLER_CLASS_PARAMETER);
+	protected ExceptionHandler createExceptionHandler(PortletContext portletContext) {
+		String exceptionHandlerClassName = portletContext.getInitParameter(EXCEPTION_HANDLER_CLASS_PARAMETER);
 		ExceptionHandler handler = null;
 		if(null != exceptionHandlerClassName){
 			ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
@@ -117,13 +126,18 @@
 		// Boolean.valueOf(null != windowState.getViewId()));
 		try {
 			execute(facesContext);
+			// Save view state for a render phases.
 			facesContext.getApplication().getStateManager().saveSerializedView(
 					facesContext);
 			// save request scope variables and Faces Messages.
 			if (!facesContext.getResponseComplete()) {
 				windowState.saveRequest(facesContext);
-
-			} // saveView(facesContext);
+			} else {
+				String redirectViewId = (String) facesContext.getExternalContext().getRequestMap().get(AbstractExternalContext.REDIRECT_VIEW_ID);
+				if(null != redirectViewId){
+					windowState.setViewId(redirectViewId);
+				}
+			}
 		} catch (Exception e) {
 			// TODO - handle exception.
 			log.error("Error processing execute lifecycle", e);
@@ -166,32 +180,42 @@
 			}
 			String namespace = response.getNamespace();
 			windowState.restoreRequest(facesContext, true);
-			if (null == facesContext.getViewRoot()) {
-				execute(facesContext);
+			renderResponse(facesContext, windowState);
+			// TODO - detect redirect case. Reset response, clear request variables as far as Seam state.
+			// Perform new render phase with a new ViewId.
+			String redirectViewId = (String) facesContext.getExternalContext().getRequestMap().get(AbstractExternalContext.REDIRECT_VIEW_ID);
+			if(null != redirectViewId){
+				windowState.reset();
+				windowState.setViewId(redirectViewId);
+				// release old FacesContext.
+				facesContext.release();
+				// Reset attributes to initial state
+				ArrayList initialAttributes = (ArrayList) request.getAttribute(AbstractExternalContext.EXCLUDED_PARAMETERS_ATTRIBUTE);
+				ArrayList currentAttributes = Collections.list(request.getAttributeNames());
+				currentAttributes.removeAll(initialAttributes);
+				for (Object newAttribute : currentAttributes) {
+					request.removeAttribute((String) newAttribute);
+				}
+				request.setAttribute(AbstractExternalContext.VIEW_ID_PARAMETER, redirectViewId);
+				// Create new FacesContext
+				facesContext = getFacesContext(request, response);
+				renderResponse(facesContext, windowState);
 			}
-			//
-			AjaxContext ajaxContext = AjaxContext
-					.getCurrentInstance(facesContext);
-			Map commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
+			// Set important Portal parameters to window state.
 			String actionURL = facesContext.getApplication().getViewHandler().getActionURL(facesContext, facesContext.getViewRoot().getViewId());
-			commonAjaxParameters.put(AbstractExternalContext.ACTION__PARAMETER,
-					facesContext.getExternalContext().encodeActionURL(actionURL));
-			commonAjaxParameters.put(
-					AbstractExternalContext.PORTLET_MODE_PARAMETER, request
-							.getPortletMode().toString());
-			commonAjaxParameters.put(
-					AbstractExternalContext.NAMESPACE_PARAMETER, namespace);
-			commonAjaxParameters.put(
-					AbstractExternalContext.PORTLET_NAME_PARAMETER,
-					getPortletConfig().getPortletName());
-			render(facesContext);
+			actionURL = facesContext.getExternalContext().encodeActionURL(actionURL);
+			windowState.setPortalActionURL(new PortalActionURL(actionURL));
+			PortletURL portletURL = response.createRenderURL();
+			portletURL.setParameter(PortletStateHolder.STATE_ID_PARAMETER, windowState.getStateId());
+			String renderUrl = portletURL.toString();
+			windowState.setPortalRenderURL(new PortalActionURL(renderUrl));
+			windowState.setNamespace(namespace);
 			// writer.println("</div>");
 			PortletSession portletSession = request.getPortletSession(true);
-			// Store namespace value in portlet scope session.
-			// ServletContext, in case of ajax requests,
-			// will restore session prefiv by it's value.
-			portletSession.setAttribute(
-					AbstractExternalContext.NAMESPACE_PARAMETER, namespace);
+			WindowIDRetriver idRetriver = (WindowIDRetriver) portletSession.getAttribute(PortletStateHolder.WINDOW_ID_RETRIVER);
+			if(null != idRetriver){
+				windowState.setWindowId(idRetriver.getWindowID());
+			}
 			Principal userPrincipal = request.getUserPrincipal();
 			// TODO - get user roles, defined in the portlet.xml ( ??? parse it ??? ), and store all values for a "isUserInRole(roleName)" calls
 			portletSession.setAttribute(AbstractExternalContext.PORTAL_USER_PRINCIPAL, userPrincipal, PortletSession.APPLICATION_SCOPE);
@@ -215,6 +239,26 @@
 	}
 
 	/**
+	 * @param facesContext
+	 * @param windowState
+	 * @throws FacesException
+	 */
+	private void renderResponse(FacesContext facesContext,
+			PortletViewState windowState) throws FacesException {
+		if (null == facesContext.getViewRoot()) {
+			execute(facesContext);
+			// TODO - detect redirect case.
+		}
+		//
+		AjaxContext ajaxContext = AjaxContext
+				.getCurrentInstance(facesContext);
+		Map commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
+		commonAjaxParameters.put(
+				PortletStateHolder.STATE_ID_PARAMETER, windowState.getStateId());
+		render(facesContext);
+	}
+
+	/**
 	 * @param request
 	 * @param response
 	 * @param actionPhase

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/ExceptionHandlerImpl.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/ExceptionHandlerImpl.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/ExceptionHandlerImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,34 +1,56 @@
 /**
- * 
+ *
  */
 package org.ajax4jsf.portlet;
 
+import org.ajax4jsf.portlet.application.PortletViewState;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+
 import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
 import javax.portlet.faces.BridgeException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathExpressionException;
+import java.io.IOException;
+import java.io.InputStream;
 
-import org.ajax4jsf.portlet.application.PortletViewState;
-
 /**
  * @author asmirnov
- *
+ * @author <a href="mailto:whales at redhat.com">Wesley Hales</a>
  */
-public class ExceptionHandlerImpl implements ExceptionHandler {
 
-	/* (non-Javadoc)
-	 * @see org.ajax4jsf.portlet.ExceptionHandler#processActionException(javax.faces.context.FacesContext, org.ajax4jsf.portlet.application.PortletViewState, java.lang.Exception)
-	 */
-	public void processActionException(FacesContext context,
-			PortletViewState windowState, Exception e) throws BridgeException {
-		throw new BridgeException("Error processing action lifecycle",e);
+public class ExceptionHandlerImpl implements ExceptionHandler
+{
+   protected static final Log log = LogFactory.getLog(ExceptionHandlerImpl.class);
 
-	}
 
-	/* (non-Javadoc)
-	 * @see org.ajax4jsf.portlet.ExceptionHandler#processRenderException(javax.faces.context.FacesContext, org.ajax4jsf.portlet.application.PortletViewState, java.lang.Exception)
-	 */
-	public void processRenderException(FacesContext context,
-			PortletViewState windowState, Exception e) throws BridgeException {
-		throw new BridgeException("Error processing render lifecycle",e);
-	}
+   /* (non-Javadoc)
+   * @see org.ajax4jsf.portlet.ExceptionHandler#processActionException(javax.faces.context.FacesContext, org.ajax4jsf.portlet.application.PortletViewState, java.lang.Exception)
+   */
+   public void processActionException(FacesContext context,
+                                      PortletViewState windowState, Exception e) throws BridgeException
+   {
+      throw new BridgeException("Error processing action lifecycle", e);
 
+   }
+
+   /* (non-Javadoc)
+    * @see org.ajax4jsf.portlet.ExceptionHandler#processRenderException(javax.faces.context.FacesContext, org.ajax4jsf.portlet.application.PortletViewState, java.lang.Exception)
+    */
+   public void processRenderException(FacesContext context,
+                                      PortletViewState windowState, Exception e) throws BridgeException
+   {
+      throw new BridgeException("Error processing render lifecycle", e);
+   }
+
 }

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/SeamExceptionHandlerImpl.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/SeamExceptionHandlerImpl.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/SeamExceptionHandlerImpl.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/SeamExceptionHandlerImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,143 @@
+/**
+ *
+ */
+package org.ajax4jsf.portlet;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.faces.context.FacesContext;
+import javax.portlet.faces.BridgeException;
+import javax.servlet.ServletException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.ajax4jsf.portlet.application.PortletViewState;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.seam.Seam;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.FacesLifecycle;
+import org.jboss.seam.core.ConversationPropagation;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.exception.Exceptions;
+import org.jboss.seam.transaction.Transaction;
+import org.jboss.seam.transaction.UserTransaction;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * @author asmirnov
+ * @author <a href="mailto:whales at redhat.com">Wesley Hales</a>
+ */
+
+public class SeamExceptionHandlerImpl implements ExceptionHandler
+{
+   protected static final Log log = LogFactory.getLog(SeamExceptionHandlerImpl.class);
+
+
+   /* (non-Javadoc)
+   * @see org.ajax4jsf.portlet.ExceptionHandler#processActionException(javax.faces.context.FacesContext, org.ajax4jsf.portlet.application.PortletViewState, java.lang.Exception)
+   */
+   public void processActionException(FacesContext context,
+                                      PortletViewState windowState, Exception e) throws BridgeException
+   {
+      log.error("Error processing action lifecycle", e);
+      windowState.saveBeans(context);
+      windowState.saveMessages(context);
+      handleException(context, e);
+      windowState.setViewRoot(context.getViewRoot());
+   }
+
+   /* (non-Javadoc)
+    * @see org.ajax4jsf.portlet.ExceptionHandler#processRenderException(javax.faces.context.FacesContext, org.ajax4jsf.portlet.application.PortletViewState, java.lang.Exception)
+    */
+   public void processRenderException(FacesContext context,
+                                      PortletViewState windowState, Exception e) throws BridgeException
+   {
+      log.error("Error processing render lifecycle", e);
+      handleException(context, e);
+   }
+
+
+
+   public static Class classForName(String name) throws ClassNotFoundException
+   {
+      try
+      {
+         return Thread.currentThread().getContextClassLoader().loadClass(name);
+      }
+      catch (Exception e)
+      {
+         return Class.forName(name);
+      }
+   }
+   
+   private void handleException(FacesContext facesContext, Exception e) throws BridgeException {
+	      //if the event context was cleaned up, fish the conversation id 
+	      //directly out of the ServletRequest attributes, else get it from
+	      //the event context
+	      Manager manager = Contexts.isEventContextActive() ?
+	              (Manager) Contexts.getEventContext().get(Manager.class) :
+	              null;
+	      String conversationId = manager==null ? null : manager.getCurrentConversationId();
+	      
+	      //Initialize the temporary context objects
+	      FacesLifecycle.beginExceptionRecovery( facesContext.getExternalContext() );
+	      
+	      //If there is an existing long-running conversation on
+	      //the failed request, propagate it
+	      if (conversationId==null)
+	      {
+	          Manager.instance().initializeTemporaryConversation();
+	      }
+	      else
+	      {
+	          ConversationPropagation.instance().setConversationId(conversationId);
+	          Manager.instance().restoreConversation();
+	      }
+	      
+	      //Now do the exception handling
+	      try
+	      {
+	         rollbackTransactionIfNecessary();
+	         Exceptions.instance().handle(e);
+	      }
+	      catch (Exception ehe)
+	      {
+	         throw new BridgeException(ehe);
+	      }
+	      finally
+	      {
+	         //Finally, clean up the contexts
+	         try 
+	         {
+	            FacesLifecycle.endRequest( facesContext.getExternalContext() );
+	            log.debug("done running exception handlers");
+	         }
+	         catch (Exception ere)
+	         {
+	            log.error("could not destroy contexts", ere);
+	         }
+	      }
+
+   }
+
+   protected void rollbackTransactionIfNecessary()
+   {
+      try 
+      {
+         UserTransaction transaction = Transaction.instance();
+         if ( transaction.isActiveOrMarkedRollback() || transaction.isRolledBack() )
+         {
+            log.debug("killing transaction");
+            transaction.rollback();
+         }
+      }
+      catch (Exception te)
+      {
+         log.error("could not roll back transaction", te);
+      }
+   }
+}

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -4,42 +4,68 @@
 package org.ajax4jsf.portlet.application;
 
 import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
+import java.util.UUID;
+import java.util.Map.Entry;
 
+import javax.faces.FacesException;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletSessionUtil;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
 import javax.portlet.faces.Bridge;
 import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
+import javax.portlet.faces.BridgeException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
 
 import org.ajax4jsf.portlet.AjaxFacesPortlet;
-import org.apache.commons.collections.map.LRUMap;
+import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.ajax4jsf.util.LRUMap;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * @author asmirnov
  * 
  */
-public class PortletStateHolder implements Serializable {
+public class PortletStateHolder {
 	/**
 	 * 
 	 */
 	private static final long serialVersionUID = 3040262189850562853L;
 
-	private static final String STATE_HOLDER = PortletStateHolder.class
+	public static final String STATE_HOLDER = PortletStateHolder.class
 			.getName();
 
-	private static final String[] modes = { PortletMode.VIEW.toString(),
-			PortletMode.EDIT.toString(), PortletMode.HELP.toString() };
-
 	private static final String DEFAULT = "default-";
 
+	private static final Log log = LogFactory.getLog(PortletStateHolder.class);
+
 	private PortletMode lastMode = PortletMode.VIEW;
 
+	public static final String WINDOW_ID_RETRIVER = "org.ajax4jsf.portlet.WINDOW_ID_RETRIVER";
+
+	public static final String STATE_ID_PARAMETER = "javax.faces.portlet.STATE_ID";
+
+	private static final int DEFAULT_MAX_MANAGED_SCOPES = 1000;
+
 	/**
 	 * View states for a different portlet modes, Views and serial numbers.
 	 */
-	private Map states = new LRUMap();
+	private Map<String, PortletViewState> states;
 
 	/**
 	 * Private constructor - instance must be stored in the session, and created
@@ -47,9 +73,27 @@
 	 * 
 	 * @param context
 	 */
-	private PortletStateHolder() {
+	private PortletStateHolder(int max) {
+		states = new LRUMap<String, PortletViewState>(max);
 	}
 
+	public static void init(PortletContext context) {
+		synchronized (context) {
+			PortletStateHolder stateHolder = (PortletStateHolder) context
+					.getAttribute(STATE_HOLDER);
+			if (null == stateHolder) {
+				int maxScopes = DEFAULT_MAX_MANAGED_SCOPES;
+				String maxScopesParameter = context
+						.getInitParameter(Bridge.MAX_MANAGED_REQUEST_SCOPES);
+				if (null != maxScopesParameter) {
+					maxScopes = Integer.parseInt(maxScopesParameter);
+				}
+				context.setAttribute(STATE_HOLDER, new PortletStateHolder(
+						maxScopes));
+			}
+		}
+	}
+
 	/**
 	 * Get instance of portlet states, stored in the session. If no previsious
 	 * instance in session, create default value.
@@ -59,23 +103,12 @@
 	 */
 	public static PortletStateHolder getInstance(FacesContext context) {
 		ExternalContext externalContext = context.getExternalContext();
-		Object session = externalContext.getSession(true);
-		Map sessionMap = externalContext.getSessionMap();
-		PortletStateHolder instance = null;
-		synchronized (session) {
-			instance = (PortletStateHolder) sessionMap.get(STATE_HOLDER);
-			if (null == instance) {
-				// Create and store in session new state holder.
-				instance = new PortletStateHolder();
-				Object request = externalContext.getRequest();
-				if (request instanceof PortletRequest) {
-					PortletRequest portletRequest = (PortletRequest) request;
-					instance.setLastMode(portletRequest.getPortletMode());
-				}
-				sessionMap.put(STATE_HOLDER, instance);
-			}
+		PortletStateHolder stateHolder = (PortletStateHolder) externalContext
+				.getApplicationMap().get(STATE_HOLDER);
+		if (null == stateHolder) {
+			throw new BridgeException("Jsf portlet bridge not initialised");
 		}
-		return instance;
+		return stateHolder;
 	}
 
 	/**
@@ -97,10 +130,12 @@
 		// If none of above happen, try to get default viewId for a current
 		// mode.
 		if (null == viewId) {
-			viewId = (String) context.getExternalContext().getRequestMap().get(Bridge.DEFAULT_VIEWID);
+			viewId = (String) context.getExternalContext().getRequestMap().get(
+					Bridge.DEFAULT_VIEWID);
 		}
 		if (null == viewId) {
-			throw new BridgeDefaultViewNotSpecifiedException("could'n determine portlet view id");
+			throw new BridgeDefaultViewNotSpecifiedException(
+					"could'n determine portlet view id");
 		}
 		return viewId;
 	}
@@ -112,102 +147,187 @@
 	 * @return
 	 */
 	public PortletViewState getWindowState(FacesContext context) {
-		PortletMode portletMode = AjaxFacesPortlet.getPortletMode(context);
-		if (null == portletMode) {
-			portletMode = lastMode;
+		String stateId = getStateId(context);
+		PortletViewState state;
+		synchronized (states) {
+			state = getWindowState(stateId);
+			if (null == state) {
+				state = new PortletViewState(stateId);
+				states.put(stateId, state);
+			}
 		}
-		StateKey windowKey = new StateKey(portletMode);
-		PortletViewState state = (PortletViewState) states.get(windowKey);
-		if (null == state) {
-			state = new PortletViewState();
-			states.put(windowKey, state);
-		}
 		return state;
 	}
 
 	/**
+	 * @param stateId
+	 * @return
+	 */
+	public PortletViewState getWindowState(String stateId) {
+		PortletViewState state;
+			state = (PortletViewState) states.get(stateId);
+		return state;
+	}
+
+	private void removeSessionStates(String scoprId) {
+		synchronized (states) {
+			// Iterate over copy of the keys, so LinkedHashSet do not support concurrent modifications.
+			for (Iterator<String> keysIterator = states.keySet().iterator();keysIterator.hasNext();) {
+				String key = keysIterator.next();
+				if (key.startsWith(scoprId)) {
+					keysIterator.remove();
+				}
+			}
+
+		}
+	}
+
+	public String getStateId(FacesContext context) {
+		ExternalContext externalContext = context.getExternalContext();
+		Object request = externalContext.getRequest();
+		String stateId;
+		if (request instanceof HttpServletRequest) {
+			HttpServletRequest servletRequest = (HttpServletRequest) request;
+			stateId = servletRequest.getParameter(STATE_ID_PARAMETER);
+			if (null == stateId) {
+				throw new FacesException("No portlet stateId parameter for AJAX request");
+			}
+		} else if (request instanceof PortletRequest) {
+			PortletRequest portletRequest = (PortletRequest) request;
+			PortletSession portletSession = portletRequest
+					.getPortletSession(true);
+			PortletConfig portletConfig = (PortletConfig) portletRequest
+					.getAttribute(AbstractExternalContext.PORTLET_CONFIG_ATTRIBUTE);
+			if (null == portletConfig) {
+				throw new FacesException();
+			}
+			String scopeId = portletConfig.getPortletName()
+					+ portletSession.getId();
+			String portletModeName = portletRequest.getPortletMode().toString();
+			if (request instanceof RenderRequest) {
+				RenderRequest renderRequest = (RenderRequest) request;
+				stateId = renderRequest.getParameter(STATE_ID_PARAMETER);
+				if (null == stateId) {
+					RenderResponse response = (RenderResponse) externalContext
+							.getResponse();
+					stateId = scopeId + portletModeName
+							+ response.getNamespace();
+				}
+			} else if (request instanceof ActionRequest) {
+				ActionRequest actionRequest = (ActionRequest) request;
+				stateId = (String) actionRequest
+						.getAttribute(STATE_ID_PARAMETER);
+				if (null == stateId) {
+
+					UUID uuid = UUID.randomUUID();
+					stateId = scopeId
+							+ portletModeName
+							+ uuid.toString();
+					actionRequest.setAttribute(STATE_ID_PARAMETER, stateId);
+					ActionResponse response = (ActionResponse) externalContext
+							.getResponse();
+					response.setRenderParameter(STATE_ID_PARAMETER, stateId);
+				}
+			} else {
+				throw new FacesException();
+			}
+			WindowIDRetriver idRetriver = (WindowIDRetriver) portletSession
+					.getAttribute(WINDOW_ID_RETRIVER);
+			if (null == idRetriver) {
+				idRetriver = new WindowIDRetriver(scopeId);
+				portletSession.setAttribute(WINDOW_ID_RETRIVER, idRetriver);
+			}
+		} else {
+			throw new FacesException();
+		}
+		return stateId;
+	}
+
+	/**
+	 * @return the lastMode
+	 */
+	public PortletMode getLastMode() {
+		return lastMode;
+	}
+
+	/**
+	 * @param lastMode
+	 *            the lastMode to set
+	 */
+	public void setLastMode(PortletMode lastMode) {
+		this.lastMode = lastMode;
+	}
+
+	/**
+	 * Based on the Julien Viet idea.
+	 * 
 	 * @author asmirnov
 	 * 
 	 */
-	private static class StateKey implements Serializable {
-		/**
-		 * 
-		 */
-		private static final long serialVersionUID = -1490104706512592990L;
+	public final class WindowIDRetriver implements HttpSessionBindingListener {
 
-		private PortletMode mode;
+		public static final String PORTLET_SCOPE_PREFIX = "javax.portlet.p.";
 
-		private String namespace;
-		
-		
+		private final String scopeId;
 
-		public StateKey(PortletMode mode) {
-			super();
-			this.mode = mode;
-		}
+		private String windowID;
 
 		/**
-		 * @param mode
-		 * @param namespace
+		 * @param scopeId
 		 */
-		public StateKey(PortletMode mode, String namespace) {
-			this.mode = mode;
-			this.namespace = namespace;
+		private WindowIDRetriver(String scopeId) {
+			this.scopeId = scopeId;
 		}
 
 		/*
 		 * (non-Javadoc)
 		 * 
-		 * @see java.lang.Object#hashCode()
+		 * @see javax.servlet.http.HttpSessionBindingListener#valueBound(javax.servlet.http.HttpSessionBindingEvent)
 		 */
-		public int hashCode() {
-			final int PRIME = 31;
-			int result = 1;
-			result = PRIME * result + ((mode == null) ? 0 : mode.hashCode());
-			result = PRIME * result
-					+ ((namespace == null) ? 0 : namespace.hashCode());
-			return result;
+		public void valueBound(HttpSessionBindingEvent event) {
+			String name = event.getName();
+			if (null == name || 0 == name.length()) {
+				throw new FacesException(
+						"WindowIDRetriver bind to session without name");
+			}
+			if (PortletSession.PORTLET_SCOPE != PortletSessionUtil
+					.decodeScope(name)) {
+				throw new FacesException(
+						"WindowIDRetriver bind to APPLICATION_SCOPE. PORTLET_SCOPE is required");
+			}
+			windowID = name.substring(PORTLET_SCOPE_PREFIX.length(), name
+					.indexOf('?'));
+			if (log.isDebugEnabled()) {
+				log
+						.debug("WindowIDRetriver have been bind to session for a portlet window "
+								+ windowID);
+			}
+
 		}
 
 		/*
 		 * (non-Javadoc)
 		 * 
-		 * @see java.lang.Object#equals(java.lang.Object)
+		 * @see javax.servlet.http.HttpSessionBindingListener#valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
 		 */
-		public boolean equals(Object obj) {
-			if (this == obj)
-				return true;
-			if (obj == null)
-				return false;
-			if (getClass() != obj.getClass())
-				return false;
-			final StateKey other = (StateKey) obj;
-			if (mode == null) {
-				if (other.mode != null)
-					return false;
-			} else if (!mode.equals(other.mode))
-				return false;
-			if (namespace == null) {
-				if (other.namespace != null)
-					return false;
-			} else if (!namespace.equals(other.namespace))
-				return false;
-			return true;
+		public void valueUnbound(HttpSessionBindingEvent event) {
+			removeSessionStates(scopeId);
 		}
 
-	}
+		/**
+		 * @return the windowID
+		 */
+		public String getWindowID() {
+			return windowID;
+		}
 
-	/**
-	 * @return the lastMode
-	 */
-	public PortletMode getLastMode() {
-		return lastMode;
+		/**
+		 * @return the scopeId
+		 */
+		public String getScopeId() {
+			return scopeId;
+		}
+
 	}
 
-	/**
-	 * @param lastMode the lastMode to set
-	 */
-	public void setLastMode(PortletMode lastMode) {
-		this.lastMode = lastMode;
-	}
 }

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -82,17 +82,18 @@
 	  public void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException,
 	                                                                       FacesException
 	  {
-	    // Get the renderPolicy from the requestScope
-	    Bridge.BridgeRenderPolicy renderPolicy = (Bridge.BridgeRenderPolicy) context
-	                                                                                .getExternalContext()
-	                                                                                .getRequestMap()
-	                                                                                .get(
-	                                                                                     AbstractExternalContext.RENDER_POLICY_ATTRIBUTE);
+	    // Get the renderPolicy from the init parameters
+		  String renderPolicyParam = context
+          .getExternalContext()
+          .getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX+Bridge.RENDER_POLICY);
 
-	    if (renderPolicy == null)
+	    Bridge.BridgeRenderPolicy renderPolicy ;
+ 	    if (renderPolicyParam == null)
 	    {
-	      renderPolicy = Bridge.BridgeRenderPolicy.valueOf("DEFAULT");
-	    }
+	      renderPolicy = Bridge.BridgeRenderPolicy.DEFAULT;
+	    } else {
+		  renderPolicy = Bridge.BridgeRenderPolicy.valueOf(renderPolicyParam);
+		}
 
 	    if (context.getExternalContext().getContext() instanceof ServletContext
 	        || renderPolicy == Bridge.BridgeRenderPolicy.ALWAYS_DELEGATE)

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -12,6 +12,7 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
+import javax.faces.application.Application;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.ExternalContext;
@@ -22,6 +23,7 @@
 
 import org.ajax4jsf.context.AjaxContext;
 import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.ajax4jsf.portlet.context.PortalActionURL;
 
 /**
  * @author asmirnov
@@ -73,9 +75,48 @@
 
 	private String viewId;
 
-	private Map<String, String[]> _requestParameters;
+	private Map<String, String[]> requestParameters;
+	
+	private String namespace;
+	
+	private PortalActionURL portalActionURL;
+	
+	private PortalActionURL portalRenderURL;
 
+	private final String stateId;
+	
+	private String windowId;
+
 	/**
+	 * @param stateId
+	 */
+	public PortletViewState(String stateId) {
+		this.stateId = stateId;
+	}
+
+	/**
+	 * @return the windowId
+	 */
+	public String getWindowId() {
+		return windowId;
+	}
+
+	/**
+	 * @param windowId the windowId to set
+	 */
+	public void setWindowId(String windowId) {
+		this.windowId = windowId;
+	}
+
+
+	/**
+	 * @return the stateId
+	 */
+	public String getStateId() {
+		return stateId;
+	}
+
+	/**
 	 * @return the viewId
 	 */
 	public String getViewId() {
@@ -245,15 +286,32 @@
 				beans.put(attributeName, entry.getValue());
 			}
 		}
-		_requestParameters = new HashMap<String, String[]>(facesContext
+		requestParameters = new HashMap<String, String[]>(facesContext
 				.getExternalContext().getRequestParameterValuesMap());
+		saveSeamConversationId(facesContext);
+	}
+
+	/**
+	 * @param facesContext
+	 */
+	public void saveSeamConversationId(FacesContext facesContext) {
 		// Seam hack - save conversation Id for a request parameter.
 		try {
-			Object conversationId = facesContext.getApplication()
-					.evaluateExpressionGet(facesContext, "#{conversation.id}",
-							Object.class);
-			if(null != conversationId){
-				_requestParameters.put("conversationId", new String[]{conversationId.toString()});
+			Application application = facesContext.getApplication();
+			Object isLongRunningConversation = application
+			.evaluateExpressionGet(facesContext, "#{conversation.longRunning}",
+					Boolean.class);
+			if (Boolean.TRUE.equals(isLongRunningConversation)) {
+				Object conversationId = application.evaluateExpressionGet(
+						facesContext, "#{conversation.id}", Object.class);
+				if (null != conversationId) {
+					requestParameters.put(
+							AbstractExternalContext.CONVERSATION_ID_PARAMETER,
+							new String[] { conversationId.toString() });
+				}
+
+			} else {
+				requestParameters.remove(AbstractExternalContext.CONVERSATION_ID_PARAMETER);
 			}
 		} catch (Exception e) {
 			// Do nothing - no seam conversation found !
@@ -266,7 +324,9 @@
 		if (null != beans) {
 			requestMap.putAll(beans);
 		}
-		requestMap.put(REQUEST_PARAMETERS_ATTRIBUTE, _requestParameters);
+		if (null != requestParameters) {
+			requestMap.put(REQUEST_PARAMETERS_ATTRIBUTE, requestParameters);
+		}
 	}
 
 	public void restoreRequest(FacesContext facesContext, boolean b) {
@@ -309,4 +369,58 @@
 		saveMessages(facesContext);
 	}
 
+	/**
+	 * @return the namespace
+	 */
+	public String getNamespace() {
+		return namespace;
+	}
+
+	/**
+	 * @param namespace the namespace to set
+	 */
+	public void setNamespace(String namespace) {
+		this.namespace = namespace;
+	}
+
+	/**
+	 * @return the portalActionURL
+	 */
+	public PortalActionURL getPortalActionURL() {
+		return portalActionURL;
+	}
+
+	/**
+	 * @param portalActionURL the portalActionURL to set
+	 */
+	public void setPortalActionURL(PortalActionURL actionURL) {
+		this.portalActionURL = actionURL;
+	}
+
+	/**
+	 * @return the portalRenderURL
+	 */
+	public PortalActionURL getPortalRenderURL() {
+		return portalRenderURL;
+	}
+
+	/**
+	 * @param portalRenderURL the portalRenderURL to set
+	 */
+	public void setPortalRenderURL(PortalActionURL portalURL) {
+		this.portalRenderURL = portalURL;
+	}
+
+	public void reset() {
+		this.requestParameters=null;
+		this.beans = null;
+		this.componentsState = null;
+		this.messages = null;
+		this.portalActionURL=null;
+		this.portalRenderURL=null;
+		this.treeStructure=null;
+		this.viewRoot=null;
+		this.viewId=null;
+	}
+
 }

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -135,6 +135,8 @@
 	private Object context;
 	
 	private boolean hasNavigationRedirect = false;
+	public static final Object REDIRECT_VIEW_ID = "javax.faces.portlet.REDIRECT_VIEW_ID";
+	public static final String CONVERSATION_ID_PARAMETER = "conversationId";
 
 	/**
 	 * @return the hasNavigationRedirect
@@ -533,4 +535,20 @@
 	}
 
 	protected abstract String encodeURL(String actionUrl);
+
+	public String encodeResourceURL(String url) {
+		try {
+			PortalActionURL portalUrl = new PortalActionURL(url);
+			boolean inContext = portalUrl
+					.isInContext(getRequestContextPath());
+			// For resources in the portlet application context add namespace as URL parameter, to restore portlet session.
+			if (inContext) {
+				portalUrl.addParameter(NAMESPACE_PARAMETER, getNamespace());
+				url=portalUrl.toString();
+			}
+		} catch (MalformedURLException e) {
+			throw new FacesException(e);
+		}
+		return encodeURL(url);
+	}
 }
\ No newline at end of file

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -92,7 +92,7 @@
 	 * Hold <code>FacesContextFactory</code> from default implementation.
 	 * 
 	 */
-	// private FacesContextFactory defaultFacesContextFactory;
+	private FacesContextFactory defaultFacesContextFactory;
 	private static final Log _log = LogFactory
 			.getLog(FacesContextFactoryImpl.class);
 
@@ -105,11 +105,11 @@
 	 * Factory from JSF implementation.
 	 * 
 	 */
-	public FacesContextFactoryImpl(/* FacesContextFactory defaultFactory */) {
+	public FacesContextFactoryImpl(FacesContextFactory defaultFactory) {
 		super();
-		// if (this.defaultFacesContextFactory == null) {
-		// this.defaultFacesContextFactory = defaultFactory;
-		// }
+		 if (this.defaultFacesContextFactory == null) {
+		 this.defaultFacesContextFactory = defaultFactory;
+		 }
 		if (_log.isDebugEnabled()) {
 			_log.debug("Portal - specific FacesContextFactory has initialised");
 		}
@@ -137,7 +137,7 @@
 		if ((context instanceof PortletContext)
 				&& (request instanceof ActionRequest)
 				&& (response instanceof ActionResponse)) {
-			externalContext = new PortletContextImpl((PortletContext) context,
+			externalContext = new PortletExternalContextImpl((PortletContext) context,
 					(PortletRequest) request, (PortletResponse) response);
 			if (_log.isDebugEnabled()) {
 				_log
@@ -146,7 +146,7 @@
 		} else if ((context instanceof PortletContext)
 				&& (request instanceof RenderRequest)
 				&& (response instanceof RenderResponse)) {
-			externalContext = new PortletRenderContextImpl((PortletContext) context,
+			externalContext = new RenderPortletExternalContextImpl((PortletContext) context,
 					(PortletRequest) request, (PortletResponse) response);
 			if (_log.isDebugEnabled()) {
 				_log
@@ -155,7 +155,8 @@
 		} else if ((context instanceof ServletContext)
 				&& (request instanceof HttpServletRequest)
 				&& (response instanceof HttpServletResponse)) {
-			externalContext = new ServletContextImpl((ServletContext) context,
+			// TODO - if request don't contain namespace parameter, create default context instance.
+			externalContext = new ServletExternalContextImpl((ServletContext) context,
 					(HttpServletRequest) request,
 					(HttpServletResponse) response);
 			if (_log.isDebugEnabled()) {

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -377,11 +377,11 @@
 
 	public void responseComplete() {
 		checkReleased();
-		if (externalContext.isHasNavigationRedirect()) {
-			this.renderResponse = true;
-		} else {
-			this.responseComplete = true;
-		}
+//		if (externalContext.isHasNavigationRedirect()) {
+//			this.renderResponse = true;
+//		} else {
+		this.responseComplete = true;
+//		}
 	}
 
 	private void checkReleased() {

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -7,6 +7,7 @@
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.regex.Matcher;
@@ -71,7 +72,7 @@
 		}
 		this.path = urlMatcher.group(5);
 		queryString = urlMatcher.group(7);
-		parameters = new LinkedMap(30);
+		parameters = new LinkedHashMap<String, String>(30);
 		if (null != queryString) {
 			String[] queryParams = queryString.split("&");
 			for (int i = 0; i < queryParams.length; i++) {
@@ -87,6 +88,24 @@
 	}
 
 	/**
+	 * Clone constructor
+	 * @param src
+	 */
+	public PortalActionURL(PortalActionURL src){
+		if(null == src){
+			throw new NullPointerException("Source URL is null");
+		}
+		this._length = src._length;
+		this.protocol = src.protocol;
+		this.host = src.host;
+		this.port = src.port;
+		this.path = src.path;
+		this.queryString = src.queryString;
+		this.parameters = new LinkedHashMap<String, String>(src.parameters);
+		this.authority = src.authority;
+		this.userInfo = src.userInfo;
+	}
+	/**
 	 * @return the protocol
 	 */
 	public String getProtocol() {

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,365 +0,0 @@
-/**
- * 
- */
-package org.ajax4jsf.portlet.context;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import javax.faces.application.ViewHandler;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.context.FacesContextFactory;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletURL;
-import javax.portlet.faces.Bridge;
-
-import org.ajax4jsf.webapp.WebXml;
-
-/**
- * Version of the {@link ExternalContext} for a Portlet request.
- * {@link FacesContextFactory} will create instance of this class for a portal
- * <code>action</code> phase.
- * 
- * @author asmirnov
- * 
- */
-public class PortletContextImpl extends AbstractExternalContext {
-
-	public static final String ACTION_URL_DO_NOTHITG = "/ajax4jsfPortletBridge/actionUrl/do/nothitg";
-	private String namespace;
-
-	public PortletContextImpl(PortletContext context, PortletRequest request,
-			PortletResponse response) {
-		super(context, request, response);
-		WebXml webXml = (WebXml) context.getAttribute(WebXml.CONTEXT_ATTRIBUTE);
-		if (null != webXml) {
-			_servletPath = webXml.getFacesServletPrefix();
-		}
-		ArrayList excludedAttributes = Collections.list(request
-				.getAttributeNames());
-		request.setAttribute(EXCLUDED_PARAMETERS_ATTRIBUTE, excludedAttributes);
-	}
-
-	public void setResponseCharacterEncoding(String encoding) {
-		// Do nothing
-	}
-
-	public String getResponseCharacterEncoding() {
-		return null;
-	}
-
-	public String getResponseContentType() {
-		return null;
-	}
-
-	public void setRequestCharacterEncoding(String encoding)
-			throws UnsupportedEncodingException {
-		try {
-			ActionRequest actionRequest = (ActionRequest) getPortletRequest();
-			actionRequest.setCharacterEncoding(encoding);
-		} catch (IllegalStateException e) {
-			// TODO: handle exception
-		}
-	}
-
-	public String getRequestCharacterEncoding() {
-		ActionRequest actionRequest = (ActionRequest) getPortletRequest();
-		return actionRequest.getCharacterEncoding();
-	}
-
-	public String getRequestContentType() {
-		return null;
-	}
-
-	protected PortletContext getPortletContext() {
-		return (PortletContext) getContext();
-	}
-
-	protected PortletRequest getPortletRequest() {
-		return (PortletRequest) getRequest();
-	}
-
-	protected PortletResponse getPortletResponse() {
-		return (PortletResponse) getResponse();
-	}
-
-	public String getInitParameter(String name) {
-		return getPortletContext().getInitParameter(name);
-	}
-
-	protected String getNamespace() {
-		if (null == namespace) {
-			namespace = (String) getRequestParameter(AbstractExternalContext.NAMESPACE_PARAMETER);
-			if (null == namespace) {
-				throw new IllegalStateException(
-						"Can not determine portlet namespace");
-			}
-		}
-		return namespace;
-	}
-
-	public URL getResource(String path) throws MalformedURLException {
-		return getPortletContext().getResource(path);
-	}
-
-	public InputStream getResourceAsStream(String path) {
-		return getPortletContext().getResourceAsStream(path);
-	}
-
-	public Set getResourcePaths(String path) {
-		return getPortletContext().getResourcePaths(path);
-	}
-
-	protected Enumeration enumerateRequestParameterNames() {
-		return getPortletRequest().getParameterNames();
-	}
-
-	protected Object getContextAttribute(String name) {
-		return getPortletContext().getAttribute(name);
-	}
-
-	protected Enumeration getContextAttributeNames() {
-		return getPortletContext().getAttributeNames();
-	}
-
-	protected Enumeration getInitParametersNames() {
-		return getPortletContext().getInitParameterNames();
-	}
-
-	protected Object getRequestAttribute(String name) {
-		return getPortletRequest().getAttribute(name);
-	}
-
-	protected Enumeration getRequestAttributeNames() {
-		return getPortletRequest().getAttributeNames();
-	}
-
-	public Map getRequestParameterValuesMap() {
-		return getPortletRequest().getParameterMap();
-	}
-
-	protected Object getRequestParameterValues(String name) {
-		return getPortletRequest().getParameterValues(name);
-	}
-
-	protected Object getRequestHeader(String name) {
-		return getPortletRequest().getProperty(name);
-	}
-
-	protected Enumeration getRequestHeaderNames() {
-		return getPortletRequest().getPropertyNames();
-	}
-
-	protected String[] getRequestHeaderValues(String name) {
-		Enumeration properties = getPortletRequest().getProperties(name);
-		List values = new ArrayList();
-		while (properties.hasMoreElements()) {
-			Object value = (Object) properties.nextElement();
-			values.add(value);
-		}
-		return (String[]) values.toArray(EMPTY_STRING_ARRAY);
-	}
-
-	protected Object getRequestParameter(String name) {
-		return getPortletRequest().getParameter(name);
-	}
-
-	protected Object getSessionAttribute(String name) {
-		return getPortletRequest().getPortletSession(true).getAttribute(name,
-				PortletSession.PORTLET_SCOPE);
-	}
-
-	protected Enumeration getSessionAttributeNames() {
-		return getPortletRequest().getPortletSession(true).getAttributeNames(
-				PortletSession.PORTLET_SCOPE);
-	}
-
-	protected void removeContextAttribute(String name) {
-		getPortletContext().removeAttribute(name);
-	}
-
-	protected void removeRequestAttribute(String name) {
-		getPortletRequest().removeAttribute(name);
-	}
-
-	protected void removeSessionAttribute(String name) {
-		getPortletRequest().getPortletSession(true).removeAttribute(name,
-				PortletSession.PORTLET_SCOPE);
-	}
-
-	protected void setContextAttribute(String name, Object value) {
-		getPortletContext().setAttribute(name, value);
-	}
-
-	protected void setRequestAttribute(String name, Object value) {
-		getPortletRequest().setAttribute(name, value);
-	}
-
-	protected void setSessionAttribute(String name, Object value) {
-		getPortletRequest().getPortletSession(true).setAttribute(name, value,
-				PortletSession.PORTLET_SCOPE);
-	}
-
-	public void dispatch(String path) throws IOException {
-		if (null == path) {
-			throw new NullPointerException("Path to new view is null");
-		}
-		throw new IllegalStateException(
-				"Dispatch to new view not at render phase");
-	}
-
-	private static final Pattern absoluteUrl = Pattern.compile("");
-	private static final Pattern directLink = Pattern.compile("");
-	private static final Pattern viewIdParam = Pattern.compile("");
-
-	/**
-	 * @param parameters
-	 * @return
-	 */
-	@Override
-	protected String createActionUrl(Map<String, String> parameters) {
-		String dummyActionURL = getRequestContextPath() + ACTION_URL_DO_NOTHITG;
-		try {
-			PortalActionURL actionUrl = new PortalActionURL(dummyActionURL);
-			for (Iterator<Map.Entry<String, String>> param = parameters
-					.entrySet().iterator(); param.hasNext();) {
-				Map.Entry<String, String> parameter = param.next();
-				actionUrl
-						.addParameter(parameter.getKey(), parameter.getValue());
-			}
-			return actionUrl.toString();
-		} catch (MalformedURLException e) {
-
-		}
-		return dummyActionURL;
-	}
-
-	public String encodeResourceURL(String url) {
-		return encodeURL(url);
-	}
-
-	/**
-	 * @param url
-	 * @return
-	 */
-	protected String encodeURL(String url) {
-		return getPortletResponse().encodeURL(url);
-	}
-
-	public String getAuthType() {
-		return getPortletRequest().getAuthType();
-	}
-
-	public String getRemoteUser() {
-		return getPortletRequest().getRemoteUser();
-	}
-
-	public String getRequestContextPath() {
-		return getPortletRequest().getContextPath();
-	}
-
-	public Locale getRequestLocale() {
-		return getPortletRequest().getLocale();
-	}
-
-	public Iterator getRequestLocales() {
-		return new EnumerationIterator(getPortletRequest().getLocales());
-	}
-
-	private String _pathInfo = null;
-
-	public String getRequestPathInfo() {
-		String pathInfo = (String) getRequestParameter(VIEW_ID_PARAMETER);
-		if (null == pathInfo) {
-			pathInfo = (String) getRequestAttribute(VIEW_ID_PARAMETER);
-		}
-		return pathInfo;
-	}
-
-	private String _servletPath = null;
-
-	public String getRequestServletPath() {
-		return _servletPath;
-	}
-
-	public Object getSession(boolean create) {
-		return getPortletRequest().getPortletSession();
-	}
-
-	public Principal getUserPrincipal() {
-		return getPortletRequest().getUserPrincipal();
-	}
-
-	public boolean isUserInRole(String role) {
-		return getPortletRequest().isUserInRole(role);
-	}
-
-	public void log(String message) {
-		getPortletContext().log(message);
-	}
-
-	public void log(String message, Throwable exception) {
-		getPortletContext().log(message, exception);
-	}
-
-	public void redirect(String url) throws IOException {
-		if (null == url || url.length() < 0) {
-			throw new NullPointerException("Path to redirect is null");
-		}
-		PortalActionURL actionURL = new PortalActionURL(url);
-		if (url.startsWith("#")
-				|| (!actionURL.isInContext(getRequestContextPath()))
-				|| "true".equalsIgnoreCase(actionURL
-						.getParameter(Bridge.DIRECT_LINK))) {
-			((ActionResponse) getResponse()).sendRedirect(url);
-		} else {
-			internalRedirect(actionURL);
-		}
-	}
-
-	/**
-	 * @param actionURL
-	 */
-	protected void internalRedirect(PortalActionURL actionURL) {
-		// Detect ViewId from URL and create new view for them.
-		String viewId = actionURL.getParameter(VIEW_ID_PARAMETER);
-		if (null != viewId) {
-			try {
-				viewId = URLDecoder.decode(viewId, "UTF8");
-				FacesContext facesContext = FacesContext.getCurrentInstance();
-				ViewHandler viewHandler = facesContext.getApplication()
-						.getViewHandler();
-				facesContext.setViewRoot(viewHandler.createView(facesContext,
-						viewId));
-				setHasNavigationRedirect(true);
-			} catch (UnsupportedEncodingException e) {
-				// Do nothing - UTF-8 encoding is a default.
-			}
-		}
-	}
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,362 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet.context;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import javax.faces.application.ViewHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.faces.Bridge;
+
+import org.ajax4jsf.webapp.WebXml;
+
+/**
+ * Version of the {@link ExternalContext} for a Portlet request.
+ * {@link FacesContextFactory} will create instance of this class for a portal
+ * <code>action</code> phase.
+ * 
+ * @author asmirnov
+ * 
+ */
+public class PortletExternalContextImpl extends AbstractExternalContext {
+
+	public static final String ACTION_URL_DO_NOTHITG = "/ajax4jsfPortletBridge/actionUrl/do/nothitg";
+	private String namespace;
+
+	public PortletExternalContextImpl(PortletContext context, PortletRequest request,
+			PortletResponse response) {
+		super(context, request, response);
+		WebXml webXml = (WebXml) context.getAttribute(WebXml.CONTEXT_ATTRIBUTE);
+		if (null != webXml) {
+			_servletPath = webXml.getFacesServletPrefix();
+		}
+		List excludedAttributes = Collections.list(request
+				.getAttributeNames());
+		request.setAttribute(EXCLUDED_PARAMETERS_ATTRIBUTE, excludedAttributes);
+	}
+
+	public void setResponseCharacterEncoding(String encoding) {
+		// Do nothing
+	}
+
+	public String getResponseCharacterEncoding() {
+		return null;
+	}
+
+	public String getResponseContentType() {
+		return null;
+	}
+
+	public void setRequestCharacterEncoding(String encoding)
+			throws UnsupportedEncodingException {
+		try {
+			ActionRequest actionRequest = (ActionRequest) getPortletRequest();
+			actionRequest.setCharacterEncoding(encoding);
+		} catch (IllegalStateException e) {
+			// TODO: handle exception
+		}
+	}
+
+	public String getRequestCharacterEncoding() {
+		ActionRequest actionRequest = (ActionRequest) getPortletRequest();
+		return actionRequest.getCharacterEncoding();
+	}
+
+	public String getRequestContentType() {
+		return null;
+	}
+
+	protected PortletContext getPortletContext() {
+		return (PortletContext) getContext();
+	}
+
+	protected PortletRequest getPortletRequest() {
+		return (PortletRequest) getRequest();
+	}
+
+	protected PortletResponse getPortletResponse() {
+		return (PortletResponse) getResponse();
+	}
+
+	public String getInitParameter(String name) {
+		return getPortletContext().getInitParameter(name);
+	}
+
+	protected String getNamespace() {
+		if (null == namespace) {
+			namespace = (String) getRequestParameter(AbstractExternalContext.NAMESPACE_PARAMETER);
+			if (null == namespace) {
+				throw new IllegalStateException(
+						"Can not determine portlet namespace");
+			}
+		}
+		return namespace;
+	}
+
+	public URL getResource(String path) throws MalformedURLException {
+		return getPortletContext().getResource(path);
+	}
+
+	public InputStream getResourceAsStream(String path) {
+		return getPortletContext().getResourceAsStream(path);
+	}
+
+	public Set getResourcePaths(String path) {
+		return getPortletContext().getResourcePaths(path);
+	}
+
+	protected Enumeration enumerateRequestParameterNames() {
+		return getPortletRequest().getParameterNames();
+	}
+
+	protected Object getContextAttribute(String name) {
+		return getPortletContext().getAttribute(name);
+	}
+
+	protected Enumeration getContextAttributeNames() {
+		return getPortletContext().getAttributeNames();
+	}
+
+	protected Enumeration getInitParametersNames() {
+		return getPortletContext().getInitParameterNames();
+	}
+
+	protected Object getRequestAttribute(String name) {
+		return getPortletRequest().getAttribute(name);
+	}
+
+	protected Enumeration getRequestAttributeNames() {
+		return getPortletRequest().getAttributeNames();
+	}
+
+	public Map getRequestParameterValuesMap() {
+		return getPortletRequest().getParameterMap();
+	}
+
+	protected Object getRequestParameterValues(String name) {
+		return getPortletRequest().getParameterValues(name);
+	}
+
+	protected Object getRequestHeader(String name) {
+		return getPortletRequest().getProperty(name);
+	}
+
+	protected Enumeration getRequestHeaderNames() {
+		return getPortletRequest().getPropertyNames();
+	}
+
+	protected String[] getRequestHeaderValues(String name) {
+		Enumeration properties = getPortletRequest().getProperties(name);
+		List values = new ArrayList();
+		while (properties.hasMoreElements()) {
+			Object value = (Object) properties.nextElement();
+			values.add(value);
+		}
+		return (String[]) values.toArray(EMPTY_STRING_ARRAY);
+	}
+
+	protected Object getRequestParameter(String name) {
+		return getPortletRequest().getParameter(name);
+	}
+
+	protected Object getSessionAttribute(String name) {
+		return getPortletRequest().getPortletSession(true).getAttribute(name,
+				PortletSession.PORTLET_SCOPE);
+	}
+
+	protected Enumeration getSessionAttributeNames() {
+		return getPortletRequest().getPortletSession(true).getAttributeNames(
+				PortletSession.PORTLET_SCOPE);
+	}
+
+	protected void removeContextAttribute(String name) {
+		getPortletContext().removeAttribute(name);
+	}
+
+	protected void removeRequestAttribute(String name) {
+		getPortletRequest().removeAttribute(name);
+	}
+
+	protected void removeSessionAttribute(String name) {
+		getPortletRequest().getPortletSession(true).removeAttribute(name,
+				PortletSession.PORTLET_SCOPE);
+	}
+
+	protected void setContextAttribute(String name, Object value) {
+		getPortletContext().setAttribute(name, value);
+	}
+
+	protected void setRequestAttribute(String name, Object value) {
+		getPortletRequest().setAttribute(name, value);
+	}
+
+	protected void setSessionAttribute(String name, Object value) {
+		getPortletRequest().getPortletSession(true).setAttribute(name, value,
+				PortletSession.PORTLET_SCOPE);
+	}
+
+	public void dispatch(String path) throws IOException {
+		if (null == path) {
+			throw new NullPointerException("Path to new view is null");
+		}
+		throw new IllegalStateException(
+				"Dispatch to new view not at render phase");
+	}
+
+	private static final Pattern absoluteUrl = Pattern.compile("");
+	private static final Pattern directLink = Pattern.compile("");
+	private static final Pattern viewIdParam = Pattern.compile("");
+	/**
+	 * @param parameters
+	 * @return
+	 */
+	@Override
+	protected String createActionUrl(Map<String, String> parameters) {
+		String dummyActionURL = getRequestContextPath() + ACTION_URL_DO_NOTHITG;
+		try {
+			PortalActionURL actionUrl = new PortalActionURL(dummyActionURL);
+			for (Iterator<Map.Entry<String, String>> param = parameters
+					.entrySet().iterator(); param.hasNext();) {
+				Map.Entry<String, String> parameter = param.next();
+				actionUrl
+						.addParameter(parameter.getKey(), parameter.getValue());
+			}
+			return actionUrl.toString();
+		} catch (MalformedURLException e) {
+
+		}
+		return dummyActionURL;
+	}
+
+	/**
+	 * @param url
+	 * @return
+	 */
+	protected String encodeURL(String url) {
+		return getPortletResponse().encodeURL(url);
+	}
+
+	public String getAuthType() {
+		return getPortletRequest().getAuthType();
+	}
+
+	public String getRemoteUser() {
+		return getPortletRequest().getRemoteUser();
+	}
+
+	public String getRequestContextPath() {
+		return getPortletRequest().getContextPath();
+	}
+
+	public Locale getRequestLocale() {
+		return getPortletRequest().getLocale();
+	}
+
+	public Iterator getRequestLocales() {
+		return new EnumerationIterator(getPortletRequest().getLocales());
+	}
+
+	private String _pathInfo = null;
+
+	public String getRequestPathInfo() {
+//		String pathInfo = (String) getRequestParameter(VIEW_ID_PARAMETER);
+//		if (null == pathInfo) {
+			String pathInfo = (String) getRequestAttribute(VIEW_ID_PARAMETER);
+//		}
+		return pathInfo;
+	}
+
+	private String _servletPath = null;
+
+	public String getRequestServletPath() {
+		return _servletPath;
+	}
+
+	public Object getSession(boolean create) {
+		return getPortletRequest().getPortletSession();
+	}
+
+	public Principal getUserPrincipal() {
+		return getPortletRequest().getUserPrincipal();
+	}
+
+	public boolean isUserInRole(String role) {
+		return getPortletRequest().isUserInRole(role);
+	}
+
+	public void log(String message) {
+		getPortletContext().log(message);
+	}
+
+	public void log(String message, Throwable exception) {
+		getPortletContext().log(message, exception);
+	}
+
+	public void redirect(String url) throws IOException {
+		if (null == url || url.length() < 0) {
+			throw new NullPointerException("Path to redirect is null");
+		}
+		PortalActionURL actionURL = new PortalActionURL(url);
+		if (url.startsWith("#")
+				|| (!actionURL.isInContext(getRequestContextPath()))
+				|| "true".equalsIgnoreCase(actionURL
+						.getParameter(Bridge.DIRECT_LINK))) {
+			((ActionResponse) getResponse()).sendRedirect(url);
+		} else {
+			internalRedirect(actionURL);
+		}
+	}
+
+	/**
+	 * @param actionURL
+	 */
+	protected void internalRedirect(PortalActionURL actionURL) {
+		// Detect ViewId from URL and create new view for them.
+		String viewId = actionURL.getParameter(VIEW_ID_PARAMETER);
+		if (null != viewId) {
+			try {
+				viewId = URLDecoder.decode(viewId, "UTF8");
+				// Save new viewId to restore after redirect.
+				getRequestMap().put(AbstractExternalContext.REDIRECT_VIEW_ID, viewId);
+//				FacesContext facesContext = FacesContext.getCurrentInstance();
+//				ViewHandler viewHandler = facesContext.getApplication()
+//						.getViewHandler();
+//				facesContext.setViewRoot(viewHandler.createView(facesContext,
+//						viewId));
+//				setHasNavigationRedirect(true);
+			} catch (UnsupportedEncodingException e) {
+				// Do nothing - UTF-8 encoding is a default.
+			}
+		}
+	}
+}

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,180 +0,0 @@
-/**
- * 
- */
-package org.ajax4jsf.portlet.context;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Pattern;
-
-import javax.faces.FacesException;
-import javax.faces.render.ResponseStateManager;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.faces.Bridge;
-
-import org.ajax4jsf.portlet.application.PortletViewState;
-
-/**
- * @author asmirnov
- * 
- */
-public class PortletRenderContextImpl extends PortletContextImpl {
-
-	public String getResponseCharacterEncoding() {
-		RenderResponse renderResponse = (RenderResponse) getPortletResponse();
-		return renderResponse.getCharacterEncoding();
-	}
-
-	public String getResponseContentType() {
-		RenderResponse renderResponse = (RenderResponse) getPortletResponse();
-		return renderResponse.getContentType();
-	}
-
-	public void setRequestCharacterEncoding(String encoding)
-			throws UnsupportedEncodingException {
-		// Do nothing.
-	}
-
-	public String getRequestCharacterEncoding() {
-		return null;
-	}
-
-	protected String getNamespace() {
-		return ((RenderResponse) getPortletResponse()).getNamespace();
-	}
-
-	private Map<String, String[]> _requestParameters;
-
-	public PortletRenderContextImpl(PortletContext context,
-			PortletRequest request, PortletResponse response) {
-		super(context, request, response);
-	}
-
-	protected Object getRequestParameter(String name) {
-		Object[] values = (Object[]) getRequestParameterValues(name);
-		if (null != values) {
-			return values[0];
-		} else {
-			return null;
-		}
-	}
-
-	protected Enumeration enumerateRequestParameterNames() {
-		Map<String, String[]> requestParameters = getSavedRequestParameters();
-		if (null != requestParameters) {
-			return Collections.enumeration(requestParameters.keySet());
-		} else {
-			return Collections.enumeration(Collections.EMPTY_LIST);
-		}
-	}
-
-	@Override
-	public void redirect(String url) throws IOException {
-		if (null == url) {
-			throw new NullPointerException("Path to redirect is null");
-		}
-		PortalActionURL actionURL = new PortalActionURL(url);
-      if((!actionURL.isInContext(getRequestContextPath()) && null == actionURL.getParameter(VIEW_ID_PARAMETER)) || "true".equalsIgnoreCase(actionURL.getParameter(Bridge.DIRECT_LINK))){
-//			dispatch(url);
-
-//         throw new IllegalStateException(
-//			"Redirect to new url not at action phase");
-		} else {
-		// HACK - if page is in the context, just treat it as navigation case
-			internalRedirect(actionURL);
-		}
-	}
-
-	@Override
-	protected String createActionUrl(Map<String, String> parameters) {
-		RenderResponse renderResponse = (RenderResponse) getPortletResponse();
-		PortletURL portletURL = renderResponse.createActionURL();
-		portletURL.setParameter(AbstractExternalContext.NAMESPACE_PARAMETER,
-				renderResponse.getNamespace());
-		for (Iterator<Entry<String, String>> param = parameters.entrySet()
-				.iterator(); param.hasNext();) {
-			Entry<String, String> parameter = param.next();
-			portletURL.setParameter(parameter.getKey(), parameter.getValue());
-		}
-      return portletURL.toString();
-	}
-
-	public void dispatch(String path) throws IOException {
-		if (null == path) {
-			throw new NullPointerException("Path to new view is null");
-		}
-      PortletRequestDispatcher dispatcher = getPortletContext()
-				.getRequestDispatcher(path);
-		if (null == dispatcher) {
-			throw new IllegalStateException(
-					"Dispatcher for render request is not created");
-		}
-		try {
-			RenderRequest renderRequest = (RenderRequest) getPortletRequest();
-			RenderResponse portletResponse = (RenderResponse) getPortletResponse();
-			dispatcher.include(renderRequest, portletResponse);
-		} catch (PortletException e) {
-			throw new FacesException(e);
-		}
-	}
-
-	/**
-	 * @return
-	 */
-	@SuppressWarnings("unchecked")
-	private Map<String, String[]> getSavedRequestParameters() {
-		if (null == _requestParameters) {
-			// Get parameters ( all or a View state only ) restored as requered
-			// in the JSR 301 PLT 5.1
-			Object preserveRequestAttr = Boolean.FALSE;
-			PortletConfig portletConfig = (PortletConfig) getRequestAttribute(PORTLET_CONFIG_ATTRIBUTE);
-			if (null != portletConfig) {
-				String portletPreserveParamName = Bridge.PORTLET_ATTR_PREFIX
-						+ portletConfig.getPortletName()
-						+ Bridge.PRESERVE_ACTION_PARAM_ATTR_SUFFIX;
-				preserveRequestAttr = getContextAttribute(portletPreserveParamName);
-			}
-			Map<String, String[]> parameters = (Map<String, String[]>) getRequestAttribute(PortletViewState.REQUEST_PARAMETERS_ATTRIBUTE);
-			if (Boolean.TRUE.equals(preserveRequestAttr)) {
-				_requestParameters = parameters;
-			} else if (null != parameters) {
-				_requestParameters = new HashMap<String, String[]>();
-				String[] viewState = parameters
-						.get(ResponseStateManager.VIEW_STATE_PARAM);
-				if (null != viewState) {
-					_requestParameters.put(
-							ResponseStateManager.VIEW_STATE_PARAM, viewState);
-
-				}
-			}
-		}
-		return _requestParameters;
-	}
-
-	protected Object getRequestParameterValues(String name) {
-		Map<String, String[]> requestParameters = getSavedRequestParameters();
-		if (null != requestParameters) {
-			return requestParameters.get(name);
-		} else {
-			return null;
-		}
-	}
-
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/RenderPortletExternalContextImpl.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/RenderPortletExternalContextImpl.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/RenderPortletExternalContextImpl.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/RenderPortletExternalContextImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,184 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet.context;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
+import javax.faces.FacesException;
+import javax.faces.render.ResponseStateManager;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.faces.Bridge;
+
+import org.ajax4jsf.portlet.application.PortletViewState;
+
+/**
+ * @author asmirnov
+ * 
+ */
+public class RenderPortletExternalContextImpl extends PortletExternalContextImpl {
+
+	public String getResponseCharacterEncoding() {
+		RenderResponse renderResponse = (RenderResponse) getPortletResponse();
+		return renderResponse.getCharacterEncoding();
+	}
+
+	public String getResponseContentType() {
+		RenderResponse renderResponse = (RenderResponse) getPortletResponse();
+		return renderResponse.getContentType();
+	}
+
+	public void setRequestCharacterEncoding(String encoding)
+			throws UnsupportedEncodingException {
+		// Do nothing.
+	}
+
+	public String getRequestCharacterEncoding() {
+		return null;
+	}
+
+	protected String getNamespace() {
+		return ((RenderResponse) getPortletResponse()).getNamespace();
+	}
+
+	private Map<String, String[]> _requestParameters;
+
+	public RenderPortletExternalContextImpl(PortletContext context,
+			PortletRequest request, PortletResponse response) {
+		super(context, request, response);
+	}
+
+	protected Object getRequestParameter(String name) {
+		Object[] values = (Object[]) getRequestParameterValues(name);
+		if (null != values) {
+			return values[0];
+		} else {
+			return null;
+		}
+	}
+
+	protected Enumeration enumerateRequestParameterNames() {
+		Map<String, String[]> requestParameters = getSavedRequestParameters();
+		if (null != requestParameters) {
+			return Collections.enumeration(requestParameters.keySet());
+		} else {
+			return Collections.enumeration(Collections.EMPTY_LIST);
+		}
+	}
+
+	@Override
+	public void redirect(String url) throws IOException {
+		if (null == url) {
+			throw new NullPointerException("Path to redirect is null");
+		}
+		PortalActionURL actionURL = new PortalActionURL(url);
+      if((!actionURL.isInContext(getRequestContextPath()) && null == actionURL.getParameter(VIEW_ID_PARAMETER)) || "true".equalsIgnoreCase(actionURL.getParameter(Bridge.DIRECT_LINK))){
+//			dispatch(url);
+
+//         throw new IllegalStateException(
+//			"Redirect to new url not at action phase");
+		} else {
+		// HACK - if page is in the context, just treat it as navigation case
+			internalRedirect(actionURL);
+		}
+	}
+
+	@Override
+	protected String createActionUrl(Map<String, String> parameters) {
+		RenderResponse renderResponse = (RenderResponse) getPortletResponse();
+		PortletURL portletURL = renderResponse.createActionURL();
+		portletURL.setParameter(AbstractExternalContext.NAMESPACE_PARAMETER,
+				renderResponse.getNamespace());
+		for (Iterator<Entry<String, String>> param = parameters.entrySet()
+				.iterator(); param.hasNext();) {
+			Entry<String, String> parameter = param.next();
+			portletURL.setParameter(parameter.getKey(), parameter.getValue());
+		}
+      return portletURL.toString();
+	}
+
+	public void dispatch(String path) throws IOException {
+		if (null == path) {
+			throw new NullPointerException("Path to new view is null");
+		}
+      PortletRequestDispatcher dispatcher = getPortletContext()
+				.getRequestDispatcher(path);
+		if (null == dispatcher) {
+			throw new IllegalStateException(
+					"Dispatcher for render request is not created");
+		}
+		try {
+			RenderRequest renderRequest = (RenderRequest) getPortletRequest();
+			RenderResponse portletResponse = (RenderResponse) getPortletResponse();
+			dispatcher.include(renderRequest, portletResponse);
+		} catch (PortletException e) {
+			throw new FacesException(e);
+		}
+	}
+
+	/**
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	private Map<String, String[]> getSavedRequestParameters() {
+		if (null == _requestParameters) {
+			// Get parameters ( all or a View state only ) restored as requered
+			// in the JSR 301 PLT 5.1
+			Object preserveRequestAttr = Boolean.FALSE;
+			PortletConfig portletConfig = (PortletConfig) getRequestAttribute(PORTLET_CONFIG_ATTRIBUTE);
+			if (null != portletConfig) {
+				String portletPreserveParamName = Bridge.PORTLET_ATTR_PREFIX
+						+ portletConfig.getPortletName()
+						+ Bridge.PRESERVE_ACTION_PARAM_ATTR_SUFFIX;
+				preserveRequestAttr = getContextAttribute(portletPreserveParamName);
+			}
+			Map<String, String[]> parameters = (Map<String, String[]>) getRequestAttribute(PortletViewState.REQUEST_PARAMETERS_ATTRIBUTE);
+			if (Boolean.TRUE.equals(preserveRequestAttr)) {
+				_requestParameters = parameters;
+			} else if (null != parameters) {
+				_requestParameters = new HashMap<String, String[]>();
+				String[] viewState = parameters
+						.get(ResponseStateManager.VIEW_STATE_PARAM);
+				if (null != viewState) {
+					_requestParameters.put(
+							ResponseStateManager.VIEW_STATE_PARAM, viewState);
+
+				}
+				String[] conversationId = parameters.get(CONVERSATION_ID_PARAMETER);
+				if(null != conversationId){
+					_requestParameters.put(CONVERSATION_ID_PARAMETER, conversationId);
+				}
+			}
+		}
+		return _requestParameters;
+	}
+
+	protected Object getRequestParameterValues(String name) {
+		Map<String, String[]> requestParameters = getSavedRequestParameters();
+		if (null != requestParameters) {
+			return requestParameters.get(name);
+		} else {
+			return null;
+		}
+	}
+
+}

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,386 +0,0 @@
-/**
- * 
- */
-package org.ajax4jsf.portlet.context;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-import javax.portlet.PortletSession;
-import javax.portlet.PortletSessionUtil;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.portlet.AjaxPortletBridge;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author asmirnov
- * 
- */
-public class ServletContextImpl extends AbstractExternalContext {
-
-	private static final Log _log = LogFactory.getLog(ServletContextImpl.class);
-
-	private String namespace;
-
-	/**
-	 * @param context
-	 * @param request
-	 * @param response
-	 */
-	public ServletContextImpl(ServletContext context,
-			HttpServletRequest request, HttpServletResponse response) {
-		super(context, request, response);
-		ArrayList excludedAttributes = Collections.list(request.getAttributeNames());
-		request.setAttribute(EXCLUDED_PARAMETERS_ATTRIBUTE, excludedAttributes);
-	}
-
-	public void setResponseCharacterEncoding(String encoding) {
-
-		getHttpResponse().setCharacterEncoding(encoding);
-	}
-
-	public String getResponseCharacterEncoding() {
-		return getHttpResponse().getCharacterEncoding();
-	}
-
-	public String getResponseContentType() {
-		return getHttpResponse().getContentType();
-	}
-
-	public void setRequestCharacterEncoding(String encoding)
-			throws UnsupportedEncodingException {
-		getHttpRequest().setCharacterEncoding(encoding);
-	}
-
-	public String getRequestCharacterEncoding() {
-		return getHttpRequest().getCharacterEncoding();
-	}
-
-	public String getRequestContentType() {
-		return getHttpRequest().getContentType();
-	}
-
-	private HttpServletRequest getHttpRequest() {
-		return (HttpServletRequest) getRequest();
-	}
-
-	private ServletContext getServletContext() {
-		return (ServletContext) getContext();
-	}
-
-	private HttpServletResponse getHttpResponse() {
-		return (HttpServletResponse) getResponse();
-	}
-
-	protected String getNamespace() {
-		if (null == namespace) {
-			Object requestParameter = getRequestParameter(NAMESPACE_PARAMETER);
-			if (null != requestParameter) {
-				namespace = (String) requestParameter;
-				if (_log.isDebugEnabled()) {
-					_log.debug("Namespace for a portlet instance is "
-							+ namespace);
-				}
-			} else {
-				throw new FacesException(
-						"AJAX call to portlet without namespace parameter");
-			}
-		}
-		return namespace;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see javax.faces.context.ExternalContext#getInitParameter(java.lang.String)
-	 */
-	public String getInitParameter(String name) {
-		return getServletContext().getInitParameter(name);
-	}
-
-	protected Enumeration getInitParametersNames() {
-		return getServletContext().getInitParameterNames();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see javax.faces.context.ExternalContext#getResource(java.lang.String)
-	 */
-	public URL getResource(String path) throws MalformedURLException {
-		return getServletContext().getResource(path);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see javax.faces.context.ExternalContext#getResourceAsStream(java.lang.String)
-	 */
-	public InputStream getResourceAsStream(String path) {
-		return getServletContext().getResourceAsStream(path);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see javax.faces.context.ExternalContext#getResourcePaths(java.lang.String)
-	 */
-	public Set getResourcePaths(String path) {
-		return getServletContext().getResourcePaths(path);
-	}
-
-	protected Object getContextAttribute(String name) {
-		return getServletContext().getAttribute(name);
-	}
-
-	protected Enumeration getContextAttributeNames() {
-		return getServletContext().getAttributeNames();
-	}
-
-	protected void setContextAttribute(String name, Object value) {
-		getServletContext().setAttribute(name, value);
-	}
-
-	public String getAuthType() {
-		return getHttpRequest().getAuthType();
-	}
-
-	public String getRemoteUser() {
-		Principal userPrincipal = getUserPrincipal();
-		if( null != userPrincipal){
-			return userPrincipal.getName();
-		}
-		return getHttpRequest().getRemoteUser();
-	}
-
-	public String getRequestContextPath() {
-		return getHttpRequest().getContextPath();
-	}
-
-	public String getRequestPathInfo() {
-		return getHttpRequest().getPathInfo();
-	}
-
-	public String getRequestServletPath() {
-		return getHttpRequest().getServletPath();
-	}
-
-	protected Enumeration enumerateRequestParameterNames() {
-		return getHttpRequest().getParameterNames();
-	}
-
-	protected Object getRequestAttribute(String name) {
-		return getHttpRequest().getAttribute(name);
-	}
-
-	protected Enumeration getRequestAttributeNames() {
-		return getHttpRequest().getAttributeNames();
-	}
-
-	protected Object getRequestParameterValues(String name) {
-		return getHttpRequest().getParameterValues(name);
-	}
-
-	protected Object getRequestHeader(String name) {
-		return getHttpRequest().getHeader(name);
-	}
-
-	protected Enumeration getRequestHeaderNames() {
-		return getHttpRequest().getHeaderNames();
-	}
-
-	protected String[] getRequestHeaderValues(String name) {
-		Enumeration values = getHttpRequest().getHeaders(name);
-		ArrayList valuesList = new ArrayList();
-		while (values.hasMoreElements()) {
-			valuesList.add(values.nextElement());
-		}
-		return (String[]) valuesList.toArray(EMPTY_STRING_ARRAY);
-	}
-
-	protected Object getRequestParameter(String name) {
-		return getHttpRequest().getParameter(name);
-	}
-
-	private String sessionPrefix;
-
-	private String getSessionPrefix() {
-		if (sessionPrefix == null) {
-			HttpSession session = getHttpRequest().getSession(false);
-			String namespase = getNamespace();
-			if (null == namespase || null == session) {
-				throw new FacesException(
-						"JSF request called without portlet namespace parameter");
-			}
-			Enumeration attributeNames = session.getAttributeNames();
-			while (attributeNames.hasMoreElements() && null == sessionPrefix) {
-				String name = (String) attributeNames.nextElement();
-				Object attribute = session.getAttribute(name);
-				if (PortletSessionUtil.decodeScope(name) == PortletSession.PORTLET_SCOPE
-						&& PortletSessionUtil.decodeAttributeName(name).equals(
-								NAMESPACE_PARAMETER)
-						&& namespase.equals(attribute)) {
-					sessionPrefix = name.substring(0, name.length()
-							- NAMESPACE_PARAMETER.length());
-					if (_log.isDebugEnabled()) {
-						_log
-								.debug("Prefix for a PORTLET_SCOPE session attributes: "
-										+ sessionPrefix);
-					}
-				}
-			}
-			if (null == sessionPrefix) {
-				throw new FacesException(
-						"Prefix for attributes in portlet session scope not found");
-			}
-		}
-		return sessionPrefix;
-	}
-
-	protected Object getSessionAttribute(String name) {
-		return getHttpRequest().getSession(true).getAttribute(
-				getSessionPrefix() + name);
-	}
-
-	protected Enumeration getSessionAttributeNames() {
-		return new SessionAttributesNames(getHttpRequest().getSession(true)
-				.getAttributeNames(), getSessionPrefix());
-	}
-
-	protected void removeSessionAttribute(String name) {
-		getHttpRequest().getSession(true).removeAttribute(
-				getSessionPrefix() + name);
-	}
-
-	protected void setSessionAttribute(String name, Object value) {
-		getHttpRequest().getSession(true).setAttribute(
-				getSessionPrefix() + name, value);
-	}
-
-	protected void removeContextAttribute(String name) {
-		getHttpRequest().getSession(true).removeAttribute(name);
-	}
-
-	protected void removeRequestAttribute(String name) {
-		getHttpRequest().removeAttribute(name);
-	}
-
-	protected void setRequestAttribute(String name, Object value) {
-		getHttpRequest().setAttribute(name, value);
-	}
-
-	public void dispatch(String path) throws IOException {
-		RequestDispatcher requestDispatcher = getHttpRequest()
-				.getRequestDispatcher(path);
-		if (requestDispatcher == null) {
-			(getHttpResponse()).sendError(HttpServletResponse.SC_NOT_FOUND);
-			return;
-		}
-		try {
-			requestDispatcher.forward(getHttpRequest(), getHttpResponse());
-		} catch (IOException ioe) {
-			throw ioe;
-		} catch (ServletException se) {
-			throw new FacesException(se);
-		}
-
-	}
-
-	@Override
-	protected String createActionUrl(Map<String, String> parameters) {
-		String url = getHttpRequest().getParameter(ACTION__PARAMETER);
-		if(null == url){
-			throw new FacesException("No portal action url availible");
-		}
-		PortalActionURL portalUrl;
-		try {
-			portalUrl = new PortalActionURL(url);
-		} catch (MalformedURLException e) {
-			throw new FacesException("Malformed Portal Action URL "+url);
-		}
-		for (Entry<String, String> parameterEntry : parameters.entrySet()) {
-			portalUrl.addParameter(parameterEntry.getKey(), parameterEntry.getValue());
-		}
-		return portalUrl.toString();
-	}
-
-	public String encodeResourceURL(String url) {
-		return encodeURL(url);
-	}
-
-	/**
-	 * @param url
-	 * @return
-	 */
-	protected String encodeURL(String url) {
-		return getHttpResponse().encodeURL(url);
-	}
-
-	public Locale getRequestLocale() {
-		return getHttpRequest().getLocale();
-	}
-
-	public Iterator getRequestLocales() {
-		return new EnumerationIterator(getHttpRequest().getLocales());
-	}
-
-	public Object getSession(boolean create) {
-		HttpSession session = getHttpRequest().getSession(create);
-		if (null != session) {
-			session = new ServletSessionWrapper(session, getSessionPrefix());
-		}
-		return session;
-	}
-
-	public Principal getUserPrincipal() {
-        Principal userPrincipal = getHttpRequest().getUserPrincipal();
-		HttpSession httpSession = getHttpRequest().getSession(false);
-		if(null != httpSession){
-			Principal portalPrincipal = (Principal) httpSession.getAttribute(PORTAL_USER_PRINCIPAL);
-			if(null != portalPrincipal){
-				userPrincipal = portalPrincipal;
-			}
-		}
-		return userPrincipal;
-	}
-
-	public boolean isUserInRole(String role) {
-		return getHttpRequest().isUserInRole(role);
-	}
-
-	public void log(String message) {
-		getServletContext().log(message);
-	}
-
-	public void log(String message, Throwable exception) {
-		getServletContext().log(message, exception);
-	}
-
-	public void redirect(String url) throws IOException {
-		getHttpResponse().sendRedirect(url);
-		FacesContext.getCurrentInstance().responseComplete();
-	}
-
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,354 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet.context;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletSessionUtil;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.portlet.AjaxPortletBridge;
+import org.ajax4jsf.portlet.application.PortletStateHolder;
+import org.ajax4jsf.portlet.application.PortletViewState;
+import org.ajax4jsf.portlet.application.PortletStateHolder.WindowIDRetriver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author asmirnov
+ * 
+ */
+public class ServletExternalContextImpl extends AbstractExternalContext {
+
+	private static final Log _log = LogFactory.getLog(ServletExternalContextImpl.class);
+
+	private String namespace;
+
+	/**
+	 * @param context
+	 * @param request
+	 * @param response
+	 */
+	public ServletExternalContextImpl(ServletContext context,
+			HttpServletRequest request, HttpServletResponse response) {
+		super(context, request, response);
+		ArrayList excludedAttributes = Collections.list(request
+				.getAttributeNames());
+		request.setAttribute(EXCLUDED_PARAMETERS_ATTRIBUTE, excludedAttributes);
+		PortletStateHolder portletStateHolder = (PortletStateHolder) context
+				.getAttribute(PortletStateHolder.STATE_HOLDER);
+		if (null != portletStateHolder) {
+			String stateId = request
+					.getParameter(PortletStateHolder.STATE_ID_PARAMETER);
+			if (null != stateId) {
+				PortletViewState windowState = portletStateHolder
+						.getWindowState(stateId);
+				namespace = windowState.getNamespace();
+				sessionPrefix = WindowIDRetriver.PORTLET_SCOPE_PREFIX
+						+ windowState.getWindowId() + '?';
+				portalActionUrl = windowState.getPortalActionURL();
+			}
+		} else {
+			namespace="";
+			sessionPrefix="";
+		}
+	}
+
+	public void setResponseCharacterEncoding(String encoding) {
+
+		getHttpResponse().setCharacterEncoding(encoding);
+	}
+
+	public String getResponseCharacterEncoding() {
+		return getHttpResponse().getCharacterEncoding();
+	}
+
+	public String getResponseContentType() {
+		return getHttpResponse().getContentType();
+	}
+
+	public void setRequestCharacterEncoding(String encoding)
+			throws UnsupportedEncodingException {
+		getHttpRequest().setCharacterEncoding(encoding);
+	}
+
+	public String getRequestCharacterEncoding() {
+		return getHttpRequest().getCharacterEncoding();
+	}
+
+	public String getRequestContentType() {
+		return getHttpRequest().getContentType();
+	}
+
+	private HttpServletRequest getHttpRequest() {
+		return (HttpServletRequest) getRequest();
+	}
+
+	private ServletContext getServletContext() {
+		return (ServletContext) getContext();
+	}
+
+	private HttpServletResponse getHttpResponse() {
+		return (HttpServletResponse) getResponse();
+	}
+
+	protected String getNamespace() {
+		return namespace;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.faces.context.ExternalContext#getInitParameter(java.lang.String)
+	 */
+	public String getInitParameter(String name) {
+		return getServletContext().getInitParameter(name);
+	}
+
+	protected Enumeration getInitParametersNames() {
+		return getServletContext().getInitParameterNames();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.faces.context.ExternalContext#getResource(java.lang.String)
+	 */
+	public URL getResource(String path) throws MalformedURLException {
+		return getServletContext().getResource(path);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.faces.context.ExternalContext#getResourceAsStream(java.lang.String)
+	 */
+	public InputStream getResourceAsStream(String path) {
+		return getServletContext().getResourceAsStream(path);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.faces.context.ExternalContext#getResourcePaths(java.lang.String)
+	 */
+	public Set getResourcePaths(String path) {
+		return getServletContext().getResourcePaths(path);
+	}
+
+	protected Object getContextAttribute(String name) {
+		return getServletContext().getAttribute(name);
+	}
+
+	protected Enumeration getContextAttributeNames() {
+		return getServletContext().getAttributeNames();
+	}
+
+	protected void setContextAttribute(String name, Object value) {
+		getServletContext().setAttribute(name, value);
+	}
+
+	public String getAuthType() {
+		return getHttpRequest().getAuthType();
+	}
+
+	public String getRemoteUser() {
+		Principal userPrincipal = getUserPrincipal();
+		if( null != userPrincipal){
+			return userPrincipal.getName();
+		}
+		return getHttpRequest().getRemoteUser();
+	}
+
+	public String getRequestContextPath() {
+		return getHttpRequest().getContextPath();
+	}
+
+	public String getRequestPathInfo() {
+		return getHttpRequest().getPathInfo();
+	}
+
+	public String getRequestServletPath() {
+		return getHttpRequest().getServletPath();
+	}
+
+	protected Enumeration enumerateRequestParameterNames() {
+		return getHttpRequest().getParameterNames();
+	}
+
+	protected Object getRequestAttribute(String name) {
+		return getHttpRequest().getAttribute(name);
+	}
+
+	protected Enumeration getRequestAttributeNames() {
+		return getHttpRequest().getAttributeNames();
+	}
+
+	protected Object getRequestParameterValues(String name) {
+		return getHttpRequest().getParameterValues(name);
+	}
+
+	protected Object getRequestHeader(String name) {
+		return getHttpRequest().getHeader(name);
+	}
+
+	protected Enumeration getRequestHeaderNames() {
+		return getHttpRequest().getHeaderNames();
+	}
+
+	protected String[] getRequestHeaderValues(String name) {
+		Enumeration values = getHttpRequest().getHeaders(name);
+		ArrayList valuesList = new ArrayList();
+		while (values.hasMoreElements()) {
+			valuesList.add(values.nextElement());
+		}
+		return (String[]) valuesList.toArray(EMPTY_STRING_ARRAY);
+	}
+
+	protected Object getRequestParameter(String name) {
+		return getHttpRequest().getParameter(name);
+	}
+
+	private String sessionPrefix;
+
+	private PortalActionURL portalActionUrl;
+
+	private String getSessionPrefix() {
+		return sessionPrefix;
+	}
+
+	protected Object getSessionAttribute(String name) {
+		return getHttpRequest().getSession(true).getAttribute(
+				getSessionPrefix() + name);
+	}
+
+	protected Enumeration getSessionAttributeNames() {
+		return new SessionAttributesNames(getHttpRequest().getSession(true)
+				.getAttributeNames(), getSessionPrefix());
+	}
+
+	protected void removeSessionAttribute(String name) {
+		getHttpRequest().getSession(true).removeAttribute(
+				getSessionPrefix() + name);
+	}
+
+	protected void setSessionAttribute(String name, Object value) {
+		getHttpRequest().getSession(true).setAttribute(
+				getSessionPrefix() + name, value);
+	}
+
+	protected void removeContextAttribute(String name) {
+		getHttpRequest().getSession(true).removeAttribute(name);
+	}
+
+	protected void removeRequestAttribute(String name) {
+		getHttpRequest().removeAttribute(name);
+	}
+
+	protected void setRequestAttribute(String name, Object value) {
+		getHttpRequest().setAttribute(name, value);
+	}
+
+	public void dispatch(String path) throws IOException {
+		RequestDispatcher requestDispatcher = getHttpRequest()
+				.getRequestDispatcher(path);
+		if (requestDispatcher == null) {
+			(getHttpResponse()).sendError(HttpServletResponse.SC_NOT_FOUND);
+			return;
+		}
+		try {
+			requestDispatcher.forward(getHttpRequest(), getHttpResponse());
+		} catch (IOException ioe) {
+			throw ioe;
+		} catch (ServletException se) {
+			throw new FacesException(se);
+		}
+
+	}
+
+	@Override
+	protected String createActionUrl(Map<String, String> parameters) {
+		PortalActionURL actionUrl = new PortalActionURL(portalActionUrl);
+		for (Entry<String, String> parameterEntry : parameters.entrySet()) {
+			actionUrl.addParameter(parameterEntry.getKey(), parameterEntry.getValue());
+		}
+		return actionUrl.toString();
+	}
+
+	/**
+	 * @param url
+	 * @return
+	 */
+	protected String encodeURL(String url) {
+		return getHttpResponse().encodeURL(url);
+	}
+
+	public Locale getRequestLocale() {
+		return getHttpRequest().getLocale();
+	}
+
+	public Iterator getRequestLocales() {
+		return new EnumerationIterator(getHttpRequest().getLocales());
+	}
+
+	public Object getSession(boolean create) {
+		HttpSession session = getHttpRequest().getSession(create);
+		if (null != session) {
+			session = new ServletSessionWrapper(session, getSessionPrefix());
+		}
+		return session;
+	}
+
+	public Principal getUserPrincipal() {
+        Principal userPrincipal = getHttpRequest().getUserPrincipal();
+		HttpSession httpSession = getHttpRequest().getSession(false);
+		if(null != httpSession){
+			Principal portalPrincipal = (Principal) httpSession.getAttribute(PORTAL_USER_PRINCIPAL);
+			if(null != portalPrincipal){
+				userPrincipal = portalPrincipal;
+			}
+		}
+		return userPrincipal;
+	}
+
+	public boolean isUserInRole(String role) {
+		return getHttpRequest().isUserInRole(role);
+	}
+
+	public void log(String message) {
+		getServletContext().log(message);
+	}
+
+	public void log(String message, Throwable exception) {
+		getServletContext().log(message, exception);
+	}
+
+	public void redirect(String url) throws IOException {
+		getHttpResponse().sendRedirect(url);
+		FacesContext.getCurrentInstance().responseComplete();
+	}
+
+}

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -3,6 +3,7 @@
  */
 package org.ajax4jsf.portlet.lifecycle;
 
+import java.net.MalformedURLException;
 import java.util.Map;
 
 import javax.faces.context.FacesContext;
@@ -15,6 +16,7 @@
 import org.ajax4jsf.portlet.application.PortletStateHolder;
 import org.ajax4jsf.portlet.application.PortletViewState;
 import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.ajax4jsf.portlet.context.PortalActionURL;
 
 /**
  * @author asmirnov
@@ -35,44 +37,23 @@
 	public void afterPhase(PhaseEvent event) {
 		PhaseId phaseId = event.getPhaseId();
 		FacesContext context = event.getFacesContext();
+		Object portletPhase = context.getExternalContext().getRequestMap()
+		.get(Bridge.PORTLET_LIFECYCLE_PHASE);
 		if (phaseId.equals(PhaseId.RESTORE_VIEW)) {
-			Object portletPhase = context.getExternalContext().getRequestMap()
-					.get(Bridge.PORTLET_LIFECYCLE_PHASE);
-			if (null == portletPhase) {
-				// For a servlet phase, put all portlet-related parameters back to ajaxContext.
-				Map<String, String> requestParameters = context
-						.getExternalContext().getRequestParameterMap();
-
-				AjaxContext ajaxContext = AjaxContext
-						.getCurrentInstance(context);
-				Map commonAjaxParameters = ajaxContext
-						.getCommonAjaxParameters();
-				commonAjaxParameters
-						.put(
-								AbstractExternalContext.ACTION__PARAMETER,
-								requestParameters
-										.get(AbstractExternalContext.ACTION__PARAMETER));
-				commonAjaxParameters
-						.put(
-								AbstractExternalContext.PORTLET_MODE_PARAMETER,
-								requestParameters
-										.get(AbstractExternalContext.PORTLET_MODE_PARAMETER));
-
-				commonAjaxParameters
-						.put(
-								AbstractExternalContext.NAMESPACE_PARAMETER,
-								requestParameters
-										.get(AbstractExternalContext.NAMESPACE_PARAMETER));
-
-				commonAjaxParameters
-						.put(
-								AbstractExternalContext.PORTLET_NAME_PARAMETER,
-								requestParameters
-										.get(AbstractExternalContext.PORTLET_NAME_PARAMETER));
-
-			} else if (Bridge.PortletPhase.RenderPhase.equals(portletPhase)) {
+			if (Bridge.PortletPhase.RenderPhase.equals(portletPhase)) {
 				context.renderResponse();
 			}
+		} else if (phaseId.equals(PhaseId.RENDER_RESPONSE)) {
+			// save Seam conversation Id.
+			PortletViewState windowState = PortletStateHolder.getInstance(
+					context).getWindowState(context);	
+			windowState.saveSeamConversationId(context);
+		} else if (null == portletPhase && (phaseId.equals(PhaseId.INVOKE_APPLICATION)
+				&& context.getRenderResponse())) {
+			// save request scope variables and Faces Messages for a Servlet request.
+			PortletViewState windowState = PortletStateHolder.getInstance(
+					context).getWindowState(context);
+			windowState.saveRequest(context);
 		}
 
 	}
@@ -82,18 +63,34 @@
 	 * 
 	 * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
 	 */
+	@SuppressWarnings("unchecked")
 	public void beforePhase(PhaseEvent event) {
 		PhaseId phaseId = event.getPhaseId();
 		FacesContext context = event.getFacesContext();
-		if (phaseId.equals(PhaseId.RENDER_RESPONSE)) {
-			Object portletPhase = context.getExternalContext().getRequestMap()
-					.get(Bridge.PORTLET_LIFECYCLE_PHASE);
-			if (null == portletPhase) {
-				// save request scope variables and Faces Messages.
-				PortletViewState windowState = PortletStateHolder.getInstance(
-						context).getWindowState(context);
-				windowState.saveRequest(context);
+		Object portletPhase = context.getExternalContext().getRequestMap().get(
+				Bridge.PORTLET_LIFECYCLE_PHASE);
+		if (null == portletPhase && phaseId.equals(PhaseId.RENDER_RESPONSE)) {
+			// For a servlet phase, put all portlet-related parameters
+			// back to ajaxContext.
+			Map<String, String> requestParameters = context
+					.getExternalContext().getRequestParameterMap();
+
+			AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+			Map commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
+			PortletStateHolder portletStateHolder = PortletStateHolder.getInstance(context);
+			String stateId = requestParameters.get(PortletStateHolder.STATE_ID_PARAMETER);
+			// Change viewId parameter in the portal action URL.
+			PortletViewState windowState = portletStateHolder
+					.getWindowState(stateId);
+			if (null != windowState) {
+				PortalActionURL pal = windowState.getPortalActionURL();
+				if (null != pal) {
+					pal.addParameter(AbstractExternalContext.VIEW_ID_PARAMETER,
+							context.getViewRoot().getViewId());
+				}
 			}
+			commonAjaxParameters.put(PortletStateHolder.STATE_ID_PARAMETER,
+					stateId);
 		}
 	}
 

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam)

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,608 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.ajax4jsf.portlet.seam;
-
-import static javax.faces.event.PhaseId.ANY_PHASE;
-import static javax.faces.event.PhaseId.INVOKE_APPLICATION;
-import static javax.faces.event.PhaseId.PROCESS_VALIDATIONS;
-import static javax.faces.event.PhaseId.RENDER_RESPONSE;
-import static javax.faces.event.PhaseId.RESTORE_VIEW;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-
-import org.jboss.seam.Seam;
-import org.jboss.seam.contexts.Context;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.FacesLifecycle;
-import org.jboss.seam.core.ConversationList;
-import org.jboss.seam.core.ConversationPropagation;
-import org.jboss.seam.core.ConversationStack;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.core.Init;
-import org.jboss.seam.core.Manager;
-import org.jboss.seam.exception.Exceptions;
-import org.jboss.seam.faces.FacesManager;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.faces.FacesPage;
-import org.jboss.seam.faces.Switcher;
-import org.jboss.seam.faces.Validation;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.pageflow.Pageflow;
-import org.jboss.seam.persistence.PersistenceContexts;
-import org.jboss.seam.transaction.Transaction;
-import org.jboss.seam.util.Reflections;
-
-/**
- * Manages the Seam contexts associated with a JSF request
- * throughout the lifecycle of the request. Performs
- * transaction demarcation when Seam transaction management
- * is enabled. Hacks the JSF lifecyle to provide page
- * actions and page parameters.
- *
- * @author Gavin King
- */
-public class SeamPhaseListener implements PhaseListener
-{
-   private static final long serialVersionUID = -9127555729455066493L;
-   
-   private static final LogProvider log = Logging.getLogProvider(SeamPhaseListener.class);
-   
-   private static boolean exists = false;
-   
-   private static final Method SET_RENDER_PARAMETER;
-   private static final Class ACTION_RESPONSE;
-   private static final Class PORTLET_REQUEST;
-   
-   static
-   {
-      Method method = null;
-      Class actionResponseClass = null;
-      Class portletRequestClass = null;
-      try
-      {
-         Class[] parameterTypes = { String.class, String.class };
-         actionResponseClass = Class.forName("javax.portlet.ActionResponse");
-         portletRequestClass = Class.forName("javax.portlet.PortletRequest");
-         method = actionResponseClass.getMethod("setRenderParameter", parameterTypes);
-      }
-      catch (Exception e) {}
-      SET_RENDER_PARAMETER = method;
-      ACTION_RESPONSE = actionResponseClass;
-      PORTLET_REQUEST = portletRequestClass;
-   }
-
-   public SeamPhaseListener()
-   {
-      if (exists) 
-      {
-         log.warn("There should only be one Seam phase listener per application");
-      }
-      exists=true;
-   }
-   
-   public PhaseId getPhaseId()
-   {
-      return ANY_PHASE;
-   }
-   
-   public void beforePhase(PhaseEvent event)
-   {
-      log.trace( "before phase: " + event.getPhaseId() );
-      
-      FacesLifecycle.setPhaseId( event.getPhaseId() );
-
-      try
-      {
-         if ( isPortletRequest(event) )
-         {
-            beforePortletPhase(event);
-         }
-         else
-         {
-            beforeServletPhase(event);
-         }
-         raiseEventsBeforePhase(event);
-      }
-      catch (Exception e)
-      {
-         log.error("uncaught exception", e);
-         try
-         {
-            Exceptions.instance().handle(e);
-         }
-         catch (Exception ehe) 
-         {
-            log.error("swallowing exception", e);
-         }
-      }
-
-   }
-
-   private void beforeServletPhase(PhaseEvent event)
-   {
-      if ( event.getPhaseId() == RESTORE_VIEW )
-      {
-         beforeRestoreView( event.getFacesContext() );
-      }
-      
-      handleTransactionsBeforePhase(event);         
-      
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-         beforeRenderResponse( event.getFacesContext() );
-      }
-      
-   }
-   
-   private void beforePortletPhase(PhaseEvent event)
-   {
-
-      FacesContext facesContext = event.getFacesContext();
-      
-      if ( event.getPhaseId() == RESTORE_VIEW || event.getPhaseId() == RENDER_RESPONSE )
-      {
-         beforeRestoreView(facesContext);
-      }
-      
-      //delegate to subclass:
-      handleTransactionsBeforePhase(event);
-      
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-         afterRestoreView(facesContext);         
-         beforeRenderResponse( event.getFacesContext() );
-      }
-   }
-
-   public void afterPhase(PhaseEvent event)
-   {
-      log.trace( "after phase: " + event.getPhaseId() );
-      
-      try
-      {
-         raiseEventsAfterPhase(event);
-         if ( isPortletRequest(event) )
-         {
-            afterPortletPhase(event);
-         }
-         else
-         {
-            afterServletPhase(event);
-         }
-      }
-      catch (Exception e)
-      {
-         log.error("uncaught exception", e);
-         try
-         {
-            Exceptions.instance().handle(e);
-            // A redirect occurred inside the error handler, and we are in after
-            // phase, so we need to clean up now as there are no more after
-            // phases to be run
-            if ( event.getFacesContext().getResponseComplete() )
-            {
-               afterResponseComplete(event.getFacesContext());
-            }
-         }
-         catch (Exception ehe) 
-         {
-            log.error("swallowing exception", e);
-         }
-      }
-
-      FacesLifecycle.clearPhaseId();
-      
-   }
-
-   private void afterServletPhase(PhaseEvent event)
-   {
-  
-      FacesContext facesContext = event.getFacesContext();
-      
-      if ( event.getPhaseId() == RESTORE_VIEW )
-      {
-         afterRestoreView(facesContext);
-      }      
-      else if ( event.getPhaseId() == INVOKE_APPLICATION )
-      {
-         afterInvokeApplication();
-      }
-      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
-      {
-         afterProcessValidations(facesContext);
-      }
-            
-      //has to happen after, since restoreAnyConversationContext() 
-      //can add messages
-      FacesMessages.afterPhase();
-      
-      handleTransactionsAfterPhase(event);
-            
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-         afterRenderResponse(facesContext);
-      }
-      else if ( facesContext.getResponseComplete() )
-      {
-         afterResponseComplete(facesContext);
-      }
-   }
-   
-   private void afterPortletPhase(PhaseEvent event)
-   {
-      FacesContext facesContext = event.getFacesContext();
-      
-      if ( event.getPhaseId() == RESTORE_VIEW )
-      {
-         afterRestoreView(facesContext);
-      }
-      else if ( event.getPhaseId() == INVOKE_APPLICATION )
-      {
-         afterInvokeApplication();
-      }
-      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
-      {
-         afterProcessValidations(facesContext);
-      }
-      
-      FacesMessages.afterPhase();
-      
-      //delegate to subclass:
-      handleTransactionsAfterPhase(event);
-            
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-         //writeConversationIdToResponse( facesContext.getExternalContext().getResponse() );
-         afterRenderResponse(facesContext);
-      }
-      else if ( event.getPhaseId() == INVOKE_APPLICATION || facesContext.getRenderResponse() || facesContext.getResponseComplete() )
-      {
-         Manager manager = Manager.instance();
-         manager.beforeRedirect();
-         if ( manager.isLongRunningConversation() )
-         {
-            setPortletRenderParameter(
-                  facesContext.getExternalContext().getResponse(), 
-                  manager.getConversationIdParameter(), 
-                  manager.getCurrentConversationId()
-               );
-         }
-         afterResponseComplete(facesContext);
-      }
-      
-   }
-   
-   private static void setPortletRenderParameter(Object response, String conversationIdParameter, String conversationId)
-   {
-      if ( ACTION_RESPONSE.isInstance(response) )
-      {
-         Reflections.invokeAndWrap(SET_RENDER_PARAMETER, response, conversationIdParameter, conversationId);
-      }
-   }
-   
-   private static boolean isPortletRequest(PhaseEvent event)
-   {
-      return PORTLET_REQUEST!=null && 
-            PORTLET_REQUEST.isInstance( event.getFacesContext().getExternalContext().getRequest() );
-   }
-   
-   public void handleTransactionsBeforePhase(PhaseEvent event)
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         PhaseId phaseId = event.getPhaseId();
-         boolean beginTran = phaseId == PhaseId.RENDER_RESPONSE || 
-               phaseId == ( Transaction.instance().isConversationContextRequired() ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.RESTORE_VIEW );
-               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
-         
-         if (beginTran) 
-         {
-            begin(phaseId);
-         }
-      }
-   }
-   
-   public void handleTransactionsAfterPhase(PhaseEvent event)
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         PhaseId phaseId = event.getPhaseId();
-         boolean commitTran = phaseId == PhaseId.INVOKE_APPLICATION || 
-               event.getFacesContext().getRenderResponse() || //TODO: no need to commit the tx if we failed to restore the view
-               event.getFacesContext().getResponseComplete() ||
-               phaseId == PhaseId.RENDER_RESPONSE;
-               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
-         
-         if (commitTran)
-         { 
-            commitOrRollback(phaseId); //we commit before destroying contexts, cos the contexts have the PC in them
-         }
-      }
-   }
-   
-   protected void handleTransactionsAfterPageActions(FacesContext facesContext)
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         commitOrRollback(PhaseId.INVOKE_APPLICATION);
-         if ( !facesContext.getResponseComplete() )
-         {
-            begin(PhaseId.INVOKE_APPLICATION);
-         }
-      }
-   }
-   
-   protected void afterInvokeApplication() 
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         addTransactionFailedMessage();
-      }
-   }
-
-   protected void afterProcessValidations(FacesContext facesContext)
-   {
-      Validation.instance().afterProcessValidations(facesContext);
-   }
-   
-   /**
-    * Set up the Seam contexts, except for the conversation
-    * context
-    */
-   protected void beforeRestoreView(FacesContext facesContext)
-   {
-      FacesLifecycle.beginRequest( facesContext.getExternalContext() );
-   }
-   
-   /**
-    * Restore the page and conversation contexts during a JSF request
-    */
-   protected void afterRestoreView(FacesContext facesContext)
-   {
-      FacesLifecycle.resumePage();
-      Map parameters = facesContext.getExternalContext().getRequestParameterMap();
-      ConversationPropagation.instance().restoreConversationId(parameters);
-      boolean conversationFound = Manager.instance().restoreConversation();
-      FacesLifecycle.resumeConversation( facesContext.getExternalContext() );
-      postRestorePage(facesContext, parameters, conversationFound);            
-   }
-
-   public void raiseEventsBeforePhase(PhaseEvent event)
-   {
-      if ( Contexts.isApplicationContextActive() )
-      {
-         Events.instance().raiseEvent("org.jboss.seam.beforePhase", event);
-      }
-      
-      /*if ( Contexts.isConversationContextActive() && Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess() )
-      {
-         String name;
-         PhaseId phaseId = event.getPhaseId();
-         if ( phaseId == PhaseId.PROCESS_VALIDATIONS )
-         {
-            name = "process-validations";
-         }
-         else if ( phaseId == PhaseId.UPDATE_MODEL_VALUES )
-         {
-            name = "update-model-values";
-         }
-         else if ( phaseId == PhaseId.INVOKE_APPLICATION )
-         {
-            name = "invoke-application";
-         }
-         else if ( phaseId == PhaseId.RENDER_RESPONSE )
-         {
-            name = "render-response";
-         }
-         else
-         {
-            return;
-         }
-         Pageflow.instance().processEvents(name);
-      }*/
-   }
-   
-   public void raiseEventsAfterPhase(PhaseEvent event)
-   {
-      if ( Contexts.isApplicationContextActive() )
-      {
-         Events.instance().raiseEvent("org.jboss.seam.afterPhase", event);
-      }
-   }
-   
-   /**
-    * Add a faces message when Seam-managed transactions fail.
-    */
-   protected void addTransactionFailedMessage()
-   {
-      try
-      {
-         if ( Transaction.instance().isRolledBackOrMarkedRollback() )
-         {
-            FacesMessages.instance().addFromResourceBundleOrDefault(
-                     FacesMessage.SEVERITY_WARN, 
-                     "org.jboss.seam.TransactionFailed", 
-                     "Transaction failed"
-                  );
-         }
-      }
-      catch (Exception e) {} //swallow silently, not important
-   }
-   
-   protected void beforeRenderResponse(FacesContext facesContext)
-   {  
-      
-      if ( Contexts.isPageContextActive() )
-      {
-         Context pageContext = Contexts.getPageContext();
-         //after every time that the view may have changed,
-         //we need to flush the page context, since the 
-         //attribute map is being discarder
-         pageContext.flush();
-         //force refresh of the conversation lists (they are kept in PAGE context)
-         pageContext.remove(Seam.getComponentName(Switcher.class));
-         pageContext.remove("org.jboss.seam.core.conversationList");
-         pageContext.remove("org.jboss.seam.core.conversationStack");
-      }
-      
-      preRenderPage(facesContext);
-      
-      if ( facesContext.getResponseComplete() )
-      {
-         //workaround for a bug in MyFaces prior to 1.1.3
-         if ( Init.instance().isMyFacesLifecycleBug() ) 
-         {
-            FacesLifecycle.endRequest( facesContext.getExternalContext() );
-         }
-      }
-      else //if the page actions did not call responseComplete()
-      {
-         FacesMessages.instance().beforeRenderResponse();
-         //do this both before and after render, since conversations 
-         //and pageflows can begin during render
-         FacesManager.instance().prepareBackswitch(facesContext); 
-      }
-      
-      FacesPage.instance().storeConversation();
-      FacesPage.instance().storePageflow();
-      
-      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
-      if (persistenceContexts != null) 
-      {
-          persistenceContexts.beforeRender();
-      }
-   }
-   
-   protected void afterRenderResponse(FacesContext facesContext)
-   {
-      //do this both before and after render, since conversations 
-      //and pageflows can begin during render
-      FacesManager.instance().prepareBackswitch(facesContext);
-      
-      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
-      if (persistenceContexts != null) 
-      {
-          persistenceContexts.afterRender();
-      }
-      
-      ExternalContext externalContext = facesContext.getExternalContext();
-      Manager.instance().endRequest( externalContext.getSessionMap() );
-      FacesLifecycle.endRequest(externalContext);
-   }
-   
-   protected void afterResponseComplete(FacesContext facesContext)
-   {
-      //responseComplete() was called by one of the other phases, 
-      //so we will never get to the RENDER_RESPONSE phase
-      //Note: we can't call Manager.instance().beforeRedirect() here, 
-      //since a redirect is not the only reason for a responseComplete
-      ExternalContext externalContext = facesContext.getExternalContext();
-      Manager.instance().endRequest( externalContext.getSessionMap() );
-      FacesLifecycle.endRequest( facesContext.getExternalContext() );
-   }
-   
-   private void postRestorePage(FacesContext facesContext, Map parameters, boolean conversationFound)
-   {
-      if ( !Pages.isDebugPage() )
-      {
-         // Only redirect to no-conversation-view if a login redirect isn't required
-         if (!conversationFound && !Pages.instance().isLoginRedirectRequired(facesContext))
-         {
-            Pages.instance().redirectToNoConversationView();
-         }
-         
-         Manager.instance().handleConversationPropagation(parameters);
-         
-         if ( Init.instance().isJbpmInstalled() && !isExceptionHandlerRedirect() )
-         {
-            Pageflow.instance().validatePageflow(facesContext);
-         }
-         
-         Pages.instance().postRestore(facesContext);
-      }
-   }
-  
-   private boolean preRenderPage(FacesContext facesContext)
-   {
-      if ( Pages.isDebugPage() )
-      {
-         return false;
-      }
-      else
-      {
-         FacesLifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
-         boolean actionsWereCalled = false;
-         try
-         {
-            actionsWereCalled = Pages.instance().preRender(facesContext);
-            return actionsWereCalled;
-         }
-         finally
-         {
-            FacesLifecycle.setPhaseId(PhaseId.RENDER_RESPONSE);
-            if (actionsWereCalled) 
-            {
-               FacesMessages.afterPhase();
-               handleTransactionsAfterPageActions(facesContext); //TODO: does it really belong in the finally?
-            }
-         }
-      }
-   }
-   
-   private boolean isExceptionHandlerRedirect()
-   {
-      return Contexts.getConversationContext().isSet("org.jboss.seam.handledException");
-   }
-      
-   void begin(PhaseId phaseId) 
-   {
-      try 
-      {
-         if ( !Transaction.instance().isActiveOrMarkedRollback() )
-         {
-            log.debug("beginning transaction prior to phase: " + phaseId);
-            Transaction.instance().begin();
-         }
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Could not start transaction", e);
-      }
-   }
-   
-   void commitOrRollback(PhaseId phaseId) 
-   {
-      try 
-      {
-         if ( Transaction.instance().isActive() )
-         {
-            log.debug("committing transaction after phase: " + phaseId);
-            Transaction.instance().commit();
-         }
-         else if ( Transaction.instance().isRolledBackOrMarkedRollback() )
-         {
-            log.debug("rolling back transaction after phase: " + phaseId);
-            Transaction.instance().rollback();
-         }
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Could not commit transaction", e);
-      }
-   }
-   
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,608 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.ajax4jsf.portlet.seam;
+
+import static javax.faces.event.PhaseId.ANY_PHASE;
+import static javax.faces.event.PhaseId.INVOKE_APPLICATION;
+import static javax.faces.event.PhaseId.PROCESS_VALIDATIONS;
+import static javax.faces.event.PhaseId.RENDER_RESPONSE;
+import static javax.faces.event.PhaseId.RESTORE_VIEW;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.jboss.seam.Seam;
+import org.jboss.seam.contexts.Context;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.FacesLifecycle;
+import org.jboss.seam.core.ConversationList;
+import org.jboss.seam.core.ConversationPropagation;
+import org.jboss.seam.core.ConversationStack;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.core.Init;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.exception.Exceptions;
+import org.jboss.seam.faces.FacesManager;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.faces.FacesPage;
+import org.jboss.seam.faces.Switcher;
+import org.jboss.seam.faces.Validation;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.navigation.Pages;
+import org.jboss.seam.pageflow.Pageflow;
+import org.jboss.seam.persistence.PersistenceContexts;
+import org.jboss.seam.transaction.Transaction;
+import org.jboss.seam.util.Reflections;
+
+/**
+ * Manages the Seam contexts associated with a JSF request
+ * throughout the lifecycle of the request. Performs
+ * transaction demarcation when Seam transaction management
+ * is enabled. Hacks the JSF lifecyle to provide page
+ * actions and page parameters.
+ *
+ * @author Gavin King
+ */
+public class SeamPhaseListener implements PhaseListener
+{
+   private static final long serialVersionUID = -9127555729455066493L;
+   
+   private static final LogProvider log = Logging.getLogProvider(SeamPhaseListener.class);
+   
+   private static boolean exists = false;
+   
+   private static final Method SET_RENDER_PARAMETER;
+   private static final Class ACTION_RESPONSE;
+   private static final Class PORTLET_REQUEST;
+   
+   static
+   {
+      Method method = null;
+      Class actionResponseClass = null;
+      Class portletRequestClass = null;
+      try
+      {
+         Class[] parameterTypes = { String.class, String.class };
+         actionResponseClass = Class.forName("javax.portlet.ActionResponse");
+         portletRequestClass = Class.forName("javax.portlet.PortletRequest");
+         method = actionResponseClass.getMethod("setRenderParameter", parameterTypes);
+      }
+      catch (Exception e) {}
+      SET_RENDER_PARAMETER = method;
+      ACTION_RESPONSE = actionResponseClass;
+      PORTLET_REQUEST = portletRequestClass;
+   }
+
+   public SeamPhaseListener()
+   {
+      if (exists) 
+      {
+         log.warn("There should only be one Seam phase listener per application");
+      }
+      exists=true;
+   }
+   
+   public PhaseId getPhaseId()
+   {
+      return ANY_PHASE;
+   }
+   
+   public void beforePhase(PhaseEvent event)
+   {
+      log.trace( "before phase: " + event.getPhaseId() );
+      
+      FacesLifecycle.setPhaseId( event.getPhaseId() );
+
+      try
+      {
+         if ( isPortletRequest(event) )
+         {
+            beforePortletPhase(event);
+         }
+         else
+         {
+            beforeServletPhase(event);
+         }
+         raiseEventsBeforePhase(event);
+      }
+      catch (Exception e)
+      {
+         log.error("uncaught exception", e);
+         try
+         {
+            Exceptions.instance().handle(e);
+         }
+         catch (Exception ehe) 
+         {
+            log.error("swallowing exception", e);
+         }
+      }
+
+   }
+
+   private void beforeServletPhase(PhaseEvent event)
+   {
+      if ( event.getPhaseId() == RESTORE_VIEW )
+      {
+         beforeRestoreView( event.getFacesContext() );
+      }
+      
+      handleTransactionsBeforePhase(event);         
+      
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+         beforeRenderResponse( event.getFacesContext() );
+      }
+      
+   }
+   
+   private void beforePortletPhase(PhaseEvent event)
+   {
+
+      FacesContext facesContext = event.getFacesContext();
+      
+      if ( event.getPhaseId() == RESTORE_VIEW || event.getPhaseId() == RENDER_RESPONSE )
+      {
+         beforeRestoreView(facesContext);
+      }
+      
+      //delegate to subclass:
+      handleTransactionsBeforePhase(event);
+      
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+         afterRestoreView(facesContext);         
+         beforeRenderResponse( event.getFacesContext() );
+      }
+   }
+
+   public void afterPhase(PhaseEvent event)
+   {
+      log.trace( "after phase: " + event.getPhaseId() );
+      
+      try
+      {
+         raiseEventsAfterPhase(event);
+         if ( isPortletRequest(event) )
+         {
+            afterPortletPhase(event);
+         }
+         else
+         {
+            afterServletPhase(event);
+         }
+      }
+      catch (Exception e)
+      {
+         log.error("uncaught exception", e);
+         try
+         {
+            Exceptions.instance().handle(e);
+            // A redirect occurred inside the error handler, and we are in after
+            // phase, so we need to clean up now as there are no more after
+            // phases to be run
+            if ( event.getFacesContext().getResponseComplete() )
+            {
+               afterResponseComplete(event.getFacesContext());
+            }
+         }
+         catch (Exception ehe) 
+         {
+            log.error("swallowing exception", e);
+         }
+      }
+
+      FacesLifecycle.clearPhaseId();
+      
+   }
+
+   private void afterServletPhase(PhaseEvent event)
+   {
+  
+      FacesContext facesContext = event.getFacesContext();
+      
+      if ( event.getPhaseId() == RESTORE_VIEW )
+      {
+         afterRestoreView(facesContext);
+      }      
+      else if ( event.getPhaseId() == INVOKE_APPLICATION )
+      {
+         afterInvokeApplication();
+      }
+      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
+      {
+         afterProcessValidations(facesContext);
+      }
+            
+      //has to happen after, since restoreAnyConversationContext() 
+      //can add messages
+      FacesMessages.afterPhase();
+      
+      handleTransactionsAfterPhase(event);
+            
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+         afterRenderResponse(facesContext);
+      }
+      else if ( facesContext.getResponseComplete() )
+      {
+         afterResponseComplete(facesContext);
+      }
+   }
+   
+   private void afterPortletPhase(PhaseEvent event)
+   {
+      FacesContext facesContext = event.getFacesContext();
+      
+      if ( event.getPhaseId() == RESTORE_VIEW )
+      {
+         afterRestoreView(facesContext);
+      }
+      else if ( event.getPhaseId() == INVOKE_APPLICATION )
+      {
+         afterInvokeApplication();
+      }
+      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
+      {
+         afterProcessValidations(facesContext);
+      }
+      
+      FacesMessages.afterPhase();
+      
+      //delegate to subclass:
+      handleTransactionsAfterPhase(event);
+            
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+         //writeConversationIdToResponse( facesContext.getExternalContext().getResponse() );
+         afterRenderResponse(facesContext);
+      }
+      else if ( event.getPhaseId() == INVOKE_APPLICATION || facesContext.getRenderResponse() || facesContext.getResponseComplete() )
+      {
+         Manager manager = Manager.instance();
+         manager.beforeRedirect();
+         if ( manager.isLongRunningConversation() )
+         {
+            setPortletRenderParameter(
+                  facesContext.getExternalContext().getResponse(), 
+                  manager.getConversationIdParameter(), 
+                  manager.getCurrentConversationId()
+               );
+         }
+         afterResponseComplete(facesContext);
+      }
+      
+   }
+   
+   private static void setPortletRenderParameter(Object response, String conversationIdParameter, String conversationId)
+   {
+      if ( ACTION_RESPONSE.isInstance(response) )
+      {
+         Reflections.invokeAndWrap(SET_RENDER_PARAMETER, response, conversationIdParameter, conversationId);
+      }
+   }
+   
+   private static boolean isPortletRequest(PhaseEvent event)
+   {
+      return PORTLET_REQUEST!=null && 
+            PORTLET_REQUEST.isInstance( event.getFacesContext().getExternalContext().getRequest() );
+   }
+   
+   public void handleTransactionsBeforePhase(PhaseEvent event)
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         PhaseId phaseId = event.getPhaseId();
+         boolean beginTran = phaseId == PhaseId.RENDER_RESPONSE || 
+               phaseId == ( Transaction.instance().isConversationContextRequired() ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.RESTORE_VIEW );
+               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
+         
+         if (beginTran) 
+         {
+            begin(phaseId);
+         }
+      }
+   }
+   
+   public void handleTransactionsAfterPhase(PhaseEvent event)
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         PhaseId phaseId = event.getPhaseId();
+         boolean commitTran = phaseId == PhaseId.INVOKE_APPLICATION || 
+               event.getFacesContext().getRenderResponse() || //TODO: no need to commit the tx if we failed to restore the view
+               event.getFacesContext().getResponseComplete() ||
+               phaseId == PhaseId.RENDER_RESPONSE;
+               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
+         
+         if (commitTran)
+         { 
+            commitOrRollback(phaseId); //we commit before destroying contexts, cos the contexts have the PC in them
+         }
+      }
+   }
+   
+   protected void handleTransactionsAfterPageActions(FacesContext facesContext)
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         commitOrRollback(PhaseId.INVOKE_APPLICATION);
+         if ( !facesContext.getResponseComplete() )
+         {
+            begin(PhaseId.INVOKE_APPLICATION);
+         }
+      }
+   }
+   
+   protected void afterInvokeApplication() 
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         addTransactionFailedMessage();
+      }
+   }
+
+   protected void afterProcessValidations(FacesContext facesContext)
+   {
+      Validation.instance().afterProcessValidations(facesContext);
+   }
+   
+   /**
+    * Set up the Seam contexts, except for the conversation
+    * context
+    */
+   protected void beforeRestoreView(FacesContext facesContext)
+   {
+      FacesLifecycle.beginRequest( facesContext.getExternalContext() );
+   }
+   
+   /**
+    * Restore the page and conversation contexts during a JSF request
+    */
+   protected void afterRestoreView(FacesContext facesContext)
+   {
+      FacesLifecycle.resumePage();
+      Map parameters = facesContext.getExternalContext().getRequestParameterMap();
+      ConversationPropagation.instance().restoreConversationId(parameters);
+      boolean conversationFound = Manager.instance().restoreConversation();
+      FacesLifecycle.resumeConversation( facesContext.getExternalContext() );
+      postRestorePage(facesContext, parameters, conversationFound);            
+   }
+
+   public void raiseEventsBeforePhase(PhaseEvent event)
+   {
+      if ( Contexts.isApplicationContextActive() )
+      {
+         Events.instance().raiseEvent("org.jboss.seam.beforePhase", event);
+      }
+      
+      /*if ( Contexts.isConversationContextActive() && Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess() )
+      {
+         String name;
+         PhaseId phaseId = event.getPhaseId();
+         if ( phaseId == PhaseId.PROCESS_VALIDATIONS )
+         {
+            name = "process-validations";
+         }
+         else if ( phaseId == PhaseId.UPDATE_MODEL_VALUES )
+         {
+            name = "update-model-values";
+         }
+         else if ( phaseId == PhaseId.INVOKE_APPLICATION )
+         {
+            name = "invoke-application";
+         }
+         else if ( phaseId == PhaseId.RENDER_RESPONSE )
+         {
+            name = "render-response";
+         }
+         else
+         {
+            return;
+         }
+         Pageflow.instance().processEvents(name);
+      }*/
+   }
+   
+   public void raiseEventsAfterPhase(PhaseEvent event)
+   {
+      if ( Contexts.isApplicationContextActive() )
+      {
+         Events.instance().raiseEvent("org.jboss.seam.afterPhase", event);
+      }
+   }
+   
+   /**
+    * Add a faces message when Seam-managed transactions fail.
+    */
+   protected void addTransactionFailedMessage()
+   {
+      try
+      {
+         if ( Transaction.instance().isRolledBackOrMarkedRollback() )
+         {
+            FacesMessages.instance().addFromResourceBundleOrDefault(
+                     FacesMessage.SEVERITY_WARN, 
+                     "org.jboss.seam.TransactionFailed", 
+                     "Transaction failed"
+                  );
+         }
+      }
+      catch (Exception e) {} //swallow silently, not important
+   }
+   
+   protected void beforeRenderResponse(FacesContext facesContext)
+   {  
+      
+      if ( Contexts.isPageContextActive() )
+      {
+         Context pageContext = Contexts.getPageContext();
+         //after every time that the view may have changed,
+         //we need to flush the page context, since the 
+         //attribute map is being discarder
+         pageContext.flush();
+         //force refresh of the conversation lists (they are kept in PAGE context)
+         pageContext.remove(Seam.getComponentName(Switcher.class));
+         pageContext.remove("org.jboss.seam.core.conversationList");
+         pageContext.remove("org.jboss.seam.core.conversationStack");
+      }
+      
+      preRenderPage(facesContext);
+      
+      if ( facesContext.getResponseComplete() )
+      {
+         //workaround for a bug in MyFaces prior to 1.1.3
+         if ( Init.instance().isMyFacesLifecycleBug() ) 
+         {
+            FacesLifecycle.endRequest( facesContext.getExternalContext() );
+         }
+      }
+      else //if the page actions did not call responseComplete()
+      {
+         FacesMessages.instance().beforeRenderResponse();
+         //do this both before and after render, since conversations 
+         //and pageflows can begin during render
+         FacesManager.instance().prepareBackswitch(facesContext); 
+      }
+      
+      FacesPage.instance().storeConversation();
+      FacesPage.instance().storePageflow();
+      
+      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
+      if (persistenceContexts != null) 
+      {
+          persistenceContexts.beforeRender();
+      }
+   }
+   
+   protected void afterRenderResponse(FacesContext facesContext)
+   {
+      //do this both before and after render, since conversations 
+      //and pageflows can begin during render
+      FacesManager.instance().prepareBackswitch(facesContext);
+      
+      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
+      if (persistenceContexts != null) 
+      {
+          persistenceContexts.afterRender();
+      }
+      
+      ExternalContext externalContext = facesContext.getExternalContext();
+      Manager.instance().endRequest( externalContext.getSessionMap() );
+      FacesLifecycle.endRequest(externalContext);
+   }
+   
+   protected void afterResponseComplete(FacesContext facesContext)
+   {
+      //responseComplete() was called by one of the other phases, 
+      //so we will never get to the RENDER_RESPONSE phase
+      //Note: we can't call Manager.instance().beforeRedirect() here, 
+      //since a redirect is not the only reason for a responseComplete
+      ExternalContext externalContext = facesContext.getExternalContext();
+      Manager.instance().endRequest( externalContext.getSessionMap() );
+      FacesLifecycle.endRequest( facesContext.getExternalContext() );
+   }
+   
+   private void postRestorePage(FacesContext facesContext, Map parameters, boolean conversationFound)
+   {
+      if ( !Pages.isDebugPage() )
+      {
+         // Only redirect to no-conversation-view if a login redirect isn't required
+         if (!conversationFound && !Pages.instance().isLoginRedirectRequired(facesContext))
+         {
+            Pages.instance().redirectToNoConversationView();
+         }
+         
+         Manager.instance().handleConversationPropagation(parameters);
+         
+         if ( Init.instance().isJbpmInstalled() && !isExceptionHandlerRedirect() )
+         {
+            Pageflow.instance().validatePageflow(facesContext);
+         }
+         
+         Pages.instance().postRestore(facesContext);
+      }
+   }
+  
+   private boolean preRenderPage(FacesContext facesContext)
+   {
+      if ( Pages.isDebugPage() )
+      {
+         return false;
+      }
+      else
+      {
+         FacesLifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
+         boolean actionsWereCalled = false;
+         try
+         {
+            actionsWereCalled = Pages.instance().preRender(facesContext);
+            return actionsWereCalled;
+         }
+         finally
+         {
+            FacesLifecycle.setPhaseId(PhaseId.RENDER_RESPONSE);
+            if (actionsWereCalled) 
+            {
+               FacesMessages.afterPhase();
+               handleTransactionsAfterPageActions(facesContext); //TODO: does it really belong in the finally?
+            }
+         }
+      }
+   }
+   
+   private boolean isExceptionHandlerRedirect()
+   {
+      return Contexts.getConversationContext().isSet("org.jboss.seam.handledException");
+   }
+      
+   void begin(PhaseId phaseId) 
+   {
+      try 
+      {
+         if ( !Transaction.instance().isActiveOrMarkedRollback() )
+         {
+            log.debug("beginning transaction prior to phase: " + phaseId);
+            Transaction.instance().begin();
+         }
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException("Could not start transaction", e);
+      }
+   }
+   
+   void commitOrRollback(PhaseId phaseId) 
+   {
+      try 
+      {
+         if ( Transaction.instance().isActive() )
+         {
+            log.debug("committing transaction after phase: " + phaseId);
+            Transaction.instance().commit();
+         }
+         else if ( Transaction.instance().isRolledBackOrMarkedRollback() )
+         {
+            log.debug("rolling back transaction after phase: " + phaseId);
+            Transaction.instance().rollback();
+         }
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException("Could not commit transaction", e);
+      }
+   }
+   
+}

Added: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/util/LRUMap.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/util/LRUMap.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/util/LRUMap.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,52 @@
+/**
+ * 
+ */
+package org.ajax4jsf.util;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map.Entry;
+
+/**
+ * Last Recent Used Map cache. See {@link LinkedHashMap} for details.
+ * @author asmirnov
+ *
+ */
+public class LRUMap<K,V> extends LinkedHashMap<K,V> implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7232885382582796665L;
+	private int capacity;
+	
+	
+	/**
+	 * @param capacity - maximal cache capacity.
+	 */
+	public LRUMap(int capacity) {
+		super(capacity, 1.0f,true);
+		this.capacity = capacity;
+	}
+
+	
+	protected boolean removeEldestEntry(Entry<K,V> entry) {
+		// Remove last entry if size exceeded.
+		return size()>capacity;
+	}
+
+	/**
+	 * Get most recent used element 
+	 * @return the most Recent value
+	 */
+	public Object getMostRecent() {
+		Iterator<V> iterator = values().iterator();
+		Object mostRecent=null;
+		while (iterator.hasNext()) {
+			 mostRecent = iterator.next();
+			
+		}
+		return mostRecent;
+	}
+}


Property changes on: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/util/LRUMap.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/application/PortletViewStateTestCase.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -48,7 +48,7 @@
 	String clientId = input.getClientId(facesContext);
 	FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,"msg","detail");
 	facesContext.addMessage(clientId, facesMessage);
-	PortletViewState state = new PortletViewState();
+	PortletViewState state = new PortletViewState("testPortlet012345");
 	state.saveMessages(facesContext);
 	Map messages = state.getMessages();
 	assertEquals(1, messages.size());

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/ContextFactoryTest.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/ContextFactoryTest.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/ContextFactoryTest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -47,11 +47,11 @@
          * {@link org.ajax4jsf.portlet.context.FacesContextFactoryImpl#FacesContextFactoryImpl(javax.faces.context.FacesContextFactory)}.
          */
     public void testFacesContextFactoryImpl() {
-	FacesContextFactoryImpl factory = new FacesContextFactoryImpl();
+	FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
 	FacesContext context = factory.getFacesContext(servletContext, request,
 		response, lifecycle);
 	assertTrue((context instanceof FacesContextImpl));
-	assertTrue((context.getExternalContext() instanceof ServletContextImpl));
+	assertTrue((context.getExternalContext() instanceof AbstractExternalContext));
     }
 
     /**
@@ -59,9 +59,9 @@
          * {@link org.ajax4jsf.portlet.context.FacesContextFactoryImpl#getFacesContext(java.lang.Object, java.lang.Object, java.lang.Object, javax.faces.lifecycle.Lifecycle)}.
          */
     public void testGetFacesContextPortlet() {
-	FacesContextFactoryImpl factory = new FacesContextFactoryImpl();
-	MockPortletContext portletContext = new MockPortletContext();
-	MockActionRequest portletRequest = new MockActionRequest();
+	FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
+	MockPortletContext portletContext = new MockPortletContext(servletContext);
+	MockActionRequest portletRequest = new MockActionRequest(portletContext);
 	MockActionResponse portletResponse = new MockActionResponse();
 	FacesContext context = factory.getFacesContext(portletContext,
 		portletRequest, portletResponse, lifecycle);
@@ -71,7 +71,7 @@
     }
 
     public void testIllegalEnvironment() throws Exception {
-	FacesContextFactoryImpl factory = new FacesContextFactoryImpl();
+	FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
 	try {
 	    FacesContext context = factory.getFacesContext(null, request,
 		    response, lifecycle);

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/FacesContextImplTest.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/FacesContextImplTest.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/FacesContextImplTest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -17,7 +17,7 @@
 public class FacesContextImplTest extends AbstractAjax4JsfTestCase {
     private static final String ID0 = "_id0";
     protected FacesContextImpl portalFacesContext;
-    protected ServletContextImpl servletContextImpl;
+    protected AbstractExternalContext servletContextImpl;
 
     /**
      * @param arg0
@@ -31,7 +31,7 @@
      */
     public void setUp() throws Exception {
 	super.setUp();
-	servletContextImpl = new ServletContextImpl(servletContext,request,response);
+	servletContextImpl = new ServletExternalContextImpl(servletContext,request,response);
 	portalFacesContext = new FacesContextImpl(servletContextImpl,lifecycle);
 	
     }

Modified: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/PortletExternalContextTest.java
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/PortletExternalContextTest.java	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/context/PortletExternalContextTest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -34,10 +34,10 @@
      */
     public void setUp() throws Exception {
 	super.setUp();
-	portletContext=new MockPortletContext();
-	portletRequest = new MockActionRequest();
+	portletContext=new MockPortletContext(servletContext);
+	portletRequest = new MockActionRequest(portletContext);
 	portletResponse = new MockActionResponse();
-	portletContextImpl = new PortletContextImpl(portletContext,portletRequest,portletResponse);
+	portletContextImpl = new PortletExternalContextImpl(portletContext,portletRequest,portletResponse);
 	portalFacesContext = new FacesContextImpl(portletContextImpl,lifecycle);
 	portalFacesContext.setViewRoot(facesContext.getViewRoot());
     }
@@ -55,7 +55,7 @@
     }
 
     /**
-     * Test method for {@link org.ajax4jsf.portlet.context.PortletContextImpl#getRequestParameterValuesMap()}.
+     * Test method for {@link org.ajax4jsf.portlet.context.PortletExternalContextImpl#getRequestParameterValuesMap()}.
      */
     public final void testGetRequestParameterValuesMap() {
 	Map requestParameterValuesMap = portalFacesContext.getExternalContext().getRequestParameterValuesMap();
@@ -66,22 +66,22 @@
     }
 
     /**
-     * Test method for {@link org.ajax4jsf.portlet.context.PortletContextImpl#getInitParameter(java.lang.String)}.
+     * Test method for {@link org.ajax4jsf.portlet.context.PortletExternalContextImpl#getInitParameter(java.lang.String)}.
      */
     public final void testGetInitParameterString() {
 	assertNull(portalFacesContext.getExternalContext().getInitParameter("blabla"));
-	assertSame(MockPortletContext.PORTLET_INIT_VALUE, portalFacesContext.getExternalContext().getInitParameter(MockPortletContext.INIT_PARAMETER));
+//	assertSame(MockPortletContext.PORTLET_INIT_VALUE, portalFacesContext.getExternalContext().getInitParameter(MockPortletContext.INIT_PARAMETER));
     }
 
     /**
-     * Test method for {@link org.ajax4jsf.portlet.context.PortletContextImpl#getRequestLocales()}.
+     * Test method for {@link org.ajax4jsf.portlet.context.PortletExternalContextImpl#getRequestLocales()}.
      */
     public final void testGetRequestLocales() {
 //	fail("Not yet implemented");
     }
 
     /**
-     * Test method for {@link org.ajax4jsf.portlet.context.PortletContextImpl#getSession(boolean)}.
+     * Test method for {@link org.ajax4jsf.portlet.context.PortletExternalContextImpl#getSession(boolean)}.
      */
     public final void testGetSessionBoolean() {
 //	fail("Not yet implemented");

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam)

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,87 +0,0 @@
-/**
- * 
- */
-package org.ajax4jsf.portlet.seam;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.portlet.faces.Bridge;
-
-import org.ajax4jsf.portlet.AbstractAjax4jsfPortletTestCase;
-import org.ajax4jsf.portlet.AjaxPortletBridge;
-import org.jboss.seam.Component;
-import org.jboss.seam.Seam;
-import org.jboss.seam.contexts.ApplicationContext;
-import org.jboss.seam.contexts.Context;
-import org.jboss.seam.contexts.TestLifecycle;
-import org.jboss.seam.core.Conversation;
-import org.jboss.seam.core.ConversationEntries;
-import org.jboss.seam.core.ConversationPropagation;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.core.Init;
-import org.jboss.seam.core.ResourceLoader;
-import org.jboss.seam.faces.FacesManager;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.faces.FacesPage;
-import org.jboss.seam.faces.Validation;
-import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.web.Session;
-
-/**
- * @author asmirnov
- *
- */
-public abstract class AbstractSeamPortletTestCase extends
-		AbstractAjax4jsfPortletTestCase {
-	
-	protected Bridge portletBridge;
-
-	public AbstractSeamPortletTestCase(String name) {
-		super(name);
-	}
-
-	@Override
-	public void setUp() throws Exception {
-		super.setUp();
-		  ExternalContext externalContext = setupRequest();
-		  facesContext.setExternalContext(externalContext);
-		  portletBridge = new AjaxPortletBridge();
-		  portletBridge.init(portletConfig);
-	      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
-	      installComponents(appContext);
-	}
-	
-	protected abstract ExternalContext setupRequest();
-
-	@Override
-	public void tearDown() throws Exception {
-		TestLifecycle.endTest();
-		super.tearDown();
-		portletBridge = null;
-	}
-	
-	   protected void installComponents(Context appContext)
-	   {
-	      Init init = new Init();
-	      init.setTransactionManagementEnabled(true);
-	      appContext.set( Seam.getComponentName(Init.class), init );
-	      installComponent(appContext, MockUserTransaction.class);	      
-	      installComponent(appContext, FacesManager.class);
-	      installComponent(appContext, ConversationEntries.class);
-	      installComponent(appContext, FacesPage.class);
-	      installComponent(appContext, Conversation.class);
-	      installComponent(appContext, FacesMessages.class);
-	      installComponent(appContext, Pages.class);
-	      installComponent(appContext, Events.class);
-	      installComponent(appContext, Validation.class);
-	      installComponent(appContext, Session.class);
-	      installComponent(appContext, ConversationPropagation.class);
-	      installComponent(appContext, ResourceLoader.class);
-	   }
-	   
-	   protected void installComponent(Context appContext, Class clazz)
-	   {
-	      appContext.set( Seam.getComponentName(clazz) + ".component", new Component(clazz) );
-	   }
-
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/AbstractSeamPortletTestCase.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,87 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet.seam;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.portlet.faces.Bridge;
+
+import org.ajax4jsf.portlet.AbstractAjax4jsfPortletTestCase;
+import org.ajax4jsf.portlet.AjaxPortletBridge;
+import org.jboss.seam.Component;
+import org.jboss.seam.Seam;
+import org.jboss.seam.contexts.ApplicationContext;
+import org.jboss.seam.contexts.Context;
+import org.jboss.seam.contexts.TestLifecycle;
+import org.jboss.seam.core.Conversation;
+import org.jboss.seam.core.ConversationEntries;
+import org.jboss.seam.core.ConversationPropagation;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.core.Init;
+import org.jboss.seam.core.ResourceLoader;
+import org.jboss.seam.faces.FacesManager;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.faces.FacesPage;
+import org.jboss.seam.faces.Validation;
+import org.jboss.seam.navigation.Pages;
+import org.jboss.seam.web.Session;
+
+/**
+ * @author asmirnov
+ *
+ */
+public abstract class AbstractSeamPortletTestCase extends
+		AbstractAjax4jsfPortletTestCase {
+	
+	protected Bridge portletBridge;
+
+	public AbstractSeamPortletTestCase(String name) {
+		super(name);
+	}
+
+	@Override
+	public void setUp() throws Exception {
+		super.setUp();
+		  ExternalContext externalContext = setupRequest();
+		  facesContext.setExternalContext(externalContext);
+		  portletBridge = new AjaxPortletBridge();
+		  portletBridge.init(portletConfig);
+	      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
+	      installComponents(appContext);
+	}
+	
+	protected abstract ExternalContext setupRequest();
+
+	@Override
+	public void tearDown() throws Exception {
+		TestLifecycle.endTest();
+		super.tearDown();
+		portletBridge = null;
+	}
+	
+	   protected void installComponents(Context appContext)
+	   {
+	      Init init = new Init();
+	      init.setTransactionManagementEnabled(true);
+	      appContext.set( Seam.getComponentName(Init.class), init );
+	      installComponent(appContext, MockUserTransaction.class);	      
+	      installComponent(appContext, FacesManager.class);
+	      installComponent(appContext, ConversationEntries.class);
+	      installComponent(appContext, FacesPage.class);
+	      installComponent(appContext, Conversation.class);
+	      installComponent(appContext, FacesMessages.class);
+	      installComponent(appContext, Pages.class);
+	      installComponent(appContext, Events.class);
+	      installComponent(appContext, Validation.class);
+	      installComponent(appContext, Session.class);
+	      installComponent(appContext, ConversationPropagation.class);
+	      installComponent(appContext, ResourceLoader.class);
+	   }
+	   
+	   protected void installComponent(Context appContext, Class clazz)
+	   {
+	      appContext.set( Seam.getComponentName(clazz) + ".component", new Component(clazz) );
+	   }
+
+}

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,115 +0,0 @@
-/**
- * 
- */
-package org.ajax4jsf.portlet.seam;
-
-import static org.jboss.seam.annotations.Install.FRAMEWORK;
-
-import javax.persistence.EntityManager;
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.transaction.AbstractUserTransaction;
-
-/**
- * @author asmirnov
- *
- */
- at Name("org.jboss.seam.transaction.transaction")
- at Scope(ScopeType.EVENT)
- at Install(value = false, precedence = FRAMEWORK)
- at BypassInterceptors
-public class MockUserTransaction extends AbstractUserTransaction {
-	
-	private static final Log _log = LogFactory.getLog(MockUserTransaction.class);
-	
-	private int status = Status.STATUS_NO_TRANSACTION;
-
-	/* (non-Javadoc)
-	 * @see org.jboss.seam.transaction.AbstractUserTransaction#registerSynchronization(javax.transaction.Synchronization)
-	 */
-	@Override
-	public void registerSynchronization(Synchronization arg0) {
-		_log.info("registerSyncronisation");
-		// TODO Auto-generated method stub
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.transaction.UserTransaction#begin()
-	 */
-	public void begin() throws NotSupportedException, SystemException {
-		_log.info("Transaction begin");
-		if(status != Status.STATUS_NO_TRANSACTION){
-			throw new SystemException("Transaction already active");
-		}
-		status = Status.STATUS_ACTIVE;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.transaction.UserTransaction#commit()
-	 */
-	public void commit() throws RollbackException, HeuristicMixedException,
-			HeuristicRollbackException, SecurityException,
-			IllegalStateException, SystemException {
-		_log.info("Transaction commit");
-		if(status != Status.STATUS_ACTIVE){
-			throw new SystemException("Transaction not active");
-		}
-		status = Status.STATUS_COMMITTED;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.transaction.UserTransaction#getStatus()
-	 */
-	public int getStatus() throws SystemException {
-		// TODO Auto-generated method stub
-		return status;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.transaction.UserTransaction#rollback()
-	 */
-	public void rollback() throws IllegalStateException, SecurityException,
-			SystemException {
-		_log.info("transaction rollback");
-		if(status != Status.STATUS_ACTIVE){
-			throw new SystemException("Transaction not active");
-		}
-		status = Status.STATUS_ROLLEDBACK;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.transaction.UserTransaction#setRollbackOnly()
-	 */
-	public void setRollbackOnly() throws IllegalStateException, SystemException {
-		_log.info("Transaction set to rollback only");
-		status = Status.STATUS_MARKED_ROLLBACK;
-
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.transaction.UserTransaction#setTransactionTimeout(int)
-	 */
-	public void setTransactionTimeout(int arg0) throws SystemException {
-		// TODO Auto-generated method stub
-
-	}
-
-	@Override
-	public void enlist(EntityManager entityManager) throws SystemException {
-		_log.info("Transaction enlist");
-		// do nothing
-	}
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/MockUserTransaction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,115 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet.seam;
+
+import static org.jboss.seam.annotations.Install.FRAMEWORK;
+
+import javax.persistence.EntityManager;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.transaction.AbstractUserTransaction;
+
+/**
+ * @author asmirnov
+ *
+ */
+ at Name("org.jboss.seam.transaction.transaction")
+ at Scope(ScopeType.EVENT)
+ at Install(value = false, precedence = FRAMEWORK)
+ at BypassInterceptors
+public class MockUserTransaction extends AbstractUserTransaction {
+	
+	private static final Log _log = LogFactory.getLog(MockUserTransaction.class);
+	
+	private int status = Status.STATUS_NO_TRANSACTION;
+
+	/* (non-Javadoc)
+	 * @see org.jboss.seam.transaction.AbstractUserTransaction#registerSynchronization(javax.transaction.Synchronization)
+	 */
+	@Override
+	public void registerSynchronization(Synchronization arg0) {
+		_log.info("registerSyncronisation");
+		// TODO Auto-generated method stub
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.transaction.UserTransaction#begin()
+	 */
+	public void begin() throws NotSupportedException, SystemException {
+		_log.info("Transaction begin");
+		if(status != Status.STATUS_NO_TRANSACTION){
+			throw new SystemException("Transaction already active");
+		}
+		status = Status.STATUS_ACTIVE;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.transaction.UserTransaction#commit()
+	 */
+	public void commit() throws RollbackException, HeuristicMixedException,
+			HeuristicRollbackException, SecurityException,
+			IllegalStateException, SystemException {
+		_log.info("Transaction commit");
+		if(status != Status.STATUS_ACTIVE){
+			throw new SystemException("Transaction not active");
+		}
+		status = Status.STATUS_COMMITTED;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.transaction.UserTransaction#getStatus()
+	 */
+	public int getStatus() throws SystemException {
+		// TODO Auto-generated method stub
+		return status;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.transaction.UserTransaction#rollback()
+	 */
+	public void rollback() throws IllegalStateException, SecurityException,
+			SystemException {
+		_log.info("transaction rollback");
+		if(status != Status.STATUS_ACTIVE){
+			throw new SystemException("Transaction not active");
+		}
+		status = Status.STATUS_ROLLEDBACK;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.transaction.UserTransaction#setRollbackOnly()
+	 */
+	public void setRollbackOnly() throws IllegalStateException, SystemException {
+		_log.info("Transaction set to rollback only");
+		status = Status.STATUS_MARKED_ROLLBACK;
+
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.transaction.UserTransaction#setTransactionTimeout(int)
+	 */
+	public void setTransactionTimeout(int arg0) throws SystemException {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void enlist(EntityManager entityManager) throws SystemException {
+		_log.info("Transaction enlist");
+		// do nothing
+	}
+}

Deleted: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,75 +0,0 @@
-/**
- * 
- */
-package org.ajax4jsf.portlet.seam;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.portlet.faces.Bridge;
-
-import org.ajax4jsf.portlet.context.AbstractExternalContext;
-import org.ajax4jsf.portlet.context.PortletExternalContextImpl;
-import org.jboss.seam.contexts.Contexts;
-
-/**
- * @author asmirnov
- *
- */
-public class PhaseListenerActionPhaseTest extends AbstractSeamPortletTestCase {
-
-	private SeamPhaseListener phaseListener;
-	/**
-	 * @param name
-	 */
-	public PhaseListenerActionPhaseTest(String name) {
-		super(name);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.ajax4jsf.portlet.seam.AbstractSeamPortletTestCase#setUp()
-	 */
-	public void setUp() throws Exception {
-		super.setUp();
-		phaseListener = new SeamPhaseListener();
-		lifecycle.addPhaseListener(phaseListener);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.ajax4jsf.portlet.seam.AbstractSeamPortletTestCase#tearDown()
-	 */
-	public void tearDown() throws Exception {
-		super.tearDown();
-		phaseListener = null;
-	}
-
-	/**
-	 * Test method for {@link org.ajax4jsf.portlet.seam.SeamPhaseListener#beforePhase(javax.faces.event.PhaseEvent)}.
-	 */
-	public void testBeforePhase() {
-		assertFalse(Contexts.isEventContextActive());
-		phaseListener.beforePhase(new PhaseEvent(facesContext,PhaseId.RESTORE_VIEW,lifecycle));
-		assertTrue(Contexts.isEventContextActive());
-	}
-
-	/**
-	 * Test method for {@link org.ajax4jsf.portlet.seam.SeamPhaseListener#afterPhase(javax.faces.event.PhaseEvent)}.
-	 */
-	public void testAfterPhase() {
-		assertFalse(Contexts.isEventContextActive());
-		phaseListener.beforePhase(new PhaseEvent(facesContext,PhaseId.RESTORE_VIEW,lifecycle));
-		phaseListener.afterPhase(new PhaseEvent(facesContext,PhaseId.RESTORE_VIEW,lifecycle));
-		assertTrue(Contexts.isEventContextActive());
-	}
-
-	@Override
-	protected ExternalContext setupRequest() {
-		setupActionRequest();
-		request.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, Bridge.PortletPhase.ActionPhase);
-		request.setAttribute(AbstractExternalContext.PORTLET_CONFIG_ATTRIBUTE,
-				portletConfig);
-
-		return new PortletExternalContextImpl(portletContext,actionRequest,actionResponse);
-	}
-
-}

Copied: branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java (from rev 5573, trunk/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java)
===================================================================
--- branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java	                        (rev 0)
+++ branches/3.1.x/extensions/portletbridge/portletbridge-impl/src/test/java/org/ajax4jsf/portlet/seam/PhaseListenerActionPhaseTest.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,75 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet.seam;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.portlet.faces.Bridge;
+
+import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.ajax4jsf.portlet.context.PortletExternalContextImpl;
+import org.jboss.seam.contexts.Contexts;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PhaseListenerActionPhaseTest extends AbstractSeamPortletTestCase {
+
+	private SeamPhaseListener phaseListener;
+	/**
+	 * @param name
+	 */
+	public PhaseListenerActionPhaseTest(String name) {
+		super(name);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.ajax4jsf.portlet.seam.AbstractSeamPortletTestCase#setUp()
+	 */
+	public void setUp() throws Exception {
+		super.setUp();
+		phaseListener = new SeamPhaseListener();
+		lifecycle.addPhaseListener(phaseListener);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.ajax4jsf.portlet.seam.AbstractSeamPortletTestCase#tearDown()
+	 */
+	public void tearDown() throws Exception {
+		super.tearDown();
+		phaseListener = null;
+	}
+
+	/**
+	 * Test method for {@link org.ajax4jsf.portlet.seam.SeamPhaseListener#beforePhase(javax.faces.event.PhaseEvent)}.
+	 */
+	public void testBeforePhase() {
+		assertFalse(Contexts.isEventContextActive());
+		phaseListener.beforePhase(new PhaseEvent(facesContext,PhaseId.RESTORE_VIEW,lifecycle));
+		assertTrue(Contexts.isEventContextActive());
+	}
+
+	/**
+	 * Test method for {@link org.ajax4jsf.portlet.seam.SeamPhaseListener#afterPhase(javax.faces.event.PhaseEvent)}.
+	 */
+	public void testAfterPhase() {
+		assertFalse(Contexts.isEventContextActive());
+		phaseListener.beforePhase(new PhaseEvent(facesContext,PhaseId.RESTORE_VIEW,lifecycle));
+		phaseListener.afterPhase(new PhaseEvent(facesContext,PhaseId.RESTORE_VIEW,lifecycle));
+		assertTrue(Contexts.isEventContextActive());
+	}
+
+	@Override
+	protected ExternalContext setupRequest() {
+		setupActionRequest();
+		request.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, Bridge.PortletPhase.ActionPhase);
+		request.setAttribute(AbstractExternalContext.PORTLET_CONFIG_ATTRIBUTE,
+				portletConfig);
+
+		return new PortletExternalContextImpl(portletContext,actionRequest,actionResponse);
+	}
+
+}

Modified: branches/3.1.x/samples/ajaxPortlet/pom.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/pom.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,4 +1,7 @@
-<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">
+<?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">
 	<parent>
 		<artifactId>samples</artifactId>
 		<groupId>org.richfaces</groupId>
@@ -60,15 +63,16 @@
 		<dependency>
 			<groupId>javax.faces</groupId>
 			<artifactId>jsf-api</artifactId>
-			<version>1.2_05</version>
+			<version>1.2_07</version>
 			<scope>provided</scope>
 			</dependency>
 			<dependency>
 			<groupId>javax.faces</groupId>
 			<artifactId>jsf-impl</artifactId>
-			<version>1.2_05</version>
+			<version>1.2_07</version>
 			<scope>provided</scope>
 			</dependency>
 		-->
 	</dependencies>
-</project>
\ No newline at end of file
+</project>
+

Copied: branches/3.1.x/samples/ajaxPortlet/src/main/resources (from rev 5573, trunk/samples/ajaxPortlet/src/main/resources)

Copied: branches/3.1.x/samples/ajaxPortlet/src/main/resources/META-INF (from rev 5573, trunk/samples/ajaxPortlet/src/main/resources/META-INF)

Modified: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia	2008-01-24 02:04:36 UTC (rev 5576)
@@ -18,4 +18,40 @@
     TARGET="rules:#jsf#start.xhtml" TITLE="start"/>
   </PROCESS-ITEM>
  </PROCESS-ITEM>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup" NAME="rules:#jsf#help.jspx"
+  PATH="/jsf/help.jspx" SHAPE="240,145,0,0">
+  <PROCESS-ITEM ENTITY="JSFProcessItem" ID="rules:#jsf#help.jspx:0"
+   NAME="item" PATH="/jsf/help.jspx">
+   <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+    ID="help2::#jsf#help2.jspx" NAME="output" PATH="/jsf/help2.jspx"
+    TARGET="rules:#jsf#help2.jspx" TITLE="help2"/>
+  </PROCESS-ITEM>
+ </PROCESS-ITEM>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup" NAME="rules:#jsf#help2.jspx"
+  PATH="/jsf/help2.jspx" SHAPE="32,129,0,0">
+  <PROCESS-ITEM ENTITY="JSFProcessItem" ID="rules:#jsf#help2.jspx:0"
+   NAME="item" PATH="/jsf/help2.jspx">
+   <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+    ID="start::#jsf#help.jspx" NAME="output" PATH="/jsf/help.jspx"
+    TARGET="rules:#jsf#help.jspx" TITLE="start"/>
+  </PROCESS-ITEM>
+ </PROCESS-ITEM>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup" NAME="rules:#jsf#edit.jspx"
+  PATH="/jsf/edit.jspx" SHAPE="240,257,0,0">
+  <PROCESS-ITEM ENTITY="JSFProcessItem" ID="rules:#jsf#edit.jspx:0"
+   NAME="item" PATH="/jsf/edit.jspx">
+   <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+    ID="edit2::#jsf#edit2.jspx" NAME="output" PATH="/jsf/edit2.jspx"
+    TARGET="rules:#jsf#edit2.jspx" TITLE="edit2"/>
+  </PROCESS-ITEM>
+ </PROCESS-ITEM>
+ <PROCESS-ITEM ENTITY="JSFProcessGroup" NAME="rules:#jsf#edit2.jspx"
+  PATH="/jsf/edit2.jspx" SHAPE="32,241,0,0">
+  <PROCESS-ITEM ENTITY="JSFProcessItem" ID="rules:#jsf#edit2.jspx:0"
+   NAME="item" PATH="/jsf/edit2.jspx">
+   <PROCESS-ITEM-OUTPUT ENTITY="JSFProcessItemOutput"
+    ID="start::#jsf#edit.jspx" NAME="output" PATH="/jsf/edit.jspx"
+    TARGET="rules:#jsf#edit.jspx" TITLE="start"/>
+  </PROCESS-ITEM>
+ </PROCESS-ITEM>
 </PROCESS>

Deleted: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployments>
-  <deployment>
-    <parent-ref>default</parent-ref>
-    <if-exists>overwrite</if-exists>
-    <instance>
-      <instance-name>AjaxPortletInstance</instance-name>
-      <component-ref>ajaxPortletApp.ajaxPortlet</component-ref>
-    </instance>
-  </deployment>
-  <!--
-  	<deployment>
-  	<parent-ref>default</parent-ref>
-  	<if-exists>overwrite</if-exists>
-  	<page>
-  	<page-name>ajaxPortlet</page-name>
-  	<window>
-  	<window-name>ajaxportletWindow</window-name>
-  	<instance-ref>AjaxPortletInstance</instance-ref>
-  	<default>true</default>
-  	<region>center</region>
-  	<height>0</height>
-  	</window>
-  	<window>
-  	<window-name>ajaxportletSecondWindow</window-name>
-  	<instance-ref>AjaxPortletSecondInstance</instance-ref>
-  	<default>true</default>
-  	<region>center</region>
-  	<height>0</height>
-  	</window>
-  	</page>
-  	</deployment>
-  -->
-  <deployment>
-      <if-exists>overwrite</if-exists>
-      <parent-ref>default.default</parent-ref>
-	    <window>
-		    <window-name>otherAjaxportletWindow</window-name>
-		    <instance-ref>AjaxPortletInstance</instance-ref>
-		    <default>true</default>
-		    <region>center</region>
-		    <height>0</height>
-	    </window>
-  </deployment><!--
-  <deployment>
-    <parent-ref>default</parent-ref>
-    <if-exists>overwrite</if-exists>
-    <instance>
-      <instance-name>AjaxPortletSecondInstance</instance-name>
-      <component-ref>ajaxPortletApp.ajaxPortlet</component-ref>
-    </instance>
-  </deployment>
---></deployments>

Copied: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxrepeaterportlet-object.xml (from rev 5573, trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxrepeaterportlet-object.xml)
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxrepeaterportlet-object.xml	                        (rev 0)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxrepeaterportlet-object.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+	<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<instance>
+			<instance-name>AjaxRepeaterPortletInstance</instance-name>
+			<component-ref>ajaxRepeaterPortletApp.ajaxRepeaterPortlet</component-ref>
+		</instance>
+	</deployment>
+	<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<instance>
+			<instance-name>RichfacesPortletInstance</instance-name>
+			<component-ref>ajaxRepeaterPortletApp.richfacesPortlet</component-ref>
+		</instance>
+	</deployment>
+	<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<page>
+			<page-name>ajaxRepeaterPortlet</page-name>
+			<window>
+				<window-name>ajaxRepeaterPortletWindow</window-name>
+				<instance-ref>AjaxRepeaterPortletInstance</instance-ref>
+				<default>true</default>
+				<region>center</region>
+				<height>0</height>
+			</window>
+		</page>
+	</deployment>
+	<deployment>
+		<if-exists>overwrite</if-exists>
+		<parent-ref>default.default</parent-ref>
+		<window>
+			<window-name>otherAjaxPortletWindow</window-name>
+			<instance-ref>AjaxRepeaterPortletInstance</instance-ref>
+			<default>true</default>
+			<region>center</region>
+			<height>0</height>
+		</window>
+	</deployment>
+	<deployment>
+		<if-exists>overwrite</if-exists>
+		<parent-ref>default.default</parent-ref>
+		<window>
+			<window-name>richfacesPortletWindow</window-name>
+			<instance-ref>RichfacesPortletInstance</instance-ref>
+			<default>true</default>
+			<region>center</region>
+			<height>0</height>
+		</window>
+	</deployment>
+	<!--
+		<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<instance>
+		<instance-name>AjaxRepeaterPortletSecondInstance</instance-name>
+		<component-ref>ajaxRepeaterPortletApp.ajaxRepeaterPortlet</component-ref>
+		</instance>
+		</deployment>
+	-->
+</deployments>

Modified: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -70,10 +70,10 @@
 		<view-handler>
 			org.ajax4jsf.portlet.application.PortletViewHandler
 		</view-handler>
+		<!-- 
 		<state-manager>
 			org.ajax4jsf.portlet.application.PortalStateManager
 		</state-manager>
-		<!-- 
 			<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
 		-->
 	</application>

Modified: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-app.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-app.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-app.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,3 +1,3 @@
 <jboss-app>
-	<app-name>ajaxPortletApp</app-name>
+	<app-name>ajaxRepeaterPortletApp</app-name>
 </jboss-app>
\ No newline at end of file

Modified: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -2,8 +2,22 @@
 
 <!DOCTYPE portlet-app PUBLIC
    "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
-   "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd"><portlet-app>
-    <portlet>
-         <portlet-name>ajaxPortlet</portlet-name>
-    </portlet>
-</portlet-app>         
\ No newline at end of file
+   "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<portlet-app>
+	<portlet>
+		<portlet-name>ajaxRepeaterPortlet</portlet-name>
+		<header-content>
+			<script src="/faces/rfRes/org/ajax4jsf/framework.pack.js" type="text/javascript" ></script>
+			<script src="/faces/rfRes/org/richfaces/ui.pack.js" type="text/javascript" ></script>
+			<link rel="stylesheet" type="text/css" href="/faces/rfRes/org/richfaces/skin.xcss" /> 
+		</header-content>
+	</portlet>
+	<portlet>
+		<portlet-name>richfacesPortlet</portlet-name>
+		<header-content>
+			<script src="/faces/rfRes/org/ajax4jsf/framework.pack.js" type="text/javascript" ></script>
+			<script src="/faces/rfRes/org/richfaces/ui.pack.js" type="text/javascript" ></script>
+			<link rel="stylesheet" type="text/css" href="/faces/rfRes/org/richfaces/skin.xcss" /> 
+		</header-content>
+	</portlet>
+</portlet-app>

Modified: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -2,14 +2,14 @@
 <deployments>
 	<deployment>
 		<instance>
-			<instance-id>AjaxPortletInstance</instance-id>
-			<portlet-ref>ajaxPortlet</portlet-ref>
+			<instance-id>AjaxRepeaterPortletInstance</instance-id>
+			<portlet-ref>ajaxRepeaterPortlet</portlet-ref>
 		</instance>
 	</deployment>
 	<deployment>
 		<instance>
-			<instance-id>AjaxPortletSecondInstance</instance-id>
-			<portlet-ref>ajaxPortlet</portlet-ref>
+			<instance-id>RichfacesPortletInstance</instance-id>
+			<portlet-ref>richfacesPortlet</portlet-ref>
 		</instance>
 	</deployment>
 </deployments>

Modified: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -2,7 +2,7 @@
   xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
   xmlns="http://java.sun.com/xml/ns/portlet">
   <portlet>
-    <portlet-name>ajaxPortlet</portlet-name>
+    <portlet-name>ajaxRepeaterPortlet</portlet-name>
     <portlet-class>
       javax.portlet.faces.GenericFacesPortlet
     </portlet-class>
@@ -24,7 +24,7 @@
 
     <expiration-cache>-0</expiration-cache>
     <portlet-info>
-       <title>Ajax Portlet</title>
+       <title>Ajax Repeater Portlet</title>
     </portlet-info>
     <supports>
       <mime-type>text/html</mime-type>
@@ -33,4 +33,36 @@
       <portlet-mode>HELP</portlet-mode>
     </supports>
   </portlet>
+  <portlet>
+    <portlet-name>richfacesPortlet</portlet-name>
+    <portlet-class>
+      javax.portlet.faces.GenericFacesPortlet
+    </portlet-class>
+
+    <init-param>
+      <name>javax.portlet.faces.defaultViewId.view</name>
+      <value>/richfaces/start.xhtml</value>
+    </init-param>
+
+    <init-param>
+      <name>javax.portlet.faces.defaultViewId.edit</name>
+      <value>/richfaces/edit.xhtml</value>
+    </init-param>
+
+    <init-param>
+      <name>javax.portlet.faces.defaultViewId.help</name>
+      <value>/richfaces/help.xhtml</value>
+    </init-param>
+
+    <expiration-cache>-0</expiration-cache>
+    <portlet-info>
+       <title>RichFaces components demo</title>
+    </portlet-info>
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+  </portlet>
 </portlet-app>

Modified: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/web.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/WEB-INF/web.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -59,6 +59,18 @@
   <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
   <param-value>org.ajax4jsf.portlet.application.FaceletPortletViewHandler</param-value>
  </context-param>
+   <context-param>
+		<param-name>org.richfaces.LoadStyleStrategy</param-name>
+		<param-value>NONE</param-value>
+	</context-param>
+	<context-param>
+		<param-name>org.richfaces.LoadScriptStrategy</param-name>
+		<param-value>NONE</param-value>
+	</context-param>
+	<context-param>
+		<param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
+		<param-value>rfRes</param-value>
+	</context-param>
  <!-- 
 		<context-param>
 		<param-name>facelets.LIBRARIES</param-name>

Copied: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes (from rev 5573, trunk/samples/ajaxPortlet/src/main/webapp/includes)

Deleted: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,57 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<f:view xmlns="http://www.w3.org/1999/xhtml"
-	xmlns:ui="http://java.sun.com/jsf/facelets"
-	xmlns:f="http://java.sun.com/jsf/core"
-	xmlns:h="http://java.sun.com/jsf/html"
-	xmlns:a="http://richfaces.org/a4j"
-	xmlns:rich="http://richfaces.org/rich">
-	<h:panelGrid columns="2" columnClasses="cols" width="100%">
-	<h:form>
-		<rich:panelMenu style="width:200px" mode="ajax"
-			iconExpandedGroup="disc" iconCollapsedGroup="disc"
-			iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
-			iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right">
-
-			<rich:panelMenuGroup label="Group 1">
-
-				<rich:panelMenuItem label="Item 1.1"
-					action="#{panelMenu.updateCurrent}">
-				</rich:panelMenuItem>
-
-				<rich:panelMenuItem label="Item 1.2"
-					action="#{panelMenu.updateCurrent}">
-				</rich:panelMenuItem>
-
-				<rich:panelMenuItem label="Item 1.3"
-					action="#{panelMenu.updateCurrent}">
-				</rich:panelMenuItem>
-			</rich:panelMenuGroup>
-			<rich:panelMenuGroup label="Group 2">
-
-				<rich:panelMenuItem label="Item 1.1"
-					action="#{panelMenu.updateCurrent}">
-				</rich:panelMenuItem>
-
-				<rich:panelMenuItem label="Item 1.2"
-					action="#{panelMenu.updateCurrent}">
-				</rich:panelMenuItem>
-
-				<rich:panelMenuItem label="Item 1.3"
-					action="#{panelMenu.updateCurrent}">
-				</rich:panelMenuItem>
-			</rich:panelMenuGroup>
-		</rich:panelMenu>
-		</h:form>
-		<rich:panel>
-			<f:facet name="header">
-				<h:panelGroup layout="block" styleClass="header">
-					<ui:insert name="header" />
-				</h:panelGroup>
-			</f:facet>
-			<ui:insert name="content" />
-		</rich:panel>
-	</h:panelGrid>
-	<h:panelGroup layout="block" styleClass="header">
-		Created with Richfaces UI components, Richfaces JSF portlet bridge and Facelets
-	</h:panelGroup>
-</f:view>

Copied: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml (from rev 5573, trunk/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml)
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:a="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+	<h:panelGrid columns="2" columnClasses="cols" width="100%">
+	<h:form>
+		<rich:panelMenu style="width:200px" mode="ajax"
+			iconExpandedGroup="disc" iconCollapsedGroup="disc"
+			iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
+			iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right">
+
+			<rich:panelMenuGroup label="Group 1">
+
+				<rich:panelMenuItem label="Item 1.1"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.2"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.3"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+			</rich:panelMenuGroup>
+			<rich:panelMenuGroup label="Group 2">
+
+				<rich:panelMenuItem label="Item 1.1"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.2"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.3"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+			</rich:panelMenuGroup>
+		</rich:panelMenu>
+		</h:form>
+		<rich:panel>
+			<f:facet name="header">
+				<h:panelGroup layout="block" styleClass="header">
+					<ui:insert name="header" />
+				</h:panelGroup>
+			</f:facet>
+			<ui:insert name="content" />
+		</rich:panel>
+	</h:panelGrid>
+	<h:panelGroup layout="block" styleClass="header">
+		Created with Richfaces UI components, Richfaces JSF portlet bridge and Facelets
+	</h:panelGroup>
+</f:view>

Copied: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces (from rev 5573, trunk/samples/ajaxPortlet/src/main/webapp/richfaces)

Deleted: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml	2008-01-24 01:01:33 UTC (rev 5573)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,34 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-	xmlns:ui="http://java.sun.com/jsf/facelets"
-	xmlns:h="http://java.sun.com/jsf/html"
-	xmlns:f="http://java.sun.com/jsf/core"
-	xmlns:a4j="http://richfaces.org/a4j"
-	xmlns:rich="http://richfaces.org/rich">
-<head>
-<title>Facelets composition with a "NONE" filter</title>
-</head>
-<body>
-<ui:composition template="/includes/template.xhtml">
-	<ui:define name="header">
-	<h:outputText value="RichFaces components in the portal environment"/>
-	</ui:define>
-	<ui:define name="content">
-	<h:form>
-		<h:panelGrid columns="1" border="1">
-	  <h:inputText value="#{bean.text}" >
-	     <a4j:support event="onkeyup" reRender="text,input"/>
-	  </h:inputText>
-	  <h:outputText id="text" value="#{bean.text}"/>
-	  <h:inputText disabled="true" id="input" value="#{bean.text}"/>
-	  			<rich:insert src="/pages/rusKoi.html" highlight="html"
-				encoding="Cp866" />
-			<rich:insert src="/notExist.xhtml" highlight="xhtml"
-				errorContent="/error.xhtml" />
-			<rich:insert src="/notExist.xhtml" highlight="xhtml" />
-		</h:panelGrid>
-		</h:form>
-	</ui:define>
-</ui:composition>
-</body>
-</html>
\ No newline at end of file

Copied: branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml (from rev 5573, trunk/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml)
===================================================================
--- branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+<head>
+<title>Facelets composition with a "NONE" filter</title>
+</head>
+<body>
+<ui:composition template="/includes/template.xhtml">
+	<ui:define name="header">
+	<h:outputText value="RichFaces components in the portal environment"/>
+	</ui:define>
+	<ui:define name="content">
+	<h:form>
+		<h:panelGrid columns="1" border="1">
+	  <h:inputText value="#{bean.text}" >
+	     <a4j:support event="onkeyup" reRender="text,input"/>
+	  </h:inputText>
+	  <h:outputText id="text" value="#{bean.text}"/>
+	  <h:inputText disabled="true" id="input" value="#{bean.text}"/>
+	  			<rich:insert src="/pages/rusKoi.html" highlight="html"
+				encoding="Cp866" />
+			<rich:insert src="/notExist.xhtml" highlight="xhtml"
+				errorContent="/error.xhtml" />
+			<rich:insert src="/notExist.xhtml" highlight="xhtml" />
+		</h:panelGrid>
+		</h:form>
+	</ui:define>
+</ui:composition>
+</body>
+</html>
\ No newline at end of file

Modified: branches/3.1.x/samples/pom.xml
===================================================================
--- branches/3.1.x/samples/pom.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -428,6 +428,7 @@
 		<module>listShuttleDemo</module>
 		<module>contextMenuDemo</module>
 		<module>ajaxPortlet</module>
+		<module>seamPortletEar</module>
 		<module>panelmenu-sample</module>
 		<module>rich-message-demo</module>
 		<!--

Modified: branches/3.1.x/samples/scrollableDataTableDemo/pom.xml
===================================================================
--- branches/3.1.x/samples/scrollableDataTableDemo/pom.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/scrollableDataTableDemo/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -4,34 +4,34 @@
 	<parent>
 		<artifactId>samples</artifactId>
 		<groupId>org.richfaces</groupId>
-		<version>3.1.4-SNAPSHOT</version>
+		<version>3.1.3.GA</version>
 	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<artifactId>scrollableDataTableDemo</artifactId>
 	<groupId>org.richfaces.samples</groupId>
-	<version>3.1.4-SNAPSHOT</version>
+	<version>3.1.3.GA</version>
 	<packaging>war</packaging>
 	<name>scrollableDataTable Maven Webapp</name>
 	<dependencies>
 		<dependency>
 			<groupId>org.richfaces.ui</groupId>
 			<artifactId>scrollableDataTable</artifactId>
-			<version>3.1.4-SNAPSHOT</version>
+			<version>3.1.3.GA</version>
 		</dependency>
 		<dependency>
 			<groupId>org.richfaces.samples</groupId>
 			<artifactId>skins</artifactId>
-			<version>3.1.4-SNAPSHOT</version>
+			<version>3.1.3.GA</version>
 		</dependency>
 		<dependency>
 			<groupId>org.richfaces.ui</groupId>
 			<artifactId>core</artifactId>
-			<version>3.1.4-SNAPSHOT</version>
+			<version>3.1.3.GA</version>
 		</dependency>
 	    <dependency>
 	      <groupId>org.richfaces.ui</groupId>
 	      <artifactId>dataTable</artifactId>
-	      <version>3.1.4-SNAPSHOT</version>
+	      <version>3.1.3.GA</version>
 	    </dependency>
 	</dependencies>
 

Copied: branches/3.1.x/samples/seamPortletEar/ear (from rev 5574, trunk/samples/seamPortletEar/ear)

Deleted: branches/3.1.x/samples/seamPortletEar/ear/pom.xml
===================================================================
--- trunk/samples/seamPortletEar/ear/pom.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/ear/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<project>
-	<parent>
-		<artifactId>seamPortletEar</artifactId>
-		<groupId>org.richfaces.samples</groupId>
-		<version>3.2.0-SNAPSHOT</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.richfaces.samples.seamPortletEar</groupId>
-	<artifactId>portletEar</artifactId>
-	<packaging>ear</packaging>
-	<name>Seam Portlet Ear</name>
-	<version>3.2.0-SNAPSHOT</version>
-	<dependencies>
-		<dependency>
-			<groupId>org.jboss.seam</groupId>
-			<artifactId>jboss-seam</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.richfaces.samples.seamPortletEar</groupId>
-			<artifactId>seamBooking</artifactId>
-			<type>ejb</type>
-		</dependency>
-		<dependency>
-			<groupId>org.richfaces.samples.seamPortletEar</groupId>
-			<artifactId>seamBookingPortlet</artifactId>
-			<type>war</type>
-		</dependency>
-	</dependencies>
-	<build>
-		<finalName>seamEAR</finalName>
-		<plugins>
-			<plugin>
-				<artifactId>maven-ear-plugin</artifactId>
-				<configuration>
-					<defaultLibBundleDir>lib</defaultLibBundleDir>
-					<modules>
-						<ejbModule>
-							<groupId>org.jboss.seam</groupId>
-							<artifactId>jboss-seam</artifactId>
-							<!--
-								<includeInApplicationXml>
-								true
-								</includeInApplicationXml>
-							-->
-							<bundleDir>/</bundleDir>
-						</ejbModule>
-						<ejbModule>
-							<groupId>
-								org.richfaces.samples.seamPortletEar
-							</groupId>
-							<artifactId>seamBooking</artifactId>
-							<bundleDir>/</bundleDir>
-						</ejbModule>
-						<jarModule>
-							<groupId>org.richfaces.framework</groupId>
-							<artifactId>richfaces-api</artifactId>
-							<includeInApplicationXml>
-								true
-							</includeInApplicationXml>
-							<bundleDir>/</bundleDir>
-						</jarModule>
-					</modules>
-					<artifactTypeMappings>
-						<artifactTypeMapping type="jar" mapping="ejb" />
-					</artifactTypeMappings>
-					<archive>
-						<manifest>
-							<addClasspath>true</addClasspath>
-						</manifest>
-					</archive>
-					<jboss>
-						<version>4.2</version>
-						<loader-repository>
-							seam.jboss.org:loader=seamEAR
-						</loader-repository>
-					</jboss>
-					<version>5</version>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-</project>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/ear/pom.xml (from rev 5574, trunk/samples/seamPortletEar/ear/pom.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/ear/pom.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/ear/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<project>
+	<parent>
+		<artifactId>seamPortletEar</artifactId>
+		<groupId>org.richfaces.samples</groupId>
+		<version>3.1.4-SNAPSHOT</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.richfaces.samples.seamPortletEar</groupId>
+	<artifactId>portletEar</artifactId>
+	<packaging>ear</packaging>
+	<name>Seam Portlet Ear</name>
+	<version>3.1.4-SNAPSHOT</version>
+	<dependencies>
+		<dependency>
+			<groupId>org.jboss.seam</groupId>
+			<artifactId>jboss-seam</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.richfaces.samples.seamPortletEar</groupId>
+			<artifactId>seamBooking</artifactId>
+			<type>ejb</type>
+		</dependency>
+		<dependency>
+			<groupId>org.richfaces.samples.seamPortletEar</groupId>
+			<artifactId>seamBookingPortlet</artifactId>
+			<type>war</type>
+		</dependency>
+	</dependencies>
+	<build>
+		<finalName>seamEAR</finalName>
+		<plugins>
+			<plugin>
+				<artifactId>maven-ear-plugin</artifactId>
+				<configuration>
+					<defaultLibBundleDir>lib</defaultLibBundleDir>
+					<modules>
+						<ejbModule>
+							<groupId>org.jboss.seam</groupId>
+							<artifactId>jboss-seam</artifactId>
+							<!--
+								<includeInApplicationXml>
+								true
+								</includeInApplicationXml>
+							-->
+							<bundleDir>/</bundleDir>
+						</ejbModule>
+						<ejbModule>
+							<groupId>
+								org.richfaces.samples.seamPortletEar
+							</groupId>
+							<artifactId>seamBooking</artifactId>
+							<bundleDir>/</bundleDir>
+						</ejbModule>
+						<jarModule>
+							<groupId>org.richfaces.framework</groupId>
+							<artifactId>richfaces-api</artifactId>
+							<includeInApplicationXml>
+								true
+							</includeInApplicationXml>
+							<bundleDir>/</bundleDir>
+						</jarModule>
+					</modules>
+					<artifactTypeMappings>
+						<artifactTypeMapping type="jar" mapping="ejb" />
+					</artifactTypeMappings>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+						</manifest>
+					</archive>
+					<jboss>
+						<version>4.2</version>
+						<loader-repository>
+							seam.jboss.org:loader=seamEAR
+						</loader-repository>
+					</jboss>
+					<version>5</version>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/ear/src (from rev 5574, trunk/samples/seamPortletEar/ear/src)

Copied: branches/3.1.x/samples/seamPortletEar/pom.xml (from rev 5574, trunk/samples/seamPortletEar/pom.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/pom.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,122 @@
+<?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">
+	<!--
+		<parent>
+		<artifactId>samples</artifactId>
+		<groupId>org.richfaces</groupId>
+		<version>3.1.4-SNAPSHOT</version>
+		</parent>
+	-->
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.richfaces.samples</groupId>
+	<version>3.1.4-SNAPSHOT</version>
+	<artifactId>seamPortletEar</artifactId>
+	<packaging>pom</packaging>
+	<name>seam EAR portlet project</name>
+        <properties>
+          <seam>2.0.1.CR2</seam>
+        </properties>
+	<modules>
+		<module>seamBookingPortlet</module>
+<!--		<module>seamBooking</module>
+		<module>ear</module> -->
+    <module>ear</module>
+    <module>seamBooking</module>
+  </modules>
+	<build>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<inherited>true</inherited>
+					<configuration>
+						<source>1.5</source>
+						<target>1.5</target>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+	<repositories>
+		<repository>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
+				<updatePolicy>never</updatePolicy>
+			</snapshots>
+			<id>repository.jboss.com</id>
+			<name>Jboss Repository for Maven</name>
+			<url>http://repository.jboss.com/maven2/</url>
+			<layout>default</layout>
+		</repository>
+	</repositories>
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>org.richfaces.samples.seamPortletEar</groupId>
+				<artifactId>seamBookingPortlet</artifactId>
+				<version>3.1.4-SNAPSHOT</version>
+				<type>war</type>
+			</dependency>
+			<dependency>
+				<groupId>org.richfaces.samples.seamPortletEar</groupId>
+				<artifactId>seamBooking</artifactId>
+				<version>3.1.4-SNAPSHOT</version>
+				<type>ejb</type>
+			</dependency>
+                <dependency>
+                        <groupId>org.hibernate</groupId>
+                        <artifactId>hibernate-validator</artifactId>
+                        <version>3.0.0.GA</version>
+                        <scope>provided</scope>
+                </dependency>
+                <dependency>
+                        <groupId>org.hibernate</groupId>
+                        <artifactId>hibernate-annotations</artifactId>
+                        <version>3.3.0.ga</version>
+                        <scope>provided</scope>
+                </dependency>
+                <dependency>
+                        <groupId>org.hibernate</groupId>
+                        <artifactId>hibernate-entitymanager</artifactId>
+                        <version>3.3.1.ga</version>
+                        <scope>provided</scope>
+                </dependency>
+                <dependency>
+                        <groupId>org.jboss.seam</groupId>
+                        <artifactId>jboss-seam</artifactId>
+                        <version>${seam}</version>
+                        <exclusions>
+                          <exclusion><groupId>javax.el</groupId><artifactId>el-api</artifactId></exclusion>
+                          <exclusion><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId></exclusion>
+                        </exclusions>
+                </dependency>
+                <dependency>
+                        <groupId>org.jboss.seam</groupId>
+                        <artifactId>jboss-seam-ui</artifactId>
+                        <version>${seam}</version>
+                        <exclusions>
+                          <exclusion><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId></exclusion>
+                        </exclusions>
+                </dependency>
+                <dependency>
+                        <groupId>org.jboss.seam</groupId>
+                        <artifactId>jboss-seam-ioc</artifactId>
+                        <version>${seam}</version>
+                        <exclusions>
+                          <exclusion><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId></exclusion>
+                        </exclusions>
+                </dependency>
+                <dependency>
+                        <groupId>org.jboss.seam</groupId>
+                        <artifactId>jboss-seam-debug</artifactId>
+                        <version>${seam}</version>
+                        <exclusions>
+                          <exclusion><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId></exclusion>
+                        </exclusions>
+                </dependency>
+		</dependencies>
+	</dependencyManagement>
+</project>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking (from rev 5574, trunk/samples/seamPortletEar/seamBooking)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/pom.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/pom.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<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">
-  <parent>
-    <artifactId>seamPortletEar</artifactId>
-    <groupId>org.richfaces.samples</groupId>
-    <version>3.2.0-SNAPSHOT</version>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.richfaces.samples.seamPortletEar</groupId>
-  <artifactId>seamBooking</artifactId>
-  <name>seamBooking</name>
-  <packaging>ejb</packaging>
-  <version>3.2.0-SNAPSHOT</version>
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
-                <dependency>
-                        <groupId>org.jboss.seam</groupId>
-                        <artifactId>jboss-seam</artifactId>
-                        <scope>provided</scope>
-                </dependency>
-		<dependency>
-		    <groupId>javax.faces</groupId>
-		    <artifactId>jsf-api</artifactId>
-	            <version>1.2_07</version>
-	            <scope>provided</scope>
-	</dependency>
-                <dependency>
-                        <groupId>org.richfaces.framework</groupId>
-                        <artifactId>richfaces-api</artifactId>
-                        <version>3.2.0-SNAPSHOT</version>
-        	</dependency>
-                <dependency>
-                        <groupId>javax.ejb</groupId>
-                        <artifactId>ejb-api</artifactId>
-                        <version>3.0</version>
-                        <scope>provided</scope>
-                        <optional>true</optional>
-                </dependency>
-                <dependency>
-                        <groupId>javax.annotation</groupId>
-                        <artifactId>jsr250-api</artifactId>
-                        <version>1.0</version>
-                        <scope>provided</scope>
-                        <optional>true</optional>
-                </dependency>
-                <dependency>
-                        <groupId>javax.persistence</groupId>
-                        <artifactId>persistence-api</artifactId>
-                        <version>1.0</version>
-                        <scope>provided</scope>
-                        <optional>true</optional>
-                </dependency>
-                <dependency>
-                        <groupId>org.hibernate</groupId>
-                        <artifactId>hibernate-commons-annotations</artifactId>
-                        <version>3.3.0.ga</version>
-                        <optional>true</optional>
-                        <scope>provided</scope>
-                </dependency>
-                        <dependency>
-                        <groupId>org.hibernate</groupId>
-                        <artifactId>hibernate-annotations</artifactId>
-                        <version>3.2.0.ga</version>
-                        <optional>true</optional>
-                        <scope>provided</scope>
-                        </dependency>
-  </dependencies>
-  <build>
-        <finalName>seamBooking</finalName>
-                <plugins>
-                        <plugin>
-                                <artifactId>maven-ejb-plugin</artifactId>
-                                <configuration>
-                                        <ejbVersion>3.0</ejbVersion>
-                                        <archive>
-                                                <manifest>
-                                                        <addClasspath>true</addClasspath>
-                                                </manifest>
-                                        </archive>
-                                </configuration>
-                        </plugin>
-                </plugins>
-        </build>
-</project>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/pom.xml (from rev 5574, trunk/samples/seamPortletEar/seamBooking/pom.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/pom.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<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">
+  <parent>
+    <artifactId>seamPortletEar</artifactId>
+    <groupId>org.richfaces.samples</groupId>
+    <version>3.1.4-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.richfaces.samples.seamPortletEar</groupId>
+  <artifactId>seamBooking</artifactId>
+  <name>seamBooking</name>
+  <packaging>ejb</packaging>
+  <version>3.1.4-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+                <dependency>
+                        <groupId>org.jboss.seam</groupId>
+                        <artifactId>jboss-seam</artifactId>
+                        <scope>provided</scope>
+                </dependency>
+		<dependency>
+		    <groupId>javax.faces</groupId>
+		    <artifactId>jsf-api</artifactId>
+	            <version>1.2_07</version>
+	            <scope>provided</scope>
+	</dependency>
+                <dependency>
+                        <groupId>org.richfaces.framework</groupId>
+                        <artifactId>richfaces-api</artifactId>
+                        <version>3.1.4-SNAPSHOT</version>
+        	</dependency>
+                <dependency>
+                        <groupId>javax.ejb</groupId>
+                        <artifactId>ejb-api</artifactId>
+                        <version>3.0</version>
+                        <scope>provided</scope>
+                        <optional>true</optional>
+                </dependency>
+                <dependency>
+                        <groupId>javax.annotation</groupId>
+                        <artifactId>jsr250-api</artifactId>
+                        <version>1.0</version>
+                        <scope>provided</scope>
+                        <optional>true</optional>
+                </dependency>
+                <dependency>
+                        <groupId>javax.persistence</groupId>
+                        <artifactId>persistence-api</artifactId>
+                        <version>1.0</version>
+                        <scope>provided</scope>
+                        <optional>true</optional>
+                </dependency>
+                <dependency>
+                        <groupId>org.hibernate</groupId>
+                        <artifactId>hibernate-commons-annotations</artifactId>
+                        <version>3.3.0.ga</version>
+                        <optional>true</optional>
+                        <scope>provided</scope>
+                </dependency>
+                        <dependency>
+                        <groupId>org.hibernate</groupId>
+                        <artifactId>hibernate-annotations</artifactId>
+                        <version>3.2.0.ga</version>
+                        <optional>true</optional>
+                        <scope>provided</scope>
+                        </dependency>
+  </dependencies>
+  <build>
+        <finalName>seamBooking</finalName>
+                <plugins>
+                        <plugin>
+                                <artifactId>maven-ejb-plugin</artifactId>
+                                <configuration>
+                                        <ejbVersion>3.0</ejbVersion>
+                                        <archive>
+                                                <manifest>
+                                                        <addClasspath>true</addClasspath>
+                                                </manifest>
+                                        </archive>
+                                </configuration>
+                        </plugin>
+                </plugins>
+        </build>
+</project>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,9 +0,0 @@
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
- at Local
-public interface Authenticator
-{
-   boolean authenticate();
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Authenticator.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,9 @@
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface Authenticator
+{
+   boolean authenticate();
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,40 +0,0 @@
-package org.jboss.seam.example.booking;
-
-import static org.jboss.seam.ScopeType.SESSION;
-
-import java.util.List;
-
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-
- at Stateless
- at Name("authenticator")
-public class AuthenticatorAction implements Authenticator
-{
-   @PersistenceContext 
-   private EntityManager em;
-   
-   @Out(required=false, scope = SESSION)
-   private User user;
-   
-   public boolean authenticate()
-   {
-      List results = em.createQuery("select u from User u where u.username=#{identity.username} and u.password=#{identity.password}")
-            .getResultList();
-      
-      if ( results.size()==0 )
-      {
-         return false;
-      }
-      else
-      {
-         user = (User) results.get(0);
-         return true;
-      }
-   }
-
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,40 @@
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.util.List;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+ at Stateless
+ at Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+   @PersistenceContext 
+   private EntityManager em;
+   
+   @Out(required=false, scope = SESSION)
+   private User user;
+   
+   public boolean authenticate()
+   {
+      List results = em.createQuery("select u from User u where u.username=#{identity.username} and u.password=#{identity.password}")
+            .getResultList();
+      
+      if ( results.size()==0 )
+      {
+         return false;
+      }
+      else
+      {
+         user = (User) results.get(0);
+         return true;
+      }
+   }
+
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,190 +0,0 @@
-//$Id: Booking.java,v 1.15 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.text.DateFormat;
-import java.util.Date;
-
-import javax.persistence.Basic;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotNull;
-import org.hibernate.validator.Pattern;
-import org.jboss.seam.annotations.Name;
-
- at Entity
- at Name("booking")
-public class Booking implements Serializable
-{
-   private Long id;
-   private User user;
-   private Hotel hotel;
-   private Date checkinDate;
-   private Date checkoutDate;
-   private String creditCard;
-   private String creditCardName;
-   private int creditCardExpiryMonth;
-   private int creditCardExpiryYear;
-   private boolean smoking;
-   private int beds;
-   
-   public Booking() {}
-   
-   public Booking(Hotel hotel, User user)
-   {
-      this.hotel = hotel;
-      this.user = user;
-   }
-   
-   @Transient
-   public BigDecimal getTotal()
-   {
-      return hotel.getPrice().multiply( new BigDecimal( getNights() ) );
-   }
-
-   @Transient
-   public int getNights()
-   {
-      return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / 1000 / 60 / 60 / 24;
-   }
-
-   @Id @GeneratedValue
-   public Long getId()
-   {
-      return id;
-   }
-   public void setId(Long id)
-   {
-      this.id = id;
-   }
-   
-   @NotNull
-   @Basic @Temporal(TemporalType.DATE) 
-   public Date getCheckinDate()
-   {
-      return checkinDate;
-   }
-   public void setCheckinDate(Date datetime)
-   {
-      this.checkinDate = datetime;
-   }
-
-   @ManyToOne @NotNull
-   public Hotel getHotel()
-   {
-      return hotel;
-   }
-   public void setHotel(Hotel hotel)
-   {
-      this.hotel = hotel;
-   }
-   
-   @ManyToOne @NotNull
-   public User getUser()
-   {
-      return user;
-   }
-   public void setUser(User user)
-   {
-      this.user = user;
-   }
-   
-   @Basic @Temporal(TemporalType.DATE) 
-   @NotNull
-   public Date getCheckoutDate()
-   {
-      return checkoutDate;
-   }
-   public void setCheckoutDate(Date checkoutDate)
-   {
-      this.checkoutDate = checkoutDate;
-   }
-   
-   @NotNull(message="Credit card number is required")
-   @Length(min=16, max=16, message="Credit card number must 16 digits long")
-   @Pattern(regex="^\\d*$", message="Credit card number must be numeric")
-   public String getCreditCard()
-   {
-      return creditCard;
-   }
-
-   public void setCreditCard(String creditCard)
-   {
-      this.creditCard = creditCard;
-   }
-   
-   @Transient
-   public String getDescription()
-   {
-      DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
-      return hotel==null ? null : hotel.getName() + 
-            ", " + df.format( getCheckinDate() ) + 
-            " to " + df.format( getCheckoutDate() );
-   }
-
-   public boolean isSmoking()
-   {
-      return smoking;
-   }
-
-   public void setSmoking(boolean smoking)
-   {
-      this.smoking = smoking;
-   }
-   
-   public int getBeds()
-   {
-      return beds;
-   }
-
-   public void setBeds(int beds)
-   {
-      this.beds = beds;
-   }
-   @NotNull(message="Credit card name is required")
-   @Length(min=3, max=70, message="Credit card name is required")
-   public String getCreditCardName()
-   {
-      return creditCardName;
-   }
-
-   public void setCreditCardName(String creditCardName)
-   {
-      this.creditCardName = creditCardName;
-   }
-
-   public int getCreditCardExpiryMonth()
-   {
-      return creditCardExpiryMonth;
-   }
-
-   public void setCreditCardExpiryMonth(int creditCardExpiryMonth)
-   {
-      this.creditCardExpiryMonth = creditCardExpiryMonth;
-   }
-
-   public int getCreditCardExpiryYear()
-   {
-      return creditCardExpiryYear;
-   }
-
-   public void setCreditCardExpiryYear(int creditCardExpiryYear)
-   {
-      this.creditCardExpiryYear = creditCardExpiryYear;
-   }
-   
-   @Override
-   public String toString()
-   {
-      return "Booking(" + user + ","+ hotel + ")";
-   }
-
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,190 @@
+//$Id: Booking.java,v 1.15 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.text.DateFormat;
+import java.util.Date;
+
+import javax.persistence.Basic;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+import org.jboss.seam.annotations.Name;
+
+ at Entity
+ at Name("booking")
+public class Booking implements Serializable
+{
+   private Long id;
+   private User user;
+   private Hotel hotel;
+   private Date checkinDate;
+   private Date checkoutDate;
+   private String creditCard;
+   private String creditCardName;
+   private int creditCardExpiryMonth;
+   private int creditCardExpiryYear;
+   private boolean smoking;
+   private int beds;
+   
+   public Booking() {}
+   
+   public Booking(Hotel hotel, User user)
+   {
+      this.hotel = hotel;
+      this.user = user;
+   }
+   
+   @Transient
+   public BigDecimal getTotal()
+   {
+      return hotel.getPrice().multiply( new BigDecimal( getNights() ) );
+   }
+
+   @Transient
+   public int getNights()
+   {
+      return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / 1000 / 60 / 60 / 24;
+   }
+
+   @Id @GeneratedValue
+   public Long getId()
+   {
+      return id;
+   }
+   public void setId(Long id)
+   {
+      this.id = id;
+   }
+   
+   @NotNull
+   @Basic @Temporal(TemporalType.DATE) 
+   public Date getCheckinDate()
+   {
+      return checkinDate;
+   }
+   public void setCheckinDate(Date datetime)
+   {
+      this.checkinDate = datetime;
+   }
+
+   @ManyToOne @NotNull
+   public Hotel getHotel()
+   {
+      return hotel;
+   }
+   public void setHotel(Hotel hotel)
+   {
+      this.hotel = hotel;
+   }
+   
+   @ManyToOne @NotNull
+   public User getUser()
+   {
+      return user;
+   }
+   public void setUser(User user)
+   {
+      this.user = user;
+   }
+   
+   @Basic @Temporal(TemporalType.DATE) 
+   @NotNull
+   public Date getCheckoutDate()
+   {
+      return checkoutDate;
+   }
+   public void setCheckoutDate(Date checkoutDate)
+   {
+      this.checkoutDate = checkoutDate;
+   }
+   
+   @NotNull(message="Credit card number is required")
+   @Length(min=16, max=16, message="Credit card number must 16 digits long")
+   @Pattern(regex="^\\d*$", message="Credit card number must be numeric")
+   public String getCreditCard()
+   {
+      return creditCard;
+   }
+
+   public void setCreditCard(String creditCard)
+   {
+      this.creditCard = creditCard;
+   }
+   
+   @Transient
+   public String getDescription()
+   {
+      DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
+      return hotel==null ? null : hotel.getName() + 
+            ", " + df.format( getCheckinDate() ) + 
+            " to " + df.format( getCheckoutDate() );
+   }
+
+   public boolean isSmoking()
+   {
+      return smoking;
+   }
+
+   public void setSmoking(boolean smoking)
+   {
+      this.smoking = smoking;
+   }
+   
+   public int getBeds()
+   {
+      return beds;
+   }
+
+   public void setBeds(int beds)
+   {
+      this.beds = beds;
+   }
+   @NotNull(message="Credit card name is required")
+   @Length(min=3, max=70, message="Credit card name is required")
+   public String getCreditCardName()
+   {
+      return creditCardName;
+   }
+
+   public void setCreditCardName(String creditCardName)
+   {
+      this.creditCardName = creditCardName;
+   }
+
+   public int getCreditCardExpiryMonth()
+   {
+      return creditCardExpiryMonth;
+   }
+
+   public void setCreditCardExpiryMonth(int creditCardExpiryMonth)
+   {
+      this.creditCardExpiryMonth = creditCardExpiryMonth;
+   }
+
+   public int getCreditCardExpiryYear()
+   {
+      return creditCardExpiryYear;
+   }
+
+   public void setCreditCardExpiryYear(int creditCardExpiryYear)
+   {
+      this.creditCardExpiryYear = creditCardExpiryYear;
+   }
+   
+   @Override
+   public String toString()
+   {
+      return "Booking(" + user + ","+ hotel + ")";
+   }
+
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,13 +0,0 @@
-//$Id: BookingList.java,v 1.7 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
- at Local
-public interface BookingList
-{
-   public void getBookings();
-   public Booking getBooking();
-   public void cancel();
-   public void destroy();
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingList.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,13 @@
+//$Id: BookingList.java,v 1.7 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface BookingList
+{
+   public void getBookings();
+   public Booking getBooking();
+   public void cancel();
+   public void destroy();
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,76 +0,0 @@
-//$Id: BookingListAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
-import static org.jboss.seam.ScopeType.SESSION;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.seam.annotations.Factory;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.datamodel.DataModel;
-import org.jboss.seam.annotations.datamodel.DataModelSelection;
-import org.jboss.seam.annotations.security.Restrict;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.log.Log;
-
- at Stateful
- at Scope(SESSION)
- at Name("bookingList")
- at Restrict("#{identity.loggedIn}")
- at TransactionAttribute(REQUIRES_NEW)
-public class BookingListAction implements BookingList, Serializable
-{
-   private static final long serialVersionUID = 1L;
-   
-   @PersistenceContext
-   private EntityManager em;
-   
-   @In
-   private User user;
-   
-   @DataModel
-   private List<Booking> bookings;
-   @DataModelSelection 
-   private Booking booking;
-   
-   @Logger 
-   private Log log;
-   
-   @Factory
-   @Observer("bookingConfirmed")
-   public void getBookings()
-   {
-      bookings = em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate")
-            .setParameter("username", user.getUsername())
-            .getResultList();
-   }
-   
-   public void cancel()
-   {
-      log.info("Cancel booking: #{bookingList.booking.id} for #{user.username}");
-      Booking cancelled = em.find(Booking.class, booking.getId());
-      if (cancelled!=null) em.remove( cancelled );
-      getBookings();
-      FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
-   }
-   
-   public Booking getBooking()
-   {
-      return booking;
-   }
-   
-   @Remove
-   public void destroy() {}
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/BookingListAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,76 @@
+//$Id: BookingListAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+ at Stateful
+ at Scope(SESSION)
+ at Name("bookingList")
+ at Restrict("#{identity.loggedIn}")
+ at TransactionAttribute(REQUIRES_NEW)
+public class BookingListAction implements BookingList, Serializable
+{
+   private static final long serialVersionUID = 1L;
+   
+   @PersistenceContext
+   private EntityManager em;
+   
+   @In
+   private User user;
+   
+   @DataModel
+   private List<Booking> bookings;
+   @DataModelSelection 
+   private Booking booking;
+   
+   @Logger 
+   private Log log;
+   
+   @Factory
+   @Observer("bookingConfirmed")
+   public void getBookings()
+   {
+      bookings = em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate")
+            .setParameter("username", user.getUsername())
+            .getResultList();
+   }
+   
+   public void cancel()
+   {
+      log.info("Cancel booking: #{bookingList.booking.id} for #{user.username}");
+      Booking cancelled = em.find(Booking.class, booking.getId());
+      if (cancelled!=null) em.remove( cancelled );
+      getBookings();
+      FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.id}");
+   }
+   
+   public Booking getBooking()
+   {
+      return booking;
+   }
+   
+   @Remove
+   public void destroy() {}
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,16 +0,0 @@
-//$Id: ChangePassword.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
- at Local
-public interface ChangePassword
-{
-   public void changePassword();
-   public boolean isChanged();
-   
-   public String getVerify();
-   public void setVerify(String verify);
-   
-   public void destroy();
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePassword.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,16 @@
+//$Id: ChangePassword.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface ChangePassword
+{
+   public void changePassword();
+   public boolean isChanged();
+   
+   public String getVerify();
+   public void setVerify(String verify);
+   
+   public void destroy();
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,73 +0,0 @@
-//$Id: ChangePasswordAction.java,v 1.22 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import static org.jboss.seam.ScopeType.EVENT;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.security.Restrict;
-import org.jboss.seam.faces.FacesMessages;
-
- at Stateful
- at Scope(EVENT)
- at Name("changePassword")
- at Restrict("#{identity.loggedIn}")
-public class ChangePasswordAction implements ChangePassword
-{
-   @In @Out
-   private User user;
-   
-   @PersistenceContext
-   private EntityManager em;
-   
-   private String verify;
-   
-   private boolean changed;
-   
-   @In
-   private FacesMessages facesMessages;
-   
-   public void changePassword()
-   {
-      if ( user.getPassword().equals(verify) )
-      {
-         user = em.merge(user);
-         facesMessages.add("Password updated");
-         changed = true;
-      }
-      else 
-      {
-         facesMessages.addToControl("verify", "Re-enter new password");
-         revertUser();
-         verify=null;
-      }
-   }
-   
-   public boolean isChanged()
-   {
-      return changed;
-   }
-   
-   private void revertUser()
-   {
-      user = em.find(User.class, user.getUsername());
-   }
-   public String getVerify()
-   {
-      return verify;
-   }
-   public void setVerify(String verify)
-   {
-      this.verify = verify;
-   }
-   
-   @Remove
-   public void destroy() {}
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,73 @@
+//$Id: ChangePasswordAction.java,v 1.22 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.EVENT;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.faces.FacesMessages;
+
+ at Stateful
+ at Scope(EVENT)
+ at Name("changePassword")
+ at Restrict("#{identity.loggedIn}")
+public class ChangePasswordAction implements ChangePassword
+{
+   @In @Out
+   private User user;
+   
+   @PersistenceContext
+   private EntityManager em;
+   
+   private String verify;
+   
+   private boolean changed;
+   
+   @In
+   private FacesMessages facesMessages;
+   
+   public void changePassword()
+   {
+      if ( user.getPassword().equals(verify) )
+      {
+         user = em.merge(user);
+         facesMessages.add("Password updated");
+         changed = true;
+      }
+      else 
+      {
+         facesMessages.addToControl("verify", "Re-enter new password");
+         revertUser();
+         verify=null;
+      }
+   }
+   
+   public boolean isChanged()
+   {
+      return changed;
+   }
+   
+   private void revertUser()
+   {
+      user = em.find(User.class, user.getUsername());
+   }
+   public String getVerify()
+   {
+      return verify;
+   }
+   public void setVerify(String verify)
+   {
+      this.verify = verify;
+   }
+   
+   @Remove
+   public void destroy() {}
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,114 +0,0 @@
-//$Id: Hotel.java,v 1.13 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotNull;
-import org.jboss.seam.annotations.Name;
-
- at Entity
- at Name("hotel")
-public class Hotel implements Serializable
-{
-   private Long id;
-   private String name;
-   private String address;
-   private String city;
-   private String state;
-   private String zip;
-   private String country;
-   private BigDecimal price;
-   
-   @Id @GeneratedValue
-   public Long getId()
-   {
-      return id;
-   }
-   public void setId(Long id)
-   {
-      this.id = id;
-   }
-   
-   @Length(max=50) @NotNull
-   public String getName()
-   {
-      return name;
-   }
-   public void setName(String name)
-   {
-      this.name = name;
-   }
-   
-   @Length(max=100) @NotNull
-   public String getAddress()
-   {
-      return address;
-   }
-   public void setAddress(String address)
-   {
-      this.address = address;
-   }
-   
-   @Length(max=40) @NotNull
-   public String getCity()
-   {
-      return city;
-   }
-   public void setCity(String city)
-   {
-      this.city = city;
-   }
-   
-   @Length(min=4, max=6) @NotNull
-   public String getZip()
-   {
-      return zip;
-   }
-   public void setZip(String zip)
-   {
-      this.zip = zip;
-   }
-   
-   @Length(min=2, max=10) @NotNull
-   public String getState()
-   {
-      return state;
-   }
-   public void setState(String state)
-   {
-      this.state = state;
-   }
-   
-   @Length(min=2, max=40) @NotNull
-   public String getCountry()
-   {
-      return country;
-   }
-   public void setCountry(String country)
-   {
-      this.country = country;
-   }
-
-   @Column(precision=6, scale=2)
-   public BigDecimal getPrice()
-   {
-      return price;
-   }
-   public void setPrice(BigDecimal price)
-   {
-      this.price = price;
-   }
-   
-   @Override
-   public String toString()
-   {
-      return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
-   }
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Hotel.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,114 @@
+//$Id: Hotel.java,v 1.13 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.annotations.Name;
+
+ at Entity
+ at Name("hotel")
+public class Hotel implements Serializable
+{
+   private Long id;
+   private String name;
+   private String address;
+   private String city;
+   private String state;
+   private String zip;
+   private String country;
+   private BigDecimal price;
+   
+   @Id @GeneratedValue
+   public Long getId()
+   {
+      return id;
+   }
+   public void setId(Long id)
+   {
+      this.id = id;
+   }
+   
+   @Length(max=50) @NotNull
+   public String getName()
+   {
+      return name;
+   }
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   @Length(max=100) @NotNull
+   public String getAddress()
+   {
+      return address;
+   }
+   public void setAddress(String address)
+   {
+      this.address = address;
+   }
+   
+   @Length(max=40) @NotNull
+   public String getCity()
+   {
+      return city;
+   }
+   public void setCity(String city)
+   {
+      this.city = city;
+   }
+   
+   @Length(min=4, max=6) @NotNull
+   public String getZip()
+   {
+      return zip;
+   }
+   public void setZip(String zip)
+   {
+      this.zip = zip;
+   }
+   
+   @Length(min=2, max=10) @NotNull
+   public String getState()
+   {
+      return state;
+   }
+   public void setState(String state)
+   {
+      this.state = state;
+   }
+   
+   @Length(min=2, max=40) @NotNull
+   public String getCountry()
+   {
+      return country;
+   }
+   public void setCountry(String country)
+   {
+      this.country = country;
+   }
+
+   @Column(precision=6, scale=2)
+   public BigDecimal getPrice()
+   {
+      return price;
+   }
+   public void setPrice(BigDecimal price)
+   {
+      this.price = price;
+   }
+   
+   @Override
+   public String toString()
+   {
+      return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
+   }
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,22 +0,0 @@
-//$Id: HotelBooking.java,v 1.14 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
- at Local
-public interface HotelBooking
-{
-   public void selectHotel(Hotel selectedHotel);
-   
-   public void bookHotel();
-   
-   public void setBookingDetails();
-   public boolean isBookingValid();
-   
-   public void confirm();
-   
-   public void cancel();
-   
-   public void destroy();
-   
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBooking.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,22 @@
+//$Id: HotelBooking.java,v 1.14 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface HotelBooking
+{
+   public void selectHotel(Hotel selectedHotel);
+   
+   public void bookHotel();
+   
+   public void setBookingDetails();
+   public boolean isBookingValid();
+   
+   public void confirm();
+   
+   public void cancel();
+   
+   public void destroy();
+   
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,108 +0,0 @@
-//$Id: HotelBookingAction.java,v 1.53 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import static javax.persistence.PersistenceContextType.EXTENDED;
-
-import java.util.Calendar;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.seam.annotations.Begin;
-import org.jboss.seam.annotations.End;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.security.Restrict;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.log.Log;
-
- at Stateful
- at Name("hotelBooking")
- at Restrict("#{identity.loggedIn}")
-public class HotelBookingAction implements HotelBooking
-{
-   
-   @PersistenceContext(type=EXTENDED)
-   private EntityManager em;
-   
-   @In 
-   private User user;
-   
-   @In(required=false) @Out
-   private Hotel hotel;
-   
-   @In(required=false) 
-   @Out(required=false)
-   private Booking booking;
-     
-   @In
-   private FacesMessages facesMessages;
-      
-   @In
-   private Events events;
-   
-   @Logger 
-   private Log log;
-   
-   private boolean bookingValid;
-   
-   @Begin
-   public void selectHotel(Hotel selectedHotel)
-   {
-      hotel = em.merge(selectedHotel);
-   }
-   
-   public void bookHotel()
-   {      
-      booking = new Booking(hotel, user);
-      Calendar calendar = Calendar.getInstance();
-      booking.setCheckinDate( calendar.getTime() );
-      calendar.add(Calendar.DAY_OF_MONTH, 1);
-      booking.setCheckoutDate( calendar.getTime() );
-   }
-   
-   public void setBookingDetails()
-   {
-      Calendar calendar = Calendar.getInstance();
-      calendar.add(Calendar.DAY_OF_MONTH, -1);
-      if ( booking.getCheckinDate().before( calendar.getTime() ) )
-      {
-         facesMessages.addToControl("checkinDate", "Check in date must be a future date");
-         bookingValid=false;
-      }
-      else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
-      {
-         facesMessages.addToControl("checkoutDate", "Check out date must be later than check in date");
-         bookingValid=false;
-      }
-      else
-      {
-         bookingValid=true;
-      }
-   }
-   
-   public boolean isBookingValid()
-   {
-      return bookingValid;
-   }
-   
-   @End
-   public void confirm()
-   {
-      em.persist(booking);
-      facesMessages.add("Thank you, #{user.name}, your confimation number for #{hotel.name} is #{booking.id}");
-      log.info("New booking: #{booking.id} for #{user.username}");
-      events.raiseTransactionSuccessEvent("bookingConfirmed");
-   }
-   
-   @End
-   public void cancel() {}
-   
-   @Remove
-   public void destroy() {}
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,108 @@
+//$Id: HotelBookingAction.java,v 1.53 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static javax.persistence.PersistenceContextType.EXTENDED;
+
+import java.util.Calendar;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+ at Stateful
+ at Name("hotelBooking")
+ at Restrict("#{identity.loggedIn}")
+public class HotelBookingAction implements HotelBooking
+{
+   
+   @PersistenceContext(type=EXTENDED)
+   private EntityManager em;
+   
+   @In 
+   private User user;
+   
+   @In(required=false) @Out
+   private Hotel hotel;
+   
+   @In(required=false) 
+   @Out(required=false)
+   private Booking booking;
+     
+   @In
+   private FacesMessages facesMessages;
+      
+   @In
+   private Events events;
+   
+   @Logger 
+   private Log log;
+   
+   private boolean bookingValid;
+   
+   @Begin
+   public void selectHotel(Hotel selectedHotel)
+   {
+      hotel = em.merge(selectedHotel);
+   }
+   
+   public void bookHotel()
+   {      
+      booking = new Booking(hotel, user);
+      Calendar calendar = Calendar.getInstance();
+      booking.setCheckinDate( calendar.getTime() );
+      calendar.add(Calendar.DAY_OF_MONTH, 1);
+      booking.setCheckoutDate( calendar.getTime() );
+   }
+   
+   public void setBookingDetails()
+   {
+      Calendar calendar = Calendar.getInstance();
+      calendar.add(Calendar.DAY_OF_MONTH, -1);
+      if ( booking.getCheckinDate().before( calendar.getTime() ) )
+      {
+         facesMessages.addToControl("checkinDate", "Check in date must be a future date");
+         bookingValid=false;
+      }
+      else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
+      {
+         facesMessages.addToControl("checkoutDate", "Check out date must be later than check in date");
+         bookingValid=false;
+      }
+      else
+      {
+         bookingValid=true;
+      }
+   }
+   
+   public boolean isBookingValid()
+   {
+      return bookingValid;
+   }
+   
+   @End
+   public void confirm()
+   {
+      em.persist(booking);
+      facesMessages.add("Thank you, #{user.name}, your confimation number for #{hotel.name} is #{booking.id}");
+      log.info("New booking: #{booking.id} for #{user.username}");
+      events.raiseTransactionSuccessEvent("bookingConfirmed");
+   }
+   
+   @End
+   public void cancel() {}
+   
+   @Remove
+   public void destroy() {}
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,23 +0,0 @@
-//$Id: HotelSearching.java,v 1.12 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
- at Local
-public interface HotelSearching
-{
-   public int getPageSize();
-   public void setPageSize(int pageSize);
-   
-   public String getSearchString();
-   public void setSearchString(String searchString);
-   
-   public String getSearchPattern();
-   
-   public void find();
-   public void nextPage();
-   public boolean isNextPageAvailable();
-
-   public void destroy();
-   
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearching.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,23 @@
+//$Id: HotelSearching.java,v 1.12 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface HotelSearching
+{
+   public int getPageSize();
+   public void setPageSize(int pageSize);
+   
+   public String getSearchString();
+   public void setSearchString(String searchString);
+   
+   public String getSearchPattern();
+   
+   public void find();
+   public void nextPage();
+   public boolean isNextPageAvailable();
+
+   public void destroy();
+   
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,86 +0,0 @@
-//$Id: HotelSearchingAction.java,v 1.20 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import java.util.List;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Factory;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.datamodel.DataModel;
-import org.jboss.seam.annotations.security.Restrict;
-
- at Stateful
- at Name("hotelSearch")
- at Scope(ScopeType.SESSION)
- at Restrict("#{identity.loggedIn}")
-public class HotelSearchingAction implements HotelSearching
-{
-   
-   @PersistenceContext
-   private EntityManager em;
-   
-   private String searchString;
-   private int pageSize = 10;
-   private int page;
-   
-   @DataModel
-   private List<Hotel> hotels;
-   
-   public void find()
-   {
-      page = 0;
-      queryHotels();
-   }
-   public void nextPage()
-   {
-      page++;
-      queryHotels();
-   }
-      
-   private void queryHotels()
-   {
-      hotels = em.createQuery("select h from Hotel h where lower(h.name) like #{pattern} or lower(h.city) like #{pattern} or lower(h.zip) like #{pattern} or lower(h.address) like #{pattern}")
-            .setMaxResults(pageSize)
-            .setFirstResult( page * pageSize )
-            .getResultList();
-   }
-   
-   public boolean isNextPageAvailable()
-   {
-      return hotels!=null && hotels.size()==pageSize;
-   }
-   
-   public int getPageSize() {
-      return pageSize;
-   }
-   
-   public void setPageSize(int pageSize) {
-      this.pageSize = pageSize;
-   }
-   
-   @Factory(value="pattern", scope=ScopeType.EVENT)
-   public String getSearchPattern()
-   {
-      return searchString==null ? 
-            "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
-   }
-   
-   public String getSearchString()
-   {
-      return searchString;
-   }
-   
-   public void setSearchString(String searchString)
-   {
-      this.searchString = searchString;
-   }
-   
-   @Remove
-   public void destroy() {}
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,86 @@
+//$Id: HotelSearchingAction.java,v 1.20 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.security.Restrict;
+
+ at Stateful
+ at Name("hotelSearch")
+ at Scope(ScopeType.SESSION)
+ at Restrict("#{identity.loggedIn}")
+public class HotelSearchingAction implements HotelSearching
+{
+   
+   @PersistenceContext
+   private EntityManager em;
+   
+   private String searchString;
+   private int pageSize = 10;
+   private int page;
+   
+   @DataModel
+   private List<Hotel> hotels;
+   
+   public void find()
+   {
+      page = 0;
+      queryHotels();
+   }
+   public void nextPage()
+   {
+      page++;
+      queryHotels();
+   }
+      
+   private void queryHotels()
+   {
+      hotels = em.createQuery("select h from Hotel h where lower(h.name) like #{pattern} or lower(h.city) like #{pattern} or lower(h.zip) like #{pattern} or lower(h.address) like #{pattern}")
+            .setMaxResults(pageSize)
+            .setFirstResult( page * pageSize )
+            .getResultList();
+   }
+   
+   public boolean isNextPageAvailable()
+   {
+      return hotels!=null && hotels.size()==pageSize;
+   }
+   
+   public int getPageSize() {
+      return pageSize;
+   }
+   
+   public void setPageSize(int pageSize) {
+      this.pageSize = pageSize;
+   }
+   
+   @Factory(value="pattern", scope=ScopeType.EVENT)
+   public String getSearchPattern()
+   {
+      return searchString==null ? 
+            "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
+   }
+   
+   public String getSearchString()
+   {
+      return searchString;
+   }
+   
+   public void setSearchString(String searchString)
+   {
+      this.searchString = searchString;
+   }
+   
+   @Remove
+   public void destroy() {}
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,16 +0,0 @@
-//$Id: Register.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import javax.ejb.Local;
-
- at Local
-public interface Register
-{
-   public void register();
-   public void invalid();
-   public String getVerify();
-   public void setVerify(String verify);
-   public boolean isRegistered();
-   
-   public void destroy();
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Register.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,16 @@
+//$Id: Register.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface Register
+{
+   public void register();
+   public void invalid();
+   public String getVerify();
+   public void setVerify(String verify);
+   public boolean isRegistered();
+   
+   public void destroy();
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,80 +0,0 @@
-//$Id: RegisterAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import static org.jboss.seam.ScopeType.EVENT;
-
-import java.util.List;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.faces.FacesMessages;
-
- at Stateful
- at Scope(EVENT)
- at Name("register")
-public class RegisterAction implements Register
-{
-   @In
-   private User user;
-   
-   @PersistenceContext
-   private EntityManager em;
-   
-   @In
-   private FacesMessages facesMessages;
-   
-   private String verify;
-   
-   private boolean registered;
-   
-   public void register()
-   {
-      if ( user.getPassword().equals(verify) )
-      {
-         List existing = em.createQuery("select u.username from User u where u.username=#{user.username}")
-            .getResultList();
-         if (existing.size()==0)
-         {
-            em.persist(user);
-            facesMessages.add("Successfully registered as #{user.username}");
-            registered = true;
-         }
-         else
-         {
-            facesMessages.addToControl("username", "Username #{user.username} already exists");
-         }
-      }
-      else 
-      {
-         facesMessages.addToControl("verify", "Re-enter your password");
-         verify=null;
-      }
-   }
-   
-   public void invalid()
-   {
-      facesMessages.add("Please try again");
-   }
-   
-   public boolean isRegistered()
-   {
-      return registered;
-   }
-   public String getVerify()
-   {
-      return verify;
-   }
-   public void setVerify(String verify)
-   {
-      this.verify = verify;
-   }
-   
-   @Remove
-   public void destroy() {}
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/RegisterAction.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,80 @@
+//$Id: RegisterAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.EVENT;
+
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.FacesMessages;
+
+ at Stateful
+ at Scope(EVENT)
+ at Name("register")
+public class RegisterAction implements Register
+{
+   @In
+   private User user;
+   
+   @PersistenceContext
+   private EntityManager em;
+   
+   @In
+   private FacesMessages facesMessages;
+   
+   private String verify;
+   
+   private boolean registered;
+   
+   public void register()
+   {
+      if ( user.getPassword().equals(verify) )
+      {
+         List existing = em.createQuery("select u.username from User u where u.username=#{user.username}")
+            .getResultList();
+         if (existing.size()==0)
+         {
+            em.persist(user);
+            facesMessages.add("Successfully registered as #{user.username}");
+            registered = true;
+         }
+         else
+         {
+            facesMessages.addToControl("username", "Username #{user.username} already exists");
+         }
+      }
+      else 
+      {
+         facesMessages.addToControl("verify", "Re-enter your password");
+         verify=null;
+      }
+   }
+   
+   public void invalid()
+   {
+      facesMessages.add("Please try again");
+   }
+   
+   public boolean isRegistered()
+   {
+      return registered;
+   }
+   public String getVerify()
+   {
+      return verify;
+   }
+   public void setVerify(String verify)
+   {
+      this.verify = verify;
+   }
+   
+   @Remove
+   public void destroy() {}
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,76 +0,0 @@
-//$Id: User.java,v 1.8 2007/06/27 00:06:49 gavin Exp $
-package org.jboss.seam.example.booking;
-
-import static org.jboss.seam.ScopeType.SESSION;
-
-import java.io.Serializable;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotNull;
-import org.hibernate.validator.Pattern;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
- at Entity
- at Name("user")
- at Scope(SESSION)
- at Table(name="Customer")
-public class User implements Serializable
-{
-   private String username;
-   private String password;
-   private String name;
-   
-   public User(String name, String password, String username)
-   {
-      this.name = name;
-      this.password = password;
-      this.username = username;
-   }
-   
-   public User() {}
-
-   @NotNull
-   @Length(max=100)
-   public String getName()
-   {
-      return name;
-   }
-   public void setName(String name)
-   {
-      this.name = name;
-   }
-   
-   @NotNull
-   @Length(min=5, max=15)
-   public String getPassword()
-   {
-      return password;
-   }
-   public void setPassword(String password)
-   {
-      this.password = password;
-   }
-   
-   @Id
-   @Length(min=4, max=15)
-   @Pattern(regex="^\\w*$", message="not a valid username")
-   public String getUsername()
-   {
-      return username;
-   }
-   public void setUsername(String username)
-   {
-      this.username = username;
-   }
-   
-   @Override
-   public String toString() 
-   {
-      return "User(" + username + ")";
-   }
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,76 @@
+//$Id: User.java,v 1.8 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+ at Entity
+ at Name("user")
+ at Scope(SESSION)
+ at Table(name="Customer")
+public class User implements Serializable
+{
+   private String username;
+   private String password;
+   private String name;
+   
+   public User(String name, String password, String username)
+   {
+      this.name = name;
+      this.password = password;
+      this.username = username;
+   }
+   
+   public User() {}
+
+   @NotNull
+   @Length(max=100)
+   public String getName()
+   {
+      return name;
+   }
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   @NotNull
+   @Length(min=5, max=15)
+   public String getPassword()
+   {
+      return password;
+   }
+   public void setPassword(String password)
+   {
+      this.password = password;
+   }
+   
+   @Id
+   @Length(min=4, max=15)
+   @Pattern(regex="^\\w*$", message="not a valid username")
+   public String getUsername()
+   {
+      return username;
+   }
+   public void setUsername(String username)
+   {
+      this.username = username;
+   }
+   
+   @Override
+   public String toString() 
+   {
+      return "User(" + username + ")";
+   }
+}

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources)

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/META-INF)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path: 
-

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/MANIFEST.MF	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" 
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
-         version="3.0">
-         
-   <interceptors>
-     <interceptor>
-       <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
-     </interceptor>
-   </interceptors>
-   
-   <assembly-descriptor>
-      <interceptor-binding>
-         <ejb-name>*</ejb-name>
-         <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
-      </interceptor-binding>
-   </assembly-descriptor>
-   
-</ejb-jar>

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/ejb-jar.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" 
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+         version="3.0">
+         
+   <interceptors>
+     <interceptor>
+       <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+     </interceptor>
+   </interceptors>
+   
+   <assembly-descriptor>
+      <interceptor-binding>
+         <ejb-name>*</ejb-name>
+         <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+      </interceptor-binding>
+   </assembly-descriptor>
+   
+</ejb-jar>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
-             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
-             version="1.0">
-   <persistence-unit name="bookingDatabase">
-      <provider>org.hibernate.ejb.HibernatePersistence</provider>
-      <jta-data-source>java:/bookingPortletDatasource</jta-data-source>
-      <properties>
-         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
-         <property name="hibernate.show_sql" value="true"/>
-         <!-- These are the default for JBoss EJB3, but not for HEM: -->
-         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
-         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
-         <property name="jboss.entity.manager.factory.jndi.name" value="java:/seamBookingEntityManagerFactory"/>
-      </properties>
-   </persistence-unit>
-</persistence>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/META-INF/persistence.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
+             version="1.0">
+   <persistence-unit name="bookingDatabase">
+      <provider>org.hibernate.ejb.HibernatePersistence</provider>
+      <jta-data-source>java:/bookingPortletDatasource</jta-data-source>
+      <properties>
+         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+         <property name="hibernate.show_sql" value="true"/>
+         <!-- These are the default for JBoss EJB3, but not for HEM: -->
+         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+         <property name="jboss.entity.manager.factory.jndi.name" value="java:/seamBookingEntityManagerFactory"/>
+      </properties>
+   </persistence-unit>
+</persistence>
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE datasources
-    PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
-    "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
-
-<datasources>
-    <local-tx-datasource>
-        <jndi-name>bookingPortletDatasource</jndi-name>
-        <connection-url>jdbc:hsqldb:.</connection-url>
-        <driver-class>org.hsqldb.jdbcDriver</driver-class>
-        <user-name>sa</user-name>
-        <password></password>
-    </local-tx-datasource>
-</datasources>
-

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/booking1-ds.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+    PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+    <local-tx-datasource>
+        <jndi-name>bookingPortletDatasource</jndi-name>
+        <connection-url>jdbc:hsqldb:.</connection-url>
+        <driver-class>org.hsqldb.jdbcDriver</driver-class>
+        <user-name>sa</user-name>
+        <password></password>
+    </local-tx-datasource>
+</datasources>
+

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/components.properties
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/resources/components.properties	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/components.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1 +0,0 @@
-jndiPattern #{ejbName}/local
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/components.properties (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/components.properties)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/components.properties	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/components.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1 @@
+jndiPattern #{ejbName}/local
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/import.sql
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/resources/import.sql	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/import.sql	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,22 +0,0 @@
-insert into Customer (username, password, name) values ('gavin', 'foobar', 'Gavin King')
-insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130, 'Hotel Beaulac', ' Esplanade Léopold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250, 'Meliá White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
-insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/import.sql (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/import.sql)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/import.sql	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/import.sql	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,22 @@
+insert into Customer (username, password, name) values ('gavin', 'foobar', 'Gavin King')
+insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130, 'Hotel Beaulac', ' Esplanade Léopold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250, 'Meliá White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,50 +0,0 @@
-javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type
-javax.faces.component.UIInput.REQUIRED=value is required
-javax.faces.component.UIInput.REQUIRED_detail=value is required
-javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information
-javax.faces.component.UISelectOne.INVALID=value is not valid
-javax.faces.component.UISelectMany.INVALID=value is not valid
-
-javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
-javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1}
-javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be a number
-javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits
-javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
-javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false)
-javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
-javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
-javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
-javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character
-javax.faces.convert.DateTimeConverter.CONVERSION value must be a datetime
-javax.faces.convert.DateTimeConverter.CONVERSION_detail value must be a datetime
-javax.faces.converter.DateTimeConverter.DATE=value must be a date
-javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date,  eg. {1}
-javax.faces.converter.DateTimeConverter.TIME=value must be a time
-javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time,  eg. {1}
-javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
-javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time,  eg. {1}
-javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value
-javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
-javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308
-javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
-javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1}
-javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided
-javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided
-javax.faces.converter.FloatConverter.FLOAT=value must be a number
-javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38
-javax.faces.converter.IntegerConverter.INTEGER=value must be a number
-javax.faces.converter.IntegerConverter.INTEGER_detail=value must be a number between -2147483648 and 2147483647
-javax.faces.converter.LongConverter.LONG=value must be a number
-javax.faces.converter.LongConverter.LONG_detail=must be a number between -9223372036854775808 and 9223372036854775807
-javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
-javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1}
-javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
-javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1}
-javax.faces.converter.NumberConverter.NUMBER=value must be a number
-javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
-javax.faces.converter.NumberConverter.PATTERN=value must be a number
-javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
-javax.faces.converter.ShortConverter.SHORT=value must be a number
-javax.faces.converter.ShortConverter.SHORT_detail=value must be a number between -32768 and 32767
-
-

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/messages.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,50 @@
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.REQUIRED_detail=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be a number
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character
+javax.faces.convert.DateTimeConverter.CONVERSION value must be a datetime
+javax.faces.convert.DateTimeConverter.CONVERSION_detail value must be a datetime
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date,  eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time,  eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time,  eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be a number
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be a number between -2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be a number
+javax.faces.converter.LongConverter.LONG_detail=must be a number between -9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be a number
+javax.faces.converter.ShortConverter.SHORT_detail=value must be a number between -32768 and 32767
+
+

Deleted: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/seam.properties
===================================================================

Copied: branches/3.1.x/samples/seamPortletEar/seamBooking/src/main/resources/seam.properties (from rev 5574, trunk/samples/seamPortletEar/seamBooking/src/main/resources/seam.properties)
===================================================================

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.exadelproject
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/.exadelproject	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.exadelproject	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<FILESYSTEMS APPLICATION_NAME="seamBookingPortlet" ENTITY="FileSystems"
- VERSION="8.0.4" WORKSPACE_HOME="./src/main/webapp/WEB-INF">
- <FILESYSTEM ENTITY="FileSystemFolder" LOCATION="%exadel.workspace%" NAME="WEB-INF"/>
- <FILESYSTEM ENTITY="FileSystemFolder" INFO="Content-Type=Web"
-  LOCATION="%exadel.workspace%/.." NAME="WEB-ROOT"/>
- <FILESYSTEM ENTITY="FileSystemFolder"
-  LOCATION="%exadel.workspace%/../../java" NAME="src"/>
- <FILESYSTEM ENTITY="FileSystemFolder"
-  LOCATION="%exadel.workspace%/../../resources" NAME="src2"/>
- <FILESYSTEM ENTITY="FileSystemFolder"
-  LOCATION="%exadel.workspace%/../../../test/java" NAME="src3"/>
- <FILESYSTEM ENTITY="FileSystemFolder"
-  LOCATION="%exadel.workspace%/../../../../target/classes" NAME="classes"/>
- <FILESYSTEM ENTITY="FileSystemFolder"
-  LOCATION="%exadel.eclipse.project%" NAME="seamBookingPortlet"/>
- <WEB ENTITY="ExadelWeb" MODEL_PATH="/web.xml" SERVLET_VERSION="2.4">
-  <MODULE ENTITY="WebJSFModule" ROOT="WEB-ROOT" SRC="src,src2,src3" URI="/WEB-INF/faces-config.xml"/>
- </WEB>
-</FILESYSTEMS>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.exadelproject (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/.exadelproject)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.exadelproject	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.exadelproject	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FILESYSTEMS APPLICATION_NAME="seamBookingPortlet" ENTITY="FileSystems"
+ VERSION="8.0.4" WORKSPACE_HOME="./src/main/webapp/WEB-INF">
+ <FILESYSTEM ENTITY="FileSystemFolder" LOCATION="%exadel.workspace%" NAME="WEB-INF"/>
+ <FILESYSTEM ENTITY="FileSystemFolder" INFO="Content-Type=Web"
+  LOCATION="%exadel.workspace%/.." NAME="WEB-ROOT"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+  LOCATION="%exadel.workspace%/../../java" NAME="src"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+  LOCATION="%exadel.workspace%/../../resources" NAME="src2"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+  LOCATION="%exadel.workspace%/../../../test/java" NAME="src3"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+  LOCATION="%exadel.workspace%/../../../../target/classes" NAME="classes"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+  LOCATION="%exadel.eclipse.project%" NAME="seamBookingPortlet"/>
+ <WEB ENTITY="ExadelWeb" MODEL_PATH="/web.xml" SERVLET_VERSION="2.4">
+  <MODULE ENTITY="WebJSFModule" ROOT="WEB-ROOT" SRC="src,src2,src3" URI="/WEB-INF/faces-config.xml"/>
+ </WEB>
+</FILESYSTEMS>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.xdoclet
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/.xdoclet	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.xdoclet	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<configurations/>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.xdoclet (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/.xdoclet)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.xdoclet	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/.xdoclet	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<configurations/>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,10 +0,0 @@
-#File used by hibernate tools to override <datasource> and other container specific settings in persistence.xml
-hibernate.connection.password=password
-hibernate.connection.username=username
-hibernate.connection.driver_class=org.hsqldb.jdbcDriver
-hibernate.dialect=org.hibernate.dialect.HSQLDialect
-hibernate.connection.url=jdbc:hsqldb:hsql://host
-
-hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
-hibernate.datasource=
-hibernate.transaction.manager_lookup_class=
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/hibernate-console.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,10 @@
+#File used by hibernate tools to override <datasource> and other container specific settings in persistence.xml
+hibernate.connection.password=password
+hibernate.connection.username=username
+hibernate.connection.driver_class=org.hsqldb.jdbcDriver
+hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.connection.url=jdbc:hsqldb:hsql://host
+
+hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
+hibernate.datasource=
+hibernate.transaction.manager_lookup_class=
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/pom.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/pom.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,169 +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">
-	<parent>
-		<artifactId>seamPortletEar</artifactId>
-		<groupId>org.richfaces.samples</groupId>
-		<version>3.2.0-SNAPSHOT</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.richfaces.samples.seamPortletEar</groupId>
-	<artifactId>seamBookingPortlet</artifactId>
-	<packaging>war</packaging>
-	<name>seamBookingPortlet Maven Webapp</name>
-	<version>3.2.0-SNAPSHOT</version>
-	<build>
-		<finalName>seamBookingPortlet</finalName>
-		<plugins>
-			<plugin>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<inherited>true</inherited>
-				<configuration>
-					<source>1.5</source>
-					<target>1.5</target>
-				</configuration>
-			</plugin>
-			<plugin>
-				<artifactId>maven-war-plugin</artifactId>
-				<configuration>
-					<!--
-						<webResources>
-						<resource>
-						<directory>${seamHome}</directory>
-						<targetPath>WEB-INF/lib</targetPath>
-						<includes>
-						<include>jboss-seam.jar</include>
-						<include>jboss-seam-ui.jar</include>
-						<include>jboss-seam-debug.jar</include>
-						<include>
-						jboss-seam-remoting.jar
-						</include>
-						<include>
-						jboss-seam-pdf.jar
-						</include>
-						</includes>
-						</resource>
-						<resource>
-						<directory>${seamHome}/lib</directory>
-						<targetPath>WEB-INF/lib</targetPath>
-						<includes>
-						<include>jboss-el.jar</include>
-						</includes>
-						</resource>
-						</webResources>
-					-->
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-	<dependencies>
-		<dependency>
-			<groupId>org.hibernate</groupId>
-			<artifactId>hibernate-validator</artifactId>
-			<version>3.0.0.GA</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.hibernate</groupId>
-			<artifactId>hibernate-annotations</artifactId>
-			<version>3.3.0.ga</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.hibernate</groupId>
-			<artifactId>hibernate-entitymanager</artifactId>
-			<version>3.3.1.ga</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.jboss.seam</groupId>
-			<artifactId>jboss-seam</artifactId>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.jboss.seam</groupId>
-			<artifactId>jboss-seam-ui</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.jboss.seam</groupId>
-			<artifactId>jboss-seam-ioc</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.jboss.seam</groupId>
-			<artifactId>jboss-seam-debug</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>javax.portlet</groupId>
-			<artifactId>portlet-api</artifactId>
-			<version>1.0</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>javax.servlet</groupId>
-			<artifactId>servlet-api</artifactId>
-			<version>2.5</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.richfaces.extensions.portletbridge</groupId>
-			<artifactId>portletbridge-api</artifactId>
-			<version>3.2.0-SNAPSHOT</version>
-			<exclusions>
-				<exclusion>
-					<groupId>javax.faces</groupId>
-					<artifactId>jsf-api</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>javax.faces</groupId>
-					<artifactId>jsf-impl</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>org.richfaces.extensions.portletbridge</groupId>
-			<artifactId>portletbridge-impl</artifactId>
-			<version>3.2.0-SNAPSHOT</version>
-			<exclusions>
-				<exclusion>
-					<groupId>javax.faces</groupId>
-					<artifactId>jsf-api</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>javax.faces</groupId>
-					<artifactId>jsf-impl</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>org.richfaces.ui</groupId>
-			<artifactId>richfaces-ui</artifactId>
-			<version>3.2.0-SNAPSHOT</version>
-		</dependency>
-		<dependency>
-			<groupId>org.richfaces.framework</groupId>
-			<artifactId>richfaces-api</artifactId>
-			<version>3.2.0-SNAPSHOT</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>javax.faces</groupId>
-			<artifactId>jsf-api</artifactId>
-			<version>1.2_07</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>javax.faces</groupId>
-			<artifactId>jsf-impl</artifactId>
-			<version>1.2_07</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>javax.el</groupId>
-			<artifactId>el-api</artifactId>
-			<version>1.0</version>
-			<scope>provided</scope>
-		</dependency>
-	</dependencies>
-</project>
-

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/pom.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/pom.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/pom.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,169 @@
+<?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">
+	<parent>
+		<artifactId>seamPortletEar</artifactId>
+		<groupId>org.richfaces.samples</groupId>
+		<version>3.1.4-SNAPSHOT</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.richfaces.samples.seamPortletEar</groupId>
+	<artifactId>seamBookingPortlet</artifactId>
+	<packaging>war</packaging>
+	<name>seamBookingPortlet Maven Webapp</name>
+	<version>3.1.4-SNAPSHOT</version>
+	<build>
+		<finalName>seamBookingPortlet</finalName>
+		<plugins>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<inherited>true</inherited>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-war-plugin</artifactId>
+				<configuration>
+					<!--
+						<webResources>
+						<resource>
+						<directory>${seamHome}</directory>
+						<targetPath>WEB-INF/lib</targetPath>
+						<includes>
+						<include>jboss-seam.jar</include>
+						<include>jboss-seam-ui.jar</include>
+						<include>jboss-seam-debug.jar</include>
+						<include>
+						jboss-seam-remoting.jar
+						</include>
+						<include>
+						jboss-seam-pdf.jar
+						</include>
+						</includes>
+						</resource>
+						<resource>
+						<directory>${seamHome}/lib</directory>
+						<targetPath>WEB-INF/lib</targetPath>
+						<includes>
+						<include>jboss-el.jar</include>
+						</includes>
+						</resource>
+						</webResources>
+					-->
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-validator</artifactId>
+			<version>3.0.0.GA</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-annotations</artifactId>
+			<version>3.3.0.ga</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-entitymanager</artifactId>
+			<version>3.3.1.ga</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.seam</groupId>
+			<artifactId>jboss-seam</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.seam</groupId>
+			<artifactId>jboss-seam-ui</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.seam</groupId>
+			<artifactId>jboss-seam-ioc</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.seam</groupId>
+			<artifactId>jboss-seam-debug</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>javax.portlet</groupId>
+			<artifactId>portlet-api</artifactId>
+			<version>1.0</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.5</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.richfaces.extensions.portletbridge</groupId>
+			<artifactId>portletbridge-api</artifactId>
+			<version>3.1.4-SNAPSHOT</version>
+			<exclusions>
+				<exclusion>
+					<groupId>javax.faces</groupId>
+					<artifactId>jsf-api</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.faces</groupId>
+					<artifactId>jsf-impl</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.richfaces.extensions.portletbridge</groupId>
+			<artifactId>portletbridge-impl</artifactId>
+			<version>3.1.4-SNAPSHOT</version>
+			<exclusions>
+				<exclusion>
+					<groupId>javax.faces</groupId>
+					<artifactId>jsf-api</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.faces</groupId>
+					<artifactId>jsf-impl</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.richfaces.ui</groupId>
+			<artifactId>richfaces-ui</artifactId>
+			<version>3.1.4-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.richfaces.framework</groupId>
+			<artifactId>richfaces-api</artifactId>
+			<version>3.1.4-SNAPSHOT</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.faces</groupId>
+			<artifactId>jsf-api</artifactId>
+			<version>1.2_07</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.faces</groupId>
+			<artifactId>jsf-impl</artifactId>
+			<version>1.2_07</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.el</groupId>
+			<artifactId>el-api</artifactId>
+			<version>1.0</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+</project>
+

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,121 +0,0 @@
-/**
- * 
- */
-package org.ajax4jsf.portlet.seam;
-
-import static org.jboss.seam.ScopeType.SESSION;
-import static org.jboss.seam.annotations.Install.APPLICATION;
-
-import java.security.Principal;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.security.auth.login.LoginException;
-
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Startup;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.security.Identity;
-
-/**
- * @author asmirnov
- * 
- */
-//@Name("org.jboss.seam.security.identity")
-//@Scope(SESSION)
-//@BypassInterceptors
-//@Install(precedence = APPLICATION, classDependencies = "javax.portlet.Portlet")
-//@Startup
-public class PortalIdentity extends Identity {
-
-	public PortalIdentity() {
-		super();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.seam.security.Identity#authenticate()
-	 */
-	@Override
-	public void authenticate() throws LoginException {
-		if (!isLoggedIn()) {
-			throw new LoginException();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.seam.security.Identity#hasPermission(java.lang.String,
-	 *      java.lang.String, java.lang.Object[])
-	 */
-	@Override
-	public boolean hasPermission(String name, String action, Object... arg) {
-		// TODO Auto-generated method stub
-		return super.hasPermission(name, action, arg);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.seam.security.Identity#getPrincipal()
-	 */
-	@Override
-	public Principal getPrincipal() {
-		return FacesContext.getCurrentInstance().getExternalContext()
-				.getUserPrincipal();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.seam.security.Identity#getUsername()
-	 */
-	@Override
-	public String getUsername() {
-		String userName = null;
-		FacesContext facesContext = FacesContext.getCurrentInstance();
-		if (null != facesContext) {
-			ExternalContext externalContext = facesContext.getExternalContext();
-			if (null != externalContext.getUserPrincipal()) {
-				userName = externalContext.getRemoteUser();
-			}
-		}
-		return userName;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.seam.security.Identity#hasRole(java.lang.String)
-	 */
-	@Override
-	public boolean hasRole(String role) {
-		return FacesContext.getCurrentInstance().getExternalContext()
-				.isUserInRole(role);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.seam.security.Identity#isLoggedIn()
-	 */
-	@Override
-	public boolean isLoggedIn() {
-		return null != getPrincipal();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.seam.security.Identity#isLoggedIn(boolean)
-	 */
-	@Override
-	public boolean isLoggedIn(boolean attemptLogin) {
-		return isLoggedIn();
-	}
-
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,121 @@
+/**
+ * 
+ */
+package org.ajax4jsf.portlet.seam;
+
+import static org.jboss.seam.ScopeType.SESSION;
+import static org.jboss.seam.annotations.Install.APPLICATION;
+
+import java.security.Principal;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.security.auth.login.LoginException;
+
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.security.Identity;
+
+/**
+ * @author asmirnov
+ * 
+ */
+//@Name("org.jboss.seam.security.identity")
+//@Scope(SESSION)
+//@BypassInterceptors
+//@Install(precedence = APPLICATION, classDependencies = "javax.portlet.Portlet")
+//@Startup
+public class PortalIdentity extends Identity {
+
+	public PortalIdentity() {
+		super();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.seam.security.Identity#authenticate()
+	 */
+	@Override
+	public void authenticate() throws LoginException {
+		if (!isLoggedIn()) {
+			throw new LoginException();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.seam.security.Identity#hasPermission(java.lang.String,
+	 *      java.lang.String, java.lang.Object[])
+	 */
+	@Override
+	public boolean hasPermission(String name, String action, Object... arg) {
+		// TODO Auto-generated method stub
+		return super.hasPermission(name, action, arg);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.seam.security.Identity#getPrincipal()
+	 */
+	@Override
+	public Principal getPrincipal() {
+		return FacesContext.getCurrentInstance().getExternalContext()
+				.getUserPrincipal();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.seam.security.Identity#getUsername()
+	 */
+	@Override
+	public String getUsername() {
+		String userName = null;
+		FacesContext facesContext = FacesContext.getCurrentInstance();
+		if (null != facesContext) {
+			ExternalContext externalContext = facesContext.getExternalContext();
+			if (null != externalContext.getUserPrincipal()) {
+				userName = externalContext.getRemoteUser();
+			}
+		}
+		return userName;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.seam.security.Identity#hasRole(java.lang.String)
+	 */
+	@Override
+	public boolean hasRole(String role) {
+		return FacesContext.getCurrentInstance().getExternalContext()
+				.isUserInRole(role);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.seam.security.Identity#isLoggedIn()
+	 */
+	@Override
+	public boolean isLoggedIn() {
+		return null != getPrincipal();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.seam.security.Identity#isLoggedIn(boolean)
+	 */
+	@Override
+	public boolean isLoggedIn(boolean attemptLogin) {
+		return isLoggedIn();
+	}
+
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,629 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.ajax4jsf.portlet.seam;
-
-import static javax.faces.event.PhaseId.ANY_PHASE;
-import static javax.faces.event.PhaseId.INVOKE_APPLICATION;
-import static javax.faces.event.PhaseId.PROCESS_VALIDATIONS;
-import static javax.faces.event.PhaseId.RENDER_RESPONSE;
-import static javax.faces.event.PhaseId.RESTORE_VIEW;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-
-import org.jboss.seam.Seam;
-import org.jboss.seam.contexts.Context;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.FacesLifecycle;
-import org.jboss.seam.core.ConversationList;
-import org.jboss.seam.core.ConversationPropagation;
-import org.jboss.seam.core.ConversationStack;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.core.Init;
-import org.jboss.seam.core.Manager;
-import org.jboss.seam.exception.Exceptions;
-import org.jboss.seam.faces.FacesManager;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.faces.FacesPage;
-import org.jboss.seam.faces.Switcher;
-import org.jboss.seam.faces.Validation;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.pageflow.Pageflow;
-import org.jboss.seam.persistence.PersistenceContexts;
-import org.jboss.seam.transaction.Transaction;
-import org.jboss.seam.util.Reflections;
-
-/**
- * Manages the Seam contexts associated with a JSF request
- * throughout the lifecycle of the request. Performs
- * transaction demarcation when Seam transaction management
- * is enabled. Hacks the JSF lifecyle to provide page
- * actions and page parameters.
- *
- * @author Gavin King
- */
-public class SeamPhaseListener implements PhaseListener
-{
-   public static final String JAVAX_PORTLET_FACES_PHASE = "javax.portlet.faces.phase";
-
-private static final long serialVersionUID = -9127555729455066493L;
-   
-   private static final LogProvider log = Logging.getLogProvider(SeamPhaseListener.class);
-   
-   private static boolean exists = false;
-   
-   private static final Method SET_RENDER_PARAMETER;
-   private static final Class ACTION_RESPONSE;
-   private static final Class PORTLET_REQUEST;
-   
-   static
-   {
-      Method method = null;
-      Class actionResponseClass = null;
-      Class portletRequestClass = null;
-      try
-      {
-         Class[] parameterTypes = { String.class, String.class };
-         actionResponseClass = Class.forName("javax.portlet.ActionResponse");
-         portletRequestClass = Class.forName("javax.portlet.PortletRequest");
-         method = actionResponseClass.getMethod("setRenderParameter", parameterTypes);
-      }
-      catch (Exception e) {}
-      SET_RENDER_PARAMETER = method;
-      ACTION_RESPONSE = actionResponseClass;
-      PORTLET_REQUEST = portletRequestClass;
-   }
-
-   public SeamPhaseListener()
-   {
-      if (exists) 
-      {
-         log.warn("There should only be one Seam phase listener per application");
-      }
-      exists=true;
-   }
-   
-   public PhaseId getPhaseId()
-   {
-      return ANY_PHASE;
-   }
-   
-   public void beforePhase(PhaseEvent event)
-   {
-      log.trace( "before phase: " + event.getPhaseId() );
-      
-      FacesLifecycle.setPhaseId( event.getPhaseId() );
-
-      try
-      {
-         if ( isPortletRequest(event) )
-         {
-            beforePortletPhase(event);
-         }
-         else
-         {
-            beforeServletPhase(event);
-         }
-         raiseEventsBeforePhase(event);
-      }
-      catch (Exception e)
-      {
-         log.error("uncaught exception", e);
-         try
-         {
-            Exceptions.instance().handle(e);
-         }
-         catch (Exception ehe) 
-         {
-            log.error("swallowing exception", e);
-         }
-      }
-
-   }
-
-   private void beforeServletPhase(PhaseEvent event)
-   {
-      if ( event.getPhaseId() == RESTORE_VIEW )
-      {
-         beforeRestoreView( event.getFacesContext() );
-      }
-      
-      handleTransactionsBeforePhase(event);         
-      
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-         beforeRenderResponse( event.getFacesContext() );
-      }
-      
-   }
-   
-   private void beforePortletPhase(PhaseEvent event)
-   {
-      // Changed to compability with JSR-301 portlet bridhe
-      FacesContext facesContext = event.getFacesContext();
-      
-      if ( event.getPhaseId() == RESTORE_VIEW /*|| event.getPhaseId() == RENDER_RESPONSE*/ )
-      {
-         beforeRestoreView(facesContext);
-      }
-
-      if (!Contexts.isApplicationContextActive()) {
-          beforeRestoreView(facesContext);
-          afterRestoreView(facesContext);
-     }
-      
-      //delegate to subclass:
-      handleTransactionsBeforePhase(event);
-      
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-//         afterRestoreView(facesContext);         
-         beforeRenderResponse( event.getFacesContext() );
-      }        
-   }
-
-   public void afterPhase(PhaseEvent event)
-   {
-      log.trace( "after phase: " + event.getPhaseId() );
-      
-      try
-      {
-         raiseEventsAfterPhase(event);
-         if ( isPortletRequest(event) )
-         {
-            afterPortletPhase(event);
-         }
-         else
-         {
-            afterServletPhase(event);
-         }
-      }
-      catch (Exception e)
-      {
-         log.error("uncaught exception", e);
-         try
-         {
-            Exceptions.instance().handle(e);
-            // A redirect occurred inside the error handler, and we are in after
-            // phase, so we need to clean up now as there are no more after
-            // phases to be run
-            if ( event.getFacesContext().getResponseComplete() )
-            {
-               afterResponseComplete(event.getFacesContext());
-            }
-         }
-         catch (Exception ehe) 
-         {
-            log.error("swallowing exception", e);
-         }
-      }
-
-      FacesLifecycle.clearPhaseId();
-      
-   }
-
-   private void afterServletPhase(PhaseEvent event)
-   {
-  
-      FacesContext facesContext = event.getFacesContext();
-      
-      if ( event.getPhaseId() == RESTORE_VIEW )
-      {
-         afterRestoreView(facesContext);
-      }      
-      else if ( event.getPhaseId() == INVOKE_APPLICATION )
-      {
-         afterInvokeApplication();
-      }
-      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
-      {
-         afterProcessValidations(facesContext);
-      }
-            
-      //has to happen after, since restoreAnyConversationContext() 
-      //can add messages
-      FacesMessages.afterPhase();
-      
-      handleTransactionsAfterPhase(event);
-            
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-         afterRenderResponse(facesContext);
-      }
-      else if ( facesContext.getResponseComplete() )
-      {
-         afterResponseComplete(facesContext);
-      }
-   }
-   
-   private void afterPortletPhase(PhaseEvent event)
-   {
-      FacesContext facesContext = event.getFacesContext();
-      
-      if ( event.getPhaseId() == RESTORE_VIEW )
-      {
-         afterRestoreView(facesContext);
-      }
-      else if ( event.getPhaseId() == INVOKE_APPLICATION )
-      {
-         afterInvokeApplication();
-      }
-      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
-      {
-         afterProcessValidations(facesContext);
-      }
-      
-      FacesMessages.afterPhase();
-      
-      
-      Object bridgePhase = facesContext.getExternalContext().getRequestMap().get(JAVAX_PORTLET_FACES_PHASE);
-            
-
-      if ( event.getPhaseId() == RENDER_RESPONSE )
-      {
-          //delegate to subclass:
-          handleTransactionsAfterPhase(event);
-         //writeConversationIdToResponse( facesContext.getExternalContext().getResponse() );
-         afterRenderResponse(facesContext);
-      }
-      else if ( (null == bridgePhase || "ActionPhase".equals(bridgePhase.toString())) && (event.getPhaseId() == INVOKE_APPLICATION || facesContext.getRenderResponse() || facesContext.getResponseComplete()) )
-      {
-         preRenderPage(facesContext, event.getPhaseId());
-         //delegate to subclass:
-         handleTransactionsAfterPhase(event);
-         Manager manager = Manager.instance();
-         manager.beforeRedirect();
-         if ( manager.isLongRunningConversation() )
-         {
-            setPortletRenderParameter(
-                  facesContext.getExternalContext().getResponse(), 
-                  manager.getConversationIdParameter(), 
-                  manager.getCurrentConversationId()
-               );
-         }
-         afterResponseComplete(facesContext);
-      } else {
-          //delegate to subclass:
-          handleTransactionsAfterPhase(event);
-    }
-      
-   }
-   
-   private static void setPortletRenderParameter(Object response, String conversationIdParameter, String conversationId)
-   {
-      if ( ACTION_RESPONSE.isInstance(response) )
-      {
-         Reflections.invokeAndWrap(SET_RENDER_PARAMETER, response, conversationIdParameter, conversationId);
-      }
-   }
-   
-   private static boolean isPortletRequest(PhaseEvent event)
-   {
-      return PORTLET_REQUEST!=null && 
-            PORTLET_REQUEST.isInstance( event.getFacesContext().getExternalContext().getRequest() );
-   }
-   
-   public void handleTransactionsBeforePhase(PhaseEvent event)
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         PhaseId phaseId = event.getPhaseId();
-         boolean beginTran = phaseId == PhaseId.RENDER_RESPONSE || 
-               phaseId == ( Transaction.instance().isConversationContextRequired() ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.RESTORE_VIEW );
-               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
-         
-         if (beginTran) 
-         {
-            begin(phaseId);
-         }
-      }
-   }
-   
-   public void handleTransactionsAfterPhase(PhaseEvent event)
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         PhaseId phaseId = event.getPhaseId();
-         boolean commitTran = phaseId == PhaseId.INVOKE_APPLICATION || 
-               event.getFacesContext().getRenderResponse() || //TODO: no need to commit the tx if we failed to restore the view
-               event.getFacesContext().getResponseComplete() ||
-               phaseId == PhaseId.RENDER_RESPONSE;
-               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
-         
-         if (commitTran)
-         { 
-            commitOrRollback(phaseId); //we commit before destroying contexts, cos the contexts have the PC in them
-         }
-      }
-   }
-   
-   protected void handleTransactionsAfterPageActions(FacesContext facesContext)
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         commitOrRollback(PhaseId.INVOKE_APPLICATION);
-         if ( !facesContext.getResponseComplete() )
-         {
-            begin(PhaseId.INVOKE_APPLICATION);
-         }
-      }
-   }
-   
-   protected void afterInvokeApplication() 
-   {
-      if ( Init.instance().isTransactionManagementEnabled() ) 
-      {
-         addTransactionFailedMessage();
-      }
-   }
-
-   protected void afterProcessValidations(FacesContext facesContext)
-   {
-      Validation.instance().afterProcessValidations(facesContext);
-   }
-   
-   /**
-    * Set up the Seam contexts, except for the conversation
-    * context
-    */
-   protected void beforeRestoreView(FacesContext facesContext)
-   {
-      FacesLifecycle.beginRequest( facesContext.getExternalContext() );
-   }
-   
-   /**
-    * Restore the page and conversation contexts during a JSF request
-    */
-   protected void afterRestoreView(FacesContext facesContext)
-   {
-      FacesLifecycle.resumePage();
-      Map parameters = facesContext.getExternalContext().getRequestParameterMap();
-      ConversationPropagation.instance().restoreConversationId(parameters);
-      boolean conversationFound = Manager.instance().restoreConversation();
-      FacesLifecycle.resumeConversation( facesContext.getExternalContext() );
-      postRestorePage(facesContext, parameters, conversationFound);            
-   }
-
-   public void raiseEventsBeforePhase(PhaseEvent event)
-   {
-      if ( Contexts.isApplicationContextActive() )
-      {
-         Events.instance().raiseEvent("org.jboss.seam.beforePhase", event);
-      }
-      
-      /*if ( Contexts.isConversationContextActive() && Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess() )
-      {
-         String name;
-         PhaseId phaseId = event.getPhaseId();
-         if ( phaseId == PhaseId.PROCESS_VALIDATIONS )
-         {
-            name = "process-validations";
-         }
-         else if ( phaseId == PhaseId.UPDATE_MODEL_VALUES )
-         {
-            name = "update-model-values";
-         }
-         else if ( phaseId == PhaseId.INVOKE_APPLICATION )
-         {
-            name = "invoke-application";
-         }
-         else if ( phaseId == PhaseId.RENDER_RESPONSE )
-         {
-            name = "render-response";
-         }
-         else
-         {
-            return;
-         }
-         Pageflow.instance().processEvents(name);
-      }*/
-   }
-   
-   public void raiseEventsAfterPhase(PhaseEvent event)
-   {
-      if ( Contexts.isApplicationContextActive() )
-      {
-         Events.instance().raiseEvent("org.jboss.seam.afterPhase", event);
-      }
-   }
-   
-   /**
-    * Add a faces message when Seam-managed transactions fail.
-    */
-   protected void addTransactionFailedMessage()
-   {
-      try
-      {
-         if ( Transaction.instance().isRolledBackOrMarkedRollback() )
-         {
-            FacesMessages.instance().addFromResourceBundleOrDefault(
-                     FacesMessage.SEVERITY_WARN, 
-                     "org.jboss.seam.TransactionFailed", 
-                     "Transaction failed"
-                  );
-         }
-      }
-      catch (Exception e) {} //swallow silently, not important
-   }
-   
-   protected void beforeRenderResponse(FacesContext facesContext)
-   {  
-      
-      if ( Contexts.isPageContextActive() )
-      {
-         Context pageContext = Contexts.getPageContext();
-         //after every time that the view may have changed,
-         //we need to flush the page context, since the 
-         //attribute map is being discarder
-         pageContext.flush();
-         //force refresh of the conversation lists (they are kept in PAGE context)
-         pageContext.remove(Seam.getComponentName(Switcher.class));
-         pageContext.remove("org.jboss.seam.core.conversationList");
-         pageContext.remove("org.jboss.seam.core.conversationStack");
-      }
-      
-      preRenderPage(facesContext, PhaseId.RENDER_RESPONSE);
-      
-      if ( facesContext.getResponseComplete() )
-      {
-         //workaround for a bug in MyFaces prior to 1.1.3
-         if ( Init.instance().isMyFacesLifecycleBug() ) 
-         {
-            FacesLifecycle.endRequest( facesContext.getExternalContext() );
-         }
-      }
-      else //if the page actions did not call responseComplete()
-      {
-         FacesMessages.instance().beforeRenderResponse();
-         //do this both before and after render, since conversations 
-         //and pageflows can begin during render
-         FacesManager.instance().prepareBackswitch(facesContext); 
-      }
-      
-      FacesPage.instance().storeConversation();
-      FacesPage.instance().storePageflow();
-      
-      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
-      if (persistenceContexts != null) 
-      {
-          persistenceContexts.beforeRender();
-      }
-   }
-   
-   protected void afterRenderResponse(FacesContext facesContext)
-   {
-      //do this both before and after render, since conversations 
-      //and pageflows can begin during render
-      FacesManager.instance().prepareBackswitch(facesContext);
-      
-      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
-      if (persistenceContexts != null) 
-      {
-          persistenceContexts.afterRender();
-      }
-      
-      ExternalContext externalContext = facesContext.getExternalContext();
-      Manager.instance().endRequest( externalContext.getSessionMap() );
-      FacesLifecycle.endRequest(externalContext);
-   }
-   
-   protected void afterResponseComplete(FacesContext facesContext)
-   {
-      //responseComplete() was called by one of the other phases, 
-      //so we will never get to the RENDER_RESPONSE phase
-      //Note: we can't call Manager.instance().beforeRedirect() here, 
-      //since a redirect is not the only reason for a responseComplete
-      ExternalContext externalContext = facesContext.getExternalContext();
-      Manager.instance().endRequest( externalContext.getSessionMap() );
-      FacesLifecycle.endRequest( facesContext.getExternalContext() );
-   }
-   
-   private void postRestorePage(FacesContext facesContext, Map parameters, boolean conversationFound)
-   {
-      if ( !Pages.isDebugPage() )
-      {
-         // Only redirect to no-conversation-view if a login redirect isn't required
-         if (!conversationFound && !Pages.instance().isLoginRedirectRequired(facesContext))
-         {
-            Pages.instance().redirectToNoConversationView();
-         }
-         
-         Manager.instance().handleConversationPropagation(parameters);
-         
-         if ( Init.instance().isJbpmInstalled() && !isExceptionHandlerRedirect() )
-         {
-            Pageflow.instance().validatePageflow(facesContext);
-         }
-         
-         Pages.instance().postRestore(facesContext);
-      }
-   }
-
-   
-   
-   private boolean preRenderPage(FacesContext facesContext, PhaseId phaseId)
-   {
-      if ( Pages.isDebugPage() )
-      {
-         return false;
-      }
-      else
-      {
-         FacesLifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
-         boolean actionsWereCalled = false;
-         try
-         {
-            actionsWereCalled = Pages.instance().preRender(facesContext);
-            return actionsWereCalled;
-         }
-         finally
-         {
-            FacesLifecycle.setPhaseId(phaseId);
-            if (actionsWereCalled) 
-            {
-               FacesMessages.afterPhase();
-               handleTransactionsAfterPageActions(facesContext); //TODO: does it really belong in the finally?
-            }
-         }
-      }
-   }
-   
-   private boolean isExceptionHandlerRedirect()
-   {
-      return Contexts.getConversationContext().isSet("org.jboss.seam.handledException");
-   }
-      
-   void begin(PhaseId phaseId) 
-   {
-      try 
-      {
-         if ( !Transaction.instance().isActiveOrMarkedRollback() )
-         {
-            if(!Transaction.instance().isNoTransaction()){
-               Transaction.instance().rollback();
-            }
-            log.debug("beginning transaction prior to phase: " + phaseId);
-            Transaction.instance().begin();
-         }
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Could not start transaction", e);
-      }
-   }
-   
-   void commitOrRollback(PhaseId phaseId) 
-   {
-      try 
-      {
-         if ( Transaction.instance().isActive() )
-         {
-            log.debug("committing transaction after phase: " + phaseId);
-            Transaction.instance().commit();
-         }
-         else if ( Transaction.instance().isRolledBackOrMarkedRollback() )
-         {
-            log.debug("rolling back transaction after phase: " + phaseId);
-            Transaction.instance().rollback();
-         }
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Could not commit transaction", e);
-      }
-   }
-   
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/SeamPhaseListener.java	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,629 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.ajax4jsf.portlet.seam;
+
+import static javax.faces.event.PhaseId.ANY_PHASE;
+import static javax.faces.event.PhaseId.INVOKE_APPLICATION;
+import static javax.faces.event.PhaseId.PROCESS_VALIDATIONS;
+import static javax.faces.event.PhaseId.RENDER_RESPONSE;
+import static javax.faces.event.PhaseId.RESTORE_VIEW;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.jboss.seam.Seam;
+import org.jboss.seam.contexts.Context;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.FacesLifecycle;
+import org.jboss.seam.core.ConversationList;
+import org.jboss.seam.core.ConversationPropagation;
+import org.jboss.seam.core.ConversationStack;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.core.Init;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.exception.Exceptions;
+import org.jboss.seam.faces.FacesManager;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.faces.FacesPage;
+import org.jboss.seam.faces.Switcher;
+import org.jboss.seam.faces.Validation;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.navigation.Pages;
+import org.jboss.seam.pageflow.Pageflow;
+import org.jboss.seam.persistence.PersistenceContexts;
+import org.jboss.seam.transaction.Transaction;
+import org.jboss.seam.util.Reflections;
+
+/**
+ * Manages the Seam contexts associated with a JSF request
+ * throughout the lifecycle of the request. Performs
+ * transaction demarcation when Seam transaction management
+ * is enabled. Hacks the JSF lifecyle to provide page
+ * actions and page parameters.
+ *
+ * @author Gavin King
+ */
+public class SeamPhaseListener implements PhaseListener
+{
+   public static final String JAVAX_PORTLET_FACES_PHASE = "javax.portlet.faces.phase";
+
+private static final long serialVersionUID = -9127555729455066493L;
+   
+   private static final LogProvider log = Logging.getLogProvider(SeamPhaseListener.class);
+   
+   private static boolean exists = false;
+   
+   private static final Method SET_RENDER_PARAMETER;
+   private static final Class ACTION_RESPONSE;
+   private static final Class PORTLET_REQUEST;
+   
+   static
+   {
+      Method method = null;
+      Class actionResponseClass = null;
+      Class portletRequestClass = null;
+      try
+      {
+         Class[] parameterTypes = { String.class, String.class };
+         actionResponseClass = Class.forName("javax.portlet.ActionResponse");
+         portletRequestClass = Class.forName("javax.portlet.PortletRequest");
+         method = actionResponseClass.getMethod("setRenderParameter", parameterTypes);
+      }
+      catch (Exception e) {}
+      SET_RENDER_PARAMETER = method;
+      ACTION_RESPONSE = actionResponseClass;
+      PORTLET_REQUEST = portletRequestClass;
+   }
+
+   public SeamPhaseListener()
+   {
+      if (exists) 
+      {
+         log.warn("There should only be one Seam phase listener per application");
+      }
+      exists=true;
+   }
+   
+   public PhaseId getPhaseId()
+   {
+      return ANY_PHASE;
+   }
+   
+   public void beforePhase(PhaseEvent event)
+   {
+      log.trace( "before phase: " + event.getPhaseId() );
+      
+      FacesLifecycle.setPhaseId( event.getPhaseId() );
+
+      try
+      {
+         if ( isPortletRequest(event) )
+         {
+            beforePortletPhase(event);
+         }
+         else
+         {
+            beforeServletPhase(event);
+         }
+         raiseEventsBeforePhase(event);
+      }
+      catch (Exception e)
+      {
+         log.error("uncaught exception", e);
+         try
+         {
+            Exceptions.instance().handle(e);
+         }
+         catch (Exception ehe) 
+         {
+            log.error("swallowing exception", e);
+         }
+      }
+
+   }
+
+   private void beforeServletPhase(PhaseEvent event)
+   {
+      if ( event.getPhaseId() == RESTORE_VIEW )
+      {
+         beforeRestoreView( event.getFacesContext() );
+      }
+      
+      handleTransactionsBeforePhase(event);         
+      
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+         beforeRenderResponse( event.getFacesContext() );
+      }
+      
+   }
+   
+   private void beforePortletPhase(PhaseEvent event)
+   {
+      // Changed to compability with JSR-301 portlet bridhe
+      FacesContext facesContext = event.getFacesContext();
+      
+      if ( event.getPhaseId() == RESTORE_VIEW /*|| event.getPhaseId() == RENDER_RESPONSE*/ )
+      {
+         beforeRestoreView(facesContext);
+      }
+
+      if (!Contexts.isApplicationContextActive()) {
+          beforeRestoreView(facesContext);
+          afterRestoreView(facesContext);
+     }
+      
+      //delegate to subclass:
+      handleTransactionsBeforePhase(event);
+      
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+//         afterRestoreView(facesContext);         
+         beforeRenderResponse( event.getFacesContext() );
+      }        
+   }
+
+   public void afterPhase(PhaseEvent event)
+   {
+      log.trace( "after phase: " + event.getPhaseId() );
+      
+      try
+      {
+         raiseEventsAfterPhase(event);
+         if ( isPortletRequest(event) )
+         {
+            afterPortletPhase(event);
+         }
+         else
+         {
+            afterServletPhase(event);
+         }
+      }
+      catch (Exception e)
+      {
+         log.error("uncaught exception", e);
+         try
+         {
+            Exceptions.instance().handle(e);
+            // A redirect occurred inside the error handler, and we are in after
+            // phase, so we need to clean up now as there are no more after
+            // phases to be run
+            if ( event.getFacesContext().getResponseComplete() )
+            {
+               afterResponseComplete(event.getFacesContext());
+            }
+         }
+         catch (Exception ehe) 
+         {
+            log.error("swallowing exception", e);
+         }
+      }
+
+      FacesLifecycle.clearPhaseId();
+      
+   }
+
+   private void afterServletPhase(PhaseEvent event)
+   {
+  
+      FacesContext facesContext = event.getFacesContext();
+      
+      if ( event.getPhaseId() == RESTORE_VIEW )
+      {
+         afterRestoreView(facesContext);
+      }      
+      else if ( event.getPhaseId() == INVOKE_APPLICATION )
+      {
+         afterInvokeApplication();
+      }
+      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
+      {
+         afterProcessValidations(facesContext);
+      }
+            
+      //has to happen after, since restoreAnyConversationContext() 
+      //can add messages
+      FacesMessages.afterPhase();
+      
+      handleTransactionsAfterPhase(event);
+            
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+         afterRenderResponse(facesContext);
+      }
+      else if ( facesContext.getResponseComplete() )
+      {
+         afterResponseComplete(facesContext);
+      }
+   }
+   
+   private void afterPortletPhase(PhaseEvent event)
+   {
+      FacesContext facesContext = event.getFacesContext();
+      
+      if ( event.getPhaseId() == RESTORE_VIEW )
+      {
+         afterRestoreView(facesContext);
+      }
+      else if ( event.getPhaseId() == INVOKE_APPLICATION )
+      {
+         afterInvokeApplication();
+      }
+      else if ( event.getPhaseId() == PROCESS_VALIDATIONS )
+      {
+         afterProcessValidations(facesContext);
+      }
+      
+      FacesMessages.afterPhase();
+      
+      
+      Object bridgePhase = facesContext.getExternalContext().getRequestMap().get(JAVAX_PORTLET_FACES_PHASE);
+            
+
+      if ( event.getPhaseId() == RENDER_RESPONSE )
+      {
+          //delegate to subclass:
+          handleTransactionsAfterPhase(event);
+         //writeConversationIdToResponse( facesContext.getExternalContext().getResponse() );
+         afterRenderResponse(facesContext);
+      }
+      else if ( (null == bridgePhase || "ActionPhase".equals(bridgePhase.toString())) && (event.getPhaseId() == INVOKE_APPLICATION || facesContext.getRenderResponse() || facesContext.getResponseComplete()) )
+      {
+         preRenderPage(facesContext, event.getPhaseId());
+         //delegate to subclass:
+         handleTransactionsAfterPhase(event);
+         Manager manager = Manager.instance();
+         manager.beforeRedirect();
+         if ( manager.isLongRunningConversation() )
+         {
+            setPortletRenderParameter(
+                  facesContext.getExternalContext().getResponse(), 
+                  manager.getConversationIdParameter(), 
+                  manager.getCurrentConversationId()
+               );
+         }
+         afterResponseComplete(facesContext);
+      } else {
+          //delegate to subclass:
+          handleTransactionsAfterPhase(event);
+    }
+      
+   }
+   
+   private static void setPortletRenderParameter(Object response, String conversationIdParameter, String conversationId)
+   {
+      if ( ACTION_RESPONSE.isInstance(response) )
+      {
+         Reflections.invokeAndWrap(SET_RENDER_PARAMETER, response, conversationIdParameter, conversationId);
+      }
+   }
+   
+   private static boolean isPortletRequest(PhaseEvent event)
+   {
+      return PORTLET_REQUEST!=null && 
+            PORTLET_REQUEST.isInstance( event.getFacesContext().getExternalContext().getRequest() );
+   }
+   
+   public void handleTransactionsBeforePhase(PhaseEvent event)
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         PhaseId phaseId = event.getPhaseId();
+         boolean beginTran = phaseId == PhaseId.RENDER_RESPONSE || 
+               phaseId == ( Transaction.instance().isConversationContextRequired() ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.RESTORE_VIEW );
+               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
+         
+         if (beginTran) 
+         {
+            begin(phaseId);
+         }
+      }
+   }
+   
+   public void handleTransactionsAfterPhase(PhaseEvent event)
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         PhaseId phaseId = event.getPhaseId();
+         boolean commitTran = phaseId == PhaseId.INVOKE_APPLICATION || 
+               event.getFacesContext().getRenderResponse() || //TODO: no need to commit the tx if we failed to restore the view
+               event.getFacesContext().getResponseComplete() ||
+               phaseId == PhaseId.RENDER_RESPONSE;
+               //( phaseId == PhaseId.RENDER_RESPONSE && !Init.instance().isClientSideConversations() );
+         
+         if (commitTran)
+         { 
+            commitOrRollback(phaseId); //we commit before destroying contexts, cos the contexts have the PC in them
+         }
+      }
+   }
+   
+   protected void handleTransactionsAfterPageActions(FacesContext facesContext)
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         commitOrRollback(PhaseId.INVOKE_APPLICATION);
+         if ( !facesContext.getResponseComplete() )
+         {
+            begin(PhaseId.INVOKE_APPLICATION);
+         }
+      }
+   }
+   
+   protected void afterInvokeApplication() 
+   {
+      if ( Init.instance().isTransactionManagementEnabled() ) 
+      {
+         addTransactionFailedMessage();
+      }
+   }
+
+   protected void afterProcessValidations(FacesContext facesContext)
+   {
+      Validation.instance().afterProcessValidations(facesContext);
+   }
+   
+   /**
+    * Set up the Seam contexts, except for the conversation
+    * context
+    */
+   protected void beforeRestoreView(FacesContext facesContext)
+   {
+      FacesLifecycle.beginRequest( facesContext.getExternalContext() );
+   }
+   
+   /**
+    * Restore the page and conversation contexts during a JSF request
+    */
+   protected void afterRestoreView(FacesContext facesContext)
+   {
+      FacesLifecycle.resumePage();
+      Map parameters = facesContext.getExternalContext().getRequestParameterMap();
+      ConversationPropagation.instance().restoreConversationId(parameters);
+      boolean conversationFound = Manager.instance().restoreConversation();
+      FacesLifecycle.resumeConversation( facesContext.getExternalContext() );
+      postRestorePage(facesContext, parameters, conversationFound);            
+   }
+
+   public void raiseEventsBeforePhase(PhaseEvent event)
+   {
+      if ( Contexts.isApplicationContextActive() )
+      {
+         Events.instance().raiseEvent("org.jboss.seam.beforePhase", event);
+      }
+      
+      /*if ( Contexts.isConversationContextActive() && Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess() )
+      {
+         String name;
+         PhaseId phaseId = event.getPhaseId();
+         if ( phaseId == PhaseId.PROCESS_VALIDATIONS )
+         {
+            name = "process-validations";
+         }
+         else if ( phaseId == PhaseId.UPDATE_MODEL_VALUES )
+         {
+            name = "update-model-values";
+         }
+         else if ( phaseId == PhaseId.INVOKE_APPLICATION )
+         {
+            name = "invoke-application";
+         }
+         else if ( phaseId == PhaseId.RENDER_RESPONSE )
+         {
+            name = "render-response";
+         }
+         else
+         {
+            return;
+         }
+         Pageflow.instance().processEvents(name);
+      }*/
+   }
+   
+   public void raiseEventsAfterPhase(PhaseEvent event)
+   {
+      if ( Contexts.isApplicationContextActive() )
+      {
+         Events.instance().raiseEvent("org.jboss.seam.afterPhase", event);
+      }
+   }
+   
+   /**
+    * Add a faces message when Seam-managed transactions fail.
+    */
+   protected void addTransactionFailedMessage()
+   {
+      try
+      {
+         if ( Transaction.instance().isRolledBackOrMarkedRollback() )
+         {
+            FacesMessages.instance().addFromResourceBundleOrDefault(
+                     FacesMessage.SEVERITY_WARN, 
+                     "org.jboss.seam.TransactionFailed", 
+                     "Transaction failed"
+                  );
+         }
+      }
+      catch (Exception e) {} //swallow silently, not important
+   }
+   
+   protected void beforeRenderResponse(FacesContext facesContext)
+   {  
+      
+      if ( Contexts.isPageContextActive() )
+      {
+         Context pageContext = Contexts.getPageContext();
+         //after every time that the view may have changed,
+         //we need to flush the page context, since the 
+         //attribute map is being discarder
+         pageContext.flush();
+         //force refresh of the conversation lists (they are kept in PAGE context)
+         pageContext.remove(Seam.getComponentName(Switcher.class));
+         pageContext.remove("org.jboss.seam.core.conversationList");
+         pageContext.remove("org.jboss.seam.core.conversationStack");
+      }
+      
+      preRenderPage(facesContext, PhaseId.RENDER_RESPONSE);
+      
+      if ( facesContext.getResponseComplete() )
+      {
+         //workaround for a bug in MyFaces prior to 1.1.3
+         if ( Init.instance().isMyFacesLifecycleBug() ) 
+         {
+            FacesLifecycle.endRequest( facesContext.getExternalContext() );
+         }
+      }
+      else //if the page actions did not call responseComplete()
+      {
+         FacesMessages.instance().beforeRenderResponse();
+         //do this both before and after render, since conversations 
+         //and pageflows can begin during render
+         FacesManager.instance().prepareBackswitch(facesContext); 
+      }
+      
+      FacesPage.instance().storeConversation();
+      FacesPage.instance().storePageflow();
+      
+      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
+      if (persistenceContexts != null) 
+      {
+          persistenceContexts.beforeRender();
+      }
+   }
+   
+   protected void afterRenderResponse(FacesContext facesContext)
+   {
+      //do this both before and after render, since conversations 
+      //and pageflows can begin during render
+      FacesManager.instance().prepareBackswitch(facesContext);
+      
+      PersistenceContexts persistenceContexts = PersistenceContexts.instance();
+      if (persistenceContexts != null) 
+      {
+          persistenceContexts.afterRender();
+      }
+      
+      ExternalContext externalContext = facesContext.getExternalContext();
+      Manager.instance().endRequest( externalContext.getSessionMap() );
+      FacesLifecycle.endRequest(externalContext);
+   }
+   
+   protected void afterResponseComplete(FacesContext facesContext)
+   {
+      //responseComplete() was called by one of the other phases, 
+      //so we will never get to the RENDER_RESPONSE phase
+      //Note: we can't call Manager.instance().beforeRedirect() here, 
+      //since a redirect is not the only reason for a responseComplete
+      ExternalContext externalContext = facesContext.getExternalContext();
+      Manager.instance().endRequest( externalContext.getSessionMap() );
+      FacesLifecycle.endRequest( facesContext.getExternalContext() );
+   }
+   
+   private void postRestorePage(FacesContext facesContext, Map parameters, boolean conversationFound)
+   {
+      if ( !Pages.isDebugPage() )
+      {
+         // Only redirect to no-conversation-view if a login redirect isn't required
+         if (!conversationFound && !Pages.instance().isLoginRedirectRequired(facesContext))
+         {
+            Pages.instance().redirectToNoConversationView();
+         }
+         
+         Manager.instance().handleConversationPropagation(parameters);
+         
+         if ( Init.instance().isJbpmInstalled() && !isExceptionHandlerRedirect() )
+         {
+            Pageflow.instance().validatePageflow(facesContext);
+         }
+         
+         Pages.instance().postRestore(facesContext);
+      }
+   }
+
+   
+   
+   private boolean preRenderPage(FacesContext facesContext, PhaseId phaseId)
+   {
+      if ( Pages.isDebugPage() )
+      {
+         return false;
+      }
+      else
+      {
+         FacesLifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION);
+         boolean actionsWereCalled = false;
+         try
+         {
+            actionsWereCalled = Pages.instance().preRender(facesContext);
+            return actionsWereCalled;
+         }
+         finally
+         {
+            FacesLifecycle.setPhaseId(phaseId);
+            if (actionsWereCalled) 
+            {
+               FacesMessages.afterPhase();
+               handleTransactionsAfterPageActions(facesContext); //TODO: does it really belong in the finally?
+            }
+         }
+      }
+   }
+   
+   private boolean isExceptionHandlerRedirect()
+   {
+      return Contexts.getConversationContext().isSet("org.jboss.seam.handledException");
+   }
+      
+   void begin(PhaseId phaseId) 
+   {
+      try 
+      {
+         if ( !Transaction.instance().isActiveOrMarkedRollback() )
+         {
+            if(!Transaction.instance().isNoTransaction()){
+               Transaction.instance().rollback();
+            }
+            log.debug("beginning transaction prior to phase: " + phaseId);
+            Transaction.instance().begin();
+         }
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException("Could not start transaction", e);
+      }
+   }
+   
+   void commitOrRollback(PhaseId phaseId) 
+   {
+      try 
+      {
+         if ( Transaction.instance().isActive() )
+         {
+            log.debug("committing transaction after phase: " + phaseId);
+            Transaction.instance().commit();
+         }
+         else if ( Transaction.instance().isRolledBackOrMarkedRollback() )
+         {
+            log.debug("rolling back transaction after phase: " + phaseId);
+            Transaction.instance().rollback();
+         }
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException("Could not commit transaction", e);
+      }
+   }
+   
+}

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1 +0,0 @@
-jndiPattern #{ejbName}/local
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1 @@
+jndiPattern #{ejbName}/local
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/seam.properties
===================================================================

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/resources/seam.properties (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/seam.properties)
===================================================================

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path: 
-

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/MANIFEST.MF	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
-             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
-             version="1.0">
-   <persistence-unit name="bookingDatabase">
-      <provider>org.hibernate.ejb.HibernatePersistence</provider>
-      <jta-data-source>java:/bookingDatasource</jta-data-source>
-      <properties>
-         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
-         <property name="hibernate.show_sql" value="true"/>
-         <!-- These are the default for JBoss EJB3, but not for HEM: -->
-         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
-         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
-      </properties>
-   </persistence-unit>
-</persistence>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
+             version="1.0">
+   <persistence-unit name="bookingDatabase">
+      <provider>org.hibernate.ejb.HibernatePersistence</provider>
+      <jta-data-source>java:/bookingDatasource</jta-data-source>
+      <properties>
+         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+         <property name="hibernate.show_sql" value="true"/>
+         <!-- These are the default for JBoss EJB3, but not for HEM: -->
+         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+      </properties>
+   </persistence-unit>
+</persistence>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PROCESS ENTITY="JSFProcess"/>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<components xmlns="http://jboss.com/products/seam/components"
-            xmlns:core="http://jboss.com/products/seam/core"
-            xmlns:drools="http://jboss.com/products/seam/drools"
-            xmlns:persistence="http://jboss.com/products/seam/persistence"
-            xmlns:security="http://jboss.com/products/seam/security"
-            xmlns:web="http://jboss.com/products/seam/web"
-            xmlns:mail="http://jboss.com/products/seam/mail"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xmlns:transaction="http://jboss.com/products/seam/transaction"
-            xsi:schemaLocation=
-                    "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
-                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
-                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
-                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
-                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
-                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
-                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
-
-
-    <core:init jndi-pattern="seamEAR/#{ejbName}/local" debug="false"/>
-
-    <core:manager conversation-timeout="120000"
-                  concurrent-request-timeout="500"
-                  conversation-id-parameter="cid"/>
-
-    <persistence:managed-persistence-context name="entityManager"
-                                             auto-create="true"
-                                             persistence-unit-jndi-name="java:/seamBookingEntityManagerFactory"/>
-
-    <!--<transaction:ejb-transaction/>
-
-    --><security:identity authenticate-method="#{authenticator.authenticate}"/>
-
-</components>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+            xmlns:core="http://jboss.com/products/seam/core"
+            xmlns:drools="http://jboss.com/products/seam/drools"
+            xmlns:persistence="http://jboss.com/products/seam/persistence"
+            xmlns:security="http://jboss.com/products/seam/security"
+            xmlns:web="http://jboss.com/products/seam/web"
+            xmlns:mail="http://jboss.com/products/seam/mail"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns:transaction="http://jboss.com/products/seam/transaction"
+            xsi:schemaLocation=
+                    "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
+                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
+                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
+                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
+                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
+
+
+    <core:init jndi-pattern="seamEAR/#{ejbName}/local" debug="false"/>
+
+    <core:manager conversation-timeout="120000"
+                  concurrent-request-timeout="500"
+                  conversation-id-parameter="cid"/>
+
+    <persistence:managed-persistence-context name="entityManager"
+                                             auto-create="true"
+                                             persistence-unit-jndi-name="java:/seamBookingEntityManagerFactory"/>
+
+    <!--<transaction:ejb-transaction/>
+
+    --><security:identity authenticate-method="#{authenticator.authenticate}"/>
+
+</components>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,18 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<faces-config version="1.2"
-              xmlns="http://java.sun.com/xml/ns/javaee"
-              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
-    
-	<application>
-		<view-handler>
-			org.ajax4jsf.portlet.application.PortletViewHandler
-		</view-handler>
-	</application>
-	<factory>
-		<faces-context-factory>
-			org.ajax4jsf.portlet.context.FacesContextFactoryImpl
-		</faces-context-factory>
-	</factory>
-
-</faces-config>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+              xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+    
+	<application>
+		<view-handler>
+			org.ajax4jsf.portlet.application.PortletViewHandler
+		</view-handler>
+	</application>
+	<factory>
+		<faces-context-factory>
+			org.ajax4jsf.portlet.context.FacesContextFactoryImpl
+		</faces-context-factory>
+	</factory>
+
+</faces-config>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PROCESS ENTITY="JSFProcess"/>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,3 +0,0 @@
-<jboss-app>
-	<app-name>seamBookingPortletApp</app-name>
-</jboss-app>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,3 @@
+<jboss-app>
+	<app-name>seamBookingPortletApp</app-name>
+</jboss-app>
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE portlet-app PUBLIC
-   "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
-   "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd"><portlet-app>
-    <portlet>
-         <portlet-name>seamBookingPortlet</portlet-name>
-          <header-content>
-            <link rel="stylesheet" type="text/css" href="/css/screen.css" media="screen"/>
-         </header-content>
-    </portlet>
-</portlet-app>         
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE portlet-app PUBLIC
+   "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+   "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd"><portlet-app>
+    <portlet>
+         <portlet-name>seamBookingPortlet</portlet-name>
+          <header-content>
+            <link rel="stylesheet" type="text/css" href="/css/screen.css" media="screen"/>
+         </header-content>
+    </portlet>
+</portlet-app>         
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,12 +0,0 @@
- <!DOCTYPE jboss-web PUBLIC
-    "-//JBoss//DTD Web Application 4.2//EN"
-    "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
-
-<jboss-web>  
-    <class-loading java2ClassLoadingCompliance="false">
-        <loader-repository>
-            seam.jboss.org:loader=seamBookingPortlet
-            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
-        </loader-repository>
-    </class-loading>
-</jboss-web>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,12 @@
+ <!DOCTYPE jboss-web PUBLIC
+    "-//JBoss//DTD Web Application 4.2//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+
+<jboss-web>  
+    <class-loading java2ClassLoadingCompliance="false">
+        <loader-repository>
+            seam.jboss.org:loader=seamBookingPortlet
+            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
+        </loader-repository>
+    </class-loading>
+</jboss-web>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<pages xmlns="http://jboss.com/products/seam/pages"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
-	   no-conversation-view-id="/main.xhtml"
-       login-view-id="/home.xhtml">
-       <!--
-no-conversation-view-id="/main.xhtml"
-    -->
-    <page view-id="/register.xhtml">
-    
-        <action if="#{validation.failed}"
-           execute="#{register.invalid}"/>
-    
-        <navigation>
-            <rule if="#{register.registered}">
-                <render view-id="/home.xhtml"/>
-            </rule>
-        </navigation>
-        
-    </page>
-
-    <page view-id="/home.xhtml">
-    	<action execute="#{identity.login}" if="#{identity.loggedIn}"/>
-        <navigation from-action="#{identity.login}">
-            <render  view-id="/main.xhtml"/>
-        </navigation>
-        <navigation>
-            <rule if="#{identity.loggedIn}">
-                <render view-id="/main.xhtml"/>
-            </rule>
-        </navigation>
-        
-    </page>
-    
-    <page view-id="/password.xhtml"
-          login-required="true">
-    
-        <navigation>
-            <rule if="#{changePassword.changed}">
-                <render view-id="/main.xhtml"/>
-            </rule>
-        </navigation>
-        
-    </page>
-
-    <page view-id="/main.xhtml" 
-          login-required="true">
-    
-        <navigation from-action="#{hotelBooking.selectHotel(hot)}">
-            <render view-id="/hotel.xhtml"/>
-        </navigation>
-        
-        <navigation from-action="#{bookingList.cancel}">
-            <render/>
-        </navigation>
-        
-    </page>
-    
-	<page view-id="/hotel.xhtml" 
-	      conversation-required="true" 
-	      login-required="true">
-          
-        <description>View hotel: #{hotel.name}</description>
-        
-        <navigation from-action="#{hotelBooking.bookHotel}">
-            <render view-id="/book.xhtml"/>
-        </navigation>
-        
-    </page>
-
-	<page view-id="/book.xhtml" 
-	      conversation-required="true" 
-	      login-required="true">
-          
-        <description>Book hotel: #{hotel.name}</description>
-        
-        <navigation from-action="#{hotelBooking.setBookingDetails}">
-            <rule if="#{hotelBooking.bookingValid}">
-                <render view-id="/confirm.xhtml"/>
-            </rule>
-        </navigation>
-        
-    </page>
-
-	<page view-id="/confirm.xhtml" 
-	      conversation-required="true" 
-	      login-required="true">
-          
-        <description>Confirm booking: #{booking.description}</description>
-        
-        <navigation from-action="#{hotelBooking.confirm}">
-            <render view-id="/main.xhtml"/>
-        </navigation>
-        
-    </page>
-    
-    <page view-id="*">
-    
-        <navigation from-action="#{identity.logout}">
-            <render view-id="/home.xhtml"/>
-        </navigation>
-
-        <navigation from-action="#{hotelBooking.cancel}">
-            <render view-id="/main.xhtml"/>
-        </navigation>
-        
-    </page>
-    
-    <exception class="org.jboss.seam.security.NotLoggedInException">
-        <redirect view-id="/home.xhtml">
-            <message severity="warn">You must be logged in to use this feature</message>
-        </redirect>
-    </exception>
-
-</pages>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages xmlns="http://jboss.com/products/seam/pages"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
+	   no-conversation-view-id="/main.xhtml"
+       login-view-id="/home.xhtml">
+       <!--
+no-conversation-view-id="/main.xhtml"
+    -->
+    <page view-id="/register.xhtml">
+    
+        <action if="#{validation.failed}"
+           execute="#{register.invalid}"/>
+    
+        <navigation>
+            <rule if="#{register.registered}">
+                <render view-id="/home.xhtml"/>
+            </rule>
+        </navigation>
+        
+    </page>
+
+    <page view-id="/home.xhtml">
+    	<action execute="#{identity.login}" if="#{identity.loggedIn}"/>
+        <navigation from-action="#{identity.login}">
+            <render  view-id="/main.xhtml"/>
+        </navigation>
+        <navigation>
+            <rule if="#{identity.loggedIn}">
+                <render view-id="/main.xhtml"/>
+            </rule>
+        </navigation>
+        
+    </page>
+    
+    <page view-id="/password.xhtml"
+          login-required="true">
+    
+        <navigation>
+            <rule if="#{changePassword.changed}">
+                <render view-id="/main.xhtml"/>
+            </rule>
+        </navigation>
+        
+    </page>
+
+    <page view-id="/main.xhtml" 
+          login-required="true">
+    
+        <navigation from-action="#{hotelBooking.selectHotel(hot)}">
+            <render view-id="/hotel.xhtml"/>
+        </navigation>
+        
+        <navigation from-action="#{bookingList.cancel}">
+            <render/>
+        </navigation>
+        
+    </page>
+    
+	<page view-id="/hotel.xhtml" 
+	      conversation-required="true" 
+	      login-required="true">
+          
+        <description>View hotel: #{hotel.name}</description>
+        
+        <navigation from-action="#{hotelBooking.bookHotel}">
+            <render view-id="/book.xhtml"/>
+        </navigation>
+        
+    </page>
+
+	<page view-id="/book.xhtml" 
+	      conversation-required="true" 
+	      login-required="true">
+          
+        <description>Book hotel: #{hotel.name}</description>
+        
+        <navigation from-action="#{hotelBooking.setBookingDetails}">
+            <rule if="#{hotelBooking.bookingValid}">
+                <render view-id="/confirm.xhtml"/>
+            </rule>
+        </navigation>
+        
+    </page>
+
+	<page view-id="/confirm.xhtml" 
+	      conversation-required="true" 
+	      login-required="true">
+          
+        <description>Confirm booking: #{booking.description}</description>
+        
+        <navigation from-action="#{hotelBooking.confirm}">
+            <render view-id="/main.xhtml"/>
+        </navigation>
+        
+    </page>
+    
+    <page view-id="*">
+    
+        <navigation from-action="#{identity.logout}">
+            <render view-id="/home.xhtml"/>
+        </navigation>
+
+        <navigation from-action="#{hotelBooking.cancel}">
+            <render view-id="/main.xhtml"/>
+        </navigation>
+        
+    </page>
+    
+    <exception class="org.jboss.seam.security.NotLoggedInException">
+        <redirect view-id="/home.xhtml">
+            <message severity="warn">You must be logged in to use this feature</message>
+        </redirect>
+    </exception>
+
+</pages>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<deployments>
-	<deployment>
-		<instance>
-			<instance-id>SeamBookingPortletInstance</instance-id>
-			<portlet-ref>seamBookingPortlet</portlet-ref>
-		</instance>
-	</deployment>
-	<deployment>
-		<instance>
-			<instance-id>SeamBookingPortletSecondInstance</instance-id>
-			<portlet-ref>seamBookingPortlet</portlet-ref>
-		</instance>
-	</deployment>
-</deployments>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<deployments>
+	<deployment>
+		<instance>
+			<instance-id>SeamBookingPortletInstance</instance-id>
+			<portlet-ref>seamBookingPortlet</portlet-ref>
+		</instance>
+	</deployment>
+	<deployment>
+		<instance>
+			<instance-id>SeamBookingPortletSecondInstance</instance-id>
+			<portlet-ref>seamBookingPortlet</portlet-ref>
+		</instance>
+	</deployment>
+</deployments>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,27 +0,0 @@
-<portlet-app version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
-  xmlns="http://java.sun.com/xml/ns/portlet">
-  <portlet>
-    <portlet-name>seamBookingPortlet</portlet-name>
-    <portlet-class>
-      javax.portlet.faces.GenericFacesPortlet
-    </portlet-class>
-
-    <init-param>
-      <name>javax.portlet.faces.defaultViewId.view</name>
-      <value>/home.xhtml</value>
-    </init-param>
-    <init-param>
-      <name>javax.portlet.faces.preserveActionParams</name>
-      <value>true</value>
-    </init-param>
-    <expiration-cache>-0</expiration-cache>
-    <portlet-info>
-       <title>Seam Booking Example Portlet</title>
-    </portlet-info>
-    <supports>
-      <mime-type>text/html</mime-type>
-      <portlet-mode>VIEW</portlet-mode>
-    </supports>
-  </portlet>
-</portlet-app>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,27 @@
+<portlet-app version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
+  xmlns="http://java.sun.com/xml/ns/portlet">
+  <portlet>
+    <portlet-name>seamBookingPortlet</portlet-name>
+    <portlet-class>
+      javax.portlet.faces.GenericFacesPortlet
+    </portlet-class>
+
+    <init-param>
+      <name>javax.portlet.faces.defaultViewId.view</name>
+      <value>/home.xhtml</value>
+    </init-param>
+    <init-param>
+      <name>javax.portlet.faces.preserveActionParams</name>
+      <value>true</value>
+    </init-param>
+    <expiration-cache>-0</expiration-cache>
+    <portlet-info>
+       <title>Seam Booking Example Portlet</title>
+    </portlet-info>
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
+  </portlet>
+</portlet-app>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployments>
-  <deployment>
-    <parent-ref>default</parent-ref>
-    <if-exists>overwrite</if-exists>
-    <instance>
-      <instance-name>SeamBookingPortletInstance</instance-name>
-      <component-ref>seamBookingPortletApp.seamBookingPortlet</component-ref>
-    </instance>
-  </deployment>
-  	<deployment>
-  	<parent-ref>default</parent-ref>
-  	<if-exists>overwrite</if-exists>
-  	<page>
-  	<page-name>seamBookingPortlet</page-name>
-	    <window>
-		    <window-name>seamBookingPortletWindow</window-name>
-		    <instance-ref>SeamBookingPortletInstance</instance-ref>
-		    <default>true</default>
-		    <region>center</region>
-		    <height>0</height>
-	    </window>
-  	</page>
-  	</deployment>
-<!--
-  <deployment>
-    <parent-ref>default</parent-ref>
-    <if-exists>overwrite</if-exists>
-    <instance>
-      <instance-name>SeamBookingPortletSecondInstance</instance-name>
-      <component-ref>seamBookingPortletApp.seamBookingPortlet</component-ref>
-    </instance>
-  </deployment>
---></deployments>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+  <deployment>
+    <parent-ref>default</parent-ref>
+    <if-exists>overwrite</if-exists>
+    <instance>
+      <instance-name>SeamBookingPortletInstance</instance-name>
+      <component-ref>seamBookingPortletApp.seamBookingPortlet</component-ref>
+    </instance>
+  </deployment>
+  	<deployment>
+  	<parent-ref>default</parent-ref>
+  	<if-exists>overwrite</if-exists>
+  	<page>
+  	<page-name>seamBookingPortlet</page-name>
+	    <window>
+		    <window-name>seamBookingPortletWindow</window-name>
+		    <instance-ref>SeamBookingPortletInstance</instance-ref>
+		    <default>true</default>
+		    <region>center</region>
+		    <height>0</height>
+	    </window>
+  	</page>
+  	</deployment>
+<!--
+  <deployment>
+    <parent-ref>default</parent-ref>
+    <if-exists>overwrite</if-exists>
+    <instance>
+      <instance-name>SeamBookingPortletSecondInstance</instance-name>
+      <component-ref>seamBookingPortletApp.seamBookingPortlet</component-ref>
+    </instance>
+  </deployment>
+--></deployments>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
-
-	<display-name>Seam Booking Example</display-name>
-
-	<context-param>
-		<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
-		<param-value>
-			org.ajax4jsf.portlet.application.FaceletPortletViewHandler
-		</param-value>
-	</context-param>
-	<context-param>
-		<param-name>org.ajax4jsf.portlet.ExceptionHandler</param-name>
-		<param-value>
-			org.ajax4jsf.portlet.SeamExceptionHandlerImpl
-		</param-value>
-	</context-param>
-	<context-param>
-		<param-name>javax.portlet.faces.renderPolicy</param-name>
-		<param-value>
-			ALWAYS_DELEGATE
-		</param-value>
-	</context-param>
-	<!-- Seam -->
-
-	<listener>
-		<listener-class>
-			org.jboss.seam.servlet.SeamListener
-		</listener-class>
-	</listener>
-
-	<servlet>
-		<servlet-name>Seam Resource Servlet</servlet-name>
-		<servlet-class>
-			org.jboss.seam.servlet.SeamResourceServlet
-		</servlet-class>
-	</servlet>
-
-	<servlet-mapping>
-		<servlet-name>Seam Resource Servlet</servlet-name>
-		<url-pattern>/seam/resource/*</url-pattern>
-	</servlet-mapping>
-
-	<filter>
-		<filter-name>Seam Filter</filter-name>
-		<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
-	</filter>
-
-	<filter-mapping>
-		<filter-name>Seam Filter</filter-name>
-		<servlet-name>FacesServlet</servlet-name>
-		<dispatcher>FORWARD</dispatcher>
-		<dispatcher>REQUEST</dispatcher>
-		<dispatcher>INCLUDE</dispatcher>
-	</filter-mapping>
-
-	<!-- JSF -->
-
-	<context-param>
-		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
-		<param-value>.xhtml</param-value>
-	</context-param>
-
-	<context-param>
-		<param-name>facelets.DEVELOPMENT</param-name>
-		<param-value>true</param-value>
-	</context-param>
-
-	<servlet>
-		<servlet-name>FacesServlet</servlet-name>
-		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
-		<load-on-startup>1</load-on-startup>
-	</servlet>
-
-	<servlet-mapping>
-		<servlet-name>FacesServlet</servlet-name>
-		<url-pattern>/faces/*</url-pattern>
-	</servlet-mapping>
-
-	<session-config>
-		<session-timeout>10</session-timeout>
-	</session-config>
-
-</web-app>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+	<display-name>Seam Booking Example</display-name>
+
+	<context-param>
+		<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+		<param-value>
+			org.ajax4jsf.portlet.application.FaceletPortletViewHandler
+		</param-value>
+	</context-param>
+	<context-param>
+		<param-name>org.ajax4jsf.portlet.ExceptionHandler</param-name>
+		<param-value>
+			org.ajax4jsf.portlet.SeamExceptionHandlerImpl
+		</param-value>
+	</context-param>
+	<context-param>
+		<param-name>javax.portlet.faces.renderPolicy</param-name>
+		<param-value>
+			ALWAYS_DELEGATE
+		</param-value>
+	</context-param>
+	<!-- Seam -->
+
+	<listener>
+		<listener-class>
+			org.jboss.seam.servlet.SeamListener
+		</listener-class>
+	</listener>
+
+	<servlet>
+		<servlet-name>Seam Resource Servlet</servlet-name>
+		<servlet-class>
+			org.jboss.seam.servlet.SeamResourceServlet
+		</servlet-class>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>Seam Resource Servlet</servlet-name>
+		<url-pattern>/seam/resource/*</url-pattern>
+	</servlet-mapping>
+
+	<filter>
+		<filter-name>Seam Filter</filter-name>
+		<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+	</filter>
+
+	<filter-mapping>
+		<filter-name>Seam Filter</filter-name>
+		<servlet-name>FacesServlet</servlet-name>
+		<dispatcher>FORWARD</dispatcher>
+		<dispatcher>REQUEST</dispatcher>
+		<dispatcher>INCLUDE</dispatcher>
+	</filter-mapping>
+
+	<!-- JSF -->
+
+	<context-param>
+		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+		<param-value>.xhtml</param-value>
+	</context-param>
+
+	<context-param>
+		<param-name>facelets.DEVELOPMENT</param-name>
+		<param-value>true</param-value>
+	</context-param>
+
+	<servlet>
+		<servlet-name>FacesServlet</servlet-name>
+		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>FacesServlet</servlet-name>
+		<url-pattern>/faces/*</url-pattern>
+	</servlet-mapping>
+
+	<session-config>
+		<session-timeout>10</session-timeout>
+	</session-config>
+
+</web-app>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,122 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-	    		xmlns:ui="http://java.sun.com/jsf/facelets"
-	  			xmlns:h="http://java.sun.com/jsf/html"
-	  			xmlns:f="http://java.sun.com/jsf/core"
-	  			xmlns:s="http://jboss.com/products/seam/taglib"
-                xmlns:a="http://richfaces.org/a4j"
-                xmlns:rich="http://richfaces.org/rich"
-				template="template.xhtml">
-
-<!-- content -->
-<ui:define name="content">
-<div class="section">
-	<h1>Book Hotel</h1>
-</div>
-<div class="section">
-	<div class="entry errors">
-		<h:messages globalOnly="true"/>
-	</div>
-
-	<ui:include src="hotelview.xhtml"/>
-	
-	<div style="clear:both"/>
-
-	<h:form id="booking">
-	<fieldset>
-			
-		<s:decorate id="checkinDateDecorate" template="edit.xhtml">
-			<ui:define name="label">Check In Date:</ui:define>
-			<rich:calendar id="checkinDate" value="#{booking.checkinDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkinDateDecorate" />
-		</s:decorate>
-		
-		<s:decorate id="checkoutDateDecorate" template="edit.xhtml">
-			<ui:define name="label">Check Out Date:</ui:define>
-			<rich:calendar id="checkoutDate" value="#{booking.checkoutDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkoutDateDecorate" />
-		</s:decorate>
-		
-		<s:decorate id="bedsDecorate" template="edit.xhtml">
-			<ui:define name="label">Room Preference:</ui:define>
-			<h:selectOneMenu id="beds" value="#{booking.beds}">
-				<f:selectItem itemLabel="One king-size bed" itemValue="1"/>
-				<f:selectItem itemLabel="Two double beds" itemValue="2"/>
-				<f:selectItem itemLabel="Three beds" itemValue="3"/>
-			</h:selectOneMenu>
-		</s:decorate>
-		
-		<s:decorate id="smokingDecorate" template="edit.xhtml">
-			<ui:define name="label">Smoking Preference:</ui:define>
-			<h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection" styleClass="radio">
-				<f:selectItem itemLabel="Smoking" itemValue="true"/>
-				<f:selectItem itemLabel="Non Smoking" itemValue="false"/>
-			</h:selectOneRadio>
-		</s:decorate>
-
-		<s:decorate id="creditCardDecorate" template="edit.xhtml">
-			<ui:define name="label">Credit Card #:</ui:define>
-			<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
-				<a:support event="onblur" reRender="creditCardDecorate" bypassUpdates="true"/>
-			</h:inputText>
-		</s:decorate>
-
-		<s:decorate id="creditCardNameDecorate" template="edit.xhtml">
-			<ui:define name="label">Credit Card Name:</ui:define>
-			<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
-				<a:support event="onblur" reRender="creditCardNameDecorate" bypassUpdates="true"/>
-			</h:inputText>
-		</s:decorate>
-
-		<s:decorate id="creditCardExpiryDecorate" template="edit.xhtml">
-			<ui:define name="label">Credit Card Expiry:</ui:define>
-			<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
-				<f:selectItem itemLabel="Jan" itemValue="1"/>
-				<f:selectItem itemLabel="Feb" itemValue="2"/>
-				<f:selectItem itemLabel="Mar" itemValue="3"/>
-				<f:selectItem itemLabel="Apr" itemValue="4"/>
-				<f:selectItem itemLabel="May" itemValue="5"/>
-				<f:selectItem itemLabel="Jun" itemValue="6"/>
-				<f:selectItem itemLabel="Jul" itemValue="7"/>
-				<f:selectItem itemLabel="Aug" itemValue="8"/>
-				<f:selectItem itemLabel="Sep" itemValue="9"/>
-				<f:selectItem itemLabel="Oct" itemValue="10"/>
-				<f:selectItem itemLabel="Nov" itemValue="11"/>
-				<f:selectItem itemLabel="Dec" itemValue="12"/>
-			</h:selectOneMenu>
-			<h:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
-				<f:selectItem itemLabel="2005" itemValue="2005"/>
-				<f:selectItem itemLabel="2006" itemValue="2006"/>
-				<f:selectItem itemLabel="2007" itemValue="2007"/>
-				<f:selectItem itemLabel="2008" itemValue="2008"/>
-				<f:selectItem itemLabel="2009" itemValue="2009"/>
-			</h:selectOneMenu>
-		</s:decorate>
-		
-		<div class="buttonBox">
-			<a:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/>
-			&#160;
-			<a:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}" immediate="true"/>
-		</div>
-		
-	</fieldset>
-	</h:form>
-</div>
-</ui:define>
-
-<!-- sidebar -->
-<ui:define name="sidebar">
-
-<h1>Workspace management</h1>
-<p>
-   As you can see, Seam makes it easy to work in multiple windows or multiple browser 
-   tabs. But you can even switch between multiple tasks inside a single browser tab!
-   The "Workspaces" section showcases this advanced feature.
-</p>
-<p>
-   <a href="#" onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
-	  How does the workspace list work?
-   </a>
-</p>
-
-</ui:define>
-
-</ui:composition>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,122 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	    		xmlns:ui="http://java.sun.com/jsf/facelets"
+	  			xmlns:h="http://java.sun.com/jsf/html"
+	  			xmlns:f="http://java.sun.com/jsf/core"
+	  			xmlns:s="http://jboss.com/products/seam/taglib"
+                xmlns:a="http://richfaces.org/a4j"
+                xmlns:rich="http://richfaces.org/rich"
+				template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+	<h1>Book Hotel</h1>
+</div>
+<div class="section">
+	<div class="entry errors">
+		<h:messages globalOnly="true"/>
+	</div>
+
+	<ui:include src="hotelview.xhtml"/>
+	
+	<div style="clear:both"/>
+
+	<h:form id="booking">
+	<fieldset>
+			
+		<s:decorate id="checkinDateDecorate" template="edit.xhtml">
+			<ui:define name="label">Check In Date:</ui:define>
+			<rich:calendar id="checkinDate" value="#{booking.checkinDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkinDateDecorate" />
+		</s:decorate>
+		
+		<s:decorate id="checkoutDateDecorate" template="edit.xhtml">
+			<ui:define name="label">Check Out Date:</ui:define>
+			<rich:calendar id="checkoutDate" value="#{booking.checkoutDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkoutDateDecorate" />
+		</s:decorate>
+		
+		<s:decorate id="bedsDecorate" template="edit.xhtml">
+			<ui:define name="label">Room Preference:</ui:define>
+			<h:selectOneMenu id="beds" value="#{booking.beds}">
+				<f:selectItem itemLabel="One king-size bed" itemValue="1"/>
+				<f:selectItem itemLabel="Two double beds" itemValue="2"/>
+				<f:selectItem itemLabel="Three beds" itemValue="3"/>
+			</h:selectOneMenu>
+		</s:decorate>
+		
+		<s:decorate id="smokingDecorate" template="edit.xhtml">
+			<ui:define name="label">Smoking Preference:</ui:define>
+			<h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection" styleClass="radio">
+				<f:selectItem itemLabel="Smoking" itemValue="true"/>
+				<f:selectItem itemLabel="Non Smoking" itemValue="false"/>
+			</h:selectOneRadio>
+		</s:decorate>
+
+		<s:decorate id="creditCardDecorate" template="edit.xhtml">
+			<ui:define name="label">Credit Card #:</ui:define>
+			<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
+				<a:support event="onblur" reRender="creditCardDecorate" bypassUpdates="true"/>
+			</h:inputText>
+		</s:decorate>
+
+		<s:decorate id="creditCardNameDecorate" template="edit.xhtml">
+			<ui:define name="label">Credit Card Name:</ui:define>
+			<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
+				<a:support event="onblur" reRender="creditCardNameDecorate" bypassUpdates="true"/>
+			</h:inputText>
+		</s:decorate>
+
+		<s:decorate id="creditCardExpiryDecorate" template="edit.xhtml">
+			<ui:define name="label">Credit Card Expiry:</ui:define>
+			<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
+				<f:selectItem itemLabel="Jan" itemValue="1"/>
+				<f:selectItem itemLabel="Feb" itemValue="2"/>
+				<f:selectItem itemLabel="Mar" itemValue="3"/>
+				<f:selectItem itemLabel="Apr" itemValue="4"/>
+				<f:selectItem itemLabel="May" itemValue="5"/>
+				<f:selectItem itemLabel="Jun" itemValue="6"/>
+				<f:selectItem itemLabel="Jul" itemValue="7"/>
+				<f:selectItem itemLabel="Aug" itemValue="8"/>
+				<f:selectItem itemLabel="Sep" itemValue="9"/>
+				<f:selectItem itemLabel="Oct" itemValue="10"/>
+				<f:selectItem itemLabel="Nov" itemValue="11"/>
+				<f:selectItem itemLabel="Dec" itemValue="12"/>
+			</h:selectOneMenu>
+			<h:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
+				<f:selectItem itemLabel="2005" itemValue="2005"/>
+				<f:selectItem itemLabel="2006" itemValue="2006"/>
+				<f:selectItem itemLabel="2007" itemValue="2007"/>
+				<f:selectItem itemLabel="2008" itemValue="2008"/>
+				<f:selectItem itemLabel="2009" itemValue="2009"/>
+			</h:selectOneMenu>
+		</s:decorate>
+		
+		<div class="buttonBox">
+			<a:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/>
+			&#160;
+			<a:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}" immediate="true"/>
+		</div>
+		
+	</fieldset>
+	</h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>Workspace management</h1>
+<p>
+   As you can see, Seam makes it easy to work in multiple windows or multiple browser 
+   tabs. But you can even switch between multiple tasks inside a single browser tab!
+   The "Workspaces" section showcases this advanced feature.
+</p>
+<p>
+   <a href="#" onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
+	  How does the workspace list work?
+   </a>
+</p>
+
+</ui:define>
+
+</ui:composition>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,74 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-	    		xmlns:ui="http://java.sun.com/jsf/facelets"
-	  			xmlns:h="http://java.sun.com/jsf/html"
-	  			xmlns:f="http://java.sun.com/jsf/core"
-                xmlns:s="http://jboss.com/products/seam/taglib"
-				template="template.xhtml">
-
-<!-- content -->
-<ui:define name="content">
-
-<div class="section">
-	<h1>Confirm Hotel Booking</h1>
-</div>
-
-<div class="section">
-
-	<ui:include src="hotelview.xhtml"/>
-		
-	<s:decorate template="display.xhtml">
-		<ui:define name="label">Total Payment:</ui:define>
-		<h:outputText value="#{booking.total}">
-			<f:convertNumber type="currency" currencySymbol="$"/>
-		</h:outputText>
-	</s:decorate>
-
-	<s:decorate template="display.xhtml">
-		<ui:define name="label">Check In Date:</ui:define>
-		<h:outputText value="#{booking.checkinDate}"/>
-	</s:decorate>
-
-	<s:decorate template="display.xhtml">
-		<ui:define name="label">Check Out Date:</ui:define>
-		<h:outputText value="#{booking.checkoutDate}"/>
-	</s:decorate>
-
-	<s:decorate template="display.xhtml">
-		<ui:define name="label">Credit Card #:</ui:define>
-		#{booking.creditCard}
-	</s:decorate>
-	
-	<div class="buttonBox">
-		<h:form id="confirm">
-			<h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/>
-			&#160;
-    		<s:button id="revise" value="Revise" view="/book.xhtml"/>
-    		&#160;
-    		<h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
-		</h:form>
-	</div>
-
-</div>
-
-</ui:define>
-
-<!-- sidebar -->
-<ui:define name="sidebar">
-<h1>Back button navigation</h1>
-<p>
-   When you click "Confirm", the new booking is written to the database, the 
-   conversation ends, and state associated with the conversation is automatically 
-   destroyed by Seam. After you confirm your booking, try hitting the back button
-   on your web browser and clicking "Confirm" again. Seam makes it easy implement
-   applications that behave elegantly in response to the back, forward and refresh
-   buttons.
-</p>
-<p>
-   <a href="#" onclick="window.open('exp/confirmExp.html','exp','width=752,height=500,scrollbars=yes');">
-      What happens when the conversation ends?
-   </a>
-</p>
-</ui:define>
-
-</ui:composition>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/confirm.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,74 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	    		xmlns:ui="http://java.sun.com/jsf/facelets"
+	  			xmlns:h="http://java.sun.com/jsf/html"
+	  			xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:s="http://jboss.com/products/seam/taglib"
+				template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+	<h1>Confirm Hotel Booking</h1>
+</div>
+
+<div class="section">
+
+	<ui:include src="hotelview.xhtml"/>
+		
+	<s:decorate template="display.xhtml">
+		<ui:define name="label">Total Payment:</ui:define>
+		<h:outputText value="#{booking.total}">
+			<f:convertNumber type="currency" currencySymbol="$"/>
+		</h:outputText>
+	</s:decorate>
+
+	<s:decorate template="display.xhtml">
+		<ui:define name="label">Check In Date:</ui:define>
+		<h:outputText value="#{booking.checkinDate}"/>
+	</s:decorate>
+
+	<s:decorate template="display.xhtml">
+		<ui:define name="label">Check Out Date:</ui:define>
+		<h:outputText value="#{booking.checkoutDate}"/>
+	</s:decorate>
+
+	<s:decorate template="display.xhtml">
+		<ui:define name="label">Credit Card #:</ui:define>
+		#{booking.creditCard}
+	</s:decorate>
+	
+	<div class="buttonBox">
+		<h:form id="confirm">
+			<h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/>
+			&#160;
+    		<s:button id="revise" value="Revise" view="/book.xhtml"/>
+    		&#160;
+    		<h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+		</h:form>
+	</div>
+
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+<h1>Back button navigation</h1>
+<p>
+   When you click "Confirm", the new booking is written to the database, the 
+   conversation ends, and state associated with the conversation is automatically 
+   destroyed by Seam. After you confirm your booking, try hitting the back button
+   on your web browser and clicking "Confirm" again. Seam makes it easy implement
+   applications that behave elegantly in response to the back, forward and refresh
+   buttons.
+</p>
+<p>
+   <a href="#" onclick="window.open('exp/confirmExp.html','exp','width=752,height=500,scrollbars=yes');">
+      What happens when the conversation ends?
+   </a>
+</p>
+</ui:define>
+
+</ui:composition>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,38 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-     xmlns:c="http://java.sun.com/jstl/core"
-     xmlns:ui="http://java.sun.com/jsf/facelets"
-     xmlns:f="http://java.sun.com/jsf/core"
-     xmlns:h="http://java.sun.com/jsf/html"	
-     xmlns:a4j="http://richfaces.org/a4j"
-	 xmlns:rich="http://richfaces.org/rich"
-     xmlns:s="http://jboss.com/products/seam/taglib">
-	<a4j:outputPanel ajaxRendered="true">
-	     
-	<div class="section">
-	    <h1><h:outputText  value="Workspaces"/></h1>
-	</div>
-	
-	<div class="section">
-	    <h:form>
-	        <h:dataTable value="#{conversationList}" var="entry">
-	            <h:column>
-	                <h:commandLink action="#{entry.select}" value="#{entry.description}"/>
-	                &#160;
-	                <h:outputText value="[current]" rendered="#{entry.current}"/>
-	            </h:column>
-	            <h:column>
-	                <h:outputText value="#{entry.startDatetime}">
-	                    <s:convertDateTime type="time" pattern="hh:mm"/>
-	                </h:outputText>
-	                -
-	                <h:outputText value="#{entry.lastDatetime}">
-	                    <s:convertDateTime type="time" pattern="hh:mm"/>
-	                </h:outputText>
-	            </h:column>
-	        </h:dataTable>
-	    </h:form>
-	</div>
-	
-	</a4j:outputPanel>
-</ui:composition>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/conversations.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,38 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+     xmlns:c="http://java.sun.com/jstl/core"
+     xmlns:ui="http://java.sun.com/jsf/facelets"
+     xmlns:f="http://java.sun.com/jsf/core"
+     xmlns:h="http://java.sun.com/jsf/html"	
+     xmlns:a4j="http://richfaces.org/a4j"
+	 xmlns:rich="http://richfaces.org/rich"
+     xmlns:s="http://jboss.com/products/seam/taglib">
+	<a4j:outputPanel ajaxRendered="true">
+	     
+	<div class="section">
+	    <h1><h:outputText  value="Workspaces"/></h1>
+	</div>
+	
+	<div class="section">
+	    <h:form>
+	        <h:dataTable value="#{conversationList}" var="entry">
+	            <h:column>
+	                <h:commandLink action="#{entry.select}" value="#{entry.description}"/>
+	                &#160;
+	                <h:outputText value="[current]" rendered="#{entry.current}"/>
+	            </h:column>
+	            <h:column>
+	                <h:outputText value="#{entry.startDatetime}">
+	                    <s:convertDateTime type="time" pattern="hh:mm"/>
+	                </h:outputText>
+	                -
+	                <h:outputText value="#{entry.lastDatetime}">
+	                    <s:convertDateTime type="time" pattern="hh:mm"/>
+	                </h:outputText>
+	            </h:column>
+	        </h:dataTable>
+	    </h:form>
+	</div>
+	
+	</a4j:outputPanel>
+</ui:composition>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,185 +0,0 @@
-div.seam-date 
-{
-  margin-top: 5px;
-  border: 1px solid #AAAAAA;
-  background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
-  background-color: #FFFFFF;  
-  color: #505050;
-  font-family: Tahoma, Arial, Helvetica, sans-serif;
-  font-size: 12px;
-}
-
-table.seam-date td {
-  font-family: Tahoma, Arial, Helvetica, sans-serif;
-  font-size: 11px; 
-}
-
-.seam-date-monthNames
-{
-  width: 70px;
-  border: 1px solid #dddddd;
-  border-right: 3px solid #444444;
-  border-bottom: 3px solid #444444;
-  background-color: #ffffff; 
-  font-size: 12px;
-  cursor: pointer;	
-  font-family: Tahoma, Arial, Helvetica, sans-serif;
-  font-weight: normal;
-}
-
-a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
-{
-  text-align: center;
-  display: block;
-  color: #555555;  
-}
-
-a.seam-date-monthNameLink:hover
-{ 
-  background-color: #CCCCCC;
-  color: red;  
-}
-
-.seam-date-years
-{
-  height: 10em;
-  overflow: auto;
-  width: 60px;
-  border: 1px solid #dddddd;
-  border-right: 3px solid #444444;
-  border-bottom: 3px solid #444444;
-  background-color: #ffffff; 
-  font-size: 12px;
-  cursor: pointer;	
-  font-family: Tahoma, Arial, Helvetica, sans-serif;
-  font-weight: normal;
-}
-
-a.seam-date-yearLink, a.seam-date-yearLink:visited
-{
-  text-align: center;
-  display: block;
-  color: #555555;    
-}
-
-a.seam-date-yearLink:hover
-{
-  background-color: #CCCCCC;
-  color: red;    
-}  
-
-tr.seam-date-header
-{
-  padding: 2px 0px 2px 0px;
-}
-  
-td.seam-date-header
-{
-  padding: 0px 8px 0px 8px;
-  text-align: center;
-  color: gray;
-  font-family: Tahoma, Arial, Helvetica, sans-serif;
-  font-weight: bold;
-  font-size: 12px;  
-}
-
-td.seam-date-header-prevMonth
-{
-  background-image: url("../img/cal-prev.png");
-  background-repeat: no-repeat;
-  background-position: center;
-  padding: 0px 2px 0px 2px;
-  width: 17px;
-  height: 16px;
-  margin-left: 2px;
-}
-
-td.seam-date-header-nextMonth
-{
-  background-image: url("../img/cal-next.png");
-  background-repeat: no-repeat;
-  background-position: center;
-  padding: 0px 2px 0px 2px;
-  width: 17px;
-  height: 16px;
-  margin-right: 2px;
-}
-
-tr.seam-date-headerDays
-{
-  color: white;
-  font-weight: normal;
-}
-
-tr.seam-date-headerDays > td
-{
-  background-color: #CCCCCC;
-  border: 1px solid #AAAAAA;
-  color: white;
-  text-align: center;
-  width: 26px;   
-}
-
-tr.seam-date-footer
-{
-  background-color: white; 
-  color: #505050;
-  font-weight: bold;
-}
-
-tr.seam-date-footer > td
-{
-  text-align: center;
-}
-
-td.seam-date-inMonth
-{
-  background-color: white; 
-  color: black;
-  font-weight: normal;
-  cursor: pointer;
-  border: 1px solid #ece9d8;
-}
-
-td.seam-date-outMonth
-{
-  background-color: white; 
-  color: #999999;
-  font-weight: normal;
-  cursor: pointer;
-  border: 1px solid #ece9d8;
-}
-
-td.seam-date-selected
-{
-  background-color: #CCCCCC;        
-  border: 1px solid #AAAAAA; 
-  color: black;
-  font-weight: normal;
-}
-
-td.seam-date-dayOff-inMonth
-{
-  background-color: #efefef;
-  color: black;
-  font-weight: normal;
-  cursor: pointer;
-  border: 1px solid #ece9d8;
-}
-
-td.seam-date-dayOff-outMonth
-{
-  background-color: #efefef;
-  color: #999999;
-  font-weight: normal;
-  cursor: pointer;
-  border: 1px solid #ece9d8;
-}
-
-td.seam-date-hover 
-{
-  background-color: #CCCCCC;
-  border: 1px solid #AAAAAA;
-  cursor: pointer;
-  color: red;
-}
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/date.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,185 @@
+div.seam-date 
+{
+  margin-top: 5px;
+  border: 1px solid #AAAAAA;
+  background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+  background-color: #FFFFFF;  
+  color: #505050;
+  font-family: Tahoma, Arial, Helvetica, sans-serif;
+  font-size: 12px;
+}
+
+table.seam-date td {
+  font-family: Tahoma, Arial, Helvetica, sans-serif;
+  font-size: 11px; 
+}
+
+.seam-date-monthNames
+{
+  width: 70px;
+  border: 1px solid #dddddd;
+  border-right: 3px solid #444444;
+  border-bottom: 3px solid #444444;
+  background-color: #ffffff; 
+  font-size: 12px;
+  cursor: pointer;	
+  font-family: Tahoma, Arial, Helvetica, sans-serif;
+  font-weight: normal;
+}
+
+a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
+{
+  text-align: center;
+  display: block;
+  color: #555555;  
+}
+
+a.seam-date-monthNameLink:hover
+{ 
+  background-color: #CCCCCC;
+  color: red;  
+}
+
+.seam-date-years
+{
+  height: 10em;
+  overflow: auto;
+  width: 60px;
+  border: 1px solid #dddddd;
+  border-right: 3px solid #444444;
+  border-bottom: 3px solid #444444;
+  background-color: #ffffff; 
+  font-size: 12px;
+  cursor: pointer;	
+  font-family: Tahoma, Arial, Helvetica, sans-serif;
+  font-weight: normal;
+}
+
+a.seam-date-yearLink, a.seam-date-yearLink:visited
+{
+  text-align: center;
+  display: block;
+  color: #555555;    
+}
+
+a.seam-date-yearLink:hover
+{
+  background-color: #CCCCCC;
+  color: red;    
+}  
+
+tr.seam-date-header
+{
+  padding: 2px 0px 2px 0px;
+}
+  
+td.seam-date-header
+{
+  padding: 0px 8px 0px 8px;
+  text-align: center;
+  color: gray;
+  font-family: Tahoma, Arial, Helvetica, sans-serif;
+  font-weight: bold;
+  font-size: 12px;  
+}
+
+td.seam-date-header-prevMonth
+{
+  background-image: url("../img/cal-prev.png");
+  background-repeat: no-repeat;
+  background-position: center;
+  padding: 0px 2px 0px 2px;
+  width: 17px;
+  height: 16px;
+  margin-left: 2px;
+}
+
+td.seam-date-header-nextMonth
+{
+  background-image: url("../img/cal-next.png");
+  background-repeat: no-repeat;
+  background-position: center;
+  padding: 0px 2px 0px 2px;
+  width: 17px;
+  height: 16px;
+  margin-right: 2px;
+}
+
+tr.seam-date-headerDays
+{
+  color: white;
+  font-weight: normal;
+}
+
+tr.seam-date-headerDays > td
+{
+  background-color: #CCCCCC;
+  border: 1px solid #AAAAAA;
+  color: white;
+  text-align: center;
+  width: 26px;   
+}
+
+tr.seam-date-footer
+{
+  background-color: white; 
+  color: #505050;
+  font-weight: bold;
+}
+
+tr.seam-date-footer > td
+{
+  text-align: center;
+}
+
+td.seam-date-inMonth
+{
+  background-color: white; 
+  color: black;
+  font-weight: normal;
+  cursor: pointer;
+  border: 1px solid #ece9d8;
+}
+
+td.seam-date-outMonth
+{
+  background-color: white; 
+  color: #999999;
+  font-weight: normal;
+  cursor: pointer;
+  border: 1px solid #ece9d8;
+}
+
+td.seam-date-selected
+{
+  background-color: #CCCCCC;        
+  border: 1px solid #AAAAAA; 
+  color: black;
+  font-weight: normal;
+}
+
+td.seam-date-dayOff-inMonth
+{
+  background-color: #efefef;
+  color: black;
+  font-weight: normal;
+  cursor: pointer;
+  border: 1px solid #ece9d8;
+}
+
+td.seam-date-dayOff-outMonth
+{
+  background-color: #efefef;
+  color: #999999;
+  font-weight: normal;
+  cursor: pointer;
+  border: 1px solid #ece9d8;
+}
+
+td.seam-date-hover 
+{
+  background-color: #CCCCCC;
+  border: 1px solid #AAAAAA;
+  cursor: pointer;
+  color: red;
+}
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,147 +0,0 @@
-body {
-   font: normal 12px Lucida Sans, Trebuchet, tahoma, sans-serif;
-}
-
-.align-center {
-   text-align: center;
-}
-
-.align-left {
-   text-align: left;
-}
-
-.align-center-margin {
-   margin: 0 auto 0 auto;
-}
-
-.float-left {
-   float: left;
-}
-
-.float-right {
-   float: right;
-}
-
-.align-left {
-   text-align: left;
-}
-
-.align-right {
-   text-align: right;
-}
-
-.half-width {
-   width: 49%;
-}
-
-.quarter-width {
-   width: 24.9%;
-}
-
-.three-quarter-width {
-   width: 74.9%;
-}
-
-.full-width {
-   width: 100%;
-}
-
-.third-width {
-   width: 32.9%;
-}
-
-.two-third-width {
-   width: 65.5%;
-}
-
-.tenpx-top-bottom {
-   margin: 10px 0 10px 0;
-}
-
-.relative {
-   position:relative
-}
-
-.absolute{
-   position:absolute
-}
-
-p.white-padded{
-   color:#fff;
-   padding:5px;
-}
-
-.clear {
-   clear: both;
-}
-
-img {
-   margin: 0;
-   padding: 0;
-   border: 0;
-}
-
-   div,
-   form,
-   ul,
-   li{
-   margin: 0;
-   padding: 0;
-}
-
-ul{
-
-}
-
-/*--------------------------------Decoration*/
-
-h2 {
-   font-size: 1.9em;
-   color: #fff;
-   margin: 0;
-   padding: 0;
-}
-
-h3 {
-   font-size: 1.0em;
-   color: #fff;
-   margin: 0;
-   padding: 0;
-}
-
-a {
-   color: #e1d77e;
-}
-
-p {
-   margin: 0;
-   padding: 0;
-}
-
-.white-border {
-   border: 1px solid #fff;
-}
-
-.bold-black {
-   font-size: 1.0em;
-   color: #000;
-}
-
-.yellow {
-   background-color:#FFFF00;
-}
-
-.blue {
-   background-color:#3333CC;
-}
-
-.green {
-   background-color:#009933;
-}
-
-.white {
-   background-color:#fff;
-}
-
-/*---------------------------Main layout*/
-

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/master.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,147 @@
+body {
+   font: normal 12px Lucida Sans, Trebuchet, tahoma, sans-serif;
+}
+
+.align-center {
+   text-align: center;
+}
+
+.align-left {
+   text-align: left;
+}
+
+.align-center-margin {
+   margin: 0 auto 0 auto;
+}
+
+.float-left {
+   float: left;
+}
+
+.float-right {
+   float: right;
+}
+
+.align-left {
+   text-align: left;
+}
+
+.align-right {
+   text-align: right;
+}
+
+.half-width {
+   width: 49%;
+}
+
+.quarter-width {
+   width: 24.9%;
+}
+
+.three-quarter-width {
+   width: 74.9%;
+}
+
+.full-width {
+   width: 100%;
+}
+
+.third-width {
+   width: 32.9%;
+}
+
+.two-third-width {
+   width: 65.5%;
+}
+
+.tenpx-top-bottom {
+   margin: 10px 0 10px 0;
+}
+
+.relative {
+   position:relative
+}
+
+.absolute{
+   position:absolute
+}
+
+p.white-padded{
+   color:#fff;
+   padding:5px;
+}
+
+.clear {
+   clear: both;
+}
+
+img {
+   margin: 0;
+   padding: 0;
+   border: 0;
+}
+
+   div,
+   form,
+   ul,
+   li{
+   margin: 0;
+   padding: 0;
+}
+
+ul{
+
+}
+
+/*--------------------------------Decoration*/
+
+h2 {
+   font-size: 1.9em;
+   color: #fff;
+   margin: 0;
+   padding: 0;
+}
+
+h3 {
+   font-size: 1.0em;
+   color: #fff;
+   margin: 0;
+   padding: 0;
+}
+
+a {
+   color: #e1d77e;
+}
+
+p {
+   margin: 0;
+   padding: 0;
+}
+
+.white-border {
+   border: 1px solid #fff;
+}
+
+.bold-black {
+   font-size: 1.0em;
+   color: #000;
+}
+
+.yellow {
+   background-color:#FFFF00;
+}
+
+.blue {
+   background-color:#3333CC;
+}
+
+.green {
+   background-color:#009933;
+}
+
+.white {
+   background-color:#fff;
+}
+
+/*---------------------------Main layout*/
+

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,274 +0,0 @@
-/* Setup defaults since variable in browsers
------------------------------------------------ */
-#document body, #document div, #document span, #document dd, #document dt, #document dl, #document img, #document ul, #document ol, #document li, #document p, #document h1, #document h2, #document h3, #document h4, #document h5, #document form, #document hr, #document fieldset {
-   margin: 0;
-   padding: 0;
-}
-/* Element Defaults
------------------------------------------------ */
-div#content-container html {
-   height: 100%;
-   background-color: #DBD4C6;
-}
-#document img {
-   border: 0;
-}
-#pgHome {
-   font-family: Verdana, Arial, Helvetica, sans-serif;
-   font-size: small;
-   line-height: 1.25em;
-   color: #362F2D;
-   position: relative;
-   width: 760px;
-   height: 100%;
-   margin-left: auto;
-   margin-right: auto;
-}
-#document .label {
-   font-weight: bold;
-   color: #5E5147;
-}
-#document input {
-   border: 1px solid #C3BBB6;
-   padding: 4px;
-   margin: 5px 0;
-   background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
-}
-#document select {
-   border: 1px solid #C3BBB6;
-   padding: 4px;
-   margin: 5px 0;
-   background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
-}
-#document ol, #document ul {
-   margin: 10px 0px 10px 6px;
-}
-#document li {
-   margin: 10px 12px;
-}
-#document fieldset {
-   border: 0;
-}
-/* Layout
------------------------------------------------ */
-#document {
-   padding: 0 1px;
-   background: #fff url(../img/bg.gif) 0 0 repeat-y;
-   float: left;
-   border-bottom: 1px solid #C3BBB6;
-}
-#document #header {
-   float: left;
-   width: 758px;
-   height: 46px;
-   background: url(../img/hdr.bg.gif) 0 0 repeat-x;
-}
-#document #container {
-   float: left;
-   width: 758px;
-   background: url(../img/hdr.bar.jpg) 0 0 repeat-x;
-}
-#document #sidebar {
-   float: left;
-   width: 190px;
-   margin-top: 96px;
-   padding: 20px 10px 0 10px;
-   background: url(../img/sdb.bg.gif) 0 0 no-repeat;
-}
-#document #content {
-   float: left;
-   width: 548px;
-   margin-top: 75px;
-   padding-top: 5px;
-   background: #fff url(../img/cnt.bg.gif) 0 0 repeat-x;
-}
-#document #footer {
-   clear: both;
-   margin-top: 40px;
-   float: left;
-   padding: 20px;
-   border-top: 1px solid #C3BBB6;
-   background-color: #fff;
-   width: 718px;
-   text-align: right;
-}
-/* General
------------------------------------------------ */
-#document input[type="submit"], #document input[type="button"] {
-   font-weight: bold;
-   color: #fff;
-   border: 1px solid #5D1414;
-   height: 26px;
-   background: #fff url(../img/btn.bg.gif) 0 0 repeat-x;
-   border-style: none;
-}
-#document .center {
-   text-align: center;
-}
-#document .entry {
-   clear: both;
-   padding-top: 10px;
-}
-#document .entry .label {
-   float: left;
-   padding-right: 5px;
-   font-weight: bold;
-   width: 150px;
-   text-align: right;
-}
-#document .entry .output {
-   float: right;
-   width: 360px;
-   padding-top: 10px;
-   text-align: left;
-}
-#document .entry .input {
-   float: right;
-   width: 360px;
-   text-align: left;
-}
-#document .entry .error {
-   float: right;
-   width: 360px;
-   text-align: left;
-}
-/* Sidebar
------------------------------------------------ */
-#document .notes {
-   text-align: center;
-   font-size: small;
-}
-#document .errors {
-   font-size: small;
-   font-weight: bold;
-   text-align: center;
-   color: #600;
-}
-#document .errors div {
-   text-align: left;
-}
-#document .errors span {
-   text-align: left;
-}
-#document .errors input {
-   border: 1px solid #600;
-}
-#document .errors ul {
-   list-style: none;
-}
-#document .buttonBox {
-   text-align: center;
-   padding: 5px 0;
-   clear: both;
-}
-#document #sidebar p {
-   font-size: small;
-   color: #8B7869;
-   line-height: 150%;
-   padding-bottom: 10px;
-}
-#document #sidebar li {
-   font-size: small;
-   color: #8B7869;
-}
-#document #sidebar h1 {
-   line-height: normal;
-   font-weight: bold;
-   font-size: small;
-}
-/*
-#sidebar p:hover {
-   color: #362F2D;
-}
-*/
-/* Content
------------------------------------------------ */
-#document #content .section {
-   float: left;
-   width: 518px;
-   padding: 15px 15px 0 15px;
-}
-#document #content .section h1 {
-   font-family: "Trebuchet MS", Arial, sans-serif;
-   line-height: normal;
-   font-weight: normal;
-   font-size: large;
-}
-#document #content .section p {
-   line-height: 150%;
-   padding: 10px 0;
-   font-size: small;
-}
-#document #content table {
-   width: 100%;
-   border: 1px solid #D2C9C4;
-   border-collapse: collapse;
-}
-#document #content table caption {
-   padding-bottom: 6px;
-   text-align: left;
-   font-weight: bold;
-}
-#document #content table thead th {
-   border-left: 1px solid #D2C9C4;
-   background: #fff url(../img/th.bg.gif) 0 100% repeat-x;
-   border-bottom: 1px solid #D2C9C4;
-   padding: 6px;
-   text-align: left;
-   font-size: small;
-}
-#document #content table tbody td {
-   border-left: 1px solid #E4DBD5;
-   padding: 4px;
-   border-bottom: 1px solid #D2C9C4;
-   font-size: small;
-}
-#document #content dt {
-   font-weight: bold;
-   float: left;
-   width: 33%;
-}
-#document #content dd {
-   padding-left: 10px;
-   float: left;
-   width: 66%;
-}
-#document #content table.radio {
-   border: 0px;
-}
-#document #content table.radio tbody tr td {
-   border: 0px;
-   border-left: 0px;
-   border-bottom: 0px;
-}
-/* Header
------------------------------------------------ */
-#document #title {
-   float: left;
-   padding: 1px 0 6px 15px;
-}
-#document #status {
-   color: #C7B299;
-   float: right;
-   font-family: Verdana, Arial, Helvetica, sans-serif;
-   font-weight: bold;
-   font-size: x-small;
-   text-align: right;
-   padding-top: 14px;
-   padding-right: 15px;
-}
-#document #status a {
-   color: #C7B299;
-   text-decoration: none;
-}
-/* Homepage Modifications
------------------------------------------------ */
-#pgHome #container {
-   background: url(../img/hdr.ad.jpg) 0 0 repeat-x;
-}
-#pgHome #sidebar {
-   margin-top: 207px;
-}
-#pgHome #content {
-   margin-top: 183px;
-}

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/screen.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,274 @@
+/* Setup defaults since variable in browsers
+----------------------------------------------- */
+#document body, #document div, #document span, #document dd, #document dt, #document dl, #document img, #document ul, #document ol, #document li, #document p, #document h1, #document h2, #document h3, #document h4, #document h5, #document form, #document hr, #document fieldset {
+   margin: 0;
+   padding: 0;
+}
+/* Element Defaults
+----------------------------------------------- */
+div#content-container html {
+   height: 100%;
+   background-color: #DBD4C6;
+}
+#document img {
+   border: 0;
+}
+#pgHome {
+   font-family: Verdana, Arial, Helvetica, sans-serif;
+   font-size: small;
+   line-height: 1.25em;
+   color: #362F2D;
+   position: relative;
+   width: 760px;
+   height: 100%;
+   margin-left: auto;
+   margin-right: auto;
+}
+#document .label {
+   font-weight: bold;
+   color: #5E5147;
+}
+#document input {
+   border: 1px solid #C3BBB6;
+   padding: 4px;
+   margin: 5px 0;
+   background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}
+#document select {
+   border: 1px solid #C3BBB6;
+   padding: 4px;
+   margin: 5px 0;
+   background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}
+#document ol, #document ul {
+   margin: 10px 0px 10px 6px;
+}
+#document li {
+   margin: 10px 12px;
+}
+#document fieldset {
+   border: 0;
+}
+/* Layout
+----------------------------------------------- */
+#document {
+   padding: 0 1px;
+   background: #fff url(../img/bg.gif) 0 0 repeat-y;
+   float: left;
+   border-bottom: 1px solid #C3BBB6;
+}
+#document #header {
+   float: left;
+   width: 758px;
+   height: 46px;
+   background: url(../img/hdr.bg.gif) 0 0 repeat-x;
+}
+#document #container {
+   float: left;
+   width: 758px;
+   background: url(../img/hdr.bar.jpg) 0 0 repeat-x;
+}
+#document #sidebar {
+   float: left;
+   width: 190px;
+   margin-top: 96px;
+   padding: 20px 10px 0 10px;
+   background: url(../img/sdb.bg.gif) 0 0 no-repeat;
+}
+#document #content {
+   float: left;
+   width: 548px;
+   margin-top: 75px;
+   padding-top: 5px;
+   background: #fff url(../img/cnt.bg.gif) 0 0 repeat-x;
+}
+#document #footer {
+   clear: both;
+   margin-top: 40px;
+   float: left;
+   padding: 20px;
+   border-top: 1px solid #C3BBB6;
+   background-color: #fff;
+   width: 718px;
+   text-align: right;
+}
+/* General
+----------------------------------------------- */
+#document input[type="submit"], #document input[type="button"] {
+   font-weight: bold;
+   color: #fff;
+   border: 1px solid #5D1414;
+   height: 26px;
+   background: #fff url(../img/btn.bg.gif) 0 0 repeat-x;
+   border-style: none;
+}
+#document .center {
+   text-align: center;
+}
+#document .entry {
+   clear: both;
+   padding-top: 10px;
+}
+#document .entry .label {
+   float: left;
+   padding-right: 5px;
+   font-weight: bold;
+   width: 150px;
+   text-align: right;
+}
+#document .entry .output {
+   float: right;
+   width: 360px;
+   padding-top: 10px;
+   text-align: left;
+}
+#document .entry .input {
+   float: right;
+   width: 360px;
+   text-align: left;
+}
+#document .entry .error {
+   float: right;
+   width: 360px;
+   text-align: left;
+}
+/* Sidebar
+----------------------------------------------- */
+#document .notes {
+   text-align: center;
+   font-size: small;
+}
+#document .errors {
+   font-size: small;
+   font-weight: bold;
+   text-align: center;
+   color: #600;
+}
+#document .errors div {
+   text-align: left;
+}
+#document .errors span {
+   text-align: left;
+}
+#document .errors input {
+   border: 1px solid #600;
+}
+#document .errors ul {
+   list-style: none;
+}
+#document .buttonBox {
+   text-align: center;
+   padding: 5px 0;
+   clear: both;
+}
+#document #sidebar p {
+   font-size: small;
+   color: #8B7869;
+   line-height: 150%;
+   padding-bottom: 10px;
+}
+#document #sidebar li {
+   font-size: small;
+   color: #8B7869;
+}
+#document #sidebar h1 {
+   line-height: normal;
+   font-weight: bold;
+   font-size: small;
+}
+/*
+#sidebar p:hover {
+   color: #362F2D;
+}
+*/
+/* Content
+----------------------------------------------- */
+#document #content .section {
+   float: left;
+   width: 518px;
+   padding: 15px 15px 0 15px;
+}
+#document #content .section h1 {
+   font-family: "Trebuchet MS", Arial, sans-serif;
+   line-height: normal;
+   font-weight: normal;
+   font-size: large;
+}
+#document #content .section p {
+   line-height: 150%;
+   padding: 10px 0;
+   font-size: small;
+}
+#document #content table {
+   width: 100%;
+   border: 1px solid #D2C9C4;
+   border-collapse: collapse;
+}
+#document #content table caption {
+   padding-bottom: 6px;
+   text-align: left;
+   font-weight: bold;
+}
+#document #content table thead th {
+   border-left: 1px solid #D2C9C4;
+   background: #fff url(../img/th.bg.gif) 0 100% repeat-x;
+   border-bottom: 1px solid #D2C9C4;
+   padding: 6px;
+   text-align: left;
+   font-size: small;
+}
+#document #content table tbody td {
+   border-left: 1px solid #E4DBD5;
+   padding: 4px;
+   border-bottom: 1px solid #D2C9C4;
+   font-size: small;
+}
+#document #content dt {
+   font-weight: bold;
+   float: left;
+   width: 33%;
+}
+#document #content dd {
+   padding-left: 10px;
+   float: left;
+   width: 66%;
+}
+#document #content table.radio {
+   border: 0px;
+}
+#document #content table.radio tbody tr td {
+   border: 0px;
+   border-left: 0px;
+   border-bottom: 0px;
+}
+/* Header
+----------------------------------------------- */
+#document #title {
+   float: left;
+   padding: 1px 0 6px 15px;
+}
+#document #status {
+   color: #C7B299;
+   float: right;
+   font-family: Verdana, Arial, Helvetica, sans-serif;
+   font-weight: bold;
+   font-size: x-small;
+   text-align: right;
+   padding-top: 14px;
+   padding-right: 15px;
+}
+#document #status a {
+   color: #C7B299;
+   text-decoration: none;
+}
+/* Homepage Modifications
+----------------------------------------------- */
+#pgHome #container {
+   background: url(../img/hdr.ad.jpg) 0 0 repeat-x;
+}
+#pgHome #sidebar {
+   margin-top: 207px;
+}
+#pgHome #content {
+   margin-top: 183px;
+}

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,148 +0,0 @@
-* {
-    margin:  0px; 
-    padding: 0px; 
-    border:  none;
-}
-
-body {
-    font: 1em verdana, arial, sans-serif;
-    background: #CCCCCC;
-}
-
-div#main {
-    margin-left:  0px;
-    width: 751px;
-    background: #ecefdf;
-}
-
-div#top,div#pictures{
-}
-
-div#pictures img {
-    float:left;
-}
-
-img#head1 {
-    margin-right: 3px;
-} 
-
-img#head2 {
-    margin-right: 4px;
-} 
-
-div.trail {
-    clear:both;     
-    margin-left:  50px;
-    margin-top:   0px;
-    margin-right: 50px
-}
-
-div.foot {
-    margin-left:  50px;
-    margin-right: 50px;
-    margin-top:   50px;
-    text-align:   center;
-    font-size:    .5em;
-    height: 36px;
-}
-
-div.trail h1 {
-    margin-top:   -30px;
-    margin-left:  -50px;
-    font-size:    1.2em;   
-    font-weight:  bold;
-    padding-left: .4em;
-}
-
-div.trail h2 { 
-    float:        left;
-    font-size:    1em;   
-    font-weight:  bold;
-    padding-left: .4em;
-}
-
-div.trail h3 { 
-    float:        left;
-    font-size:    .8em;   
-    font-weight:  bold;
-    margin-left: -1.4em;
-    margin-bottom: 1em;
-}
-
-
-div.trail p {
-    clear:      both;
-    margin-top: 20px;
-    font-size: .8em;
-    text-decoration: none;
-}
-
-div#next_trail {
-    margin-left: 36px;
-}
-
-div.numbox {
-    border: thin solid black; 
-    margin-left: -.8em;
-    float:   left;
-    background: #ffffff;
-    padding: .2em .35em .3em;
-    font-style: normal;
-    font-weight: bold;
-    font-size: 1.4em;
-}
-
-div.figure {
-    text-align: center;
-    font-size: .6em;
-    margin-top: 30px;
-}
-
-div.figure img {
-    display: block;
-    margin-right: auto;
-    margin-left: auto;
-}
-
-code {
-    font: 1.1em "Courier New", Courier, mono;
-}
-
-code.block {
-    white-space: pre;
-    font: 10pt "Courier New", Courier, mono;
-    display: block;
-    border-style: dashed;
-    border-width: thin;
-    padding: .5em;
-    background: #ffffff;
-    margin: 20px;
-}
-
-div.foot_image {
-   float: left;
-   height: 86px;
-}
-
-a:active {
-    color : #666666;
-    text-decoration: none;
-}
-
-a:hover {
-    color : #000000;
-    background-color : #D6E0FE;
-    text-decoration: none;
-}
-
-a:link {
-    color : #005EB6;
-    text-decoration: none;
-}
-
-a:visited {
-    color : #888888;
-    text-decoration: none;
-}
-
-

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,148 @@
+* {
+    margin:  0px; 
+    padding: 0px; 
+    border:  none;
+}
+
+body {
+    font: 1em verdana, arial, sans-serif;
+    background: #CCCCCC;
+}
+
+div#main {
+    margin-left:  0px;
+    width: 751px;
+    background: #ecefdf;
+}
+
+div#top,div#pictures{
+}
+
+div#pictures img {
+    float:left;
+}
+
+img#head1 {
+    margin-right: 3px;
+} 
+
+img#head2 {
+    margin-right: 4px;
+} 
+
+div.trail {
+    clear:both;     
+    margin-left:  50px;
+    margin-top:   0px;
+    margin-right: 50px
+}
+
+div.foot {
+    margin-left:  50px;
+    margin-right: 50px;
+    margin-top:   50px;
+    text-align:   center;
+    font-size:    .5em;
+    height: 36px;
+}
+
+div.trail h1 {
+    margin-top:   -30px;
+    margin-left:  -50px;
+    font-size:    1.2em;   
+    font-weight:  bold;
+    padding-left: .4em;
+}
+
+div.trail h2 { 
+    float:        left;
+    font-size:    1em;   
+    font-weight:  bold;
+    padding-left: .4em;
+}
+
+div.trail h3 { 
+    float:        left;
+    font-size:    .8em;   
+    font-weight:  bold;
+    margin-left: -1.4em;
+    margin-bottom: 1em;
+}
+
+
+div.trail p {
+    clear:      both;
+    margin-top: 20px;
+    font-size: .8em;
+    text-decoration: none;
+}
+
+div#next_trail {
+    margin-left: 36px;
+}
+
+div.numbox {
+    border: thin solid black; 
+    margin-left: -.8em;
+    float:   left;
+    background: #ffffff;
+    padding: .2em .35em .3em;
+    font-style: normal;
+    font-weight: bold;
+    font-size: 1.4em;
+}
+
+div.figure {
+    text-align: center;
+    font-size: .6em;
+    margin-top: 30px;
+}
+
+div.figure img {
+    display: block;
+    margin-right: auto;
+    margin-left: auto;
+}
+
+code {
+    font: 1.1em "Courier New", Courier, mono;
+}
+
+code.block {
+    white-space: pre;
+    font: 10pt "Courier New", Courier, mono;
+    display: block;
+    border-style: dashed;
+    border-width: thin;
+    padding: .5em;
+    background: #ffffff;
+    margin: 20px;
+}
+
+div.foot_image {
+   float: left;
+   height: 86px;
+}
+
+a:active {
+    color : #666666;
+    text-decoration: none;
+}
+
+a:hover {
+    color : #000000;
+    background-color : #D6E0FE;
+    text-decoration: none;
+}
+
+a:link {
+    color : #005EB6;
+    text-decoration: none;
+}
+
+a:visited {
+    color : #888888;
+    text-decoration: none;
+}
+
+

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,16 +0,0 @@
-<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
-                 xmlns:ui="http://java.sun.com/jsf/facelets"
-                 xmlns:h="http://java.sun.com/jsf/html"
-                 xmlns:f="http://java.sun.com/jsf/core"
-                 xmlns:s="http://jboss.com/products/seam/taglib">
-                 
-    <div class="entry">
-        <span class="label">
-            <ui:insert name="label"/>
-        </span>
-        <span class="input">
-            <ui:insert/>
-        </span>
-    </div>
-    
-</ui:composition>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/display.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,16 @@
+<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
+                 xmlns:ui="http://java.sun.com/jsf/facelets"
+                 xmlns:h="http://java.sun.com/jsf/html"
+                 xmlns:f="http://java.sun.com/jsf/core"
+                 xmlns:s="http://jboss.com/products/seam/taglib">
+                 
+    <div class="entry">
+        <span class="label">
+            <ui:insert name="label"/>
+        </span>
+        <span class="input">
+            <ui:insert/>
+        </span>
+    </div>
+    
+</ui:composition>
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,24 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-                xmlns:ui="http://java.sun.com/jsf/facelets"
-                xmlns:h="http://java.sun.com/jsf/html"
-                xmlns:f="http://java.sun.com/jsf/core"
-                xmlns:a="http://richfaces.org/a4j"
-                xmlns:s="http://jboss.com/products/seam/taglib">
-                 
-    <div class="entry">
-        <s:label styleClass="label #{invalid?'errors':''}">
-            <ui:insert name="label"/>
-            <s:span styleClass="required" rendered="#{required}">*</s:span>
-        </s:label>
-        <span class="input #{invalid?'errors':''}">
-            <s:validateAll>
-                <ui:insert/>
-            </s:validateAll>
-        </span>
-        <a:outputPanel ajaxRendered="true">
-        <s:message styleClass="error errors"/>
-        </a:outputPanel>
-    </div>
-    
-</ui:composition>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/edit.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,24 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:h="http://java.sun.com/jsf/html"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:a="http://richfaces.org/a4j"
+                xmlns:s="http://jboss.com/products/seam/taglib">
+                 
+    <div class="entry">
+        <s:label styleClass="label #{invalid?'errors':''}">
+            <ui:insert name="label"/>
+            <s:span styleClass="required" rendered="#{required}">*</s:span>
+        </s:label>
+        <span class="input #{invalid?'errors':''}">
+            <s:validateAll>
+                <ui:insert/>
+            </s:validateAll>
+        </span>
+        <a:outputPanel ajaxRendered="true">
+        <s:message styleClass="error errors"/>
+        </a:outputPanel>
+    </div>
+    
+</ui:composition>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,161 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>In-depth Explanation</title>
-	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-
-<div id="main">
-  <div class="trail">
-    <div class="numbox">5</div>
-    <h2>Conversations</h2>
-    <img src="../img/header_line.gif" />
-    
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-    <p>
-       The hotel booking "wizard" is implemented by a conversation-scoped
-       stateful session bean. All Seam components are in the 
-       conversation scope by default. 
-       The <code>HotelBookingAction</code> maintains
-       state associated with the booking process in the Seam conversation
-       scope. This ensures that if the user is working in multiple brower
-       tabs or multiple brower windows, the various conversations are
-       completely isolated from each other.
-    </p>
-    <p>
-       To see this working in practice, right click on the "View Hotel" button 
-       in the search screen and select "open in new tab" or "open in new window",
-       and try working on multiple hotel bookings simultaneously. 
-       In the <a href="workspaceExp.html">next step</a>, we will discuss
-       Seam's built-in components to manage multiple concurrent conversations.
-    </p>
-    
-<code class="block">
- at Stateful
- at Name("hotelBooking")
- at LoggedIn
-public class HotelBookingAction implements HotelBooking
-{
-   
-   @PersistenceContext(type=EXTENDED)
-   private EntityManager em;
-   
-   @In
-   private User user;
-   
-   @In(required=false) @Out
-   private Hotel hotel;
-   
-   @In(required=false) 
-   @Out(required=false)
-   private Booking booking;
-   
-   @In(create=true)
-   private FacesMessages facesMessages;
-      
-   @In(create=true)
-   private Events events;
-      
-   @In 
-   private HotelSearching hotelSearch;
-   
-   @Logger 
-   private Log log;
-   
-   private boolean bookingValid;
-   
-   @Begin
-   public void selectHotel(Hotel selectedHotel)
-   {
-      hotel = em.merge(selectedHotel);
-   }
-   
-   public void bookHotel()
-   {      
-      booking = new Booking(hotel, user);
-      Calendar calendar = Calendar.getInstance();
-      booking.setCheckinDate( calendar.getTime() );
-      calendar.add(Calendar.DAY_OF_MONTH, 1);
-      booking.setCheckoutDate( calendar.getTime() );
-   }
-   
-
-   public void setBookingDetails()
-   {
-      Calendar calendar = Calendar.getInstance();
-      calendar.add(Calendar.DAY_OF_MONTH, -1);
-      if ( booking.getCheckinDate().before( calendar.getTime() ) )
-      {
-         facesMessages.addToControl("checkinDate", "Check in date must be a future date");
-         bookingValid=false;
-      }
-      else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
-      {
-         facesMessages.addToControl("checkoutDate", "Check out date must be later than check in date");
-         bookingValid=false;
-      }
-      else
-      {
-         bookingValid=true;
-      }
-   }
-   
-   public boolean isBookingValid()
-   {
-      return bookingValid;
-   }
-   
-   @End
-   public void confirm()
-   {
-      em.persist(booking);
-      facesMessages.add("Thank you, #{user.name}, your confimation number for #{hotel.name} is #{booking.id}");
-      log.info("New booking: #{booking.id} for #{user.username}");
-      events.raiseTransactionSuccessEvent("bookingConfirmed");
-   }
-   
-   @End
-   public void cancel() {}
-   
-   @Remove
-   public void destroy() {}
-}</code>
-
-    <p>
-       The conversation begins when the <code>@Begin</code> annotated
-       <code>selectHotel()</code> is called, and ends when 
-       the <code>@End</code> annotated 
-       <code>confirm()</code> or <code>cancel()</code> is called. Between the
-       <code>@Begin</code> and <code>@End</code> methods, the user can do
-       any number of things with the application (i.e., invoke any 
-       event handler method or use the BACK button etc.) and the 
-       <code>hotelBooking</code> maintains its state throughout the process.
-       When the <code>@End</code> method is called, Seam destroys this
-       component and avoids any memory leak.
-    </p>
-    
-    <p>
-      However, none of the <code>HotelBookingAction</code> bean methods 
-      may be called outside of a long-running conversation. 
-      So if we try to use the 
-      back button after the end of the conversation, Seam will redirect to the main page, with an 
-      error message.
-   </p>
-
-
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-  </div>
-</div>
-
-</body>
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/bookingExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,161 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>In-depth Explanation</title>
+	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+  <div class="trail">
+    <div class="numbox">5</div>
+    <h2>Conversations</h2>
+    <img src="../img/header_line.gif" />
+    
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+    <p>
+       The hotel booking "wizard" is implemented by a conversation-scoped
+       stateful session bean. All Seam components are in the 
+       conversation scope by default. 
+       The <code>HotelBookingAction</code> maintains
+       state associated with the booking process in the Seam conversation
+       scope. This ensures that if the user is working in multiple brower
+       tabs or multiple brower windows, the various conversations are
+       completely isolated from each other.
+    </p>
+    <p>
+       To see this working in practice, right click on the "View Hotel" button 
+       in the search screen and select "open in new tab" or "open in new window",
+       and try working on multiple hotel bookings simultaneously. 
+       In the <a href="workspaceExp.html">next step</a>, we will discuss
+       Seam's built-in components to manage multiple concurrent conversations.
+    </p>
+    
+<code class="block">
+ at Stateful
+ at Name("hotelBooking")
+ at LoggedIn
+public class HotelBookingAction implements HotelBooking
+{
+   
+   @PersistenceContext(type=EXTENDED)
+   private EntityManager em;
+   
+   @In
+   private User user;
+   
+   @In(required=false) @Out
+   private Hotel hotel;
+   
+   @In(required=false) 
+   @Out(required=false)
+   private Booking booking;
+   
+   @In(create=true)
+   private FacesMessages facesMessages;
+      
+   @In(create=true)
+   private Events events;
+      
+   @In 
+   private HotelSearching hotelSearch;
+   
+   @Logger 
+   private Log log;
+   
+   private boolean bookingValid;
+   
+   @Begin
+   public void selectHotel(Hotel selectedHotel)
+   {
+      hotel = em.merge(selectedHotel);
+   }
+   
+   public void bookHotel()
+   {      
+      booking = new Booking(hotel, user);
+      Calendar calendar = Calendar.getInstance();
+      booking.setCheckinDate( calendar.getTime() );
+      calendar.add(Calendar.DAY_OF_MONTH, 1);
+      booking.setCheckoutDate( calendar.getTime() );
+   }
+   
+
+   public void setBookingDetails()
+   {
+      Calendar calendar = Calendar.getInstance();
+      calendar.add(Calendar.DAY_OF_MONTH, -1);
+      if ( booking.getCheckinDate().before( calendar.getTime() ) )
+      {
+         facesMessages.addToControl("checkinDate", "Check in date must be a future date");
+         bookingValid=false;
+      }
+      else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
+      {
+         facesMessages.addToControl("checkoutDate", "Check out date must be later than check in date");
+         bookingValid=false;
+      }
+      else
+      {
+         bookingValid=true;
+      }
+   }
+   
+   public boolean isBookingValid()
+   {
+      return bookingValid;
+   }
+   
+   @End
+   public void confirm()
+   {
+      em.persist(booking);
+      facesMessages.add("Thank you, #{user.name}, your confimation number for #{hotel.name} is #{booking.id}");
+      log.info("New booking: #{booking.id} for #{user.username}");
+      events.raiseTransactionSuccessEvent("bookingConfirmed");
+   }
+   
+   @End
+   public void cancel() {}
+   
+   @Remove
+   public void destroy() {}
+}</code>
+
+    <p>
+       The conversation begins when the <code>@Begin</code> annotated
+       <code>selectHotel()</code> is called, and ends when 
+       the <code>@End</code> annotated 
+       <code>confirm()</code> or <code>cancel()</code> is called. Between the
+       <code>@Begin</code> and <code>@End</code> methods, the user can do
+       any number of things with the application (i.e., invoke any 
+       event handler method or use the BACK button etc.) and the 
+       <code>hotelBooking</code> maintains its state throughout the process.
+       When the <code>@End</code> method is called, Seam destroys this
+       component and avoids any memory leak.
+    </p>
+    
+    <p>
+      However, none of the <code>HotelBookingAction</code> bean methods 
+      may be called outside of a long-running conversation. 
+      So if we try to use the 
+      back button after the end of the conversation, Seam will redirect to the main page, with an 
+      error message.
+   </p>
+
+
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+  </div>
+</div>
+
+</body>
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,104 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>In-depth Explanation</title>
-	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-
-<div id="main">
-  <div class="trail">
-    <div class="numbox">7</div>
-    <h2>Ending Conversations</h2>
-    <img src="../img/header_line.gif" />
-    
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-    <p>
-       The "Confirm" button is bound to the action method <code>confirm()</code>
-       of <code>HotelBookingAction</code>.
-    </p>
-
-<code class="block">
-&lt;h:commandButton value="Confirm" 
-                 action="#{hotelBooking.confirm}" 
-                 id="confirm"/&gt;
-</code>
-
-    <p>
-       The <code>confirm()</code> method is tagged with the <code>@End</code> annotation, 
-       which ends the long-running conversation and results in all state associated with
-       the conversation being destroyed at the end of the request. 
-       Since the <code>pages.xml</code> file specifies a redirect for this action, the state
-        will not be destroyed
-       until <em>after the redirect completes</em>. Note that even the success message
-       that we create using the built-in <code>facesMessages</code> component is transparently
-       propagated across the redirect!
-    </p>
-
-<code class="block">
-   @End
-   public void confirm()
-   {
-      if (booking==null || hotel==null) return "main";
-      em.persist(booking);
-      facesMessages.add("Thank you, #{user.name}, your confimation number " + 
-                        "for #{hotel.name} is #{booking.id}");
-      log.info("New booking: #{booking.id} for #{user.username}");
-      events.raiseEvent("bookingConfirmed");
-   }
-   
-   @End
-   public void cancel() {}
-   
-   @Destroy @Remove
-   public void destroy() {}
-}
-</code>
-
-   <p>
-      When the conversation state is finally destroyed, Seam calls the <code>@Destroy</code> method,
-      which results in removal of the SFSB.
-   </p>
-   
-   <p>
-      Notice that the <code>HotelBookingAction.confirm()</code> method
-      raises a <code>bookingConfirmed</code> event before it finishes. The
-      event mechanism allows Seam components to communicate with each other
-      without direct coupling. In this case, the <code>BookingListAction</code>
-      component captures the <code>bookingConfirmed</code> event and refreshes
-      the existing booking list for the current user.
-   </p>
-   
-<code class="block">
-public class BookingListAction implements BookingList, Serializable
-{
-
-   ... ...
-   
-   @Factory
-   @Observer("bookingConfirmed")
-   public void getBookings()
-   {
-      bookings = em.createQuery("from Booking b where b.user.username = " + 
-                                ":username order by b.checkinDate")
-            .setParameter("username", user.getUsername())
-            .getResultList();
-   }
-}
-</code>
-   
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-  </div>
-</div>
-
-</body>
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/confirmExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,104 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>In-depth Explanation</title>
+	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+  <div class="trail">
+    <div class="numbox">7</div>
+    <h2>Ending Conversations</h2>
+    <img src="../img/header_line.gif" />
+    
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+    <p>
+       The "Confirm" button is bound to the action method <code>confirm()</code>
+       of <code>HotelBookingAction</code>.
+    </p>
+
+<code class="block">
+&lt;h:commandButton value="Confirm" 
+                 action="#{hotelBooking.confirm}" 
+                 id="confirm"/&gt;
+</code>
+
+    <p>
+       The <code>confirm()</code> method is tagged with the <code>@End</code> annotation, 
+       which ends the long-running conversation and results in all state associated with
+       the conversation being destroyed at the end of the request. 
+       Since the <code>pages.xml</code> file specifies a redirect for this action, the state
+        will not be destroyed
+       until <em>after the redirect completes</em>. Note that even the success message
+       that we create using the built-in <code>facesMessages</code> component is transparently
+       propagated across the redirect!
+    </p>
+
+<code class="block">
+   @End
+   public void confirm()
+   {
+      if (booking==null || hotel==null) return "main";
+      em.persist(booking);
+      facesMessages.add("Thank you, #{user.name}, your confimation number " + 
+                        "for #{hotel.name} is #{booking.id}");
+      log.info("New booking: #{booking.id} for #{user.username}");
+      events.raiseEvent("bookingConfirmed");
+   }
+   
+   @End
+   public void cancel() {}
+   
+   @Destroy @Remove
+   public void destroy() {}
+}
+</code>
+
+   <p>
+      When the conversation state is finally destroyed, Seam calls the <code>@Destroy</code> method,
+      which results in removal of the SFSB.
+   </p>
+   
+   <p>
+      Notice that the <code>HotelBookingAction.confirm()</code> method
+      raises a <code>bookingConfirmed</code> event before it finishes. The
+      event mechanism allows Seam components to communicate with each other
+      without direct coupling. In this case, the <code>BookingListAction</code>
+      component captures the <code>bookingConfirmed</code> event and refreshes
+      the existing booking list for the current user.
+   </p>
+   
+<code class="block">
+public class BookingListAction implements BookingList, Serializable
+{
+
+   ... ...
+   
+   @Factory
+   @Observer("bookingConfirmed")
+   public void getBookings()
+   {
+      bookings = em.createQuery("from Booking b where b.user.username = " + 
+                                ":username order by b.checkinDate")
+            .setParameter("username", user.getUsername())
+            .getResultList();
+   }
+}
+</code>
+   
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+  </div>
+</div>
+
+</body>
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,73 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>In-depth Explanation</title>
-	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-
-<div id="main">
-  <div class="trail">
-    <div class="numbox">1</div>
-    <h2>What is JBoss Seam</h2>
-    <img src="../img/header_line.gif" />
-    
-    <p>
-       <center>
-       <form>
-          <INPUT type="button" value="Close Window" onclick="window.close()">
-       </form>
-       </center>
-    </p>
-    
-    <p>
-       EJB 3.0 and JSF are perhaps the most exciting new developments in the Java EE 5 platform. 
-       Seam is an innovative new application framework that integrates the EJB 3.0 component model 
-       with JSF as a presentation tier. Seam builds upon the standard extension points provided by 
-       both specifications and provides a set of Java annotations that extends the standard 
-       annotations defined by the EJB specification. In addition, Seam introduces several innovative 
-       new ideas: managed conversations, declarative and contextual application state management, 
-       bijection and integrated business process management. 
-    </p>
-
-    <p>
-       Traditional web applications are incredibly vulnerable to bugs and performance problems 
-       relating to state management. Developers are forced to handle issues like back button 
-       navigation, multi-window browsing, session size management in an utterly ad-hoc fashion. 
-       Access to transactional components from the web tier has also been problematic. J2EE 
-       provided no way to have simultaneous access to state held in contexts associated with 
-       the web request, and state held in transactional resources accessed via EJB. Finally, 
-       J2EE had no first-class construct for representing state associated with a long-running 
-       business process. Seam tackles all these problems, and provides a uniform model for 
-       stateful components in Java EE 5.
-    </p>
-				
-    <p>
-       Like all JBoss software, this entire software stack is free. The full source code of this 
-       sample application is available in the <code>examples/booking</code> directory of the 
-       <a href="http://www.jboss.com/products/list/downloads#seam">Seam distribution</a>. 
-       <!--
-       There is even a  
-       <a target="_blank" href="http://docs.jboss.com/TrailBlazer/seam-booking/Seam.htm">
-          10-minute flash demo 
-       </a>
-       showing how to build a Seam web application from ground up.
-       -->
-    </p>
-
-    <p>
-       <center>
-       <form>
-          <INPUT type="button" value="Close Window" onclick="window.close()">
-       </form>
-       </center>
-    </p>
-
-  </div>
-</div>
-
-</body>
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/introExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,73 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>In-depth Explanation</title>
+	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+  <div class="trail">
+    <div class="numbox">1</div>
+    <h2>What is JBoss Seam</h2>
+    <img src="../img/header_line.gif" />
+    
+    <p>
+       <center>
+       <form>
+          <INPUT type="button" value="Close Window" onclick="window.close()">
+       </form>
+       </center>
+    </p>
+    
+    <p>
+       EJB 3.0 and JSF are perhaps the most exciting new developments in the Java EE 5 platform. 
+       Seam is an innovative new application framework that integrates the EJB 3.0 component model 
+       with JSF as a presentation tier. Seam builds upon the standard extension points provided by 
+       both specifications and provides a set of Java annotations that extends the standard 
+       annotations defined by the EJB specification. In addition, Seam introduces several innovative 
+       new ideas: managed conversations, declarative and contextual application state management, 
+       bijection and integrated business process management. 
+    </p>
+
+    <p>
+       Traditional web applications are incredibly vulnerable to bugs and performance problems 
+       relating to state management. Developers are forced to handle issues like back button 
+       navigation, multi-window browsing, session size management in an utterly ad-hoc fashion. 
+       Access to transactional components from the web tier has also been problematic. J2EE 
+       provided no way to have simultaneous access to state held in contexts associated with 
+       the web request, and state held in transactional resources accessed via EJB. Finally, 
+       J2EE had no first-class construct for representing state associated with a long-running 
+       business process. Seam tackles all these problems, and provides a uniform model for 
+       stateful components in Java EE 5.
+    </p>
+				
+    <p>
+       Like all JBoss software, this entire software stack is free. The full source code of this 
+       sample application is available in the <code>examples/booking</code> directory of the 
+       <a href="http://www.jboss.com/products/list/downloads#seam">Seam distribution</a>. 
+       <!--
+       There is even a  
+       <a target="_blank" href="http://docs.jboss.com/TrailBlazer/seam-booking/Seam.htm">
+          10-minute flash demo 
+       </a>
+       showing how to build a Seam web application from ground up.
+       -->
+    </p>
+
+    <p>
+       <center>
+       <form>
+          <INPUT type="button" value="Close Window" onclick="window.close()">
+       </form>
+       </center>
+    </p>
+
+  </div>
+</div>
+
+</body>
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,161 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>In-depth Explanation</title>
-	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-
-<div id="main">
-  <div class="trail">
-    <div class="numbox">2</div>
-    <h2>What happens when you login?</h2>
-    <img src="../img/header_line.gif" />
-    
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-    
-    <p>
-       The login page is defined using pure XHTML with JSF controls. 
-       The form uses JSF EL value binding and method binding 
-       expressions to refer to Seam components. For example, 
-       <code>#{identity.username}</code> refers to a property of the
-       <code>Identity</code> component and <code>#{identity.login}</code> 
-       refers to a method of the <code>Identity</code> component.
-    </p>
-
-<code class="block">
-&lt;div&gt;
-    &lt;h:outputLabel for="username">Login Name&lt;/h:outputLabel>
-    &lt;h:inputText id="username" value="#{identity.username}" />
-&lt;/div&gt;
-&lt;div&gt;
-    &lt;h:outputLabel for="password">Password&lt;/h:outputLabel>
-    &lt;h:inputSecret id="password" value="#{identity.password}" />
-&lt;/div&gt;
-
-... ...
-
-&lt;div class="buttonBox"&gt;
-    &lt;h:commandButton id="login"
-                     action="#{identity.login}" 
-                     value="Account Login" /&gt;
-&lt;/div&gt;
-</code>
-
-    <p>
-       After logging in, the <code>User</code> enity bean is mapped to the Seam  
-       context variable named <code>user</code> bean via the 
-       <code>@Name</code> annotation. <code>User</code> is
-       a session scoped bean, meaning that the <code>user</code>
-       component value is retained for the entire session for
-       each user. You might also notice there are validation annotation
-       on the data properties. We will discuss those annotations in the
-       <a href="registerExp.html">next step</a>.
-    </p>
-
-<code class="block">
- at Entity
- at Name("user")
- at Scope(SESSION)
-public class User implements Serializable {
-   private String username;
-   private String password;
-   private String name;
-
-   @NotNull
-   @Length(min=5, max=15)
-   public String getPassword() {
-      return password;
-   }
-   public void setPassword(String password) {
-      this.password = password;
-   }
-   
-
-   @Id
-   @Length(min=4, max=15)
-   @Pattern(regex="^\\w*$", message="not a valid username")
-   public String getUsername () {
-      return username;
-   }
-   public void setUsername (String username) {
-      this.username = username;
-   }
-
-    // ... ...
-}
-</code>
-
-    <p>
-       Seam comes with its own Security framework, based on JAAS.  It allows you 
-       to perform user authentication by configuring your own authentication method
-       in <code>components.xml</code>.
-    </p>
-    
-<code class="block">
-  &lt;security:identity authenticate-method="#{authenticator.authenticate}"/&gt;
-</code>
-
-    <p>
-       <code>AuthenticatorAction</code> is an EJB 3.0 session bean mapped 
-       to the Seam context variable named <code>authenticator</code>. When 
-       the login button is clicked, the JSF method binding 
-       <code>#{identity.login}</code> is evaluated, and based upon the previous configuration, the 
-       <code>authenticate()</code> method is invoked upon <code>AuthenticatorAction</code>.
-    </p>
-
-<code class="block">
- at Stateless
- at Scope(EVENT)
- at Name("authenticator")
-public class AuthenticatorAction implements Authenticator
-{
-   @PersistenceContext EntityManager em;
-   
-   @Out(required=false, scope = SESSION)
-   private User user;
-   
-   public boolean authenticate()
-   {
-      List results = em.createQuery("select u from User u where" + 
-                                    " u.username=#{identity.username}" + 
-                                    " and u.password=#{identity.password}")
-                       .getResultList();
-      
-      if ( results.size()==0 )
-      {
-         return false;
-      }
-      else
-      {
-         user = (User) results.get(0);
-         return true;
-      }
-   }
-}
-</code>
-
-    <p>
-       The <code>@Out</code> 
-       annotation indicates the <code>AuthenticatorAction</code> bean can change the
-       value of the <code>user</code> context variable and make the new instance 
-       available to other session beans and JSF pages.  The query expression 
-       makes use of a special syntax in Seam that allows EL expressions to 
-       serve as query parameters.  This query references the <code>identity</code> component,
-       a built-in Seam component that provides security functionality.
-    </p>
-
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-  </div>
-</div>
-
-</body>
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/loginExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,161 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>In-depth Explanation</title>
+	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+  <div class="trail">
+    <div class="numbox">2</div>
+    <h2>What happens when you login?</h2>
+    <img src="../img/header_line.gif" />
+    
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+    
+    <p>
+       The login page is defined using pure XHTML with JSF controls. 
+       The form uses JSF EL value binding and method binding 
+       expressions to refer to Seam components. For example, 
+       <code>#{identity.username}</code> refers to a property of the
+       <code>Identity</code> component and <code>#{identity.login}</code> 
+       refers to a method of the <code>Identity</code> component.
+    </p>
+
+<code class="block">
+&lt;div&gt;
+    &lt;h:outputLabel for="username">Login Name&lt;/h:outputLabel>
+    &lt;h:inputText id="username" value="#{identity.username}" />
+&lt;/div&gt;
+&lt;div&gt;
+    &lt;h:outputLabel for="password">Password&lt;/h:outputLabel>
+    &lt;h:inputSecret id="password" value="#{identity.password}" />
+&lt;/div&gt;
+
+... ...
+
+&lt;div class="buttonBox"&gt;
+    &lt;h:commandButton id="login"
+                     action="#{identity.login}" 
+                     value="Account Login" /&gt;
+&lt;/div&gt;
+</code>
+
+    <p>
+       After logging in, the <code>User</code> enity bean is mapped to the Seam  
+       context variable named <code>user</code> bean via the 
+       <code>@Name</code> annotation. <code>User</code> is
+       a session scoped bean, meaning that the <code>user</code>
+       component value is retained for the entire session for
+       each user. You might also notice there are validation annotation
+       on the data properties. We will discuss those annotations in the
+       <a href="registerExp.html">next step</a>.
+    </p>
+
+<code class="block">
+ at Entity
+ at Name("user")
+ at Scope(SESSION)
+public class User implements Serializable {
+   private String username;
+   private String password;
+   private String name;
+
+   @NotNull
+   @Length(min=5, max=15)
+   public String getPassword() {
+      return password;
+   }
+   public void setPassword(String password) {
+      this.password = password;
+   }
+   
+
+   @Id
+   @Length(min=4, max=15)
+   @Pattern(regex="^\\w*$", message="not a valid username")
+   public String getUsername () {
+      return username;
+   }
+   public void setUsername (String username) {
+      this.username = username;
+   }
+
+    // ... ...
+}
+</code>
+
+    <p>
+       Seam comes with its own Security framework, based on JAAS.  It allows you 
+       to perform user authentication by configuring your own authentication method
+       in <code>components.xml</code>.
+    </p>
+    
+<code class="block">
+  &lt;security:identity authenticate-method="#{authenticator.authenticate}"/&gt;
+</code>
+
+    <p>
+       <code>AuthenticatorAction</code> is an EJB 3.0 session bean mapped 
+       to the Seam context variable named <code>authenticator</code>. When 
+       the login button is clicked, the JSF method binding 
+       <code>#{identity.login}</code> is evaluated, and based upon the previous configuration, the 
+       <code>authenticate()</code> method is invoked upon <code>AuthenticatorAction</code>.
+    </p>
+
+<code class="block">
+ at Stateless
+ at Scope(EVENT)
+ at Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+   @PersistenceContext EntityManager em;
+   
+   @Out(required=false, scope = SESSION)
+   private User user;
+   
+   public boolean authenticate()
+   {
+      List results = em.createQuery("select u from User u where" + 
+                                    " u.username=#{identity.username}" + 
+                                    " and u.password=#{identity.password}")
+                       .getResultList();
+      
+      if ( results.size()==0 )
+      {
+         return false;
+      }
+      else
+      {
+         user = (User) results.get(0);
+         return true;
+      }
+   }
+}
+</code>
+
+    <p>
+       The <code>@Out</code> 
+       annotation indicates the <code>AuthenticatorAction</code> bean can change the
+       value of the <code>user</code> context variable and make the new instance 
+       available to other session beans and JSF pages.  The query expression 
+       makes use of a special syntax in Seam that allows EL expressions to 
+       serve as query parameters.  This query references the <code>identity</code> component,
+       a built-in Seam component that provides security functionality.
+    </p>
+
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+  </div>
+</div>
+
+</body>
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,214 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>In-depth Explanation</title>
-	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-
-<div id="main">
-  <div class="trail">
-    <div class="numbox">4</div>
-    <h2>Stateful components</h2>
-    <img src="../img/header_line.gif" />
-    
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-    <p>
-       The hotel search page is backed by the a stateful session bean named
-       <code>hotelSearch</code> and implemented by the class 
-       <code>HotelSearchingAction</code>.
-    </p>
-
-<code class="block">
-&lt;h:inputText id="searchString" value="#{hotelSearch.searchString}" &gt;
-    &lt;a:support event="onkeyup" actionListener="#{hotelSearch.find}" 
-               reRender="searchResults"/&gt;
-&lt;/h:inputText&gt;
-
-&lt;h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize"&gt;
-    &lt;f:selectItem itemLabel="5" itemValue="5"/&gt;
-    &lt;f:selectItem itemLabel="10" itemValue="10"/&gt;
-    &lt;f::selectItem itemLabel="20" itemValue="20"/&gt;
-&lt;/h:selectOneMenu&gt;
-</code>
-
-    <p>
-       When the button is clicked, the form is submitted and JSF sets the value 
-       of the text box and drop down menu onto the <code>searchString</code> and
-       <code>pageSize</code> attributes of <code>HotelSearchingAction</code> 
-       before calling the <code>find()</code> action listener method. We've used a 
-       session-scope stateful bean because we want it's state (the search results) to 
-       be held in the session between requests to the server.  The <code>&lt;a:support&gt;</code>
-       tax specfies that after a keypress, the contents of the <code>&lt;a:outputPanel&gt;</code> whose
-       id is <code>searchResults</code> should be rerendererd.  This is done through an AJAX-style
-       call back to the server with no additional code required of the application.
-    </p>
-
-<code class="block">
- at Stateful
- at Name("hotelSearch")
- at Scope(ScopeType.SESSION)
- at LoggedIn
-public class HotelSearchingAction implements HotelSearching
-{
-   @PersistenceContext
-   private EntityManager em;
-   
-   private String searchString;
-   private int pageSize = 10;
-   private int page;
-   
-   @DataModel
-   private List&lt;Hotel&gt; hotels;
-   
-   public void find()
-   {
-      page = 0;
-      queryHotels();
-   }
-   public void nextPage()
-   {
-      page++;
-      queryHotels();
-   }
-      
-   private void queryHotels()
-   {
-      hotels = em.createQuery("select h from Hotel h where lower(h.name) " + 
-                              "like #{pattern} or lower(h.city) like #{pattern} " + 
-                              "or lower(h.zip) like #{pattern} or " + 
-                              "lower(h.address) like #{pattern}")
-            .setMaxResults(pageSize)
-            .setFirstResult( page * pageSize )
-            .getResultList();
-   }
-   
-   public boolean isNextPageAvailable()
-   {
-      return hotels!=null && hotels.size()==pageSize;
-   }
-   
-   public int getPageSize() {
-      return pageSize;
-   }
-   
-   public void setPageSize(int pageSize) {
-      this.pageSize = pageSize;
-   }
-   
-   @Factory(value="pattern", scope=ScopeType.EVENT)
-   public String getSearchPattern()
-   {
-      return searchString==null ? 
-            "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
-   }
-   
-   public String getSearchString()
-   {
-      return searchString;
-   }
-   
-   public void setSearchString(String searchString)
-   {
-      this.searchString = searchString;
-   }
-   
-   @Remove
-   public void destroy() {}
-}</code>
-
-    <p>
-       The <code>find()</code> method retrieves a list of hotels from the database and
-       initializes the <code>hotels</code> field. The <code>hotels</code> field is marked 
-       with the <code>@DataModel</code> annotation, so when the <code>find()</code> method
-       returns, Seam outjects an instance of <code>ListDataModel</code> to a context
-       variable named <code>hotels</code>. So, when the search page is re-rendered, the
-       result list is available to the JSF <code>dataTable</code>. 
-       Each row of the data table has an associated command button or link 
-       (see below). 
-    </p>
-
-<code class="block">
-&lt;h:outputText value="No Hotels Found" 
-              rendered="#{hotels != null and hotels.rowCount==0}"/&gt;
-&lt;h:dataTable value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}"&gt;
-	&lt;h:column&gt;
-		&lt;f:facet name="header"&gt;Name&lt;/f:facet&gt;
-		#{hot.name}
-	&lt;/h:column&gt;
-	&lt;h:column&gt;
-		&lt;f:facet name="header"&gt;Address&lt;/f:facet&gt;
-		#{hot.address}
-	&lt;/h:column&gt;
-	&lt;h:column&gt;
-		&lt;f:facet name="header"&gt;City, State&lt;/f:facet&gt;
-		#{hot.city}, #{hot.state}
-	&lt;/h:column&gt;
-	&lt;h:column&gt;
-		&lt;f:facet name="header"&gt;Zip&lt;/f:facet&gt;
-		#{hot.zip}
-	&lt;/h:column&gt;
-	&lt;h:column&gt;
-		&lt;f:facet name="header"&gt;Action&lt;/f:facet&gt;
-		&lt;s:link value="View Hotel" 
-                        action="#{hotelBooking.selectHotel(hot)}"/&gt;
-	&lt;/h:column&gt;
-&lt;/h:dataTable&gt;
-</code>
-
-    <p>
-       The "View Hotel" link is the above mentioned command link associated
-       with each row of the data table. It is implemented 
-       using a Seam <code>&lt;s:link&gt;</code>, which is part of Seam's 
-       extension of JSF controls.
-       This JSF control let's us call an action, and pass a request parameter, without 
-       submitting any JSF form. The advantage of <code>&lt;s:link&gt;</code> is that, 
-       unlike a standard JSF <code>&lt;h:commandLink&gt;</code>, there is no JavaScript 
-       used, so "open link in new tab" works seamlessly.
-    </p>
-    <p>
-       When this link is clicked, the <code>selectHotel()</code> method of the
-       <code>HotelBookingAction</code> bean is called with the <code>hot</code>
-       parameter that is specified in the query.  The parameter values are evaluated
-       at invocation time, not when the link is generated, so the <code>&lt;s:link&gt;</code>
-       tag adds a dataModelSelection parameter that indicates the value of the 
-       <code>hot</code> loop variable for the given row.</p>
-    <p>  The <code>selectHotel()</code> method merges the selected hotel into 
-       the current persistence context (in case the same
-       hotel has been accessed before in the same session),
-       and starts a Seam conversation. We will discuss Seam conversations
-       in the next step.
-    </p>
-    
-<code class="block">
- at Stateful
- at Name("hotelBooking")
- at LoggedIn
-public class HotelBookingAction implements HotelBooking
-{
-
-   ... ...
-   
-   @Begin
-   public void selectHotel(Hotel selectedHotel)
-   {
-      hotel = em.merge(selectedHotel);
-   }
-}
-</code>
-
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-  </div>
-</div>
-
-</body>
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/mainExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,214 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>In-depth Explanation</title>
+	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+  <div class="trail">
+    <div class="numbox">4</div>
+    <h2>Stateful components</h2>
+    <img src="../img/header_line.gif" />
+    
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+    <p>
+       The hotel search page is backed by the a stateful session bean named
+       <code>hotelSearch</code> and implemented by the class 
+       <code>HotelSearchingAction</code>.
+    </p>
+
+<code class="block">
+&lt;h:inputText id="searchString" value="#{hotelSearch.searchString}" &gt;
+    &lt;a:support event="onkeyup" actionListener="#{hotelSearch.find}" 
+               reRender="searchResults"/&gt;
+&lt;/h:inputText&gt;
+
+&lt;h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize"&gt;
+    &lt;f:selectItem itemLabel="5" itemValue="5"/&gt;
+    &lt;f:selectItem itemLabel="10" itemValue="10"/&gt;
+    &lt;f::selectItem itemLabel="20" itemValue="20"/&gt;
+&lt;/h:selectOneMenu&gt;
+</code>
+
+    <p>
+       When the button is clicked, the form is submitted and JSF sets the value 
+       of the text box and drop down menu onto the <code>searchString</code> and
+       <code>pageSize</code> attributes of <code>HotelSearchingAction</code> 
+       before calling the <code>find()</code> action listener method. We've used a 
+       session-scope stateful bean because we want it's state (the search results) to 
+       be held in the session between requests to the server.  The <code>&lt;a:support&gt;</code>
+       tax specfies that after a keypress, the contents of the <code>&lt;a:outputPanel&gt;</code> whose
+       id is <code>searchResults</code> should be rerendererd.  This is done through an AJAX-style
+       call back to the server with no additional code required of the application.
+    </p>
+
+<code class="block">
+ at Stateful
+ at Name("hotelSearch")
+ at Scope(ScopeType.SESSION)
+ at LoggedIn
+public class HotelSearchingAction implements HotelSearching
+{
+   @PersistenceContext
+   private EntityManager em;
+   
+   private String searchString;
+   private int pageSize = 10;
+   private int page;
+   
+   @DataModel
+   private List&lt;Hotel&gt; hotels;
+   
+   public void find()
+   {
+      page = 0;
+      queryHotels();
+   }
+   public void nextPage()
+   {
+      page++;
+      queryHotels();
+   }
+      
+   private void queryHotels()
+   {
+      hotels = em.createQuery("select h from Hotel h where lower(h.name) " + 
+                              "like #{pattern} or lower(h.city) like #{pattern} " + 
+                              "or lower(h.zip) like #{pattern} or " + 
+                              "lower(h.address) like #{pattern}")
+            .setMaxResults(pageSize)
+            .setFirstResult( page * pageSize )
+            .getResultList();
+   }
+   
+   public boolean isNextPageAvailable()
+   {
+      return hotels!=null && hotels.size()==pageSize;
+   }
+   
+   public int getPageSize() {
+      return pageSize;
+   }
+   
+   public void setPageSize(int pageSize) {
+      this.pageSize = pageSize;
+   }
+   
+   @Factory(value="pattern", scope=ScopeType.EVENT)
+   public String getSearchPattern()
+   {
+      return searchString==null ? 
+            "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
+   }
+   
+   public String getSearchString()
+   {
+      return searchString;
+   }
+   
+   public void setSearchString(String searchString)
+   {
+      this.searchString = searchString;
+   }
+   
+   @Remove
+   public void destroy() {}
+}</code>
+
+    <p>
+       The <code>find()</code> method retrieves a list of hotels from the database and
+       initializes the <code>hotels</code> field. The <code>hotels</code> field is marked 
+       with the <code>@DataModel</code> annotation, so when the <code>find()</code> method
+       returns, Seam outjects an instance of <code>ListDataModel</code> to a context
+       variable named <code>hotels</code>. So, when the search page is re-rendered, the
+       result list is available to the JSF <code>dataTable</code>. 
+       Each row of the data table has an associated command button or link 
+       (see below). 
+    </p>
+
+<code class="block">
+&lt;h:outputText value="No Hotels Found" 
+              rendered="#{hotels != null and hotels.rowCount==0}"/&gt;
+&lt;h:dataTable value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}"&gt;
+	&lt;h:column&gt;
+		&lt;f:facet name="header"&gt;Name&lt;/f:facet&gt;
+		#{hot.name}
+	&lt;/h:column&gt;
+	&lt;h:column&gt;
+		&lt;f:facet name="header"&gt;Address&lt;/f:facet&gt;
+		#{hot.address}
+	&lt;/h:column&gt;
+	&lt;h:column&gt;
+		&lt;f:facet name="header"&gt;City, State&lt;/f:facet&gt;
+		#{hot.city}, #{hot.state}
+	&lt;/h:column&gt;
+	&lt;h:column&gt;
+		&lt;f:facet name="header"&gt;Zip&lt;/f:facet&gt;
+		#{hot.zip}
+	&lt;/h:column&gt;
+	&lt;h:column&gt;
+		&lt;f:facet name="header"&gt;Action&lt;/f:facet&gt;
+		&lt;s:link value="View Hotel" 
+                        action="#{hotelBooking.selectHotel(hot)}"/&gt;
+	&lt;/h:column&gt;
+&lt;/h:dataTable&gt;
+</code>
+
+    <p>
+       The "View Hotel" link is the above mentioned command link associated
+       with each row of the data table. It is implemented 
+       using a Seam <code>&lt;s:link&gt;</code>, which is part of Seam's 
+       extension of JSF controls.
+       This JSF control let's us call an action, and pass a request parameter, without 
+       submitting any JSF form. The advantage of <code>&lt;s:link&gt;</code> is that, 
+       unlike a standard JSF <code>&lt;h:commandLink&gt;</code>, there is no JavaScript 
+       used, so "open link in new tab" works seamlessly.
+    </p>
+    <p>
+       When this link is clicked, the <code>selectHotel()</code> method of the
+       <code>HotelBookingAction</code> bean is called with the <code>hot</code>
+       parameter that is specified in the query.  The parameter values are evaluated
+       at invocation time, not when the link is generated, so the <code>&lt;s:link&gt;</code>
+       tag adds a dataModelSelection parameter that indicates the value of the 
+       <code>hot</code> loop variable for the given row.</p>
+    <p>  The <code>selectHotel()</code> method merges the selected hotel into 
+       the current persistence context (in case the same
+       hotel has been accessed before in the same session),
+       and starts a Seam conversation. We will discuss Seam conversations
+       in the next step.
+    </p>
+    
+<code class="block">
+ at Stateful
+ at Name("hotelBooking")
+ at LoggedIn
+public class HotelBookingAction implements HotelBooking
+{
+
+   ... ...
+   
+   @Begin
+   public void selectHotel(Hotel selectedHotel)
+   {
+      hotel = em.merge(selectedHotel);
+   }
+}
+</code>
+
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+  </div>
+</div>
+
+</body>
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,229 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>In-depth Explanation</title>
-	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-
-<div id="main">
-  <div class="trail">
-    <div class="numbox">3</div>
-    <h2>What happens in the registration process?</h2>
-    <img src="img/header_line.gif" />
-    
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-    <p>
-       The register.xhtml JSF form captures the user input for new account
-       registration. It validates the user input, binds the data to a 
-       Seam data component, and invokes a Seam UI event handler method
-       when the form is submitted.
-    </p>
-    
-<code class="block">
-&lt;s:validateAll&gt;
-&lt;div class="entry"&gt;
-    &lt;div class="label"&gt;
-        &lt;h:outputLabel for="username">Username:&lt;/h:outputLabel&gt;
-    &lt;/div&gt;
-    &lt;div class="input"&gt;
-        &lt;h:inputText id="username" value="#{user.username}"/&gt;&lt;br/&gt;
-        &lt;span class="errors"&gt;&lt;h:message for="username" /&gt;&lt;/span&gt;
-    &lt;/div&gt;
-&lt;/div&gt;
-&lt;div class="entry"&gt;
-    &lt;div class="label"&gt;
-        &lt;h:outputLabel for="name">Real Name:&lt;/h:outputLabel&gt;
-    &lt;/div&gt;
-    &lt;div class="input"&gt;
-        &lt;h:inputText id="name" value="#{user.name}" /&gt;&lt;br/&gt;
-        &lt;span class="errors">&lt;h:message for="name" /&gt;&lt;/span&gt;
-    &lt;/div&gt;
-&lt;/div&gt;
-&lt;/s:validateAll&gt;
-
-... ...
-
-    &lt;div class="input"&gt;
-        &lt;h:commandButton value="Register" 
-                         action="#{register.register}" 
-                         class="button"/&gt;
-        &lt;h:commandButton value="Cancel" action="login" class="button"/&gt;
-    &lt;/div&gt;
-</code>
-
-   <p>
-      The form fields are bound to properties of a Seam component named
-      <code>user</code> via JSF EL value binding expressions such as
-      <code>#{user.username}</code>. The form submit button is bound
-      to the <code>register()</code> method of the Seam component named
-      <code>register</code> using the JSF method binding expression 
-      <code>#{register.register}</code>.
-   </p>
-
-   <p>
-       Notice that the input fields are enclosed by a <code>&lt;s:validateAll</code>
-       tag. This tag is part of Seam's extension to JSF. It tells the Seam
-       runtime to validate those input fields when the form is submitted.
-       The validation conditions are specified on the entity bean classes
-       those input fields map to (e.g., here the validation condition is
-       on the <code>User</code> class, see later).
-       This JSF form also includes <code>&lt;h:message&gt;</code> tags that
-       will display the results of any JSF validation failures.
-    </p>
-
-   <p>
-      The <code>User</code> class is an EJB 3.0 entity bean with a 
-      <code>@Name</code> annotation that binds the bean instance to a
-      context variable named <code>user</code>. In addition to the standard 
-      EJB 3.0 O/R mapping metadata, this bean features several Hibernate 
-      Validator annotations such as 
-      <code>@NotNull</code>, <code>@Length</code>. Due to the 
-      <code>&lt;s:validateAll</code> tag in the form, these constraints are 
-      automatically validated by Seam when the form is submitted. If the user 
-      enters invalid data in the JSF form, the form will be redisplayed with 
-      error messages.
-   </p>
-
-<code class="block">
- at Entity
- at Name("user")
- at Scope(SESSION)
-public class User implements Serializable
-{
-   private String username;
-   private String password;
-   private String name;
-   
-   public User(String name, String password, String username)
-   {
-      this.name = name;
-      this.password = password;
-      this.username = username;
-   }
-   
-   public User() {}
-
-   @NotNull
-   @Length(max=100)
-   public String getName()
-   {
-      return name;
-   }
-   public void setName(String name)
-   {
-      this.name = name;
-   }
-   
-   @NotNull
-   @Length(min=5, max=15)
-   public String getPassword()
-   {
-      return password;
-   }
-   public void setPassword(String password)
-   {
-      this.password = password;
-   }
-   
-   @Id
-   @Length(min=5, max=15)
-   public String getUsername()
-   {
-      return username;
-   }
-   public void setUsername(String username)
-   {
-      this.username = username;
-   }
-   
-}</code>
-
-    <p>
-       <code>RegisterAction</code> is an EJB 3.0 stateful session bean 
-       bound to the Seam context variable named <code>register</code>. 
-       The <code>register()</code> method is invoked  when the form is 
-       submitted.
-    </p>
-
-<code class="block">
- at Stateful
- at Scope(EVENT)
- at Name("register")
-public class RegisterAction implements Register
-{
-
-   @In
-   private User user;
-   
-   @PersistenceContext
-   private EntityManager em;
-   
-   @In(create=true)
-   private transient FacesMessages facesMessages;
-   
-   private String verify;
-   
-   public String register()
-   {
-      if ( user.getPassword().equals(verify) )
-      {
-         List existing = em.createQuery("select username from User " + 
-                                        "where username=:username")
-            .setParameter("username", user.getUsername())
-            .getResultList();
-         if (existing.size()==0)
-         {
-            em.persist(user);
-            return "login";
-         }
-         else
-         {
-            facesMessages.add("username #{user.username} already exists");
-            return null;
-         }
-      }
-      else 
-      {
-         facesMessages.add("re-enter your password");
-         verify=null;
-         return null;
-      }
-   }
-
-   public String getVerify()
-   {
-      return verify;
-   }
-
-   public void setVerify(String verify)
-   {
-      this.verify = verify;
-   }
-   
-   @Destroy @Remove
-   public void destroy() {}
-}</code>
-
-    <p>
-       The <code>@In</code> annotations inject Seam components into the <code>RegisterAction</code>
-       bean. The <code>user</code> component is our entity bean, of course. The <code>facesMessages</code> 
-       component is a built-in Seam component that makes it very easy to display templated and localized
-       messages to the user, even when redirect after post is used.
-    </p>
-
-       <form>
-          <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-
-  </div>
-</div>
-
-</body>
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/registerExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,229 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>In-depth Explanation</title>
+	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+  <div class="trail">
+    <div class="numbox">3</div>
+    <h2>What happens in the registration process?</h2>
+    <img src="img/header_line.gif" />
+    
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+    <p>
+       The register.xhtml JSF form captures the user input for new account
+       registration. It validates the user input, binds the data to a 
+       Seam data component, and invokes a Seam UI event handler method
+       when the form is submitted.
+    </p>
+    
+<code class="block">
+&lt;s:validateAll&gt;
+&lt;div class="entry"&gt;
+    &lt;div class="label"&gt;
+        &lt;h:outputLabel for="username">Username:&lt;/h:outputLabel&gt;
+    &lt;/div&gt;
+    &lt;div class="input"&gt;
+        &lt;h:inputText id="username" value="#{user.username}"/&gt;&lt;br/&gt;
+        &lt;span class="errors"&gt;&lt;h:message for="username" /&gt;&lt;/span&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+&lt;div class="entry"&gt;
+    &lt;div class="label"&gt;
+        &lt;h:outputLabel for="name">Real Name:&lt;/h:outputLabel&gt;
+    &lt;/div&gt;
+    &lt;div class="input"&gt;
+        &lt;h:inputText id="name" value="#{user.name}" /&gt;&lt;br/&gt;
+        &lt;span class="errors">&lt;h:message for="name" /&gt;&lt;/span&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+&lt;/s:validateAll&gt;
+
+... ...
+
+    &lt;div class="input"&gt;
+        &lt;h:commandButton value="Register" 
+                         action="#{register.register}" 
+                         class="button"/&gt;
+        &lt;h:commandButton value="Cancel" action="login" class="button"/&gt;
+    &lt;/div&gt;
+</code>
+
+   <p>
+      The form fields are bound to properties of a Seam component named
+      <code>user</code> via JSF EL value binding expressions such as
+      <code>#{user.username}</code>. The form submit button is bound
+      to the <code>register()</code> method of the Seam component named
+      <code>register</code> using the JSF method binding expression 
+      <code>#{register.register}</code>.
+   </p>
+
+   <p>
+       Notice that the input fields are enclosed by a <code>&lt;s:validateAll</code>
+       tag. This tag is part of Seam's extension to JSF. It tells the Seam
+       runtime to validate those input fields when the form is submitted.
+       The validation conditions are specified on the entity bean classes
+       those input fields map to (e.g., here the validation condition is
+       on the <code>User</code> class, see later).
+       This JSF form also includes <code>&lt;h:message&gt;</code> tags that
+       will display the results of any JSF validation failures.
+    </p>
+
+   <p>
+      The <code>User</code> class is an EJB 3.0 entity bean with a 
+      <code>@Name</code> annotation that binds the bean instance to a
+      context variable named <code>user</code>. In addition to the standard 
+      EJB 3.0 O/R mapping metadata, this bean features several Hibernate 
+      Validator annotations such as 
+      <code>@NotNull</code>, <code>@Length</code>. Due to the 
+      <code>&lt;s:validateAll</code> tag in the form, these constraints are 
+      automatically validated by Seam when the form is submitted. If the user 
+      enters invalid data in the JSF form, the form will be redisplayed with 
+      error messages.
+   </p>
+
+<code class="block">
+ at Entity
+ at Name("user")
+ at Scope(SESSION)
+public class User implements Serializable
+{
+   private String username;
+   private String password;
+   private String name;
+   
+   public User(String name, String password, String username)
+   {
+      this.name = name;
+      this.password = password;
+      this.username = username;
+   }
+   
+   public User() {}
+
+   @NotNull
+   @Length(max=100)
+   public String getName()
+   {
+      return name;
+   }
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   @NotNull
+   @Length(min=5, max=15)
+   public String getPassword()
+   {
+      return password;
+   }
+   public void setPassword(String password)
+   {
+      this.password = password;
+   }
+   
+   @Id
+   @Length(min=5, max=15)
+   public String getUsername()
+   {
+      return username;
+   }
+   public void setUsername(String username)
+   {
+      this.username = username;
+   }
+   
+}</code>
+
+    <p>
+       <code>RegisterAction</code> is an EJB 3.0 stateful session bean 
+       bound to the Seam context variable named <code>register</code>. 
+       The <code>register()</code> method is invoked  when the form is 
+       submitted.
+    </p>
+
+<code class="block">
+ at Stateful
+ at Scope(EVENT)
+ at Name("register")
+public class RegisterAction implements Register
+{
+
+   @In
+   private User user;
+   
+   @PersistenceContext
+   private EntityManager em;
+   
+   @In(create=true)
+   private transient FacesMessages facesMessages;
+   
+   private String verify;
+   
+   public String register()
+   {
+      if ( user.getPassword().equals(verify) )
+      {
+         List existing = em.createQuery("select username from User " + 
+                                        "where username=:username")
+            .setParameter("username", user.getUsername())
+            .getResultList();
+         if (existing.size()==0)
+         {
+            em.persist(user);
+            return "login";
+         }
+         else
+         {
+            facesMessages.add("username #{user.username} already exists");
+            return null;
+         }
+      }
+      else 
+      {
+         facesMessages.add("re-enter your password");
+         verify=null;
+         return null;
+      }
+   }
+
+   public String getVerify()
+   {
+      return verify;
+   }
+
+   public void setVerify(String verify)
+   {
+      this.verify = verify;
+   }
+   
+   @Destroy @Remove
+   public void destroy() {}
+}</code>
+
+    <p>
+       The <code>@In</code> annotations inject Seam components into the <code>RegisterAction</code>
+       bean. The <code>user</code> component is our entity bean, of course. The <code>facesMessages</code> 
+       component is a built-in Seam component that makes it very easy to display templated and localized
+       messages to the user, even when redirect after post is used.
+    </p>
+
+       <form>
+          <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+
+  </div>
+</div>
+
+</body>
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,92 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>In-depth Explanation</title>
-	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-
-<div id="main">
-  <div class="trail">
-    <div class="numbox">6</div>
-    <h2>The Workspace List</h2>
-    <img src="../img/header_line.gif" />
-    
-    <p>
-       <center>
-       <form>
-          <INPUT type="button" value="Close Window" onclick="window.close()">
-       </form>
-       </center>
-    </p>
-
-    <p>
-       The workspace list allows the user to switch between multiple
-       conversations from the same browser tab. There is no Java code
-       to write, just the following JSF code to include:
-    </p>
-
-<code class="block">
-&lt;h:dataTable value="#{conversationList}" var="entry"&gt;
-  &lt;h:column&gt;
-    &lt;h:commandLink action="#{entry.select}" value="#{entry.description}"/&gt;
-    &nbsp;
-    &lt;h:outputText value="[current]" rendered="#{entry.current}"/&gt;
-  &lt;/h:column&gt;
-  &lt;h:column&gt;
-    &lt;h:outputText value="#{entry.startDatetime}"&gt;
-      &lt;f:convertDateTime type="time" pattern="hh:mm"/&gt;
-    &lt;/h:outputText&gt;
-    -
-    &lt;h:outputText value="#{entry.lastDatetime}"&gt;
-      &lt;f:convertDateTime type="time" pattern="hh:mm"/&gt;
-    &lt;/h:outputText&gt;
-  &lt;/h:column&gt;
-&lt;/h:dataTable&gt;
-</code>
-
-    <p>
-       We do need to specify what text will be displayed by <code>#{entry.description}</code>. 
-       We do this by setting the <code>description</code> value for each page in <code>pages.xml</code>.
-    </p>
-
-<code class="block">
-&lt;pages&gt;
-   &lt;!-- ... --&gt;
-   &lt;page view-id="/hotel.xhtml" 
-         conversation-required="true" 
-	 login-required="true"&gt;
-          
-       &lt;description&gt;View hotel: #{hotel.name}&lt;/description&gt;
-       &lt;!-- ... --&gt;
-    &lt;/page&gt;
-
-    &lt;page view-id="/book.xhtml" 
-             conversation-required="true" 
-	     login-required="true"&gt;
-      
-        &lt;description&gt;Book hotel: #{hotel.name}&lt;/description&gt;
-        &lt;!-- ... --&gt;
-    &lt;/page&gt;
-&lt;pages&gt;
-</code>
-
-    <p>
-       Note that you don't need the <code>pages.xml</code> file if you don't want the
-       workspace list in your application.
-    </p>
-
-    <p>
-       <form>
-      <input type="button" value="Close Window" onclick="window.close()"/>
-       </form>
-    </p>
-
-  </div>
-</div>
-
-</body>
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,92 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>In-depth Explanation</title>
+	<link href="../css/trailblazer_main.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+  <div class="trail">
+    <div class="numbox">6</div>
+    <h2>The Workspace List</h2>
+    <img src="../img/header_line.gif" />
+    
+    <p>
+       <center>
+       <form>
+          <INPUT type="button" value="Close Window" onclick="window.close()">
+       </form>
+       </center>
+    </p>
+
+    <p>
+       The workspace list allows the user to switch between multiple
+       conversations from the same browser tab. There is no Java code
+       to write, just the following JSF code to include:
+    </p>
+
+<code class="block">
+&lt;h:dataTable value="#{conversationList}" var="entry"&gt;
+  &lt;h:column&gt;
+    &lt;h:commandLink action="#{entry.select}" value="#{entry.description}"/&gt;
+    &nbsp;
+    &lt;h:outputText value="[current]" rendered="#{entry.current}"/&gt;
+  &lt;/h:column&gt;
+  &lt;h:column&gt;
+    &lt;h:outputText value="#{entry.startDatetime}"&gt;
+      &lt;f:convertDateTime type="time" pattern="hh:mm"/&gt;
+    &lt;/h:outputText&gt;
+    -
+    &lt;h:outputText value="#{entry.lastDatetime}"&gt;
+      &lt;f:convertDateTime type="time" pattern="hh:mm"/&gt;
+    &lt;/h:outputText&gt;
+  &lt;/h:column&gt;
+&lt;/h:dataTable&gt;
+</code>
+
+    <p>
+       We do need to specify what text will be displayed by <code>#{entry.description}</code>. 
+       We do this by setting the <code>description</code> value for each page in <code>pages.xml</code>.
+    </p>
+
+<code class="block">
+&lt;pages&gt;
+   &lt;!-- ... --&gt;
+   &lt;page view-id="/hotel.xhtml" 
+         conversation-required="true" 
+	 login-required="true"&gt;
+          
+       &lt;description&gt;View hotel: #{hotel.name}&lt;/description&gt;
+       &lt;!-- ... --&gt;
+    &lt;/page&gt;
+
+    &lt;page view-id="/book.xhtml" 
+             conversation-required="true" 
+	     login-required="true"&gt;
+      
+        &lt;description&gt;Book hotel: #{hotel.name}&lt;/description&gt;
+        &lt;!-- ... --&gt;
+    &lt;/page&gt;
+&lt;pages&gt;
+</code>
+
+    <p>
+       Note that you don't need the <code>pages.xml</code> file if you don't want the
+       workspace list in your application.
+    </p>
+
+    <p>
+       <form>
+      <input type="button" value="Close Window" onclick="window.close()"/>
+       </form>
+    </p>
+
+  </div>
+</div>
+
+</body>
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,64 +0,0 @@
-<f:view xmlns="http://www.w3.org/1999/xhtml"
-	  xmlns:ui="http://java.sun.com/jsf/facelets"
-	  xmlns:h="http://java.sun.com/jsf/html"
-	  xmlns:f="http://java.sun.com/jsf/core"
-      xmlns:s="http://jboss.com/products/seam/taglib">
-<div id="document">
-	<div id="header">
-		<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
-	</div>
-	<div id="container">
-		<div id="sidebar">
-            <h:form id="login">
-			<fieldset>
-				<div>
-					<h:outputLabel for="username">Login Name</h:outputLabel>
-					<h:inputText id="username" value="#{identity.username}" style="width: 175px;"/>
-					<div class="errors"><h:message for="username"/></div>
-				</div>
-				<div>
-					<h:outputLabel for="password">Password</h:outputLabel>
-					<h:inputSecret id="password" value="#{identity.password}" style="width: 175px;"/>
-				</div>
-				<div class="errors"><h:messages globalOnly="true"/></div>
-				<div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
-				<div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
-			</fieldset>
-            </h:form>
-		</div>
-		<div id="content">
-			<div class="section">
-				
-			    <h1>About this example application</h1>
-			    
-			    <p>
-			       This sample application demonstrates how easy it is to develop stateful web 
-			       applications using JBoss Seam. Just register, login, and book a room to see 
-			       Seam in action. Throughout the application you'll see popup links like 
-			       the ones at the bottom of this page. Click them to see how the application 
-			       works under the hood.
-                </p>
-			    
-			    <p>
-			       Note: Please do NOT enter personal information or your credit card number in 
-			       this sample application.
-			    </p>
-			    
-			    <p>
-			       <a href="#" onclick="window.open('exp/introExp.html','exp','width=752,height=500,scrollbars=yes');">
-			          What is JBoss Seam?
-			       </a>
-                </p>
-			    
-			    <p>
-			       <a href="#" onclick="window.open('exp/loginExp.html','exp','width=752,height=500,scrollbars=yes');">
-			          What happens when I login?
-			       </a>
-                </p>
-								
-			</div>
-		</div>
-	</div>
-	<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
-</div>
-</f:view>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,64 @@
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+	  xmlns:ui="http://java.sun.com/jsf/facelets"
+	  xmlns:h="http://java.sun.com/jsf/html"
+	  xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:s="http://jboss.com/products/seam/taglib">
+<div id="document">
+	<div id="header">
+		<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+	</div>
+	<div id="container">
+		<div id="sidebar">
+            <h:form id="login">
+			<fieldset>
+				<div>
+					<h:outputLabel for="username">Login Name</h:outputLabel>
+					<h:inputText id="username" value="#{identity.username}" style="width: 175px;"/>
+					<div class="errors"><h:message for="username"/></div>
+				</div>
+				<div>
+					<h:outputLabel for="password">Password</h:outputLabel>
+					<h:inputSecret id="password" value="#{identity.password}" style="width: 175px;"/>
+				</div>
+				<div class="errors"><h:messages globalOnly="true"/></div>
+				<div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
+				<div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
+			</fieldset>
+            </h:form>
+		</div>
+		<div id="content">
+			<div class="section">
+				
+			    <h1>About this example application</h1>
+			    
+			    <p>
+			       This sample application demonstrates how easy it is to develop stateful web 
+			       applications using JBoss Seam. Just register, login, and book a room to see 
+			       Seam in action. Throughout the application you'll see popup links like 
+			       the ones at the bottom of this page. Click them to see how the application 
+			       works under the hood.
+                </p>
+			    
+			    <p>
+			       Note: Please do NOT enter personal information or your credit card number in 
+			       this sample application.
+			    </p>
+			    
+			    <p>
+			       <a href="#" onclick="window.open('exp/introExp.html','exp','width=752,height=500,scrollbars=yes');">
+			          What is JBoss Seam?
+			       </a>
+                </p>
+			    
+			    <p>
+			       <a href="#" onclick="window.open('exp/loginExp.html','exp','width=752,height=500,scrollbars=yes');">
+			          What happens when I login?
+			       </a>
+                </p>
+								
+			</div>
+		</div>
+	</div>
+	<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
+</div>
+</f:view>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,57 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-	    		xmlns:ui="http://java.sun.com/jsf/facelets"
-	  			xmlns:h="http://java.sun.com/jsf/html"
-	  			xmlns:f="http://java.sun.com/jsf/core"
-	  			xmlns:a="http://richfaces.org/a4j"
-                xmlns:s="http://jboss.com/products/seam/taglib"
-				template="template.xhtml">
-
-<!-- content -->
-<ui:define name="content">
-
-<div class="section">
-	<h1>View Hotel</h1>
-</div>
-
-<div class="section">
-	<ui:include src="hotelview.xhtml"/>
-
-	<div class="buttonBox">
-		<h:form id="hotel">
-			<a:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/>
-			&#160;
-			<a:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
-		</h:form>
-	</div>
-			
-
-</div>
-
-</ui:define>
-
-<!-- sidebar -->
-<ui:define name="sidebar">
-
-<h1>Don't kill your database</h1>
-<p>
-    Keeping conversational state in memory in the middle tier is a great way to
-    improve your application's scalability. It saves hitting the database every
-    time we refresh a page, to re-read the data we were just looking at five 
-    seconds ago. By using Seam's conversation context, we get a natural cache 
-    of data associated with the what the user is currently doing. By nature, 
-    this cache has a more efficient eviction policy than the MRU-type algorithms 
-    used by a typical second-level data cache in an O/R mapping engine like
-    Hibernate (at least for some kinds of data). Of course, you should use 
-    a clever combination of second-level caching and conversational data
-    caching to achieve the best performance for your application.
-</p>
-<p>
-   <a href="#" onclick="window.open('exp/bookingExp.html','exp','width=752,height=500,scrollbars=yes');">
-      How does the hotel booking wizard work?
-   </a>
-</p>
-
-</ui:define>
-
-</ui:composition>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotel.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,57 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	    		xmlns:ui="http://java.sun.com/jsf/facelets"
+	  			xmlns:h="http://java.sun.com/jsf/html"
+	  			xmlns:f="http://java.sun.com/jsf/core"
+	  			xmlns:a="http://richfaces.org/a4j"
+                xmlns:s="http://jboss.com/products/seam/taglib"
+				template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+	<h1>View Hotel</h1>
+</div>
+
+<div class="section">
+	<ui:include src="hotelview.xhtml"/>
+
+	<div class="buttonBox">
+		<h:form id="hotel">
+			<a:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/>
+			&#160;
+			<a:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
+		</h:form>
+	</div>
+			
+
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>Don't kill your database</h1>
+<p>
+    Keeping conversational state in memory in the middle tier is a great way to
+    improve your application's scalability. It saves hitting the database every
+    time we refresh a page, to re-read the data we were just looking at five 
+    seconds ago. By using Seam's conversation context, we get a natural cache 
+    of data associated with the what the user is currently doing. By nature, 
+    this cache has a more efficient eviction policy than the MRU-type algorithms 
+    used by a typical second-level data cache in an O/R mapping engine like
+    Hibernate (at least for some kinds of data). Of course, you should use 
+    a clever combination of second-level caching and conversational data
+    caching to achieve the best performance for your application.
+</p>
+<p>
+   <a href="#" onclick="window.open('exp/bookingExp.html','exp','width=752,height=500,scrollbars=yes');">
+      How does the hotel booking wizard work?
+   </a>
+</p>
+
+</ui:define>
+
+</ui:composition>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,45 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-	    		 xmlns:ui="http://java.sun.com/jsf/facelets"
-	  			 xmlns:h="http://java.sun.com/jsf/html"
-	  			 xmlns:f="http://java.sun.com/jsf/core"
-                 xmlns:s="http://jboss.com/products/seam/taglib">
-    
-    <s:decorate template="display.xhtml">             
-		<ui:define name="label">Name:</ui:define>
-		#{hotel.name}
-	</s:decorate>
-	
-    <s:decorate template="display.xhtml">             
-		<ui:define name="label">Address:</ui:define>
-		#{hotel.address}
-	</s:decorate>
-	
-    <s:decorate template="display.xhtml">             
-		<ui:define name="label">City:</ui:define>
-		#{hotel.city}
-	</s:decorate>
-	
-    <s:decorate template="display.xhtml">             
-		<ui:define name="label">State:</ui:define>
-		#{hotel.state}
-	</s:decorate>
-	
-    <s:decorate template="display.xhtml">             
-		<ui:define name="label">Zip:</ui:define>
-		#{hotel.zip}
-	</s:decorate>
-	
-    <s:decorate template="display.xhtml">             
-		<ui:define name="label">Country:</ui:define>
-		#{hotel.country}
-	</s:decorate>
-	
-    <s:decorate template="display.xhtml">             
-		<ui:define name="label">Nightly rate:</ui:define>
-		<h:outputText value="#{hotel.name}">
-			<f:convertNumber type="currency" currencySymbol="$"/>
-		</h:outputText>
-	</s:decorate>
-	  
-</ui:composition>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/hotelview.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,45 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	    		 xmlns:ui="http://java.sun.com/jsf/facelets"
+	  			 xmlns:h="http://java.sun.com/jsf/html"
+	  			 xmlns:f="http://java.sun.com/jsf/core"
+                 xmlns:s="http://jboss.com/products/seam/taglib">
+    
+    <s:decorate template="display.xhtml">             
+		<ui:define name="label">Name:</ui:define>
+		#{hotel.name}
+	</s:decorate>
+	
+    <s:decorate template="display.xhtml">             
+		<ui:define name="label">Address:</ui:define>
+		#{hotel.address}
+	</s:decorate>
+	
+    <s:decorate template="display.xhtml">             
+		<ui:define name="label">City:</ui:define>
+		#{hotel.city}
+	</s:decorate>
+	
+    <s:decorate template="display.xhtml">             
+		<ui:define name="label">State:</ui:define>
+		#{hotel.state}
+	</s:decorate>
+	
+    <s:decorate template="display.xhtml">             
+		<ui:define name="label">Zip:</ui:define>
+		#{hotel.zip}
+	</s:decorate>
+	
+    <s:decorate template="display.xhtml">             
+		<ui:define name="label">Country:</ui:define>
+		#{hotel.country}
+	</s:decorate>
+	
+    <s:decorate template="display.xhtml">             
+		<ui:define name="label">Nightly rate:</ui:define>
+		<h:outputText value="#{hotel.name}">
+			<f:convertNumber type="currency" currencySymbol="$"/>
+		</h:outputText>
+	</s:decorate>
+	  
+</ui:composition>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/bg.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/bg.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/btn.bg.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/btn.bg.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-next.png (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-next.png)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-prev.png (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cal-prev.png)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/dtpick.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/dtpick.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.title.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/hdr.title.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/header_line.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/header_line.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/input.bg.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/input.bg.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/spinner.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/spinner.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/th.bg.gif (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/img/th.bg.gif)
===================================================================
(Binary files differ)

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,5 +0,0 @@
-<html>
-<head>
-  <meta http-equiv="Refresh" content="0; URL=home.seam">
-</head>
-</html>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/index.html	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,5 @@
+<html>
+<head>
+  <meta http-equiv="Refresh" content="0; URL=home.seam">
+</head>
+</html>
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,143 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-	    		xmlns:ui="http://java.sun.com/jsf/facelets"
-	  			xmlns:h="http://java.sun.com/jsf/html"
-	  			xmlns:f="http://java.sun.com/jsf/core"
-	  			xmlns:s="http://jboss.com/products/seam/taglib"
-                xmlns:a="http://richfaces.org/a4j"
-				template="template.xhtml">
-
-<!-- content -->
-<ui:define name="content">
-
-<div class="section">
-  
-    <span class="errors">
-       <h:messages globalOnly="true"/>
-    </span>
-    
-    <h1>Search Hotels</h1>
-
-	<h:form id="searchCriteria">
-	<fieldset> 
-	   <h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
-         <a:support event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />
-       </h:inputText>
-       &#160;
-	   <a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" reRender="searchResults"/>
-       &#160;
-       <a:status>
-          <f:facet name="start">
-             <h:graphicImage value="/img/spinner.gif"/>
-          </f:facet>
-       </a:status>
-	   <br/>
-       <h:outputLabel for="pageSize">Maximum results:</h:outputLabel>&#160;
-       <h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize">
-          <f:selectItem itemLabel="5" itemValue="5"/>
-          <f:selectItem itemLabel="10" itemValue="10"/>
-          <f:selectItem itemLabel="20" itemValue="20"/>
-       </h:selectOneMenu>
-    </fieldset>
-    </h:form>
-    
-</div>
-<h:form id="hotels">
-<a:outputPanel id="searchResults">
-  <div class="section">
-	<h:outputText value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
-	<h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
-		<h:column>
-			<f:facet name="header">Name</f:facet>
-			#{hot.name}
-		</h:column>
-		<h:column>
-			<f:facet name="header">Address</f:facet>
-			#{hot.address}
-		</h:column>
-		<h:column>
-			<f:facet name="header">City, State</f:facet>
-			#{hot.city}, #{hot.state}, #{hot.country}
-		</h:column> 
-		<h:column>
-			<f:facet name="header">Zip</f:facet>
-			#{hot.zip}
-		</h:column>
-		<h:column>
-			<f:facet name="header">AJAX Action</f:facet>
-			<a:commandLink id="viewHotelAJAX" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
-		</h:column><!--
-		<h:column>
-			<f:facet name="header">Action</f:facet>
-			<s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
-		</h:column>
-	--></h:dataTable>
-	<a:commandLink value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}" reRender="searchResults"/>
-  </div>
-</a:outputPanel>
-</h:form>
-<div class="section">
-	<h1>Current Hotel Bookings</h1>
-</div>
-<div class="section">
-  <h:form id="bookings">
-	<h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
-	<h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
-		<h:column>
-			<f:facet name="header">Name</f:facet>
-			#{book.hotel.name}
-		</h:column>
-		<h:column>
-			<f:facet name="header">Address</f:facet>
-			#{book.hotel.address}
-		</h:column>
-		<h:column>
-			<f:facet name="header">City, State</f:facet>
-			#{book.hotel.city}, #{book.hotel.state}
-		</h:column>
-        <h:column>
-            <f:facet name="header">Check in date</f:facet>
-            <h:outputText value="#{book.checkinDate}"/>
-        </h:column>
-        <h:column>
-            <f:facet name="header">Check out date</f:facet>
-            <h:outputText value="#{book.checkoutDate}"/>
-        </h:column>
-		<h:column>
-			<f:facet name="header">Confirmation number</f:facet>
-			#{book.id}
-		</h:column>
-		<h:column>
-			<f:facet name="header">Action</f:facet>
-			<h:commandLink id="cancel" value="Cancel" action="#{bookingList.cancel}"/>
-		</h:column>
-	</h:dataTable>
-  </h:form>
-</div>
-
-</ui:define>
-
-<!-- sidebar -->
-<ui:define name="sidebar">
-
-<h1>State management in Seam</h1>
-<p>
-   State in Seam is <em>contextual</em>. When you click "Find Hotels", the application
-   retrieves a list of hotels from the database and caches it in the session context. When you
-   navigate to one of the hotel records by clicking the "View Hotel" link, a <em>conversation</em> 
-   begins. The conversation is attached to a particular tab, in a particular browser window. You can
-   navigate to multiple hotels using "open in new tab" or "open in new window" in your web browser.
-   Each window will execute in the context of a different conversation. The application keeps state
-   associated with your hotel booking in the conversation context, which ensures that the concurrent
-   conversations do not interfere with each other.
-</p>
-
-<p>
-   <a href="#" onclick="window.open('exp/mainExp.html','exp','width=752,height=500,scrollbars=yes');">
-      How does the search page work?
-   </a>
-</p>
-
-</ui:define>
-
-</ui:composition>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,143 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	    		xmlns:ui="http://java.sun.com/jsf/facelets"
+	  			xmlns:h="http://java.sun.com/jsf/html"
+	  			xmlns:f="http://java.sun.com/jsf/core"
+	  			xmlns:s="http://jboss.com/products/seam/taglib"
+                xmlns:a="http://richfaces.org/a4j"
+				template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+  
+    <span class="errors">
+       <h:messages globalOnly="true"/>
+    </span>
+    
+    <h1>Search Hotels</h1>
+
+	<h:form id="searchCriteria">
+	<fieldset> 
+	   <h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
+         <a:support event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />
+       </h:inputText>
+       &#160;
+	   <a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" reRender="searchResults"/>
+       &#160;
+       <a:status>
+          <f:facet name="start">
+             <h:graphicImage value="/img/spinner.gif"/>
+          </f:facet>
+       </a:status>
+	   <br/>
+       <h:outputLabel for="pageSize">Maximum results:</h:outputLabel>&#160;
+       <h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize">
+          <f:selectItem itemLabel="5" itemValue="5"/>
+          <f:selectItem itemLabel="10" itemValue="10"/>
+          <f:selectItem itemLabel="20" itemValue="20"/>
+       </h:selectOneMenu>
+    </fieldset>
+    </h:form>
+    
+</div>
+<h:form id="hotels">
+<a:outputPanel id="searchResults">
+  <div class="section">
+	<h:outputText value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
+	<h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
+		<h:column>
+			<f:facet name="header">Name</f:facet>
+			#{hot.name}
+		</h:column>
+		<h:column>
+			<f:facet name="header">Address</f:facet>
+			#{hot.address}
+		</h:column>
+		<h:column>
+			<f:facet name="header">City, State</f:facet>
+			#{hot.city}, #{hot.state}, #{hot.country}
+		</h:column> 
+		<h:column>
+			<f:facet name="header">Zip</f:facet>
+			#{hot.zip}
+		</h:column>
+		<h:column>
+			<f:facet name="header">AJAX Action</f:facet>
+			<a:commandLink id="viewHotelAJAX" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+		</h:column><!--
+		<h:column>
+			<f:facet name="header">Action</f:facet>
+			<s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+		</h:column>
+	--></h:dataTable>
+	<a:commandLink value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}" reRender="searchResults"/>
+  </div>
+</a:outputPanel>
+</h:form>
+<div class="section">
+	<h1>Current Hotel Bookings</h1>
+</div>
+<div class="section">
+  <h:form id="bookings">
+	<h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
+	<h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
+		<h:column>
+			<f:facet name="header">Name</f:facet>
+			#{book.hotel.name}
+		</h:column>
+		<h:column>
+			<f:facet name="header">Address</f:facet>
+			#{book.hotel.address}
+		</h:column>
+		<h:column>
+			<f:facet name="header">City, State</f:facet>
+			#{book.hotel.city}, #{book.hotel.state}
+		</h:column>
+        <h:column>
+            <f:facet name="header">Check in date</f:facet>
+            <h:outputText value="#{book.checkinDate}"/>
+        </h:column>
+        <h:column>
+            <f:facet name="header">Check out date</f:facet>
+            <h:outputText value="#{book.checkoutDate}"/>
+        </h:column>
+		<h:column>
+			<f:facet name="header">Confirmation number</f:facet>
+			#{book.id}
+		</h:column>
+		<h:column>
+			<f:facet name="header">Action</f:facet>
+			<h:commandLink id="cancel" value="Cancel" action="#{bookingList.cancel}"/>
+		</h:column>
+	</h:dataTable>
+  </h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>State management in Seam</h1>
+<p>
+   State in Seam is <em>contextual</em>. When you click "Find Hotels", the application
+   retrieves a list of hotels from the database and caches it in the session context. When you
+   navigate to one of the hotel records by clicking the "View Hotel" link, a <em>conversation</em> 
+   begins. The conversation is attached to a particular tab, in a particular browser window. You can
+   navigate to multiple hotels using "open in new tab" or "open in new window" in your web browser.
+   Each window will execute in the context of a different conversation. The application keeps state
+   associated with your hotel booking in the conversation context, which ensures that the concurrent
+   conversations do not interfere with each other.
+</p>
+
+<p>
+   <a href="#" onclick="window.open('exp/mainExp.html','exp','width=752,height=500,scrollbars=yes');">
+      How does the search page work?
+   </a>
+</p>
+
+</ui:define>
+
+</ui:composition>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,64 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-	    		xmlns:ui="http://java.sun.com/jsf/facelets"
-	  			xmlns:h="http://java.sun.com/jsf/html"
-	  			xmlns:f="http://java.sun.com/jsf/core"
-	  			xmlns:s="http://jboss.com/products/seam/taglib"
-				template="template.xhtml">
-
-<!-- content -->
-<ui:define name="content">
-
-<div class="section">
-	<h1>Change Your Password</h1>
-</div>
-
-<div class="section">
-
-	<div class="entry errors">
-		<h:messages globalOnly="true"/>
-	</div>
-			
-	<h:form id="setpassword">
-	
-		<fieldset>
-		
-			<s:decorate template="edit.xhtml">
-				<ui:define name="label">Password:</ui:define>
-				<h:inputSecret id="password" value="#{user.password}" required="true"/>
-			</s:decorate>
-			
-			<s:decorate template="edit.xhtml">
-				<ui:define name="label">Verify:</ui:define>
-				<h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
-			</s:decorate>
-			
-			<div class="buttonBox">
-				<h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/>
-				&#160;
-				<s:button id="cancel" value="Cancel" view="/main.xhtml"/>
-			</div>
-			
-		</fieldset>
-		
-	</h:form>
-</div>
-
-</ui:define>
-
-<!-- sidebar -->
-<ui:define name="sidebar">
-<h1>Simple things should be easy</h1>
-<p>
-    (And so should some complex things.) You shouldn't have to write four different classes
-    just to change a password. Traditional J2EE architectures require that developers spend
-    more time writing code to make the frameworks happy, than they ever get to spend writing
-    code to make the user happy. Seam lets you reduce the size of your code dramatically.
-    And that reduces bugs. And it makes refactoring easier. And it makes delivering new 
-    functionality quicker. Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM, you 
-    don't need to sacrifice the ability to handle complex problems just to achieve great
-    productivity.
-</p>
-</ui:define>
-
-</ui:composition>
\ No newline at end of file

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/password.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,64 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+	    		xmlns:ui="http://java.sun.com/jsf/facelets"
+	  			xmlns:h="http://java.sun.com/jsf/html"
+	  			xmlns:f="http://java.sun.com/jsf/core"
+	  			xmlns:s="http://jboss.com/products/seam/taglib"
+				template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+	<h1>Change Your Password</h1>
+</div>
+
+<div class="section">
+
+	<div class="entry errors">
+		<h:messages globalOnly="true"/>
+	</div>
+			
+	<h:form id="setpassword">
+	
+		<fieldset>
+		
+			<s:decorate template="edit.xhtml">
+				<ui:define name="label">Password:</ui:define>
+				<h:inputSecret id="password" value="#{user.password}" required="true"/>
+			</s:decorate>
+			
+			<s:decorate template="edit.xhtml">
+				<ui:define name="label">Verify:</ui:define>
+				<h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
+			</s:decorate>
+			
+			<div class="buttonBox">
+				<h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/>
+				&#160;
+				<s:button id="cancel" value="Cancel" view="/main.xhtml"/>
+			</div>
+			
+		</fieldset>
+		
+	</h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+<h1>Simple things should be easy</h1>
+<p>
+    (And so should some complex things.) You shouldn't have to write four different classes
+    just to change a password. Traditional J2EE architectures require that developers spend
+    more time writing code to make the frameworks happy, than they ever get to spend writing
+    code to make the user happy. Seam lets you reduce the size of your code dramatically.
+    And that reduces bugs. And it makes refactoring easier. And it makes delivering new 
+    functionality quicker. Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM, you 
+    don't need to sacrifice the ability to handle complex problems just to achieve great
+    productivity.
+</p>
+</ui:define>
+
+</ui:composition>
\ No newline at end of file

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,102 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-	  xmlns:ui="http://java.sun.com/jsf/facelets"
-	  xmlns:h="http://java.sun.com/jsf/html"
-	  xmlns:f="http://java.sun.com/jsf/core"
-	  xmlns:s="http://jboss.com/products/seam/taglib"
-      xmlns:a="http://richfaces.org/a4j">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-	<title>JBoss Suites: Seam Framework</title>
-	<link href="css/screen.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body id="pgHome">
-
-<div id="document">
-
-	<div id="header">
-		<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
-	</div>
-	
-	<div id="container">
-	
-		<div id="sidebar">		    
-			<h1>Integrated multi-layer validation</h1>
-			<p>
-			    Robust applications need data validation in several different places. Seam integrates Hibernate Validator,
-			    a set of annotations for expressing data model constraints in your domain model classes. Then, these 
-			    constraints are applied almost completely transparently at three levels of the application: by Seam when 
-			    the user first enters data, by EJB before persisting data to the database, and, if you use Hibernate to 
-			    generate your database schema, by the database constraints themselves. Multi-layer validation hardens
-			    your application and protects your data. Even better, it's self-documenting, and easy to change when
-			    your business rules change.
-			</p>
-			<p>
-			   <a href="#" onclick="window.open('exp/registerExp.html','exp','width=752,height=500,scrollbars=yes');">
-			      What happens when I register?
-			   </a>
-			</p>
-		</div>
-		
-		<div id="content">
-		
-			<div class="section">
-				<h1>Register</h1>
-			</div>
-			
-			<div class="section">
-                
-				<div class="entry errors">
-					<h:messages globalOnly="true"/>
-				</div>
-
-                <h:form id="registration">
-				<fieldset>
-				
-					<s:decorate id="usernameDecorate" template="edit.xhtml">
-						<ui:define name="label">Username:</ui:define>
-						<h:inputText id="username" value="#{user.username}" required="true">
-							<a:support event="onblur" reRender="usernameDecorate"/>
-						</h:inputText>
-					</s:decorate>
-					
-					<s:decorate id="nameDecorate" template="edit.xhtml">
-						<ui:define name="label">Real Name:</ui:define>
-						<h:inputText id="name" value="#{user.name}" required="true">
-							<a:support event="onblur" reRender="nameDecorate"/>
-						</h:inputText>
-					</s:decorate>
-					
-					<s:decorate id="passwordDecorate" template="edit.xhtml">
-						<ui:define name="label">Password:</ui:define>
-						<h:inputSecret id="password" value="#{user.password}" required="true"/>
-					</s:decorate>
-					
-					<s:decorate id="verifyDecorate" template="edit.xhtml">
-						<ui:define name="label">Verify Password:</ui:define>
-						<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
-					</s:decorate>
-					
-					<div class="buttonBox">
-						<h:commandButton id="register" value="Register" action="#{register.register}"/>
-						&#160;
-						<s:button id="cancel" value="Cancel" view="/home.xhtml"/>
-					</div>
-									
-				</fieldset>
-                </h:form>
-                
-			</div>
-			
-		</div>
-		
-	</div>
-	
-	<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
-	
-</div>
-
-</body>
-
-</html>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/register.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,102 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	  xmlns:ui="http://java.sun.com/jsf/facelets"
+	  xmlns:h="http://java.sun.com/jsf/html"
+	  xmlns:f="http://java.sun.com/jsf/core"
+	  xmlns:s="http://jboss.com/products/seam/taglib"
+      xmlns:a="http://richfaces.org/a4j">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>JBoss Suites: Seam Framework</title>
+	<link href="css/screen.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body id="pgHome">
+
+<div id="document">
+
+	<div id="header">
+		<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+	</div>
+	
+	<div id="container">
+	
+		<div id="sidebar">		    
+			<h1>Integrated multi-layer validation</h1>
+			<p>
+			    Robust applications need data validation in several different places. Seam integrates Hibernate Validator,
+			    a set of annotations for expressing data model constraints in your domain model classes. Then, these 
+			    constraints are applied almost completely transparently at three levels of the application: by Seam when 
+			    the user first enters data, by EJB before persisting data to the database, and, if you use Hibernate to 
+			    generate your database schema, by the database constraints themselves. Multi-layer validation hardens
+			    your application and protects your data. Even better, it's self-documenting, and easy to change when
+			    your business rules change.
+			</p>
+			<p>
+			   <a href="#" onclick="window.open('exp/registerExp.html','exp','width=752,height=500,scrollbars=yes');">
+			      What happens when I register?
+			   </a>
+			</p>
+		</div>
+		
+		<div id="content">
+		
+			<div class="section">
+				<h1>Register</h1>
+			</div>
+			
+			<div class="section">
+                
+				<div class="entry errors">
+					<h:messages globalOnly="true"/>
+				</div>
+
+                <h:form id="registration">
+				<fieldset>
+				
+					<s:decorate id="usernameDecorate" template="edit.xhtml">
+						<ui:define name="label">Username:</ui:define>
+						<h:inputText id="username" value="#{user.username}" required="true">
+							<a:support event="onblur" reRender="usernameDecorate"/>
+						</h:inputText>
+					</s:decorate>
+					
+					<s:decorate id="nameDecorate" template="edit.xhtml">
+						<ui:define name="label">Real Name:</ui:define>
+						<h:inputText id="name" value="#{user.name}" required="true">
+							<a:support event="onblur" reRender="nameDecorate"/>
+						</h:inputText>
+					</s:decorate>
+					
+					<s:decorate id="passwordDecorate" template="edit.xhtml">
+						<ui:define name="label">Password:</ui:define>
+						<h:inputSecret id="password" value="#{user.password}" required="true"/>
+					</s:decorate>
+					
+					<s:decorate id="verifyDecorate" template="edit.xhtml">
+						<ui:define name="label">Verify Password:</ui:define>
+						<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
+					</s:decorate>
+					
+					<div class="buttonBox">
+						<h:commandButton id="register" value="Register" action="#{register.register}"/>
+						&#160;
+						<s:button id="cancel" value="Cancel" view="/home.xhtml"/>
+					</div>
+									
+				</fieldset>
+                </h:form>
+                
+			</div>
+			
+		</div>
+		
+	</div>
+	
+	<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
+	
+</div>
+
+</body>
+
+</html>

Deleted: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml	2008-01-24 01:29:35 UTC (rev 5574)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -1,31 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<f:view xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:ui="http://java.sun.com/jsf/facelets"
-	  xmlns:f="http://java.sun.com/jsf/core"
-      xmlns:h="http://java.sun.com/jsf/html"
-      xmlns:a="http://richfaces.org/a4j"
-      xmlns:s="http://jboss.com/products/seam/taglib">
-
-<div id="document">
-	<div id="header">
-		<div id="title"><h:graphicImage value="/img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
-		<div id="status">
-            Welcome #{user.name}
-            | <s:link id="search" view="/main.xhtml" value="Search" propagation="none"/>
-            | <s:link id="settings" view="/password.xhtml" value="Settings" propagation="none"/>
-            | <s:link id="logout" action="#{identity.logout}" value="Logout"/>
-		</div>
-	</div>
-	<div id="container">
-		<div id="sidebar">
-			<ui:insert name="sidebar"/>
-		</div>
-		<div id="content">
-			<ui:insert name="content"/>
-		    <ui:include src="conversations.xhtml" />
-		</div>
-	</div>
-	<div id="footer">Created with JBoss Seam 2.0, JBoss EJB 3.0, JSF 1.2, Hibernate 3 and Facelets</div>
-	<a:log hotkey="M" rendered="#{!ajaxContext.ajaxRequest}" />
-</div>
-</f:view>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml)
===================================================================
--- branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml	                        (rev 0)
+++ branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/template.xhtml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+	  xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:a="http://richfaces.org/a4j"
+      xmlns:s="http://jboss.com/products/seam/taglib">
+
+<div id="document">
+	<div id="header">
+		<div id="title"><h:graphicImage value="/img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+		<div id="status">
+            Welcome #{user.name}
+            | <s:link id="search" view="/main.xhtml" value="Search" propagation="none"/>
+            | <s:link id="settings" view="/password.xhtml" value="Settings" propagation="none"/>
+            | <s:link id="logout" action="#{identity.logout}" value="Logout"/>
+		</div>
+	</div>
+	<div id="container">
+		<div id="sidebar">
+			<ui:insert name="sidebar"/>
+		</div>
+		<div id="content">
+			<ui:insert name="content"/>
+		    <ui:include src="conversations.xhtml" />
+		</div>
+	</div>
+	<div id="footer">Created with JBoss Seam 2.0, JBoss EJB 3.0, JSF 1.2, Hibernate 3 and Facelets</div>
+	<a:log hotkey="M" rendered="#{!ajaxContext.ajaxRequest}" />
+</div>
+</f:view>

Copied: branches/3.1.x/samples/seamPortletEar/seamBookingPortlet/src/test (from rev 5574, trunk/samples/seamPortletEar/seamBookingPortlet/src/test)

Modified: branches/3.1.x/samples/tooltip-sample/pom.xml
===================================================================
--- branches/3.1.x/samples/tooltip-sample/pom.xml	2008-01-24 01:32:41 UTC (rev 5575)
+++ branches/3.1.x/samples/tooltip-sample/pom.xml	2008-01-24 02:04:36 UTC (rev 5576)
@@ -20,7 +20,7 @@
 		<dependency>
 			<groupId>org.richfaces.ui</groupId>
 			<artifactId>componentControl</artifactId>
-			<version>3.2.0-SNAPSHOT</version>
+			<version>3.1.4-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>org.richfaces.samples</groupId>




More information about the richfaces-svn-commits mailing list