[seam-commits] Seam SVN: r10998 - in examples/trunk/booking: ear and 15 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue May 26 12:41:17 EDT 2009


Author: dan.j.allen
Date: 2009-05-26 12:41:17 -0400 (Tue, 26 May 2009)
New Revision: 10998

Added:
   examples/trunk/booking/war/src/main/webapp/error.xhtml
   examples/trunk/booking/war/src/main/webapp/resources/components/
   examples/trunk/booking/war/src/main/webapp/resources/components/property/
   examples/trunk/booking/war/src/main/webapp/resources/components/property/display.xhtml
   examples/trunk/booking/war/src/main/webapp/resources/components/property/edit.xhtml
Removed:
   examples/trunk/booking/war/src/main/webapp/resources/components/property/display.xhtml
   examples/trunk/booking/war/src/main/webapp/resources/components/property/edit.xhtml
   examples/trunk/booking/war/src/main/webapp/resources/property/
Modified:
   examples/trunk/booking/
   examples/trunk/booking/WORKLOG
   examples/trunk/booking/ear/
   examples/trunk/booking/ejb-jar/
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducerBean.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/PasswordManagerBean.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/Registered.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/RegistrarBean.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingHistoryBean.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/Confirmed.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/BookingFormControls.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/RegistrationFormControls.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CalendarReferenceProducer.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardExpiryYears.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardReferenceProducer.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticationEventListener.java
   examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticatorBean.java
   examples/trunk/booking/war/
   examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/account.xhtml
   examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml
   examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml
   examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml
   examples/trunk/booking/war/src/main/webapp/book.xhtml
   examples/trunk/booking/war/src/main/webapp/confirm.xhtml
   examples/trunk/booking/war/src/main/webapp/password.xhtml
   examples/trunk/booking/war/src/main/webapp/register.xhtml
Log:
add svn:ignores
move composite components under resources/components folder
change name of pageMetadata template to metadata
enable Ajax on change password page (figured out source of error)
add error page
restrict views using <s:restrictView>
add error handling
reflect changes in JSR-299 api



Property changes on: examples/trunk/booking
___________________________________________________________________
Name: svn:ignore
   - target

   + .classpath
.project
.settings
target


Modified: examples/trunk/booking/WORKLOG
===================================================================
--- examples/trunk/booking/WORKLOG	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/WORKLOG	2009-05-26 16:41:17 UTC (rev 10998)
@@ -19,7 +19,8 @@
 TODO
 ====
 
