Seam SVN: r10866 - examples/trunk/servlet-permalink.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 17:44:00 -0400 (Mon, 11 May 2009)
New Revision: 10866
Modified:
examples/trunk/servlet-permalink/pom.xml
Log:
add bridge
add jta
add facestester (experimental)
update maven-cli-aliases
Modified: examples/trunk/servlet-permalink/pom.xml
===================================================================
--- examples/trunk/servlet-permalink/pom.xml 2009-05-11 20:32:54 UTC (rev 10865)
+++ examples/trunk/servlet-permalink/pom.xml 2009-05-11 21:44:00 UTC (rev 10866)
@@ -13,7 +13,7 @@
<artifactId>seam-servlet-permalink</artifactId>
<packaging>war</packaging>
<name>Seam Permalink Example (Servlet)</name>
- <description>The Seam permalink example for deployment to a servlet container</description>
+ <description>The Seam permalink example for deployment to a servlet environment</description>
<properties>
<jetty.http.port>9090</jetty.http.port>
@@ -36,11 +36,32 @@
</dependency>
<dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
+ <groupId>com.steeplesoft.jsf</groupId>
+ <artifactId>facestester</artifactId>
+ <scope>test</scope>
+ <version>0.2.PR1</version> <!-- TODO: move to version-matrix -->
</dependency>
<dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
</dependency>
@@ -52,6 +73,11 @@
</dependency>
<dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
@@ -85,6 +111,11 @@
</dependency>
<dependency>
+ <groupId>${seam.groupId}</groupId>
+ <artifactId>seam-webbeans-bridge</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
@@ -100,7 +131,7 @@
<dependency>
<groupId>${webbeans.groupId}</groupId>
<artifactId>webbeans-logging</artifactId>
- <scope>provided</scope>
+ <scope>provided</scope> <!-- assumes the use of Web Beans RI -->
</dependency>
<dependency>
@@ -140,6 +171,38 @@
</plugin>
<plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <!--
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/integration-test-suite.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ -->
+ <includes>
+ <include>**/When*</include>
+ </includes>
+ <systemProperties>
+ <property>
+ <name>facestester.webAppPath</name>
+ <value>${project.build.directory}/${project.build.finalName}</value>
+ <!--
+ <value>${webapp.directory}</value>
+ -->
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!-- don't stage or package files added to ${webapp.directory} by war:inplace -->
@@ -173,7 +236,7 @@
<maxIdleTime>3600000</maxIdleTime>
</connector>
</connectors>
- <daemon>true</daemon>
+ <daemon>${jetty.daemon}</daemon>
<stopPort>${jetty.stop.port}</stopPort>
<stopKey>HASTA_LA_VISTA</stopKey>
<scanIntervalSeconds>10</scanIntervalSeconds>
@@ -190,14 +253,17 @@
<plugin>
<groupId>org.twdata.maven</groupId>
<artifactId>maven-cli-plugin</artifactId>
+ <version>0.6.3.CR3</version>
<configuration>
+ <prompt>${project.artifactId}</prompt>
<!-- userAliases are for cli:execute-phase -->
<userAliases>
- <runjetty>compile org.apache.maven.plugins:maven-war-plugin:inplace org.mortbay.jetty:maven-jetty-plugin:run -o</runjetty>
- <stopjetty>org.mortbay.jetty:maven-jetty-plugin:stop -o</stopjetty>
- <runtomcat>compile org.apache.maven.plugins:maven-war-plugin:inplace org.codehaus.mojo:tomcat-maven-plugin:run -o</runtomcat>
+ <runjetty>compile org.apache.maven.plugins:maven-war-plugin:inplace org.mortbay.jetty:maven-jetty-plugin:run</runjetty>
+ <stopjetty>org.mortbay.jetty:maven-jetty-plugin:stop</stopjetty>
+ <runtomcat>compile org.apache.maven.plugins:maven-war-plugin:inplace org.codehaus.mojo:tomcat-maven-plugin:run</runtomcat>
<explode>compile org.apache.maven.plugins:maven-war-plugin:inplace -o</explode>
- <restart>validate -Prestart-embedded -o</restart>
+ <restart>org.apache.maven.plugins:maven-antrun-plugin:run -Prestart-embedded</restart>
+ <!--<restart>validate -Prestart-embedded -o</restart>-->
<profiles>org.apache.maven.plugins:maven-help-plugin:active-profiles -o</profiles>
<pom>org.apache.maven.plugins:maven-help-plugin:effective-pom -o</pom>
</userAliases>
@@ -213,11 +279,17 @@
<profiles>
<profile>
<id>restart-embedded</id>
-
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+ <touch file="${webapp.directory}/WEB-INF/web.xml"/>
+ </tasks>
+ </configuration>
+ <!-- Hooking an execution to a phase is more correct, but slower -->
+ <!--
<executions>
<execution>
<id>touch-web-inf</id>
@@ -232,8 +304,8 @@
</goals>
</execution>
</executions>
+ -->
</plugin>
-
</plugins>
</build>
</profile>
15 years, 6 months
Seam SVN: r10865 - in examples/trunk/servlet-permalink: src/main/webapp/WEB-INF and 1 other directory.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:32:54 -0400 (Mon, 11 May 2009)
New Revision: 10865
Modified:
examples/trunk/servlet-permalink/readme.txt
examples/trunk/servlet-permalink/src/main/webapp/WEB-INF/web.xml
Log:
rename from Servlet Container to Servlet Environment
Modified: examples/trunk/servlet-permalink/readme.txt
===================================================================
--- examples/trunk/servlet-permalink/readme.txt 2009-05-11 20:31:59 UTC (rev 10864)
+++ examples/trunk/servlet-permalink/readme.txt 2009-05-11 20:32:54 UTC (rev 10865)
@@ -1,11 +1,11 @@
-Seam Permalink Example (Servlet Container)
-==========================================
+Seam Permalink Example (Servlet Environment)
+============================================
-This example demonstrates the use of Seam 3 in a Servlet container environment
-(Tomcat 6 / Jetty 6). Contextual state management and dependency injection are
-handled by JSR-299. Transaction and persistence context management is handled
-by the EJB 3 container. No alterations are expected to be made to the Servlet
-container. All services are self-contained within the deployment.
+This example demonstrates the use of Seam 3 in a Servlet environment (Tomcat 6
+/ Jetty 6). Contextual state management and dependency injection are handled by
+JSR-299. Transaction and persistence context management is handled by the EJB 3
+container. No alterations are required to be made to the Servlet container. All
+services are self-contained within the deployment.
This example uses a Maven 2 build. Execute the following command to build the
WAR. The WAR will will be located in the target directory after completion of
Modified: examples/trunk/servlet-permalink/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/servlet-permalink/src/main/webapp/WEB-INF/web.xml 2009-05-11 20:31:59 UTC (rev 10864)
+++ examples/trunk/servlet-permalink/src/main/webapp/WEB-INF/web.xml 2009-05-11 20:32:54 UTC (rev 10865)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
- <display-name>Seam Permalink Example (Servlet Container)</display-name>
+ <display-name>Seam Permalink Example (Servlet Environment)</display-name>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
15 years, 6 months
Seam SVN: r10864 - in examples/trunk/booking: ear and 11 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:31:59 -0400 (Mon, 11 May 2009)
New Revision: 10864
Added:
examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/model/CreditCardType.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
Modified:
examples/trunk/booking/ear/pom.xml
examples/trunk/booking/ejb-jar/pom.xml
examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducer.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/model/Booking.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/security/Authenticator.java
examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticatorBean.java
examples/trunk/booking/pom.xml
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/css/screen.css
examples/trunk/booking/war/src/main/webapp/main.xhtml
examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml
examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml
Log:
change ejb artifact name to ejb-jar
rename searchString property to query on SearchCriteria
enable hotel information in bookings
add credit card type to demonstrate using enum in UI
use Seam's session manager
accomodate two inputs in p:edit
create observer for authentication events
create producer for credit card information
update maven-cli-plugin aliases
Modified: examples/trunk/booking/ear/pom.xml
===================================================================
--- examples/trunk/booking/ear/pom.xml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ear/pom.xml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -208,7 +208,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>${project.parent.artifactId}-ejb</artifactId>
+ <artifactId>${project.parent.artifactId}-ejb-jar</artifactId>
<type>ejb</type>
</dependency>
Modified: examples/trunk/booking/ejb-jar/pom.xml
===================================================================
--- examples/trunk/booking/ejb-jar/pom.xml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/pom.xml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -10,12 +10,12 @@
<version>3.0.0-SNAPSHOT</version>
</parent>
- <artifactId>seam-booking-ejb</artifactId>
+ <artifactId>seam-booking-ejb-jar</artifactId>
<packaging>ejb</packaging>
<name>Seam Booking Example (EJB module)</name>
<build>
- <finalName>${project.artifactId}</finalName>
+ <finalName>${project.parent.artifactId}-ejb</finalName>
<plugins>
<plugin>
@@ -65,12 +65,6 @@
</dependency>
<dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<scope>provided</scope>
@@ -96,6 +90,12 @@
<dependency>
<groupId>${seam.groupId}</groupId>
+ <artifactId>seam-webbeans-bridge</artifactId> <!-- assumes use of Web Beans RI -->
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${seam.groupId}</groupId>
<artifactId>seam-faces</artifactId>
</dependency>
@@ -105,20 +105,48 @@
</dependency>
<dependency>
+ <groupId>${seam.groupId}</groupId>
+ <artifactId>seam-web</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>${webbeans.groupId}</groupId>
<artifactId>jsr299-api</artifactId>
<scope>provided</scope>
</dependency>
+ <!-- TEMPORARY! -->
<dependency>
<groupId>${webbeans.groupId}</groupId>
- <artifactId>webbeans-logging</artifactId>
+ <artifactId>webbeans-spi</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${webbeans.groupId}</groupId>
+ <artifactId>webbeans-core</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- /TEMPORARY! -->
+
+ <dependency>
+ <groupId>${webbeans.groupId}</groupId>
+ <artifactId>webbeans-logging</artifactId>
+ <scope>provided</scope> <!-- assumes the use of Web Beans RI -->
+ </dependency>
+
+ <dependency>
+ <groupId>${webbeans.groupId}</groupId>
<artifactId>webbeans-logger</artifactId>
+ <exclusions>
+ <!-- This exclusion is necessary, but I don't understand why since it's marked as provided above -->
+ <exclusion>
+ <groupId>${webbeans.groupId}</groupId>
+ <artifactId>webbeans-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducer.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducer.java 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/account/AccountProducer.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -12,6 +12,7 @@
*/
public
@Local
-interface AccountProducer {
+interface AccountProducer
+{
User getCurrentAccount();
}
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-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -111,6 +111,6 @@
{
hotels = results;
}
- log.info("Found {0} hotel(s) matching search term ''{1}'' (limit {2})", hotels.size(), criteria.getSearchString(), criteria.getPageSize());
+ log.info("Found {0} hotel(s) matching search term ''{1}'' (limit {2})", hotels.size(), criteria.getQuery(), criteria.getPageSize());
}
}
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-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -37,19 +37,19 @@
private static final String REPEAT_SQL_WIDCARD_REGEX = SQL_WILDCARD_STR + "+";
private static final char HUMAN_WILDCARD_CHAR = '*';
- private String searchString = "";
+ private String query = "";
private int pageSize = 5;
private int page = 0;
public String getSearchPattern()
{
- if (searchString == null || searchString.length() == 0)
+ if (query == null || query.length() == 0)
{
return SQL_WILDCARD_STR;
}
StringBuilder pattern = new StringBuilder();
- pattern.append(searchString.toLowerCase().replace(HUMAN_WILDCARD_CHAR, SQL_WILDCARD_CHAR).replaceAll(REPEAT_SQL_WIDCARD_REGEX, SQL_WILDCARD_STR));
+ pattern.append(query.toLowerCase().replace(HUMAN_WILDCARD_CHAR, SQL_WILDCARD_CHAR).replaceAll(REPEAT_SQL_WIDCARD_REGEX, SQL_WILDCARD_STR));
if (pattern.length() == 0 || pattern.charAt(0) != SQL_WILDCARD_CHAR)
{
pattern.insert(0, SQL_WILDCARD_CHAR);
@@ -81,15 +81,14 @@
this.pageSize = pageSize;
}
- // QUESTION: rename to searchTerm?
- public String getSearchString()
+ public String getQuery()
{
- return searchString;
+ return query;
}
- public void setSearchString(String searchString)
+ public void setQuery(String query)
{
- this.searchString = (searchString != null ? searchString.trim() : null);
+ this.query = (query != null ? query.trim() : null);
}
public void nextPage()
Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/model/Booking.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/model/Booking.java 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/model/Booking.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -31,6 +31,8 @@
import java.util.Date;
import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
@@ -58,7 +60,8 @@
private Hotel hotel;
private Date checkinDate;
private Date checkoutDate;
- private String creditCard;
+ private String creditCardNumber;
+ private CreditCardType creditCardType;
private String creditCardName;
private int creditCardExpiryMonth;
private int creditCardExpiryYear;
@@ -135,40 +138,52 @@
{
this.checkoutDate = checkoutDate;
}
-
- @NotNull(message = "Credit card number is required")
- @Size(min = 16, max = 16, message = "Credit card number must 16 digits long")
- @Pattern(regexp = "^\\d*$", message = "Credit card number must be numeric")
- public String getCreditCard()
- {
- return creditCard;
- }
-
- public void setCreditCard(String creditCard)
- {
- this.creditCard = creditCard;
- }
-
+
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 number is required")
+ @Size(min = 16, max = 16, message = "Credit card number must 16 digits long")
+ @Pattern(regexp = "^\\d*$", message = "Credit card number must be numeric")
+ public String getCreditCardNumber()
+ {
+ return creditCardNumber;
+ }
+
+ public void setCreditCardNumber(String creditCardNumber)
+ {
+ this.creditCardNumber = creditCardNumber;
+ }
+
+ @NotNull(message = "Credit card type is required")
+ @Enumerated(EnumType.STRING)
+ public CreditCardType getCreditCardType()
+ {
+ return creditCardType;
+ }
+
+ public void setCreditCardType(CreditCardType creditCardType)
+ {
+ this.creditCardType = creditCardType;
+ }
+
@NotNull(message = "Credit card name is required")
@Size(min = 3, max = 70, message = "Credit card name is required")
public String getCreditCardName()
Added: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/model/CreditCardType.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/model/CreditCardType.java (rev 0)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/model/CreditCardType.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -0,0 +1,9 @@
+package org.jboss.seam.examples.booking.model;
+
+public enum CreditCardType
+{
+ VISA,
+ MasterCard,
+ AMEX,
+ Discover
+}
\ No newline at end of file
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-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CalendarReferenceProducer.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -6,6 +6,7 @@
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
+
import javax.annotation.Named;
import javax.context.ConversationScoped;
import javax.inject.Current;
@@ -40,20 +41,4 @@
return months;
}
- public
- @Produces
- @Named
- @ConversationScoped
- @CreditCardExpiryYears
- List<Integer> getCreditCardExpiryYears()
- {
- List<Integer> years = new ArrayList<Integer>(8);
- int currentYear = Calendar.getInstance().get(Calendar.YEAR);
- for (int y = currentYear; y <= (currentYear + 8); y++)
- {
- years.add(y);
- }
-
- return years;
- }
}
Added: 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 (rev 0)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/reference/CreditCardReferenceProducer.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -0,0 +1,47 @@
+package org.jboss.seam.examples.booking.reference;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.List;
+
+import javax.annotation.Named;
+import javax.context.ConversationScoped;
+import javax.inject.Produces;
+
+import org.jboss.seam.examples.booking.model.CreditCardType;
+
+/**
+ * A bean that produces credit card reference data for
+ * user-interface forms.
+ *
+ * @author Dan Allen
+ */
+public class CreditCardReferenceProducer
+{
+ public
+ @Produces
+ @Named
+ @ConversationScoped
+ List<CreditCardType> getCreditCardTypes()
+ {
+ return new ArrayList<CreditCardType>(Arrays.asList(CreditCardType.values()));
+ }
+
+ public
+ @Produces
+ @Named
+ @ConversationScoped
+ @CreditCardExpiryYears
+ List<Integer> getCreditCardExpiryYears()
+ {
+ List<Integer> years = new ArrayList<Integer>(8);
+ int currentYear = Calendar.getInstance().get(Calendar.YEAR);
+ for (int y = currentYear; y <= (currentYear + 8); y++)
+ {
+ years.add(y);
+ }
+
+ return years;
+ }
+}
Added: 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 (rev 0)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticationEventListener.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -0,0 +1,57 @@
+package org.jboss.seam.examples.booking.security;
+
+import javax.context.Context;
+import javax.context.RequestScoped;
+import javax.context.SessionScoped;
+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;
+import org.jboss.seam.security.events.LoggedInEvent;
+import org.jboss.seam.security.events.LoggedOutEvent;
+import org.jboss.seam.web.HttpSessionManager;
+import org.jboss.webbeans.context.AbstractThreadLocalMapContext;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logger;
+
+/**
+ * An observer that monitors authentication events and performs
+ * initialization and cleanup.
+ *
+ * @author Dan Allen
+ */
+public
+@RequestScoped
+class AuthenticationEventListener
+{
+ private @Logger Log log;
+
+ /**
+ * 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)
+ {
+ 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();
+ Context sessionContext = manager.getContext(SessionScoped.class);
+ ((AbstractThreadLocalMapContext) sessionContext).getBeanStore().remove(registeredUserBean);
+ }
+
+ /**
+ * Observe the logout event and prepare the session to be terminated. We
+ * cannot terminate the session immediately or else it will cause any
+ * additional session-scoped observers to fail. It's necessary to delegate
+ * this task to the Seam HttpSessionManager, which can terminate (i.e.,
+ * invalidate) the session when the current request ends.
+ */
+ public void onLogout(@Observes LoggedOutEvent loggedOutEvent, HttpSessionManager sessionManager)
+ {
+ log.info(loggedOutEvent.getPrincipal().getName() + " has logged out");
+ sessionManager.invalidateAtEndOfRequest();
+ }
+
+}
Modified: examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/Authenticator.java
===================================================================
--- examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/Authenticator.java 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/Authenticator.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -3,13 +3,14 @@
import javax.ejb.Local;
/**
- * <strong>Authenticator</strong> is responsible for authenticating
- * the current user.
- *
+ * <strong>Authenticator</strong> is responsible for authenticating the current
+ * user. The sole method of this interface, authenticate(), is invoked as a
+ * callback method to Seam's security infrastructure during authentication.
+ *
* @author Dan Allen
*/
public
@Local
-interface Authenticator extends org.jboss.seam.security.Authenticator {
-
-}
+interface Authenticator extends org.jboss.seam.security.Authenticator
+{
+}
\ No newline at end of file
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-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/ejb-jar/src/main/java/org/jboss/seam/examples/booking/security/AuthenticatorBean.java 2009-05-11 20:31:59 UTC (rev 10864)
@@ -10,14 +10,12 @@
import org.jboss.webbeans.log.Logger;
/**
- * This implementation of <strong>Authenticator</strong>
- * cross references the values of the user's credentials
- * against the database.
- *
+ * This implementation of <strong>Authenticator</strong> cross references the
+ * values of the user's credentials against the database.
+ *
* @author Dan Allen
*/
-public
-@Stateless
+public @Stateless
class AuthenticatorBean implements Authenticator
{
private @Logger Log log;
Modified: examples/trunk/booking/pom.xml
===================================================================
--- examples/trunk/booking/pom.xml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/pom.xml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -52,23 +52,24 @@
<plugin>
<groupId>org.twdata.maven</groupId>
<artifactId>maven-cli-plugin</artifactId>
- <version>0.6.3.CR2</version> <!-- TODO move to version-matrix -->
<configuration>
+ <!-- commands are for cli:execute -->
+ <commands>
+ </commands>
+ <prompt>${project.artifactId}</prompt>
<!-- userAliases are for cli:execute-phase -->
<userAliases>
- <explode>package -o -Pexplode</explode>
- <deploy>seam-booking-ear package -o org.codehaus.mojo:jboss-maven-plugin:harddeploy</deploy>
- <undeploy>seam-booking-ear validate -o -Pundeploy</undeploy>
- <unexplode>seam-booking-ear validate -o -Pundeploy</unexplode>
- <restart>seam-booking-ear validate -o -Prestart</restart>
- <reexplode>package -o -Pundeploy -Pexplode</reexplode>
+ <!-- You can add -o to any alias to work offline -->
+ <explode>package -Pexplode</explode>
+ <deploy>seam-booking-ear package org.codehaus.mojo:jboss-maven-plugin:harddeploy</deploy>
+ <undeploy>seam-booking-ear validate -Pundeploy</undeploy>
+ <unexplode>seam-booking-ear validate -Pundeploy</unexplode>
+ <restart>seam-booking-ear validate -Prestart</restart>
+ <reexplode>package -Pundeploy -Pexplode</reexplode>
<!--<redeploy>this requires two distinct steps</redeploy>-->
<profiles>org.apache.maven.plugins:maven-help-plugin:active-profiles -o</profiles>
<pom>org.apache.maven.plugins:maven-help-plugin:effective-pom -o</pom>
</userAliases>
- <!-- commands are for cli:execute -->
- <commands>
- </commands>
</configuration>
</plugin>
@@ -105,7 +106,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>seam-booking-ejb</artifactId>
+ <artifactId>seam-booking-ejb-jar</artifactId>
<version>${project.version}</version>
<type>ejb</type>
</dependency>
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-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -3,7 +3,7 @@
<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"><ui:remove><!-- Using <f:view> as the root prevents conversation from propagating correctly--></ui:remove>
+ xmlns:f="http://java.sun.com/jsf/core"><f:view>
<f:facet name="metadata">
<ui:insert name="pageMetadata"/>
</f:facet>
@@ -49,4 +49,4 @@
</div>
</div>
</h:body>
-</html>
+</f:view></html>
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-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
- <display-name>Seam Booking Example</display-name>
+ <display-name>Seam Booking Example (Java EE Environment)</display-name>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
@@ -20,7 +20,17 @@
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
-
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
Modified: examples/trunk/booking/war/src/main/webapp/book.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/book.xhtml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/book.xhtml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -56,7 +56,12 @@
</p:edit>
<p:edit id="creditCardNumber" label="Credit card #">
- <h:inputText id="input" value="#{booking.creditCard}"/>
+ <h:inputText id="input" value="#{booking.creditCardNumber}"/>
+ #{' '}
+ <h:selectOneMenu id="input2" value="#{booking.creditCardType}">
+ <f:selectItem itemValue="#{null}" itemLabel="Select..." noSelectionOption="true"/>
+ <f:selectItems value="#{creditCardTypes}" var="_type" itemValue="#{_type}"/>
+ </h:selectOneMenu>
</p:edit>
<p:edit id="creditCardExpiry" label="Credit card expiry">
Modified: examples/trunk/booking/war/src/main/webapp/confirm.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/confirm.xhtml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/confirm.xhtml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -29,7 +29,9 @@
<f:convertDateTime for="output" type="date" pattern="MM/dd/yyyy"/>
</p:display>
- <p:display label="Credit card #" value="#{booking.creditCard}"/>
+ <p:display label="Credit card #" value="#{booking.creditCardNumber}"/>
+
+ <p:display label="Credit card type" value="#{booking.creditCardType}"/>
<div class="buttonBox">
<h:form id="confirmForm">
Modified: examples/trunk/booking/war/src/main/webapp/css/screen.css
===================================================================
--- examples/trunk/booking/war/src/main/webapp/css/screen.css 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/css/screen.css 2009-05-11 20:31:59 UTC (rev 10864)
@@ -29,17 +29,16 @@
font-weight: bold;
color: #5E5147;
}
-input {
+input, select {
border: 1px solid #C3BBB6;
- padding: 4px;
margin: 5px 0;
background: #FFFFFF url(../img/input.bg.gif) 0 0 repeat-x;
}
+input {
+ padding: 4px;
+}
select {
- border: 1px solid #C3BBB6;
padding: 1px;
- margin: 5px 0;
- background: #FFFFFF url(../img/input.bg.gif) 0 0 repeat-x;
}
ol, ul {
margin: 10px 0px 10px 6px;
@@ -148,7 +147,7 @@
.errors span {
text-align: left;
}
-.errors input {
+.errors input, .errors select, .errors textarea {
border: 1px solid #600000;
}
.errors ul {
Modified: examples/trunk/booking/war/src/main/webapp/main.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/main.xhtml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/main.xhtml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -35,12 +35,12 @@
<h:form id="searchForm" prependId="false">
<fieldset>
- <h:inputText id="searchString" value="#{searchCriteria.searchString}" style="width: 165px;">
+ <h:inputText id="query" value="#{searchCriteria.query}" style="width: 165px;">
<f:ajax event="keyup" listener="#{hotelSearch.find}" render="searchResults" onevent="controlSpinner"/>
</h:inputText>
#{' '}
<h:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}">
- <f:ajax execute="searchString" render="searchResults" onevent="controlSpinner"/>
+ <f:ajax execute="query" render="searchResults" onevent="controlSpinner"/>
</h:commandButton>
#{' '}
<span id="activity" style="display: none;"><h:graphicImage id="spinner" value="/img/spinner.gif"/></span>
@@ -82,9 +82,9 @@
<h:column id="actCol">
<f:facet id="actFct" name="header">Action</f:facet>
<h:commandLink id="view" value="View" action="#{bookingAgent.selectHotel(_hotel)}" style="white-space: nowrap;"/>
- <ui:remove>
+ <ui:remove><!--
<h:commandButton id="view" value="View" action="#{bookingAgent.selectHotel(_hotel)}"/>
- </ui:remove>
+ --></ui:remove>
</h:column>
</h:dataTable>
</h:form>
@@ -96,7 +96,7 @@
<h:commandButton id="moreResults" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}">
<f:ajax render="searchResults" onevent="controlSpinner"/>
</h:commandButton>
- <ui:remove>
+ <ui:remove><!--
<h:commandLink id="previousResults" value="Previous page" action="#{hotelSearch.previousPage}" rendered="#{hotelSearch.previousPageAvailable}">
<f:ajax render="searchResults" onevent="controlSpinner"/>
</h:commandLink>
@@ -104,7 +104,7 @@
<h:commandLink id="moreResults" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}">
<f:ajax render="searchResults" onevent="controlSpinner"/>
</h:commandLink>
- </ui:remove>
+ --></ui:remove>
</h:form>
</div>
</h:panelGroup>
@@ -119,20 +119,14 @@
<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}">
- <ui:remove>
<h:column id="nameCol">
<f:facet id="nameFct" name="header">Hotel name</f:facet>
- #{_booking.hotel}
+ #{_booking.hotel.name}
</h:column>
- <h:column id="addrCol">
- <f:facet id="addrCol" name="header">Address</f:facet>
- #{_booking.hotel.address}
- </h:column>
<h:column id="locCol">
<f:facet id="locFct" name="header">Location</f:facet>
#{_booking.hotel.location}
</h:column>
- </ui:remove>
<h:column id="inCol">
<f:facet id="inCol" name="header">Check-in date</f:facet>
<h:outputText value="#{_booking.checkinDate}">
Modified: examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -13,7 +13,10 @@
<comp:attribute name="override" required="false" default="false"/>
</comp:interface>
- <!-- TODO allow for a template to be specified, falling back to a default -->
+ <ui:remove>
+ TODO allow for a template to be specified, falling back to a default
+ </ui:remove>
+
<comp:implementation>
<div class="entry">
<span class="label">#{cc.attrs.label}:</span>
Modified: examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml 2009-05-11 20:28:30 UTC (rev 10863)
+++ examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml 2009-05-11 20:31:59 UTC (rev 10864)
@@ -12,21 +12,27 @@
<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 -->
+ <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="required" value="#{cc.attrs.required eq null ? true : cc.attrs.required}"/>
<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">
- <h:outputLabel value="#{cc.attrs.label}:" for="input" styleClass="label#{invalid ? ' errors' : ''}">
+ <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 ? ' errors' : ''}">
+ <span class="input#{invalid || invalid2 ? ' errors' : ''}">
<comp:insertChildren/>
</span>
- <h:message for="input" styleClass="error errors"/>
+ <h:message for="input" styleClass="error errors" rendered="#{invalid}"/>
+ <h:message for="input2" styleClass="error errors" rendered="#{invalid2}"/>
</div>
</comp:implementation>
15 years, 6 months
Seam SVN: r10863 - examples/trunk/booking.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:28:30 -0400 (Mon, 11 May 2009)
New Revision: 10863
Added:
examples/trunk/booking/WORKLOG
Log:
development progress notes
Added: examples/trunk/booking/WORKLOG
===================================================================
--- examples/trunk/booking/WORKLOG (rev 0)
+++ examples/trunk/booking/WORKLOG 2009-05-11 20:28:30 UTC (rev 10863)
@@ -0,0 +1,46 @@
+KNOWN ISSUES
+============
+
+(1) Ajax is not working on blur in p:edit form fields (had to disable)
+ Alert box showing "error malformedXML"
+
+(2) No list of workspaces
+
+(3) @AfterTransactionSuccess observer does not work
+
+(4) Ghost click first time clicking on View after results are returned
+ Mojarra Issue #1116; ViewState is not being put in form on partial page update
+
+(5) If you visit the main.seam page before logging in, when you logging, you remain an anonymous user; the session-scoped
+ user bean is not being cleared on login. (temporary fix)
+
+(6) blank user shown after registering
+
+TODO
+====
+
+- secure pages (likely will use <f:event type="beforeRenderView"/>
+- 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>
+- use Cargo plugin to support deployment to other Java EE application servers (GlassFish)
+- refactor the password/confirm password into a reusable component (needed on registration and change password)
+- consider using unpackTypes in the ear plugin (which works incrementally) to replace portions of the antrun logic
+- use a resource to define persistence context:
+<EntityManager>
+ <PersistenceContext>
+ <unitName>booking</unitName>
+ </PersistenceContext>
+ <booking:BookingDatabase/>
+</EntityManager>
+
+
+OPEN QUESTIONS
+==============
+
+- How do I clear a contextual bean from a scope, in particular the session scope? I've had to do workarounds.
+
+- How do I inject an Event object into a stateful component? I get an error that there is a reference to a
+ non-serializable object from a bean declaring a non-passivating scope. I have to use the Manager to fire an event
+ instead.
+
15 years, 6 months
Seam SVN: r10862 - examples/trunk/booking.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:28:18 -0400 (Mon, 11 May 2009)
New Revision: 10862
Modified:
examples/trunk/booking/readme.txt
Log:
take out -o flags (since it will cause build to break for those without a seeded M2 repository)
move dev notes to WORKLOG file
Modified: examples/trunk/booking/readme.txt
===================================================================
--- examples/trunk/booking/readme.txt 2009-05-11 20:16:02 UTC (rev 10861)
+++ examples/trunk/booking/readme.txt 2009-05-11 20:28:18 UTC (rev 10862)
@@ -1,5 +1,5 @@
-Seam Booking Example (Java EE 5)
-================================
+Seam Booking Example (Java EE Environment)
+==========================================
This example demonstrates the use of Seam 3 in a Java EE 6 environment (or a
Java EE 5 environment enhanced with JSR-299 [Web Beans], JSF 2.0 and Bean
@@ -23,11 +23,14 @@
= First steps
-This example uses a Maven 2 build. To build the EJB and WAR and package them
-inside an EAR, execute the following command:
+This example uses a Maven 2 build. The recommended version is 2.0.10. You can
+use Maven 2.1.0, but know that the maven-cli-plugin recommended in this
+tutorial is not compatible with it out of the box.
- mvn
+Execute this command to build the EJB and WAR and package them inside an EAR:
+ mvn install
+
Now you're ready to deploy.
= Pointing Maven at your JBoss AS installation
@@ -86,20 +89,20 @@
Putting JBOSS_HOME aside for the moment, you can deploy the application to
JBoss AS via JMX by executing this command:
- mvn -o -f seam-booking-ear/pom.xml jboss:deploy
+ mvn -f seam-booking-ear/pom.xml jboss:deploy
You can undeploy the application via JMX using this command:
- mvn -o -f seam-booking-ear/pom.xml jboss:undeploy
+ mvn -f seam-booking-ear/pom.xml jboss:undeploy
Here's the chained restart command via JMX:
- mvn -o -f seam-booking-ear/pom.xml jboss:undeploy && mvn -o package && mvn -o -f seam-booking-ear/pom.xml jboss:deploy
+ mvn -f seam-booking-ear/pom.xml jboss:undeploy && mvn package && mvn -f seam-booking-ear/pom.xml jboss:deploy
If you would rather deploy more traditional way by copying the archive directly
to the deploy directory of the JBoss AS domain, use this command instead:
- mvn -o -f seam-booking-ear/pom.xml jboss:harddeploy
+ mvn -f seam-booking-ear/pom.xml jboss:harddeploy
But likely during development, you're only interested in exploded archives.
@@ -109,7 +112,7 @@
smarter about what it copies to the server. The antrun plugin is bound to the
end of the package goal when the explode profile is active:
- mvn -o package -Pexplode
+ mvn package -Pexplode
This profile executes an series of Ant tasks that copy the exploded WAR,
EJB-JAR, and EAR to the JBoss AS deploy directory.
@@ -117,21 +120,22 @@
You can force a restart of the application by activating the restart profile,
which executes an Ant task bound to the validate phase:
- mvn -o validate -Prestart
+ mvn validate -Prestart
You can remove the archive by activating the undeploy profile, which also
executes an Ant task bound to the validate phase:
- mvn -o validate -Pundeploy
+ mvn validate -Pundeploy
Finally, you can undeploy and explode all in one command using both the
undeploy and explode profiles with a standard package build:
- mvn -o package -Pundeploy,explode
+ mvn package -Pundeploy,explode
-Note that the -o puts Maven in offline mode so that it doesn't perform time
-consuming update checks. The -o flag is included in the aliases configured for
-the Maven CLI plugin documented above.
+Note that you can append -o to any command after you have run the command at
+least once. This flag puts Maven in offline mode so that it doesn't perform
+time consuming update checks. You can also include -o flag in the aliases
+configured for the Maven CLI plugin documented above.
= Example highlights
@@ -141,65 +145,9 @@
- JBoss datasource is deployed with the EAR to simplify packaging
(-ds.xml doesn't have to be deployed to JBoss AS separately)
- supports both a packaged and exploded deployment to JBoss AS
+- Authentication with Seam Security by implementing the Authenticator interface
= Known issues
-(1) Clicking on logout throws an exception
- javax.context.ContextNotActiveException: No active contexts for scope type javax.context.RequestScoped
- at org.jboss.webbeans.ManagerImpl.getContext(ManagerImpl.java:739)
- at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:116)
- at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:96)
- at org.jboss.webbeans.conversation.ConversationImpl_$$_javassist_213.isLongRunning(ConversationImpl_$$_javassist_213.java)
+See WORKLOG
-(2) Ajax is not working on blur in p:edit form fields (had to disable)
- error malformedXML
-
-(3) No list of workspaces
-
-(4) Cannot use <f:view> in template or else it will remove the conversation id token from the view root
-
-(5) @AfterTransactionSuccess observer does not work
-
-(6) Can't read properties from Hotel object in history list. Get this exception:
- javax.inject.IllegalProductException: Cannot return null from a non-dependent producer method
- at org.jboss.webbeans.bean.AbstractProducerBean.checkReturnValue(AbstractProducerBean.java:209)
- at org.jboss.webbeans.bean.AbstractProducerBean.create(AbstractProducerBean.java:349)
- at org.jboss.webbeans.context.AbstractMapContext.get(AbstractMapContext.java:98)
- at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:117)
- at org.jboss.webbeans.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:96)
- at org.jboss.seam.examples.booking.model.Hotel_$$_javassist_227.getAddress(Hotel_$$_javassist_227.java)
-
-= Open questions
-
-- How do I clear a contextual bean from a scope, in particular the session scope? I've had to do workarounds.
-
-- How do I inject an Event object into a stateful component? I get an error that there is a reference to a
- non-serializable object from a bean declaring a non-passivating scope. I have to use the Manager to fire an event
- instead.
-
-- Should the parent project be adjacent to ear/ejb-jar/war?
-
-= TODO
-
-- secure pages (likely will use <f:event type="beforeRenderView"/>
-
-- 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>
-
-- use Cargo plugin to support deployment to other Java EE servers (GlassFish)
-
-- refactor the password/confirm password into a reusable component (needed on
- registration and change password)
-
-- consider using unpackTypes in the ear plugin (which works incrementally) to replace portions of the antrun logic
-
-- use a resource to define persistence context
-<EntityManager>
- <PersistenceContext>
- <unitName>booking</unitName>
- </PersistenceContext>
- <booking:BookingDatabase/>
-</EntityManager>
15 years, 6 months
Seam SVN: r10861 - modules/trunk/parent.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:16:02 -0400 (Mon, 11 May 2009)
New Revision: 10861
Modified:
modules/trunk/parent/pom.xml
Log:
add new modules
add JSR-250 if building with JDK5
Modified: modules/trunk/parent/pom.xml
===================================================================
--- modules/trunk/parent/pom.xml 2009-05-11 20:15:29 UTC (rev 10860)
+++ modules/trunk/parent/pom.xml 2009-05-11 20:16:02 UTC (rev 10861)
@@ -91,10 +91,14 @@
<modules>
<!-- declarating version-matrix as a module forces it to be built first -->
<module>../version-matrix</module>
+ <module>../mock</module>
+ <module>../bridge-api</module>
<module>../el</module>
<module>../international</module>
+ <module>../web</module>
+ <module>../faces</module>
+ <module>../drools</module>
<module>../security</module>
- <module>../faces</module>
</modules>
<build>
@@ -197,6 +201,7 @@
</dependencies>
<profiles>
+
<profile>
<id>api-coverage</id>
<activation>
@@ -225,6 +230,21 @@
</dependency>
</dependencies>
</profile>
+
+ <profile>
+ <id>jdk5</id>
+ <activation>
+ <jdk>1.5</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
</profiles>
<ciManagement>
15 years, 6 months
Seam SVN: r10860 - modules/trunk.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:15:29 -0400 (Mon, 11 May 2009)
New Revision: 10860
Added:
modules/trunk/pom-module-template.xml
Log:
pom template when creating new module
Added: modules/trunk/pom-module-template.xml
===================================================================
--- modules/trunk/pom-module-template.xml (rev 0)
+++ modules/trunk/pom-module-template.xml 2009-05-11 20:15:29 UTC (rev 10860)
@@ -0,0 +1,50 @@
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>seam-parent</artifactId>
+ <groupId>org.jboss.seam</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>seam-%MODULE_ALIAS%</artifactId>
+ <packaging>jar</packaging>
+ <version>3.0.0-SNAPSHOT</version>
+ <name>Seam %MODULE_NAME% Module</name>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/test-suite.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${webbeans.groupId}</groupId>
+ <artifactId>jsr299-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${webbeans.groupId}</groupId>
+ <artifactId>webbeans-logging</artifactId>
+ <!-- assumes use of Web Beans impl -->
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
15 years, 6 months
Seam SVN: r10859 - in modules/trunk/faces/src: main/java/org/jboss/seam/faces/lifecycle and 2 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:14:34 -0400 (Mon, 11 May 2009)
New Revision: 10859
Added:
modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/AfterPhase.java
modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/BeforePhase.java
modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/ManagedSeamPhaseListener.java
modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/SeamPhaseListener.java
modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/Transaction.java
Removed:
modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/JcdiManager.java
Modified:
modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/SeamViewHandler.java
modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/TransferStatusMessagesListener.java
modules/trunk/faces/src/main/resources/META-INF/faces-config.xml
modules/trunk/faces/src/test/java/org/jboss/seam/faces/FacesStatusMessagesTest.java
Log:
use Manager bridge to get JCDI Manager
add SeamPhaseListener to raise before/after phase events and wrap transaction around request (not complete)
temporary Transaction bean until transaction module is ready
update faces descriptor
Deleted: modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/JcdiManager.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/JcdiManager.java 2009-05-11 20:12:16 UTC (rev 10858)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/JcdiManager.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -1,60 +0,0 @@
-package org.jboss.seam.faces.application;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.inject.manager.Manager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * <strong>JcdiManager</strong> retrieves the JCDI Manager from JNDI and caches the
- * result in an application-scoped attribute.
- *
- * @author Dan Allen
- */
-public class JcdiManager
-{
- public static final String JCDI_MANAGER_JNDI_NAME = "java:app/Manager";
-
- public static final String JCDI_MANAGER_ALT_JNDI_NAME = "java:comp/env/app/Manager";
-
- private static final String JCDI_MANAGER_CACHE_KEY = JcdiManager.class.getName() + ".CACHE_KEY";
-
- public static Manager getCurrentManager()
- {
- Manager currentManager = null;
- ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
- if (externalContext != null)
- {
- currentManager = (Manager) externalContext.getApplicationMap().get(JCDI_MANAGER_CACHE_KEY);
- }
-
- if (currentManager != null)
- {
- return currentManager;
- }
-
- try
- {
- InitialContext initialContext = new InitialContext();
- try
- {
- currentManager = (Manager) initialContext.lookup(JCDI_MANAGER_JNDI_NAME);
- }
- catch (NamingException e)
- {
- currentManager = (Manager) initialContext.lookup(JCDI_MANAGER_ALT_JNDI_NAME);
- }
- }
- catch (NamingException e)
- {
- }
-
- if (currentManager != null && externalContext != null)
- {
- externalContext.getApplicationMap().put(JCDI_MANAGER_CACHE_KEY, currentManager);
- }
-
- return currentManager;
- }
-}
Modified: modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/SeamViewHandler.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/SeamViewHandler.java 2009-05-11 20:12:16 UTC (rev 10858)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/application/SeamViewHandler.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -39,12 +39,16 @@
@Override
public String getRedirectURL(FacesContext context, String viewId, Map<String, List<String>> parameters, boolean includeViewParams)
{
- // QUESTION hmmm, we have to convert to faces messages now to leverage JSF's flash feature...I suppose that is okay
- new TransferStatusMessagesListener().execute();
- // should I move this next step into TransferStatusMessagesListener?
- if (context.getMessages().hasNext())
+ // TODO temporary check if session has been killed be Web Beans throws an exception trying to access a session-scoped bean
+ if (context.getExternalContext().getSession(false) != null)
{
- context.getExternalContext().getFlash().setKeepMessages(true);
+ // QUESTION hmmm, we have to convert to faces messages now to leverage JSF's flash feature...I suppose that is okay
+ new TransferStatusMessagesListener().execute();
+ // should I move this next step into TransferStatusMessagesListener?
+ if (context.getMessages().hasNext())
+ {
+ context.getExternalContext().getFlash().setKeepMessages(true);
+ }
}
return super.getRedirectURL(context, viewId, parameters, includeViewParams);
Added: modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/AfterPhase.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/AfterPhase.java (rev 0)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/AfterPhase.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -0,0 +1,27 @@
+package org.jboss.seam.faces.lifecycle;
+
+import static java.lang.annotation.ElementType.FIELD;
+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;
+
+/**
+ * Binding type that identifies a PhaseEvent which is raised
+ * after a JSF life-cycle phase.
+ *
+ * @author Dan Allen
+ */
+@Target( { PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@Inherited
+public @interface AfterPhase
+{
+}
Added: modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/BeforePhase.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/BeforePhase.java (rev 0)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/BeforePhase.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -0,0 +1,27 @@
+package org.jboss.seam.faces.lifecycle;
+
+import static java.lang.annotation.ElementType.FIELD;
+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;
+
+/**
+ * Binding type that identifies a PhaseEvent which is
+ * raised before a JSF life-cycle phase.
+ *
+ * @author Dan Allen
+ */
+@Target( { PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@Inherited
+public @interface BeforePhase
+{
+}
Added: modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/ManagedSeamPhaseListener.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/ManagedSeamPhaseListener.java (rev 0)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/ManagedSeamPhaseListener.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -0,0 +1,110 @@
+package org.jboss.seam.faces.lifecycle;
+
+import javax.context.ApplicationScoped;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.inject.AnnotationLiteral;
+import javax.inject.Initializer;
+import javax.inject.manager.Manager;
+import javax.transaction.Status;
+import javax.transaction.UserTransaction;
+
+/**
+ * A class that is invoked by the JCDI Manager handles setup and cleanup tasks
+ * which are specific to Seam's JSF support. This listener does not tasks which
+ * are relevant for any servlet request. Specifically, it raises events so that
+ * other beans managed by JCDI can tie into the JSF phases and it handles
+ * transaction management a key points in the JSF life cycle.
+ *
+ * @author Dan Allen
+ */
+public
+@ApplicationScoped
+class ManagedSeamPhaseListener
+{
+ private Manager manager;
+
+ private UserTransaction transaction;
+
+ public ManagedSeamPhaseListener() {}
+
+ public @Initializer ManagedSeamPhaseListener(Manager manager, UserTransaction transaction)
+ {
+ this.manager = manager;
+ this.transaction = transaction;
+ }
+
+ public void beforePhase(PhaseEvent event)
+ {
+ handleTransactionBeforePhase(event);
+ raiseEventBeforePhase(event);
+ }
+
+ public void afterPhase(PhaseEvent event)
+ {
+ handleTransactionAfterPhase(event);
+ raiseEventAfterPhase(event);
+ }
+
+ protected void handleTransactionBeforePhase(PhaseEvent event)
+ {
+ if (event.getPhaseId() == PhaseId.RENDER_RESPONSE)
+ {
+ beginTransaction(event.getPhaseId());
+ }
+ }
+
+ protected void handleTransactionAfterPhase(PhaseEvent event)
+ {
+ if (event.getPhaseId() == PhaseId.RENDER_RESPONSE)
+ {
+ commitOrRollbackTransaction(event.getPhaseId());
+ }
+ }
+
+ protected void beginTransaction(PhaseId phase)
+ {
+ try
+ {
+ int status = transaction.getStatus();
+ if (status != Status.STATUS_ACTIVE && status != Status.STATUS_MARKED_ROLLBACK)
+ {
+ transaction.begin();
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not begin transaction", e);
+ }
+ }
+
+ protected void commitOrRollbackTransaction(PhaseId phase)
+ {
+ try
+ {
+ int status = transaction.getStatus();
+ if (status == Status.STATUS_ACTIVE)
+ {
+ transaction.commit();
+ }
+ else if (status == Status.STATUS_MARKED_ROLLBACK)
+ {
+ transaction.rollback();
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not commit or rollback transaction", e);
+ }
+ }
+
+ protected void raiseEventBeforePhase(PhaseEvent event)
+ {
+ manager.fireEvent(event, new AnnotationLiteral<BeforePhase>() {});
+ }
+
+ protected void raiseEventAfterPhase(PhaseEvent event)
+ {
+ manager.fireEvent(event, new AnnotationLiteral<AfterPhase>() {});
+ }
+}
Added: modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/SeamPhaseListener.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/SeamPhaseListener.java (rev 0)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/SeamPhaseListener.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -0,0 +1,38 @@
+package org.jboss.seam.faces.lifecycle;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.jboss.seam.bridge.ManagerBridge;
+
+/**
+ * A JSF <strong>PhaseListener</strong> implementation that hooks Seam into the
+ * JSF life cycle. This class observes all JSF phases and merely delegates to
+ * an application-scope bean managed by JCDI.
+ *
+ * @author Dan Allen
+ */
+public class SeamPhaseListener implements PhaseListener
+{
+ public void beforePhase(PhaseEvent event)
+ {
+ getDelegate().beforePhase(event);
+ }
+
+ public void afterPhase(PhaseEvent event)
+ {
+ getDelegate().afterPhase(event);
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.ANY_PHASE;
+ }
+
+ protected ManagedSeamPhaseListener getDelegate()
+ {
+ return ManagerBridge.getProvider().getCurrentManager().getInstanceByType(ManagedSeamPhaseListener.class);
+ }
+
+}
Added: modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/Transaction.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/Transaction.java (rev 0)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/Transaction.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -0,0 +1,47 @@
+package org.jboss.seam.faces.lifecycle;
+
+import javax.context.RequestScoped;
+import javax.inject.Produces;
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+import javax.transaction.UserTransaction;
+
+// TEMPORARY!!
+public class Transaction
+{
+ private static final String USER_TRANSACTION_JNDI_NAME = "java:comp/UserTransaction";
+
+ // Embedded JBoss has no java:comp/UserTransaction
+ private static final String ALTERNATE_USER_TRANSACTION_JNDI_NAME = "UserTransaction";
+
+ public
+ @Produces
+ @RequestScoped
+ UserTransaction getUserTransaction() throws NamingException
+ {
+ InitialContext context = new InitialContext();
+ try
+ {
+ try
+ {
+ return (UserTransaction) context.lookup(USER_TRANSACTION_JNDI_NAME);
+ }
+ catch (NameNotFoundException nnfe)
+ {
+ try
+ {
+ return (UserTransaction) context.lookup(ALTERNATE_USER_TRANSACTION_JNDI_NAME);
+ }
+ catch (NamingException e)
+ {
+ throw nnfe;
+ }
+ }
+ }
+ catch (NamingException e)
+ {
+ throw e;
+ }
+ }
+}
Modified: modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/TransferStatusMessagesListener.java
===================================================================
--- modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/TransferStatusMessagesListener.java 2009-05-11 20:12:16 UTC (rev 10858)
+++ modules/trunk/faces/src/main/java/org/jboss/seam/faces/lifecycle/TransferStatusMessagesListener.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -2,7 +2,10 @@
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
-import org.jboss.seam.faces.application.JcdiManager;
+import javax.inject.UnsatisfiedDependencyException;
+import javax.inject.manager.Manager;
+
+import org.jboss.seam.bridge.ManagerBridge;
import org.jboss.seam.international.StatusMessages;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -31,15 +34,19 @@
public void execute()
{
- StatusMessages statusMessages = JcdiManager.getCurrentManager().getInstanceByType(StatusMessages.class);
-
- if (statusMessages != null)
+ try
{
- statusMessages.onBeforeRender();
+ Manager manager = ManagerBridge.getProvider().getRootManager();
+ // tests
+ if (manager != null)
+ {
+ manager.getInstanceByType(StatusMessages.class).onBeforeRender();
+ }
}
- else
+ catch (UnsatisfiedDependencyException e)
{
- log.warn("Could not locate StatusMessages bean. Status messages will not be transfered to FacesContext.");
+ log.warn("Could not locate the StatusMessages bean. Status messages will not be transfered to the FacesContext.");
}
+
}
}
Modified: modules/trunk/faces/src/main/resources/META-INF/faces-config.xml
===================================================================
--- modules/trunk/faces/src/main/resources/META-INF/faces-config.xml 2009-05-11 20:12:16 UTC (rev 10858)
+++ modules/trunk/faces/src/main/resources/META-INF/faces-config.xml 2009-05-11 20:14:34 UTC (rev 10859)
@@ -3,10 +3,10 @@
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_2_0.xsd"
version="2.0"
- id="seam-faces">
+ id="seam3">
<ordering>
- <after>web-beans</after>
+ <after>webbeans</after>
</ordering>
<factory>
@@ -23,4 +23,10 @@
</system-event-listener>
</application>
+ <lifecycle>
+ <!-- Not ready for this yet, it is just testing
+ <phase-listener>org.jboss.seam.faces.lifecycle.SeamPhaseListener</phase-listener>
+ -->
+ </lifecycle>
+
</faces-config>
Modified: modules/trunk/faces/src/test/java/org/jboss/seam/faces/FacesStatusMessagesTest.java
===================================================================
--- modules/trunk/faces/src/test/java/org/jboss/seam/faces/FacesStatusMessagesTest.java 2009-05-11 20:12:16 UTC (rev 10858)
+++ modules/trunk/faces/src/test/java/org/jboss/seam/faces/FacesStatusMessagesTest.java 2009-05-11 20:14:34 UTC (rev 10859)
@@ -15,6 +15,7 @@
import org.jboss.seam.international.LocaleProducer;
import org.jboss.seam.international.StatusMessage;
import org.jboss.seam.international.StatusMessages;
+import org.jboss.seam.mock.faces.MockApplication;
import org.jboss.seam.mock.faces.MockFacesContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
@@ -127,7 +128,7 @@
private void installMockFacesContext()
{
- new MockFacesContext(true).setCurrent();
+ new MockFacesContext(new MockApplication(), true).setCurrent();
}
private void activateConversationContext()
15 years, 6 months
Seam SVN: r10858 - modules/trunk/faces.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:12:16 -0400 (Mon, 11 May 2009)
New Revision: 10858
Modified:
modules/trunk/faces/pom.xml
Log:
add bridge api
temporarily add transaction
Modified: modules/trunk/faces/pom.xml
===================================================================
--- modules/trunk/faces/pom.xml 2009-05-11 20:11:39 UTC (rev 10857)
+++ modules/trunk/faces/pom.xml 2009-05-11 20:12:16 UTC (rev 10858)
@@ -47,6 +47,11 @@
<dependency>
<groupId>${seam.groupId}</groupId>
+ <artifactId>seam-bridge-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>${seam.groupId}</groupId>
<artifactId>seam-el</artifactId>
</dependency>
@@ -86,6 +91,12 @@
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
</dependencies>
</project>
15 years, 6 months
Seam SVN: r10857 - modules/trunk/el.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-05-11 16:11:39 -0400 (Mon, 11 May 2009)
New Revision: 10857
Modified:
modules/trunk/el/pom.xml
Log:
note
Modified: modules/trunk/el/pom.xml
===================================================================
--- modules/trunk/el/pom.xml 2009-05-11 20:10:38 UTC (rev 10856)
+++ modules/trunk/el/pom.xml 2009-05-11 20:11:39 UTC (rev 10857)
@@ -7,6 +7,9 @@
<artifactId>seam-parent</artifactId>
<groupId>org.jboss.seam</groupId>
<version>3.0.0-SNAPSHOT</version>
+ <!-- could use this to build w/o having install the parent
+ <relativePath>../parent/pom.xml</relativePath>
+ -->
</parent>
<artifactId>seam-el</artifactId>
15 years, 6 months