[seam-commits] Seam SVN: r13209 - in examples/trunk/booking-simplified/src/main: resources and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Jun 16 18:50:29 EDT 2010


Author: lincolnthree
Date: 2010-06-16 18:50:28 -0400 (Wed, 16 Jun 2010)
New Revision: 13209

Modified:
   examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java
   examples/trunk/booking-simplified/src/main/resources/messages.properties
Log:
Added prettytime on confirmation :)

Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java	2010-06-16 22:32:02 UTC (rev 13208)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java	2010-06-16 22:50:28 UTC (rev 13209)
@@ -49,6 +49,8 @@
 import org.jboss.seam.international.status.builder.BundleKey;
 import org.slf4j.Logger;
 
+import com.ocpsoft.pretty.time.PrettyTime;
+
 @Named("bookingAgent")
 @Stateful
 @ConversationScoped
@@ -86,7 +88,8 @@
    @Begin
    public void selectHotel(final Long id)
    {
-      // NOTE get a fresh reference that's managed by the extended persistence context
+      // NOTE get a fresh reference that's managed by the extended persistence
+      // context
       hotelSelection = em.find(Hotel.class, id);
       if (hotelSelection != null)
       {
@@ -133,7 +136,7 @@
       // FIXME can't inject event object into bean with passivating scope
       manager.fireEvent(new BookingEvent(booking), ConfirmedLiteral.INSTANCE);
       log.info(msg.info("New booking at the {0} confirmed for {1}").textParams(booking.getHotel().getName(), booking.getUser().getName()).build().getText());
-      messages.info(new BundleKey("messages", "booking.confirmed")).textDefault("Booking confirmed.");
+      messages.info(new BundleKey("messages", "booking.confirmed")).textDefault("Booking confirmed.").textParams(new PrettyTime().format(booking.getCheckinDate()));
    }
 
    @End

Modified: examples/trunk/booking-simplified/src/main/resources/messages.properties
===================================================================
--- examples/trunk/booking-simplified/src/main/resources/messages.properties	2010-06-16 22:32:02 UTC (rev 13208)
+++ examples/trunk/booking-simplified/src/main/resources/messages.properties	2010-06-16 22:50:28 UTC (rev 13209)
@@ -1,7 +1,7 @@
 booking.initiated=You've initiated a booking at {0}.
 booking.checkInNotFutureDate=Check in date must be a future date.
 booking.checkOutBeforeCheckIn=Check out date must be after check in date.
-booking.confirmed=You're booked!
+booking.confirmed=You're booked! Check in is {0}.
 booking.canceled=The booking at the {0} on {1,date} has been canceled.
 booking.doesNotExist=Our records indicate that the booking you selected has already been canceled.
 account.passwordChanged=Password successfully updated.



More information about the seam-commits mailing list