-- secure pages (likely will use <f:event type="beforeRenderView"/>
+- secure pages (likely will use <s:restrictView require=""/>
+- add remember me from Seam identity
 - get status messages from default or resource bundle (not just hardcoded defaults)
 - demonstrate use of exception handling in JSF 2
 - auto-detect which files have @NotNull or @NotEmpty to determine whether to put the * in <p:edit>
@@ -32,7 +33,8 @@
       <unitName>booking</unitName>
    </PersistenceContext>
    <booking:BookingDatabase/>
-</EntityManager>
+</EntityManager> (can do with with annotations as well)
+- use conversation when changing password (and allow changing name too)
 
 
 OPEN QUESTIONS


Property changes on: examples/trunk/booking/ear
___________________________________________________________________
Name: svn:ignore
   - target
.project
.settings

   + .classpath
.project
.settings
target



Property changes on: examples/trunk/booking/ejb-jar
___________________________________________________________________
Name: svn:ignore
   - target
.settings
.classpath
.project

   + .settings
.classpath
.project
nb-configuration.xml
target


Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducerBean.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducerBean.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducerBean.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,12 +1,13 @@
 package org.jboss.seam.examples.booking.account;
 
-import javax.annotation.Named;
-import javax.context.SessionScoped;
 import javax.ejb.Stateless;
-import javax.inject.Current;
-import javax.inject.Produces;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Produces;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+
 import org.jboss.seam.examples.booking.model.User;
 import org.jboss.seam.security.Credentials;
 import org.jboss.seam.security.Identity;

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/PasswordManagerBean.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/PasswordManagerBean.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/PasswordManagerBean.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,15 +1,16 @@
 package org.jboss.seam.examples.booking.account;
 
-import javax.annotation.Named;
 import javax.annotation.PreDestroy;
-import javax.context.RequestScoped;
 import javax.ejb.Stateful;
-import javax.inject.Current;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Named;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.examples.booking.controls.RegistrationFormControls;
 import org.jboss.seam.examples.booking.model.User;
 import org.jboss.seam.international.StatusMessages;
-import org.jboss.seam.examples.booking.controls.RegistrationFormControls;
 
 /**
  * @author Dan Allen

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/Registered.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/Registered.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/Registered.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -6,12 +6,13 @@
 import static java.lang.annotation.ElementType.TYPE;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
-
 import java.lang.annotation.Documented;
 import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
-import javax.inject.BindingType;
+
+import javax.enterprise.inject.BindingType;
+
 import org.jboss.seam.examples.booking.model.User;
 
 /**

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/RegistrarBean.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/RegistrarBean.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/RegistrarBean.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,19 +1,20 @@
 package org.jboss.seam.examples.booking.account;
 
-import javax.annotation.Named;
 import javax.annotation.PreDestroy;
-import javax.context.RequestScoped;
 import javax.ejb.Stateful;
-import javax.inject.Current;
-import javax.inject.Produces;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Produces;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.examples.booking.controls.RegistrationFormControls;
 import org.jboss.seam.examples.booking.model.User;
 import org.jboss.seam.international.StatusMessage;
 import org.jboss.seam.international.StatusMessages;
 import org.jboss.seam.security.Credentials;
 import org.jboss.seam.security.Identity;
-import org.jboss.seam.examples.booking.controls.RegistrationFormControls;
 
 /**
  * @author Dan Allen

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,4 +1,4 @@
-/* 
+/*
  * JBoss, Home of Professional Open Source
  * Copyright 2009, Red Hat Middleware LLC, and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
@@ -23,28 +23,31 @@
  */
 package org.jboss.seam.examples.booking.booking;
 
+import static javax.persistence.PersistenceContextType.EXTENDED;
+
 import java.util.Calendar;
-import static javax.persistence.PersistenceContextType.EXTENDED;
-import javax.annotation.Named;
-import javax.context.Conversation;
-import javax.context.ConversationScoped;
-import javax.context.RequestScoped;
+
 import javax.ejb.Remove;
 import javax.ejb.Stateful;
-import javax.inject.AnnotationLiteral;
-import javax.inject.Current;
-import javax.inject.Produces;
-import javax.inject.manager.Manager;
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+
 import org.jboss.seam.examples.booking.account.Registered;
+import org.jboss.seam.examples.booking.controls.BookingFormControls;
 import org.jboss.seam.examples.booking.model.Booking;
 import org.jboss.seam.examples.booking.model.Hotel;
 import org.jboss.seam.examples.booking.model.User;
 import org.jboss.seam.international.StatusMessages;
 import org.jboss.webbeans.log.Log;
 import org.jboss.webbeans.log.Logger;
-import org.jboss.seam.examples.booking.controls.BookingFormControls;
 
 public
 @Named("bookingAgent")
@@ -65,7 +68,7 @@
    @Registered User user;
 
    //@Fires @Confirmed Event<BookingEvent> bookingConfirmedEvent;
-   @Current Manager manager;
+   @Current BeanManager manager;
 
    private Hotel hotelSelection;
 

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingHistoryBean.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingHistoryBean.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/BookingHistoryBean.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -2,15 +2,17 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.annotation.Named;
+
 import javax.annotation.PreDestroy;
-import javax.context.SessionScoped;
 import javax.ejb.Stateful;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Produces;
 import javax.event.Observes;
-import javax.inject.Current;
-import javax.inject.Produces;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+
 import org.jboss.seam.examples.booking.account.Registered;
 import org.jboss.seam.examples.booking.model.Booking;
 import org.jboss.seam.examples.booking.model.User;

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/Confirmed.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/Confirmed.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/booking/Confirmed.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -6,13 +6,13 @@
 import static java.lang.annotation.ElementType.TYPE;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
-
 import java.lang.annotation.Documented;
 import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
-import javax.inject.BindingType;
 
+import javax.enterprise.inject.BindingType;
+
 /**
  * @author Dan Allen
  */

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/BookingFormControls.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/BookingFormControls.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/BookingFormControls.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,7 +1,7 @@
 package org.jboss.seam.examples.booking.controls;
 
-import javax.annotation.Named;
-import javax.context.RequestScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Named;
 import javax.faces.component.UIComponent;
 
 /**

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/RegistrationFormControls.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/RegistrationFormControls.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/controls/RegistrationFormControls.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,7 +1,7 @@
 package org.jboss.seam.examples.booking.controls;
 
-import javax.annotation.Named;
-import javax.context.RequestScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Named;
 import javax.faces.component.UIComponent;
 
 /**

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,4 +1,4 @@
-/* 
+/*
  * JBoss, Home of Professional Open Source
  * Copyright 2009, Red Hat Middleware LLC, and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
@@ -25,14 +25,16 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.annotation.Named;
-import javax.context.SessionScoped;
+
 import javax.ejb.Remove;
 import javax.ejb.Stateful;
-import javax.inject.Current;
-import javax.inject.Produces;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Produces;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+
 import org.jboss.seam.examples.booking.model.Hotel;
 import org.jboss.webbeans.log.Log;
 import org.jboss.webbeans.log.Logger;

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,4 +1,4 @@
-/* 
+/*
  * JBoss, Home of Professional Open Source
  * Copyright 2009, Red Hat Middleware LLC, and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
@@ -24,9 +24,10 @@
 package org.jboss.seam.examples.booking.inventory;
 
 import java.io.Serializable;
-import javax.annotation.Named;
-import javax.context.SessionScoped;
 
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Named;
+
 public
 @Named
 @SessionScoped

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CalendarReferenceProducer.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CalendarReferenceProducer.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CalendarReferenceProducer.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -7,10 +7,10 @@
 import java.util.List;
 import java.util.Locale;
 
-import javax.annotation.Named;
-import javax.context.ConversationScoped;
-import javax.inject.Current;
-import javax.inject.Produces;
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Produces;
 
 /**
  * Produces calendar-oriented reference data to be used in user-interface forms.

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardExpiryYears.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardExpiryYears.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardExpiryYears.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -5,13 +5,13 @@
 import static java.lang.annotation.ElementType.PARAMETER;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
-
 import java.lang.annotation.Documented;
 import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
-import javax.inject.BindingType;
 
+import javax.enterprise.inject.BindingType;
+
 /**
  * A binding type attached to a collection of years
  * indicating the set is limited to the possible

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardReferenceProducer.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardReferenceProducer.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardReferenceProducer.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -5,9 +5,9 @@
 import java.util.Calendar;
 import java.util.List;
 
-import javax.annotation.Named;
-import javax.context.ConversationScoped;
-import javax.inject.Produces;
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Produces;
 
 import org.jboss.seam.examples.booking.model.CreditCardType;
 

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticationEventListener.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticationEventListener.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticationEventListener.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,12 +1,12 @@
 package org.jboss.seam.examples.booking.security;
 
-import javax.context.Context;
-import javax.context.RequestScoped;
-import javax.context.SessionScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
 import javax.event.Observes;
-import javax.inject.AnnotationLiteral;
-import javax.inject.manager.Bean;
-import javax.inject.manager.Manager;
 
 import org.jboss.seam.examples.booking.account.Registered;
 import org.jboss.seam.examples.booking.model.User;
@@ -33,10 +33,10 @@
     * Clear the dummy register user when a login event occurs. Temporary workaround
     * for not being able to clear this out some other way.
     */
-   public void onLogin(@Observes LoggedInEvent loggedInEvent, Manager manager)
+   public void onLogin(@Observes LoggedInEvent loggedInEvent, BeanManager manager)
    {
       log.info(loggedInEvent.getPrincipal().getName() + " has logged in; clearing instance of @Registered User");
-      Bean<User> registeredUserBean = manager.resolveByType(User.class, new AnnotationLiteral<Registered>() {}).iterator().next();
+      Bean<User> registeredUserBean = manager.getBeans(User.class, new AnnotationLiteral<Registered>() {}).iterator().next();
       Context sessionContext = manager.getContext(SessionScoped.class);
       ((AbstractThreadLocalMapContext) sessionContext).getBeanStore().remove(registeredUserBean);
    }

Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticatorBean.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticatorBean.java	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticatorBean.java	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,9 +1,10 @@
 package org.jboss.seam.examples.booking.security;
 
 import javax.ejb.Stateless;
-import javax.inject.Current;
+import javax.enterprise.inject.Current;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+
 import org.jboss.seam.examples.booking.model.User;
 import org.jboss.seam.security.Credentials;
 import org.jboss.webbeans.log.Log;


Property changes on: examples/trunk/booking/war
___________________________________________________________________
Name: svn:ignore
   - target
.classpath
.project
.settings

   + .classpath
.project
.settings
nb-configuration.xml
target


Modified: examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/account.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/account.xhtml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/account.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -4,7 +4,7 @@
    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:p="http://http://java.sun.com/jsf/composite/property">
+   xmlns:p="http://http://java.sun.com/jsf/composite/components/property">
     
    <p:display label="Username" value="#{user.username}"/>
    <p:display label="Real name" value="#{user.name}"/>

Modified: examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -4,7 +4,7 @@
    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:p="http://http://java.sun.com/jsf/composite/property">
+   xmlns:p="http://http://java.sun.com/jsf/composite/components/property">
     
    <p:display label="Name" value="#{hotel.name}"/>
    <p:display label="Address" value="#{hotel.address}"/>

Modified: examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -4,9 +4,7 @@
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"><f:view>
-   <f:facet name="metadata">
-      <ui:insert name="pageMetadata"/>
-   </f:facet>
+   <ui:insert name="metadata"/>
    <h:head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
       <title>JBoss Suites: Seam Framework</title>

Modified: examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -16,10 +16,12 @@
       <param-value>true</param-value>
    </context-param>
 
+   <!--
    <context-param>
       <param-name>javax.faces.PROJECT_STAGE</param-name>
       <param-value>Development</param-value>
    </context-param>
+   -->
 
    <filter>
       <filter-name>Seam Filter</filter-name>
@@ -54,5 +56,20 @@
       </web-resource-collection>
       <auth-constraint/>
    </security-constraint>
+
+   <error-page>
+      <exception-type>org.jboss.seam.security.NotLoggedInException</exception-type>
+      <location>/home.seam</location>
+   </error-page>
    
+   <error-page>
+      <exception-type>org.jboss.seam.security.AuthorizationException</exception-type>
+      <location>/error.seam</location>
+   </error-page>
+
+   <error-page>
+      <error-code>500</error-code>
+      <location>/error.seam</location>
+   </error-page>
+   
 </web-app>

Modified: examples/trunk/booking/war/src/main/webapp/book.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/book.xhtml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/book.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -4,8 +4,14 @@
    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:p="http://http://java.sun.com/jsf/composite/property"
+   xmlns:s="http://jboss.com/products/seam/faces"
+   xmlns:p="http://http://java.sun.com/jsf/composite/components/property"
    template="/WEB-INF/layout/template.xhtml">
+   <ui:define name="metadata">
+      <f:metadata>
+         <s:restrictView require="#{identity.loggedIn}"/>
+      </f:metadata>
+   </ui:define>
 
    <ui:define name="content">
       <div class="section">

Modified: examples/trunk/booking/war/src/main/webapp/confirm.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/confirm.xhtml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/confirm.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -4,7 +4,7 @@
    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:p="http://http://java.sun.com/jsf/composite/property"
+   xmlns:p="http://http://java.sun.com/jsf/composite/components/property"
    template="/WEB-INF/layout/template.xhtml">
 
    <ui:define name="content">

Added: examples/trunk/booking/war/src/main/webapp/error.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/error.xhtml	                        (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/error.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -0,0 +1,23 @@
+<!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:f="http://java.sun.com/jsf/core"
+   xmlns:h="http://java.sun.com/jsf/html"
+   xmlns:p="http://http://java.sun.com/jsf/composite/components/property"
+   template="/WEB-INF/layout/template.xhtml">
+
+   <ui:define name="content">
+
+      <div class="section">
+         <h1>Error Encountered</h1>
+      </div>
+
+      <div class="section">
+         <p>You are not authorized to perform the requested action.</p>
+         <p>#{facesContext.externalContext.requestMap['javax.servlet.error.message']}</p>
+      </div>
+
+   </ui:define>
+
+</ui:composition>

Modified: examples/trunk/booking/war/src/main/webapp/password.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/password.xhtml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/password.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -4,7 +4,7 @@
    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:p="http://http://java.sun.com/jsf/composite/property"
+   xmlns:p="http://http://java.sun.com/jsf/composite/components/property"
    template="/WEB-INF/layout/template.xhtml">
 
    <ui:define name="content">

Modified: examples/trunk/booking/war/src/main/webapp/register.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/register.xhtml	2009-05-26 16:26:13 UTC (rev 10997)
+++ examples/trunk/booking/war/src/main/webapp/register.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -4,12 +4,12 @@
    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:p="http://http://java.sun.com/jsf/composite/property"
+   xmlns:p="http://http://java.sun.com/jsf/composite/components/property"
    template="/WEB-INF/layout/template.xhtml">
 
    <ui:param name="pageClass" value="home"/>
 
-   <ui:define name="pageMetadata">
+   <ui:define name="metadata">
       <f:event type="preRenderView" listener="#{registrar.notifyIfRegistrationIsInvalid(facesContext.validationFailed)}"/>
    </ui:define>
 
@@ -32,26 +32,26 @@
                <p:edit id="username" label="Username">
                   <h:inputText id="input" value="#{newUser.username}"
                      binding="#{registrationFormControls.username}">
-                     <ui:remove><f:ajax event="blur" render="username"/></ui:remove>
+                     <f:ajax event="blur" render="username"/>
                   </h:inputText>
                </p:edit>
 
                <p:edit id="name" label="Real name">
                   <h:inputText id="input" value="#{newUser.name}">
-                     <ui:remove><f:ajax event="blur" render="name"/></ui:remove>
+                     <f:ajax event="blur" render="name"/>
                   </h:inputText>
                </p:edit>
 
                <p:edit id="password" label="Password">
                   <h:inputSecret id="input" value="#{newUser.password}" redisplay="true">
-                     <ui:remove><f:ajax event="blur" render="password"/></ui:remove>
+                     <f:ajax event="blur" render="password"/>
                   </h:inputSecret>
                </p:edit>
 
                <p:edit id="confirmPassword" label="Confirm Password">
                   <h:inputSecret id="input" value="#{registrar.confirmPassword}" redisplay="true"
                      binding="#{registrationFormControls.confirmPassword}">
-                     <ui:remove><f:ajax event="blur" render="confirmPassword"/></ui:remove>
+                     <f:ajax event="blur" render="confirmPassword"/>
                   </h:inputSecret>
                </p:edit>
                

Copied: examples/trunk/booking/war/src/main/webapp/resources/components/property (from rev 10813, examples/trunk/booking/war/src/main/webapp/resources/property)

Deleted: examples/trunk/booking/war/src/main/webapp/resources/components/property/display.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml	2009-05-06 06:46:19 UTC (rev 10813)
+++ examples/trunk/booking/war/src/main/webapp/resources/components/property/display.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,29 +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:f="http://java.sun.com/jsf/core"
-   xmlns:h="http://java.sun.com/jsf/html"
-   xmlns:c="http://java.sun.com/jsp/jstl/core"
-   xmlns:comp="http://java.sun.com/jsf/composite">
-
-   <comp:interface>
-      <comp:attribute name="label" required="true"/>
-      <comp:attribute name="value" required="false"/>
-      <comp:attribute name="override" required="false" default="false"/>
-   </comp:interface>
-
-   <!-- TODO allow for a template to be specified, falling back to a default -->
-   <comp:implementation>
-      <div class="entry">
-         <span class="label">#{cc.attrs.label}:</span>
-         <span class="output">
-            <c:choose>
-               <c:when test="#{cc.attrs.override}"><comp:insertChildren/></c:when>
-               <c:otherwise><h:outputText id="output" value="#{cc.attrs.value}"><comp:insertChildren/></h:outputText></c:otherwise>
-            </c:choose>
-         </span>
-      </div>
-   </comp:implementation>
-
-</ui:composition>

Copied: examples/trunk/booking/war/src/main/webapp/resources/components/property/display.xhtml (from rev 10864, examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml)
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/components/property/display.xhtml	                        (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/resources/components/property/display.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -0,0 +1,32 @@
+<!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:f="http://java.sun.com/jsf/core"
+   xmlns:h="http://java.sun.com/jsf/html"
+   xmlns:c="http://java.sun.com/jsp/jstl/core"
+   xmlns:comp="http://java.sun.com/jsf/composite">
+
+   <comp:interface>
+      <comp:attribute name="label" required="true"/>
+      <comp:attribute name="value" required="false"/>
+      <comp:attribute name="override" required="false" default="false"/>
+   </comp:interface>
+
+   <ui:remove>
+   TODO allow for a template to be specified, falling back to a default
+   </ui:remove>
+
+   <comp:implementation>
+      <div class="entry" id="#{cc.clientId}">
+         <span class="label">#{cc.attrs.label}:</span>
+         <span class="output">
+            <c:choose>
+               <c:when test="#{cc.attrs.override}"><comp:insertChildren/></c:when>
+               <c:otherwise><h:outputText id="output" value="#{cc.attrs.value}"><comp:insertChildren/></h:outputText></c:otherwise>
+            </c:choose>
+         </span>
+      </div>
+   </comp:implementation>
+
+</ui:composition>

Deleted: examples/trunk/booking/war/src/main/webapp/resources/components/property/edit.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml	2009-05-06 06:46:19 UTC (rev 10813)
+++ examples/trunk/booking/war/src/main/webapp/resources/components/property/edit.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -1,35 +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:f="http://java.sun.com/jsf/core"
-   xmlns:h="http://java.sun.com/jsf/html"
-   xmlns:c="http://java.sun.com/jsp/jstl/core"
-   xmlns:comp="http://java.sun.com/jsf/composite">
-
-   <comp:interface>
-      <comp:attribute name="label" required="true"/>
-      <comp:attribute name="required" required="false"/>
-   </comp:interface>
-
-   <!-- TODO allow for a template to be specified, falling back to a default -->
-   <!-- TODO detect required from child or from bean validation annotation -->
-   <comp:implementation>
-
-      <c:set var="required" value="#{cc.attrs.required eq null ? true : cc.attrs.required}"/>
-      <c:set var="invalid" value="#{not empty facesContext.getMessageList(cc.clientId.concat(':input'))}"/>
-
-      <div class="entry">
-         <h:outputLabel value="#{cc.attrs.label}:" for="input" styleClass="label#{invalid ? ' errors' : ''}">
-            <c:if test="#{required}"><span class="required">*</span></c:if>
-         </h:outputLabel>
-         <span class="input#{invalid ? ' errors' : ''}">
-            <comp:insertChildren/>
-         </span>
-         <h:message for="input" styleClass="error errors"/>
-      </div>
-
-   </comp:implementation>
-
-
-</ui:composition>

Copied: examples/trunk/booking/war/src/main/webapp/resources/components/property/edit.xhtml (from rev 10864, examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml)
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/components/property/edit.xhtml	                        (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/resources/components/property/edit.xhtml	2009-05-26 16:41:17 UTC (rev 10998)
@@ -0,0 +1,40 @@
+<!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:f="http://java.sun.com/jsf/core"
+   xmlns:h="http://java.sun.com/jsf/html"
+   xmlns:c="http://java.sun.com/jsp/jstl/core"
+   xmlns:comp="http://java.sun.com/jsf/composite">
+
+   <comp:interface>
+      <comp:attribute name="label" required="true"/>
+      <comp:attribute name="required" required="false" default="true"/>
+   </comp:interface>
+
+   <ui:remove>
+   TODO allow for a template to be specified, falling back to a default
+   TODO detect required from child or from bean validation annotation
+   Ed claims there is #{component.messageList}, but I don't see it
+   </ui:remove>
+
+   <comp:implementation>
+
+      <c:set var="invalid" value="#{not empty facesContext.getMessageList(cc.clientId.concat(':input'))}"/>
+      <c:set var="invalid2" value="#{not empty facesContext.getMessageList(cc.clientId.concat(':input2'))}"/>
+
+      <div class="entry" id="#{cc.clientId}">
+         <h:outputLabel value="#{cc.attrs.label}:" for="input" styleClass="label#{invalid || invalid2 ? ' errors' : ''}">
+            <c:if test="#{required}"><span class="required">*</span></c:if>
+         </h:outputLabel>
+         <span class="input#{invalid || invalid2 ? ' errors' : ''}">
+            <comp:insertChildren/>
+         </span>
+         <h:message for="input" styleClass="error errors" rendered="#{invalid}"/>
+         <h:message for="input2" styleClass="error errors" rendered="#{invalid2}"/>
+      </div>
+
+   </comp:implementation>
+
+
+</ui:composition>




More information about the seam-commits mailing list