[seam-commits] Seam SVN: r8991 - trunk/examples/nestedbooking/src/org/jboss/seam/example/booking.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sun Sep 14 13:16:48 EDT 2008


Author: jacob.orshalick
Date: 2008-09-14 13:16:48 -0400 (Sun, 14 Sep 2008)
New Revision: 8991

Modified:
   trunk/examples/nestedbooking/src/org/jboss/seam/example/booking/HotelBookingAction.java
Log:
JBSEAM-1943 updated nested booking

Modified: trunk/examples/nestedbooking/src/org/jboss/seam/example/booking/HotelBookingAction.java
===================================================================
--- trunk/examples/nestedbooking/src/org/jboss/seam/example/booking/HotelBookingAction.java	2008-09-14 16:40:40 UTC (rev 8990)
+++ trunk/examples/nestedbooking/src/org/jboss/seam/example/booking/HotelBookingAction.java	2008-09-14 17:16:48 UTC (rev 8991)
@@ -8,6 +8,7 @@
 import javax.persistence.PersistenceContext;
 import org.jboss.seam.annotations.Begin;
 import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.End;
 import org.jboss.seam.annotations.In;
 import org.jboss.seam.annotations.Logger;
 import org.jboss.seam.annotations.Name;
@@ -93,6 +94,7 @@
       booking.setCheckoutDate( calendar.getTime() );
    }
    
+   @End(root=true)
    public void confirm()
    {
       // on confirmation we set the room preference in the booking.  the room preference
@@ -103,51 +105,11 @@
       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");
-
-      endRoot();
    }
    
-   public void cancel() 
-   {
-	   endRootBeforeRedirect();
-   }
+   @End(root=true, beforeRedirect=true)
+   public void cancel() {}
    
    @Destroy @Remove
    public void destroy() {}
-   
-   /**
-    * End the root conversation in case we are currently in a nested conversation.
-    * Currently this can only be done programatically, but if you are interested
-    * in this feature being supported by Seam vote on:
-    * 
-    *	http://jira.jboss.org/jira/browse/JBSEAM-1943
-    */
-   private void endRoot() 
-   {
-      Conversation conversation = Conversation.instance();
-
-      if(conversation.isNested()) {
-         conversation.root();
-      }
-
-      conversation.end();
-   }
-	
-   /**
-    * End the root conversation prior to redirect in case we are currently in a 
-    * nested conversation.  Currently this can only be done programatically, but 
-    * if you are interested in this feature being supported by Seam vote on:
-    * 
-    *	http://jira.jboss.org/jira/browse/JBSEAM-1943
-    */
-   private void endRootBeforeRedirect() 
-   {
-      Conversation conversation = Conversation.instance();
-
-      if(conversation.isNested()) {
-         conversation.root();
-      }
-
-      conversation.endBeforeRedirect();
-   }
 }




More information about the seam-commits mailing list