[seam-commits] Seam SVN: r13255 - in examples/trunk/booking-simplified/src/main: java/org/jboss/seam/examples/booking/account and 4 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Fri Jun 18 16:39:20 EDT 2010
Author: dan.j.allen
Date: 2010-06-18 16:39:19 -0400 (Fri, 18 Jun 2010)
New Revision: 13255
Added:
examples/trunk/booking-simplified/src/main/resources-jbossas/
examples/trunk/booking-simplified/src/main/resources-jbossas/booking-ds.xml
Modified:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/CurrentPasswordValidator.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/ReservationDateRangeValidator.java
examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml
examples/trunk/booking-simplified/src/main/resources/META-INF/seam-beans.xml
examples/trunk/booking-simplified/src/main/webapp/book.xhtml
examples/trunk/booking-simplified/src/main/webapp/password.xhtml
examples/trunk/booking-simplified/src/main/webapp/register.xhtml
examples/trunk/booking-simplified/src/main/webapp/search.xhtml
Log:
tweaks for JBoss AS
shorten id of validators
Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/ConfirmPasswordValidator.java 2010-06-18 20:39:19 UTC (rev 13255)
@@ -37,7 +37,7 @@
/**
* @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
*/
- at FacesValidator("confirmPasswordValidator")
+ at FacesValidator("confirmPassword")
public class ConfirmPasswordValidator implements Validator
{
@Inject
Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/CurrentPasswordValidator.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/CurrentPasswordValidator.java 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/account/CurrentPasswordValidator.java 2010-06-18 20:39:19 UTC (rev 13255)
@@ -37,7 +37,7 @@
/**
* @author Dan Allen
*/
- at FacesValidator("currentPasswordValidator")
+ at FacesValidator("currentPassword")
public class CurrentPasswordValidator implements Validator
{
@Inject
Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java 2010-06-18 20:39:19 UTC (rev 13255)
@@ -47,7 +47,9 @@
import org.slf4j.Logger;
import com.ocpsoft.pretty.time.PrettyTime;
+import java.util.Locale;
import org.jboss.seam.examples.booking.i18n.DefaultBundleKey;
+import org.jboss.seam.international.locale.UserLocale;
/**
* @author Dan Allen
@@ -74,6 +76,9 @@
private User user;
@Inject
+ private Locale locale;
+
+ @Inject
@Confirmed
private Event<Booking> bookingConfirmedEventSrc;
@@ -130,7 +135,7 @@
public void onBookingComplete(@Observes(during = TransactionPhase.AFTER_SUCCESS) @Confirmed final Booking booking)
{
log.info(messageBuilder.get().text("New booking at the {0} confirmed for {1}").textParams(booking.getHotel().getName(), booking.getUser().getName()).build().getText());
- messages.info(new DefaultBundleKey("booking.confirmed")).textDefault("You're booked to stay at the {0} {1}.").textParams(booking.getHotel().getName(), new PrettyTime().format(booking.getCheckinDate()));
+ messages.info(new DefaultBundleKey("booking.confirmed")).textDefault("You're booked to stay at the {0} {1}.").textParams(booking.getHotel().getName(), new PrettyTime(locale).format(booking.getCheckinDate()));
}
@Produces
Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/ReservationDateRangeValidator.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/ReservationDateRangeValidator.java 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/ReservationDateRangeValidator.java 2010-06-18 20:39:19 UTC (rev 13255)
@@ -45,7 +45,7 @@
*
* @author Dan Allen
*/
- at FacesValidator("reservationDateRangeValidator")
+ at FacesValidator("reservationDateRange")
public class ReservationDateRangeValidator implements Validator
{
@Inject
Modified: examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml
===================================================================
--- examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml 2010-06-18 20:39:19 UTC (rev 13255)
@@ -1,14 +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">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0">
<persistence-unit name="booking">
- <!--<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>-->
+ <!--
+ <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+ -->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <!--<jta-data-source>jdbc/__default</jta-data-source>-->
- <jta-data-source>java:/DefaultDS</jta-data-source>
- <!--<jta-data-source>jdbc/__arquillian</jta-data-source>-->
+ <jta-data-source>jdbc/__default</jta-data-source>
+ <class>org.jboss.seam.examples.booking.model.User</class>
+ <class>org.jboss.seam.examples.booking.model.Hotel</class>
+ <class>org.jboss.seam.examples.booking.model.Booking</class>
+ <exclude-unlisted-classes/>
<properties>
<!-- Properties for Hibernate (default provider for JBoss AS) -->
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
Modified: examples/trunk/booking-simplified/src/main/resources/META-INF/seam-beans.xml
===================================================================
--- examples/trunk/booking-simplified/src/main/resources/META-INF/seam-beans.xml 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/resources/META-INF/seam-beans.xml 2010-06-18 20:39:19 UTC (rev 13255)
@@ -22,15 +22,12 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:seam:core"
- xmlns:lc="urn:java:org.jboss.seam.international.locale"
+ xmlns:i18n="urn:java:org.jboss.seam.international.locale"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://docs.jboss.org/cdi/beans_1_0.xsd">
- <lc:DefaultLocaleProducer>
- <s:specializes />
- <lc:defaultLocaleKey>
- <s:value>de_DE</s:value>
- </lc:defaultLocaleKey>
- </lc:DefaultLocaleProducer>
-</beans>
\ No newline at end of file
+ <i18n:DefaultLocaleProducer defaultLocaleKey="de_DE">
+ <s:specializes />
+ </i18n:DefaultLocaleProducer>
+</beans>
Added: examples/trunk/booking-simplified/src/main/resources-jbossas/booking-ds.xml
===================================================================
--- examples/trunk/booking-simplified/src/main/resources-jbossas/booking-ds.xml (rev 0)
+++ examples/trunk/booking-simplified/src/main/resources-jbossas/booking-ds.xml 2010-06-18 20:39:19 UTC (rev 13255)
@@ -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>jdbc/__default</jndi-name>
+ <use-java-context>false</use-java-context>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ <min-pool-size>5</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ </local-tx-datasource>
+</datasources>
Modified: examples/trunk/booking-simplified/src/main/webapp/book.xhtml
===================================================================
--- examples/trunk/booking-simplified/src/main/webapp/book.xhtml 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/webapp/book.xhtml 2010-06-18 20:39:19 UTC (rev 13255)
@@ -83,7 +83,7 @@
</fieldset>
- <s:validateForm validatorId="reservationDateRangeValidator"
+ <s:validateForm validatorId="reservationDateRange"
fields="beginDate=checkInDate:input endDate=checkOutDate:input"/>
</h:form>
</div>
Modified: examples/trunk/booking-simplified/src/main/webapp/password.xhtml
===================================================================
--- examples/trunk/booking-simplified/src/main/webapp/password.xhtml 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/webapp/password.xhtml 2010-06-18 20:39:19 UTC (rev 13255)
@@ -26,7 +26,7 @@
<p:input id="current">
<h:inputSecret id="password" value="#{currentUser.password}">
- <f:validator validatorId="currentPasswordValidator"/>
+ <f:validator validatorId="currentPassword"/>
</h:inputSecret>
</p:input>
@@ -46,7 +46,7 @@
</fieldset>
- <s:validateForm validatorId="confirmPasswordValidator"
+ <s:validateForm validatorId="confirmPassword"
fields="newPassword=new:password confirmPassword=confirm:password"/>
</h:form>
</div>
Modified: examples/trunk/booking-simplified/src/main/webapp/register.xhtml
===================================================================
--- examples/trunk/booking-simplified/src/main/webapp/register.xhtml 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/webapp/register.xhtml 2010-06-18 20:39:19 UTC (rev 13255)
@@ -54,8 +54,8 @@
<p:input id="confirmPassword">
<h:inputSecret id="input" value="#{registrar.confirmPassword}" redisplay="true">
<f:ajax event="blur"
- execute="@this @form:password:input @form:passwordCheck"
- render="confirmPassword @form:password :messages"/>
+ execute="@this @form:password:input @form:passwordCheck"
+ render="confirmPassword @form:password :messages"/>
</h:inputSecret>
</p:input>
@@ -76,7 +76,7 @@
</fieldset>
- <s:validateForm id="passwordCheck" validatorId="confirmPasswordValidator"
+ <s:validateForm id="passwordCheck" validatorId="confirmPassword"
fields="newPassword=password:input confirmPassword=confirmPassword:input"/>
</h:form>
Modified: examples/trunk/booking-simplified/src/main/webapp/search.xhtml
===================================================================
--- examples/trunk/booking-simplified/src/main/webapp/search.xhtml 2010-06-18 20:34:35 UTC (rev 13254)
+++ examples/trunk/booking-simplified/src/main/webapp/search.xhtml 2010-06-18 20:39:19 UTC (rev 13255)
@@ -104,8 +104,8 @@
You must be logged in to see the list of your hotel bookings.
</h:panelGroup>
<h:form id="bookings" rendered="#{identity.loggedIn}">
- <h:outputText value="No bookings found." rendered="#{bookings.size() == 0}"/>
- <h:dataTable id="bookings" value="#{bookings}" var="_booking" rendered="#{bookings.size() gt 0}">
+ <h:outputText value="No bookings found." rendered="#{empty bookings}"/>
+ <h:dataTable id="bookings" value="#{bookings}" var="_booking" rendered="#{not empty bookings}">
<h:column id="nameCol">
<f:facet id="nameFct" name="header">Hotel name</f:facet>
#{_booking.hotel.name}
More information about the seam-commits
mailing list