[seam-commits] Seam SVN: r14462 - in branches/community/Seam_2_3/examples-ee6: nestedbooking and 38 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Apr 2 06:27:19 EDT 2012
Author: maschmid
Date: 2012-04-02 06:27:17 -0400 (Mon, 02 Apr 2012)
New Revision: 14462
Added:
branches/community/Seam_2_3/examples-ee6/nestedbooking/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/pom.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-deployment-structure.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-seam-booking-ds.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/pom.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Authenticator.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Booking.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingList.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Hotel.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Register.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Room.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomHome.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomList.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreference.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreferenceAction.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/User.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/ejb-jar.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/persistence.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/import.sql
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedConversationTest.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-ftest/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-ftest/testng.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/testng.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/WEB-INF/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/WEB-INF/components.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/nestedbooking.properties
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/pom.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/components.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/faces-config.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/pages.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/web.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/book.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/confirm.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/conversations.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/date.css
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/screen.css
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/trailblazer_main.css
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/edit.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/home.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/hotel.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/bg.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/btn.bg.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cal-next.png
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cal-prev.png
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cnt.bg.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/dtpick.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.ad.jpg
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.bar.jpg
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.bg.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.title.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/header_line.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/input.bg.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/sdb.bg.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/spinner.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/th.bg.gif
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/index.html
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/main.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/output.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/password.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/payment.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/register.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/rooms.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/template.xhtml
branches/community/Seam_2_3/examples-ee6/nestedbooking/pom.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/readme.txt
Log:
Add nestedbooking example to ee6 examples
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/pom.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>nestedbooking</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0.Beta2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ear</artifactId>
+ <packaging>ear</packaging>
+ <name>Nested Booking EAR Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-web</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ejb</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3_min</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>seam-nestedbooking</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <version>6</version>
+ <defaultLibBundleDir>lib</defaultLibBundleDir>
+ <!-- Exclude eclipse generated application.xml and manually modified jboss-app.xml during mvn build -->
+ <earSourceExcludes>**/application.xml, **/jboss-app.xml</earSourceExcludes>
+ <!-- use maven generated application.xml instead -->
+ <generateApplicationXml>true</generateApplicationXml>
+ <filtering>true</filtering>
+ <modules>
+ <webModule>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-web</artifactId>
+ <contextRoot>/seam-nestedbooking</contextRoot>
+ <bundleFileName>nestedbooking-web.war</bundleFileName>
+ </webModule>
+ <ejbModule>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ejb</artifactId>
+ <bundleFileName>nestedbooking-ejb.jar</bundleFileName>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>exploded</id>
+ <properties>
+ <example.name>nestedbooking</example.name>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ear</artifactId>
+ <type>ear</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-web</artifactId>
+ <type>war</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear/${example.name}-web.war</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ejb</artifactId>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear/${example.name}-ejb.jar</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-deployment-structure.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-deployment-structure.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,12 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.apache.log4j" export="true"/>
+ <module name="org.dom4j" export="true"/>
+ <module name="org.apache.commons.logging" export="true"/>
+ <module name="org.apache.commons.collections" export="true"/>
+ <module name="javax.faces.api" export="true"/>
+ <module name="com.sun.jsf-impl" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-seam-booking-ds.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-seam-booking-ds.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ear/src/main/application/META-INF/jboss-seam-booking-ds.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources xmlns="http://www.jboss.org/ironjacamar/schema">
+ <datasource
+ jndi-name="java:/nestedBookingDatasource"
+ enabled="true"
+ use-java-context="true" pool-name="nestedbookingdb">
+ <connection-url>jdbc:h2:mem:nestedbookingdb;DB_CLOSE_DELAY=-1</connection-url>
+ <driver>h2</driver>
+ <security>
+ <user-name>sa</user-name>
+ <password>sa</password>
+ </security>
+ </datasource>
+</datasources>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/pom.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>nestedbooking</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0.Beta2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ejb</artifactId>
+ <packaging>ejb</packaging>
+ <name>Nested Booking EJB Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Authenticator.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Authenticator.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Authenticator.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,9 @@
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface Authenticator
+{
+ boolean authenticate();
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,39 @@
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.util.List;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+ at Stateless
+ at Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+ @PersistenceContext EntityManager em;
+
+ @Out(required=false, scope = SESSION)
+ private User user;
+
+ public boolean authenticate()
+ {
+ List results = em.createQuery("select u from User u where u.username=#{identity.username} and u.password=#{identity.password}")
+ .getResultList();
+
+ if ( results.size()==0 )
+ {
+ return false;
+ }
+ else
+ {
+ user = (User) results.get(0);
+ return true;
+ }
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Booking.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Booking.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Booking.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,188 @@
+//$Id: Booking.java 6893 2007-12-04 12:05:03Z pmuir $
+package org.jboss.seam.example.booking;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.text.DateFormat;
+import java.util.Date;
+
+import javax.persistence.Basic;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+
+import org.jboss.seam.annotations.Name;
+
+ at Entity
+ at Name("booking")
+public class Booking implements Serializable
+{
+ private Long id;
+ private User user;
+ private Hotel hotel;
+ private Date checkinDate;
+ private Date checkoutDate;
+ private String creditCard;
+ private String creditCardName;
+ private int creditCardExpiryMonth;
+ private int creditCardExpiryYear;
+ private Room roomPreference;
+
+ public Booking() {}
+
+ public Booking(Hotel hotel, User user)
+ {
+ this.hotel = hotel;
+ this.user = user;
+ this.roomPreference = this.hotel.getStandardRoom();
+ }
+
+ @Transient
+ public BigDecimal getTotal()
+ {
+ return getTotal(roomPreference);
+ }
+
+ @Transient
+ public BigDecimal getTotal(Room room)
+ {
+ return room.getPrice().multiply(new BigDecimal(getNights()));
+ }
+
+ @Transient
+ public int getNights()
+ {
+ return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / 1000 / 60 / 60 / 24;
+ }
+
+ @Id @GeneratedValue
+ public Long getId()
+ {
+ return id;
+ }
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @NotNull
+ @Basic @Temporal(TemporalType.DATE)
+ public Date getCheckinDate()
+ {
+ return checkinDate;
+ }
+ public void setCheckinDate(Date datetime)
+ {
+ this.checkinDate = datetime;
+ }
+
+ @ManyToOne @NotNull
+ public Hotel getHotel()
+ {
+ return hotel;
+ }
+ public void setHotel(Hotel hotel)
+ {
+ this.hotel = hotel;
+ }
+
+ @ManyToOne @NotNull
+ public User getUser()
+ {
+ return user;
+ }
+ public void setUser(User user)
+ {
+ this.user = user;
+ }
+
+ @Basic @Temporal(TemporalType.DATE)
+ @NotNull
+ public Date getCheckoutDate()
+ {
+ return checkoutDate;
+ }
+ public void setCheckoutDate(Date checkoutDate)
+ {
+ 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;
+ }
+
+ @Transient
+ public String getDescription()
+ {
+ DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
+ return hotel==null ? null : hotel.getName() +
+ ", " + df.format( getCheckinDate() ) +
+ " to " + df.format( getCheckoutDate() );
+ }
+
+ @ManyToOne @NotNull
+ public Room getRoomPreference()
+ {
+ return roomPreference;
+ }
+
+ public void setRoomPreference(Room roomPreference)
+ {
+ this.roomPreference = roomPreference;
+ }
+
+ @NotNull(message="Credit card name is required")
+ @Size(min=3, max=70, message="Credit card name is required")
+ public String getCreditCardName()
+ {
+ return creditCardName;
+ }
+
+ public void setCreditCardName(String creditCardName)
+ {
+ this.creditCardName = creditCardName;
+ }
+
+ public int getCreditCardExpiryMonth()
+ {
+ return creditCardExpiryMonth;
+ }
+
+ public void setCreditCardExpiryMonth(int creditCardExpiryMonth)
+ {
+ this.creditCardExpiryMonth = creditCardExpiryMonth;
+ }
+
+ public int getCreditCardExpiryYear()
+ {
+ return creditCardExpiryYear;
+ }
+
+ public void setCreditCardExpiryYear(int creditCardExpiryYear)
+ {
+ this.creditCardExpiryYear = creditCardExpiryYear;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Booking(" + user + ","+ hotel + ")";
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingList.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingList.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingList.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,13 @@
+//$Id: BookingList.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface BookingList
+{
+ public void getBookings();
+ public Booking getBooking();
+ public void cancel();
+ public void destroy();
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingListAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/BookingListAction.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,72 @@
+//$Id: BookingListAction.java 8748 2008-08-20 12:08:30Z pete.muir at jboss.org $
+package org.jboss.seam.example.booking;
+import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
+import static org.jboss.seam.ScopeType.SESSION;
+import java.io.Serializable;
+import java.util.List;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+ at Stateful
+ at Scope(SESSION)
+ at Name("bookingList")
+ at Restrict("#{identity.loggedIn}")
+ at TransactionAttribute(REQUIRES_NEW)
+public class BookingListAction implements BookingList, Serializable
+{
+ private static final long serialVersionUID = 1L;
+ @PersistenceContext
+ private EntityManager em;
+
+ @In
+ private User user;
+
+ @DataModel
+ private List<Booking> bookings;
+ @DataModelSelection
+ private Booking booking;
+
+ @Logger
+ private Log log;
+
+ @Factory
+ @Observer("bookingConfirmed")
+ public void getBookings()
+ {
+ bookings = em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate")
+ .setParameter("username", user.getUsername())
+ .getResultList();
+ }
+
+ public void cancel()
+ {
+ log.info("Cancel booking: #{bookingList.booking.id} for #{user.username}");
+ Booking cancelled = em.find(Booking.class, booking.getId());
+ if (cancelled!=null) em.remove( cancelled );
+ getBookings();
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
+ }
+
+ public Booking getBooking()
+ {
+ return booking;
+ }
+
+ @Destroy @Remove
+ public void destroy() {}
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePassword.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePassword.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,16 @@
+//$Id: ChangePassword.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface ChangePassword
+{
+ public void changePassword();
+ public boolean isChanged();
+
+ public String getVerify();
+ public void setVerify(String verify);
+
+ public void destroy();
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,71 @@
+//$Id: ChangePasswordAction.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+import static org.jboss.seam.ScopeType.EVENT;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.faces.FacesMessages;
+
+ at Stateful
+ at Scope(EVENT)
+ at Name("changePassword")
+ at Restrict("#{identity.loggedIn}")
+public class ChangePasswordAction implements ChangePassword
+{
+ @In @Out
+ private User user;
+
+ @PersistenceContext
+ private EntityManager em;
+
+ private String verify;
+
+ private boolean changed;
+
+ @In
+ private FacesMessages facesMessages;
+
+ public void changePassword()
+ {
+ if ( user.getPassword().equals(verify) )
+ {
+ user = em.merge(user);
+ facesMessages.add("Password updated");
+ changed = true;
+ }
+ else
+ {
+ facesMessages.addToControl("verify", "Re-enter new password");
+ revertUser();
+ verify=null;
+ }
+ }
+
+ public boolean isChanged()
+ {
+ return changed;
+ }
+
+ private void revertUser()
+ {
+ user = em.find(User.class, user.getUsername());
+ }
+ public String getVerify()
+ {
+ return verify;
+ }
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+
+ @Destroy @Remove
+ public void destroy() {}
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Hotel.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Hotel.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Hotel.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,173 @@
+//$Id: Hotel.java 6893 2007-12-04 12:05:03Z pmuir $
+package org.jboss.seam.example.booking;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.Transient;
+
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+import org.jboss.seam.annotations.Name;
+
+ at Entity
+ at Name("hotel")
+public class Hotel implements Serializable
+{
+ private Long id;
+ private String name;
+ private String address;
+ private String city;
+ private String state;
+ private String zip;
+ private String country;
+ private List<Room> rooms;
+
+ Hotel() {
+ this.rooms = new ArrayList<Room>();
+ }
+
+ @Id @GeneratedValue
+ public Long getId()
+ {
+ return id;
+ }
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @Size(max=50) @NotNull
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @Size(max=100) @NotNull
+ public String getAddress()
+ {
+ return address;
+ }
+ public void setAddress(String address)
+ {
+ this.address = address;
+ }
+
+ @Size(max=40) @NotNull
+ public String getCity()
+ {
+ return city;
+ }
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ @Size(min=4, max=6) @NotNull
+ public String getZip()
+ {
+ return zip;
+ }
+ public void setZip(String zip)
+ {
+ this.zip = zip;
+ }
+
+ @Size(min=2, max=10) @NotNull
+ public String getState()
+ {
+ return state;
+ }
+ public void setState(String state)
+ {
+ this.state = state;
+ }
+
+ @Size(min=2, max=40) @NotNull
+ public String getCountry()
+ {
+ return country;
+ }
+ public void setCountry(String country)
+ {
+ this.country = country;
+ }
+
+ @Transient
+ public BigDecimal getMinPrice()
+ {
+ return this.getStandardRoom().getPrice();
+ }
+
+ @Transient
+ public BigDecimal getMaxPrice()
+ {
+ BigDecimal maxPrice = this.getRooms().get(0).getPrice();
+
+ for(int i = 1; i < this.getRooms().size(); i++)
+ {
+ Room room = this.getRooms().get(i);
+
+ if(maxPrice.compareTo(room.getPrice()) < 0)
+ {
+ maxPrice = room.getPrice();
+ }
+ }
+
+ return maxPrice;
+ }
+
+ @OneToMany
+ @JoinColumn(name="HOTEL_ID")
+ public List<Room> getRooms()
+ {
+ return rooms;
+ }
+
+ public void setRooms(List<Room> roomsSelections)
+ {
+ this.rooms = roomsSelections;
+ }
+
+ @Transient
+ public List<Room> getAvailableRooms(Date checkinDate, Date checkoutDate)
+ {
+ // checking could be performed here to determine which
+ // rooms are available for the provided dates. to simplify
+ // the example, just return the list of rooms
+
+ return rooms;
+ }
+
+ @Transient
+ public Room getStandardRoom()
+ {
+ for(Room room : this.getRooms())
+ {
+ if(room.isIncluded())
+ {
+ return room;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBooking.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBooking.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,21 @@
+//$Id: HotelBooking.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface HotelBooking
+{
+ public void selectHotel(Hotel selectedHotel);
+
+ public void bookHotel();
+
+ public String setBookingDates();
+
+ public void confirm();
+
+ public void cancel();
+
+ public void destroy();
+
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,115 @@
+//$Id: HotelBookingAction.java 8991 2008-09-14 17:16:48Z jacob.orshalick $
+package org.jboss.seam.example.booking;
+import static javax.persistence.PersistenceContextType.EXTENDED;
+import java.util.Calendar;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.core.Conversation;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+ at Stateful
+ at Name("hotelBooking")
+ at Restrict("#{identity.loggedIn}")
+public class HotelBookingAction implements HotelBooking
+{
+
+ @PersistenceContext(type=EXTENDED)
+ private EntityManager em;
+
+ @In
+ private User user;
+
+ @In(required=false) @Out
+ private Hotel hotel;
+
+ @In(required=false)
+ @Out(required=false)
+ private Booking booking;
+
+ @In(required=false)
+ private Room roomSelection;
+
+ @In
+ private FacesMessages facesMessages;
+
+ @In
+ private Events events;
+
+ @Logger
+ private Log log;
+
+ @Begin
+ public void selectHotel(Hotel selectedHotel)
+ {
+ log.info("Selected hotel #0", selectedHotel.getName());
+ hotel = em.merge(selectedHotel);
+ }
+
+ public String setBookingDates()
+ {
+ // the result will indicate whether or not to begin the nested conversation
+ // as well as the navigation. if a null result is returned, the nested
+ // conversation will not begin, and the user will be returned to the current
+ // page to fix validation issues
+ String result = null;
+
+ Calendar calendar = Calendar.getInstance();
+ calendar.add(Calendar.DAY_OF_MONTH, -1);
+
+ // validate what we have received from the user so far
+ if ( booking.getCheckinDate().before( calendar.getTime() ) )
+ {
+ facesMessages.addToControl("checkinDate", "Check in date must be a future date");
+ }
+ else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
+ {
+ facesMessages.addToControl("checkoutDate", "Check out date must be later than check in date");
+ }
+ else
+ {
+ result = "rooms";
+ }
+
+ return result;
+ }
+
+ public void bookHotel()
+ {
+ booking = new Booking(hotel, user);
+ Calendar calendar = Calendar.getInstance();
+ booking.setCheckinDate( calendar.getTime() );
+ calendar.add(Calendar.DAY_OF_MONTH, 1);
+ booking.setCheckoutDate( calendar.getTime() );
+ }
+
+ @End(root=true)
+ public void confirm()
+ {
+ // on confirmation we set the room preference in the booking. the room preference
+ // will be injected based on the nested conversation we are in.
+ booking.setRoomPreference(roomSelection);
+
+ em.persist(booking);
+ facesMessages.add("Thank you, #{user.name}, your confimation number for #{hotel.name} is #{booking.id}");
+ log.info("New booking: #{booking.id} for #{user.username}");
+ events.raiseTransactionSuccessEvent("bookingConfirmed");
+ }
+
+ @End(root=true, beforeRedirect=true)
+ public void cancel() {}
+
+ @Destroy @Remove
+ public void destroy() {}
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearching.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearching.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,23 @@
+//$Id: HotelSearching.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface HotelSearching
+{
+ public int getPageSize();
+ public void setPageSize(int pageSize);
+
+ public String getSearchString();
+ public void setSearchString(String searchString);
+
+ public String getSearchPattern();
+
+ public void find();
+ public void nextPage();
+ public boolean isNextPageAvailable();
+
+ public void destroy();
+
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,84 @@
+//$Id: HotelSearchingAction.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+import java.util.List;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.security.Restrict;
+
+ at Stateful
+ at Name("hotelSearch")
+ at Scope(ScopeType.SESSION)
+ at Restrict("#{identity.loggedIn}")
+public class HotelSearchingAction implements HotelSearching
+{
+
+ @PersistenceContext
+ private EntityManager em;
+
+ private String searchString;
+ private int pageSize = 10;
+ private int page;
+
+ @DataModel
+ private List<Hotel> hotels;
+
+ public void find()
+ {
+ page = 0;
+ queryHotels();
+ }
+ public void nextPage()
+ {
+ page++;
+ queryHotels();
+ }
+
+ private void queryHotels()
+ {
+ hotels = em.createQuery("select h from Hotel h where lower(h.name) like #{pattern} or lower(h.city) like #{pattern} or lower(h.zip) like #{pattern} or lower(h.address) like #{pattern}")
+ .setMaxResults(pageSize)
+ .setFirstResult( page * pageSize )
+ .getResultList();
+ }
+
+ public boolean isNextPageAvailable()
+ {
+ return hotels!=null && hotels.size()==pageSize;
+ }
+
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ @Factory(value="pattern", scope=ScopeType.EVENT)
+ public String getSearchPattern()
+ {
+ return searchString==null ?
+ "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
+ }
+
+ public String getSearchString()
+ {
+ return searchString;
+ }
+
+ public void setSearchString(String searchString)
+ {
+ this.searchString = searchString;
+ }
+
+ @Destroy @Remove
+ public void destroy() {}
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Register.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Register.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Register.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,16 @@
+//$Id: Register.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+ at Local
+public interface Register
+{
+ public void register();
+ public void invalid();
+ public String getVerify();
+ public void setVerify(String verify);
+ public boolean isRegistered();
+
+ public void destroy();
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RegisterAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RegisterAction.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,76 @@
+//$Id: RegisterAction.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+import static org.jboss.seam.ScopeType.EVENT;
+import java.util.List;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.FacesMessages;
+ at Stateful
+ at Scope(EVENT)
+ at Name("register")
+public class RegisterAction implements Register
+{
+ @In
+ private User user;
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @In
+ private FacesMessages facesMessages;
+
+ private String verify;
+
+ private boolean registered;
+
+ public void register()
+ {
+ if ( user.getPassword().equals(verify) )
+ {
+ List existing = em.createQuery("select u.username from User u where u.username=#{user.username}")
+ .getResultList();
+ if (existing.size()==0)
+ {
+ em.persist(user);
+ facesMessages.add("Successfully registered as #{user.username}");
+ registered = true;
+ }
+ else
+ {
+ facesMessages.addToControl("username", "Username #{user.username} already exists");
+ }
+ }
+ else
+ {
+ facesMessages.addToControl("verify", "Re-enter your password");
+ verify=null;
+ }
+ }
+
+ public void invalid()
+ {
+ facesMessages.add("Please try again");
+ }
+
+ public boolean isRegistered()
+ {
+ return registered;
+ }
+ public String getVerify()
+ {
+ return verify;
+ }
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+
+ @Destroy @Remove
+ public void destroy() {}
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Room.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Room.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/Room.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,83 @@
+package org.jboss.seam.example.booking;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Transient;
+
+import javax.validation.constraints.Size;
+
+import org.jboss.seam.annotations.Name;
+
+ at Entity
+ at Name("room")
+public class Room implements Serializable {
+
+ private Long id;
+ private String name;
+ private String description;
+ private boolean included;
+ private BigDecimal price;
+
+ @Id @GeneratedValue
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @Size(max=64)
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @Size(max=1024)
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public boolean isIncluded()
+ {
+ return included;
+ }
+
+ public void setIncluded(boolean included)
+ {
+ this.included = included;
+ }
+
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+
+ public void setPrice(BigDecimal price)
+ {
+ this.price = price;
+ }
+
+ @Transient
+ public BigDecimal getPrice(int numNights)
+ {
+ return price.multiply(new BigDecimal(numNights));
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomHome.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomHome.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomHome.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,36 @@
+package org.jboss.seam.example.booking;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.web.RequestParameter;
+import org.jboss.seam.framework.EntityHome;
+
+import org.jboss.seam.example.booking.Room;
+
+ at Name("roomHome")
+public class RoomHome extends EntityHome<Room>
+{
+
+ @RequestParameter
+ private Long roomId;
+
+ @Override
+ public Object getId()
+ {
+ if (roomId==null)
+ {
+ return super.getId();
+ }
+ else
+ {
+ return roomId;
+ }
+ }
+
+ @Override @Begin
+ public void create()
+ {
+ super.create();
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomList.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomList.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomList.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,14 @@
+package org.jboss.seam.example.booking;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityQuery;
+
+ at Name("roomList")
+public class RoomList extends EntityQuery
+{
+ @Override
+ public String getEjbql()
+ {
+ return "select room from Room room";
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreference.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreference.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreference.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,23 @@
+package org.jboss.seam.example.booking;
+
+import java.math.BigDecimal;
+
+import javax.ejb.Local;
+
+ at Local
+public interface RoomPreference
+{
+
+ public void loadAvailableRooms();
+
+ public String selectPreference();
+
+ public BigDecimal getExpectedPrice();
+
+ public String requestConfirmation();
+
+ public String cancel();
+
+ public void destroy();
+
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreferenceAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreferenceAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/RoomPreferenceAction.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,90 @@
+package org.jboss.seam.example.booking;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.log.Log;
+
+import org.jboss.seam.example.booking.Room;
+
+ at Stateful
+ at Name("roomPreference")
+ at Restrict("#{identity.loggedIn}")
+public class RoomPreferenceAction implements RoomPreference
+{
+
+ @Logger
+ private Log log;
+
+ @In private Hotel hotel;
+
+ @In private Booking booking;
+
+ @DataModel(value="availableRooms")
+ private List<Room> availableRooms;
+
+ @DataModelSelection(value="availableRooms")
+ private Room roomSelection;
+
+ @In(required=false, value="roomSelection")
+ @Out(required=false, value="roomSelection")
+ private Room room;
+
+ @Factory("availableRooms")
+ public void loadAvailableRooms()
+ {
+ availableRooms = hotel.getAvailableRooms(booking.getCheckinDate(), booking.getCheckoutDate());
+ log.info("Retrieved #0 available rooms", availableRooms.size());
+ }
+
+ public BigDecimal getExpectedPrice()
+ {
+ log.info("Retrieving price for room #0", roomSelection.getName());
+
+ return booking.getTotal(roomSelection);
+ }
+
+ @Begin(nested=true)
+ public String selectPreference()
+ {
+ log.info("Room selected");
+
+ this.room = this.roomSelection;
+
+ return "payment";
+ }
+
+ public String requestConfirmation()
+ {
+ // all validations are performed through the s:validateAll, so checks are already
+ // performed
+ log.info("Request confirmation from user");
+
+ return "confirm";
+ }
+
+ @End(beforeRedirect=true)
+ public String cancel()
+ {
+ log.info("ending conversation");
+
+ return "cancel";
+ }
+
+ @Destroy @Remove
+ public void destroy() {}
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/User.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/User.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/java/org/jboss/seam/example/booking/User.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,77 @@
+//$Id: User.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+ at Entity
+ at Name("user")
+ at Scope(SESSION)
+ at Table(name="Customer")
+public class User implements Serializable
+{
+ private String username;
+ private String password;
+ private String name;
+
+ public User(String name, String password, String username)
+ {
+ this.name = name;
+ this.password = password;
+ this.username = username;
+ }
+
+ public User() {}
+
+ @NotNull
+ @Size(max=100)
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @NotNull
+ @Size(min=4, max=15)
+ public String getPassword()
+ {
+ return password;
+ }
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ @Id
+ @Size(min=4, max=15)
+ @Pattern(regexp="^\\w*$", message="not a valid username")
+ public String getUsername()
+ {
+ return username;
+ }
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "User(" + username + ")";
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/ejb-jar.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/ejb-jar.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ 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/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+
+</ejb-jar>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/persistence.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/persistence.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/META-INF/persistence.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="bookingDatabase">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/nestedBookingDatasource</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <!-- These are the default for JBoss EJB3, but not for HEM: -->
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/import.sql
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/import.sql (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/import.sql 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,45 @@
+insert into Customer (username, password, name) values ('gavin', 'foobar', 'Gavin King')
+insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User')
+
+insert into Hotel (id, name, address, city, state, zip, country) values (1, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (1, 1, 'King Room', 'One king bed. Table with chairs. Complimentary high-speed Internet access. TV with premium cable and pay movies. Direct-dial speakerphone with voice mail. Coffee/tea maker. Hair dryer. Iron/ironing board.', 120, true)
+insert into Room (id, hotel_id, name, description, price, included) values (2, 1, 'Double Room', 'Two double beds. Table with chairs. Complimentary high-speed Internet access. TV with premium cable and pay movies. Direct-dial speakerphone with voice mail. Coffee/tea maker. Hair dryer. Iron/ironing board.', 120, false)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (2, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (3, 2, 'Standard 1 King', 'One king bed. Wireless Internet access (surcharge). TV with video games. Marble bathroom. Complimentary newspaper. Air conditioning.', 180, true)
+insert into Room (id, hotel_id, name, description, price, included) values (4, 2, 'Deluxe King w/sofabed', 'One king Sweet Dreams bed and one sofa bed. Business-district view. Located on floors 36. 315 square feet. Contemporary furnishings. Ergonomic work center with dual-line phone and wireless Internet access (surcharge). Video games. Marble bathroom. Complimentary newspaper. Air conditioning.', 250, false)
+insert into Room (id, hotel_id, name, description, price, included) values (5, 2, 'Standard 1 King (smoking)', 'One king bed. Wireless Internet access (surcharge). TV with video games. Marble bathroom. Complimentary newspaper. Air conditioning. Smoking.', 180, false)
+insert into Room (id, hotel_id, name, description, price, included) values (6, 2, 'Standard 2 Doubles', 'Two double beds. Contemporary furnishings. Ergonomic work center with dual-line phone and wireless Internet access (surcharge). Video games. Marble bathroom. Complimentary newspaper. Air conditioning.', 180, false)
+insert into Room (id, hotel_id, name, description, price, included) values (7, 2, 'Standard 2 Dbls (smoking)', 'Two double beds. Contemporary furnishings. Ergonomic work center with dual-line phone and wireless Internet access (surcharge). Video games. Marble bathroom. Complimentary newspaper. Air conditioning. Smoking.', 180, false)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (3, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (8, 3, 'Cozy Room', 'One queen featherbed with pillowtop mattress, 350-thread-count linens, and goose-down comforter and pillows. Located on floors 3-14. 170-180 square feet. Decorated in earth tones, leaf motifs, and hand-painted fabrics. CD and DVD players, minibar, multi-line cordless phone, and high-speed Internet access (surcharge). Bathroom has shower only or shower/tub combination, makeup mirror, terry/pique spa robes, and Bliss bath products.', 450, true)
+insert into Room (id, hotel_id, name, description, price, included) values (9, 3, 'Spectacular Room', 'No description', 600, false)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (4, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (10, 4, 'Wonderful Room', 'One king bed. Desk. Cable/satellite TV with pay movies and DVD player. CD player. Coffee/tea maker and minibar. Hair dryer. Iron/ironing board. In-room safe. Complimentary newspaper.', 450, false)
+insert into Room (id, hotel_id, name, description, price, included) values (11, 4, 'Spectacular Room', 'One king bed. Desk. Cable/satellite TV with pay movies and DVD player. CD player. Coffee/tea maker and minibar. Hair dryer. Iron/ironing board. In-room safe. Complimentary newspaper.', 600, true)
+insert into Room (id, hotel_id, name, description, price, included) values (12, 4, 'Fantastic Suite', 'One king bed. Desk. Cable/satellite TV with pay movies and DVD player. CD player. Coffee/tea maker and minibar. Hair dryer. Iron/ironing board. In-room safe. Complimentary newspaper.', 1000, false)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (5, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (13, 5, 'Deluxe room with two queen beds', 'Two queen beds with triple-sheeted Frette-brand Italian linens and piped comforters (bedspreads). Floor-to-ceiling windows overlooking city. 260 square feet. Two armchairs and round hassock, 10-foot desk with chair. Sony flat-screen TV with premium channels. Sony CD player. Complimentary wireless and wired high-speed Internet access. Tall bureau/minibar. Foyer closet with two bathrobes. Bathroom with marble vanity, massaging showerhead, and Aveda toiletries. Nonsmoking. Handheld shower and sewing kit available upon request.', 500, true)
+insert into Room (id, hotel_id, name, description, price, included) values (14, 5, 'Chill suite', 'One king bed with triple-sheeted Frette-brand Italian linens and piped comforter (bedspread). Floor-to-ceiling windows overlooking city. 260 square feet. Lounge area with extra TV and either a Sony PlayStation 3 or a Nintendo Wii. Two armchairs and round hassock, 10-foot desk with chair. Sony flat-screen TV with premium channels. Sony CD player. Complimentary wireless and wired high-speed Internet access. Tall bureau/minibar. Foyer closet with two bathrobes. Bathroom with marble vanity, massaging showerhead, and Aveda toiletries. Nonsmoking. Handheld shower and sewing kit available upon request.', 800, false)
+insert into Room (id, hotel_id, name, description, price, included) values (15, 5, 'Deluxe room with king bed', 'One king bed with triple-sheeted Frette-brand Italian linens and piped comforter (bedspread). Floor-to-ceiling windows overlooking city. 260 square feet. Two armchairs and round hassock, 10-foot desk with chair. Sony flat-screen TV with premium channels. Sony CD player. Complimentary wireless and wired high-speed Internet access. Tall bureau/minibar. Foyer closet with two bathrobes. Bathroom with marble vanity, massaging showerhead, and Aveda toiletries. Nonsmoking. Handheld shower and sewing kit available upon request.', 500, false)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (6, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (16, 6, 'Queen Standard Room', 'One queen bed with thick, plush-top mattress; goose-down duvet and pillows. Approximately 250-300 square feet. May have city view (not guaranteed). 42-inch plasma-screen HDTV. Surround-sound DVD/CD player. Wireless and wired high-speed Internet access (surcharges). iHome clock radio. Bedside Candela candle lamps. LOccitane bath products, waffle-weave robes. Minibar, in-room safe, complimentary newspaper delivery.', 300, true)
+insert into Room (id, hotel_id, name, description, price, included) values (17, 6, 'Deluxe King Room', 'One king bed with thick, plush-top mattress; goose-down duvet and pillows. Approximately 280-325 square feet. May have city view (not guaranteed). 42-inch plasma-screen HDTV. Surround-sound DVD/CD player. Wireless and wired high-speed Internet access (surcharges). iHome clock radio. Bedside Candela candle lamps. LOccitane bath products, waffle-weave robes. Minibar, in-room safe, complimentary newspaper delivery.', 350, false)
+insert into Room (id, hotel_id, name, description, price, included) values (18, 6, 'Deluxe double double', 'Two double beds with thick, plush-top mattresses, goose-down duvets and pillows. Approximately 280-325 square feet. May have city view (not guaranteed). 42-inch plasma-screen HDTV. Surround-sound DVD/CD player. Wireless and wired high-speed Internet access (surcharges). iHome clock radio. Bedside Candela candle lamps. LOccitane bath products, waffle-weave robes. Minibar, in-room safe, complimentary newspaper delivery.', 350, false)
+insert into Room (id, hotel_id, name, description, price, included) values (19, 6, 'King Premier Room', 'One king bed with thick, plush-top mattress; goose-down duvet and pillows. Approximately 350-375 square feet. View of Park Avenue and Murray Hill neighborhood. Separate sitting area with sofa, coffee table. 42-inch plasma-screen HDTV. Surround-sound DVD/CD player. Wireless and wired high-speed Internet access (surcharges). iHome clock radio Bedside Candela candle lamps. Jetted tub for two, LOccitane bath products, waffle-weave robes. Minibar, in-room safe, complimentary newspaper delivery.', 400, false)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (8, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (20, 8, 'Standard room with view', 'Two double beds with 300-thread-count Anachini linens and down comforters (bedspreads). Biscayne Bay view. Located on floors 16-22 of main building. 470 square feet. Contemporary, minimalist-style decor. Wireless Internet access (surcharge). Premium cable channels with pay movies. DVD/CD player. Multi-line phone. Voice mail and complimentary local calls. Minibar and coffee/tea maker. Complimentary bottled water. Bathrobe. Hair dryer. Makeup/shaving mirror. Complimentary newspaper. Turndown service.', 300, true)
+insert into Room (id, hotel_id, name, description, price, included) values (21, 8, '1 Bedroom Condo Residence', 'One king bed with 300-thread-count Anachini linens and down comforter (bedspread) in separate bedroom. Located on floors 26-34 of main building. 850 square feet. Contemporary, minimalist-style decor. Wireless Internet access (surcharge). Premium cable channels with pay movies. DVD/CD player. Multi-line phone. Voice mail and complimentary local calls. Full kitchen with range, dishwasher, refrigerator, and coffee/tea maker. Minibar. Complimentary bottled water. Bathrobe. Hair dryer. Makeup/shaving mirror. Complimentary newspaper. Turndown service.', 350, false)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (9, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (22, 9, 'Standard room', 'No description', 80, true)
+
+insert into Hotel (id, name, address, city, state, zip, country) values (10, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
+insert into Room (id, hotel_id, name, description, price, included) values (23, 10, 'One Queen', 'One queen bed. Desk. Complimentary wireless Internet access. Premium cable TV with free HBO. Free local calls.', 90, false)
+insert into Room (id, hotel_id, name, description, price, included) values (24, 10, 'One Queen Non Smoking', 'One queen bed. Desk. Complimentary wireless Internet access. Premium cable TV with free HBO. Free local calls.', 90, true)
+insert into Room (id, hotel_id, name, description, price, included) values (25, 10, 'Two Queens Non Smoking', 'Two queen beds. Desk. Complimentary wireless Internet access. Premium cable TV with free HBO. Free local calls.', 110, false)
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-ejb/src/main/resources/seam.properties
===================================================================
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>nestedbooking</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0.Beta2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-tests</artifactId>
+ <name>Nested Booking Integration Tests Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ejb</artifactId>
+ <type>ejb</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium.server</groupId>
+ <artifactId>selenium-server</artifactId>
+ <classifier>standalone</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>functional-tests</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ <testResource> <!-- this takes datasource nestedbooking-ds.xml -->
+ <directory>${basedir}/../nestedbooking-ear/src/main/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ <testResource> <!-- this takes themes aka *.properties -->
+ <directory>${basedir}/../nestedbooking-web/src/main/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>ftest-jbossas</id>
+ <properties>
+ <example.context.path>seam-nestedbooking</example.context.path>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>failsafe-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,361 @@
+//$Id: BookingTest.java 6896 2007-12-04 15:45:49Z pmuir $
+package org.jboss.seam.example.nestedbooking.test;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Iterator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.booking.Booking;
+import org.jboss.seam.example.booking.Hotel;
+import org.jboss.seam.example.booking.HotelBooking;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.mock.SeamTest;
+import org.testng.annotations.Test;
+
+public class BookingTest extends SeamTest
+{
+
+ @Test
+ public void testBookHotel() throws Exception
+ {
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication()
+ {
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
+ }
+
+ }.run();
+
+ new FacesRequest("/main.xhtml") {
+
+ @Override
+ protected void updateModelValues()
+ {
+ setValue("#{hotelSearch.searchString}", "Union Square");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert invokeMethod("#{hotelSearch.find}")==null;
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+ assert hotels.getRowCount()==1;
+ assert ( (Hotel) hotels.getRowData() ).getCity().equals("NY");
+ assert getValue("#{hotelSearch.searchString}").equals("Union Square");
+ assert !Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ final String id = new FacesRequest("/main.xhtml") {
+
+ @Override
+ protected void invokeApplication()
+ {
+ HotelBooking hotelBooking = (HotelBooking) getInstance("hotelBooking");
+ DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+ assert hotels.getRowCount()==1;
+ hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
+ assert hotel.getCity().equals("NY");
+ assert hotel.getZip().equals("10011");
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/hotel.xhtml", id) {
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeMethod("#{hotelBooking.bookHotel}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{booking.user}")!=null;
+ assert getValue("#{booking.hotel}")!=null;
+ assert getValue("#{booking.creditCard}")==null;
+ assert getValue("#{booking.creditCardName}")==null;
+ Booking booking = (Booking) Contexts.getConversationContext().get("booking");
+ assert booking.getHotel()==Contexts.getConversationContext().get("hotel");
+ assert booking.getUser()==Contexts.getSessionContext().get("user");
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+
+ new FacesRequest("/book.xhtml", id) {
+
+ @Override @SuppressWarnings("deprecation")
+ protected void updateModelValues()
+ {
+ Date now = new Date();
+ setValue("#{booking.checkinDate}", now);
+ setValue("#{booking.checkoutDate}", now);
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert invokeMethod("#{hotelBooking.setBookingDates}")==null;
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Iterator messages = FacesContext.getCurrentInstance().getMessages();
+ assert messages.hasNext();
+ FacesMessage message = (FacesMessage) messages.next();
+ assert message.getSummary().equals("Check out date must be later than check in date");
+ assert !messages.hasNext();
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/book.xhtml", id) {
+
+ @Override @SuppressWarnings("deprecation")
+ protected void updateModelValues()
+ {
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.DAY_OF_MONTH, 2);
+ setValue("#{booking.checkoutDate}", cal.getTime() );
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert "rooms".equals(invokeMethod("#{hotelBooking.setBookingDates}"));
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/rooms.xhtml", id)
+ {
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{booking.user}")!=null;
+ assert getValue("#{booking.hotel}")!=null;
+ assert getValue("#{booking.checkinDate}")!=null;
+ assert getValue("#{booking.checkoutDate}")!=null;
+ assert getValue("#{booking.roomPreference}").equals(getValue("#{hotel.standardRoom}"));
+ assert getValue("#{booking.creditCard}")==null;
+ assert getValue("#{booking.creditCardName}")==null;
+
+ assert getValue("#{availableRooms.rowCount}").equals(new Integer(2));
+ DataModel availableRooms = (DataModel) getValue("#{availableRooms}");
+ availableRooms.setRowIndex(0);
+ assert "Cozy Room".equals(getValue("#{availableRooms.rowData.name}"));
+ availableRooms.setRowIndex(1);
+ assert "Spectacular Room".equals(getValue("#{availableRooms.rowData.name}"));
+ }
+
+ }.run();
+
+ final String nestedId = new FacesRequest("/rooms.xhtml", id)
+ {
+
+ @Override
+ protected void applyRequestValues()
+ {
+ DataModel availableRooms = (DataModel) getValue("#{availableRooms}");
+ availableRooms.setRowIndex(0);
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert getValue("#{booking.roomPreference}")!=null;
+ assert "Cozy Room".equals(getValue("#{booking.roomPreference.name}"));
+ assert "payment".equals(invokeAction("#{roomPreference.selectPreference}"));
+ System.out.println("here");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert Manager.instance().isLongRunningConversation();
+ assert Manager.instance().isNestedConversation();
+ }
+
+ }.run();
+
+ System.out.println(id + "/" + nestedId);
+ // Hmm, need this to move to the new, nested, conversation
+ // TODO This is probably a bug in SeamTest, not sure where
+ new NonFacesRequest("/payment.xhtml", nestedId)
+ {
+
+ @Override
+ protected void renderResponse()
+ {
+ System.out.println("here");
+ assert Manager.instance().isLongRunningConversation();
+ assert Manager.instance().isNestedConversation();
+
+ assert getValue("#{booking.user}")!=null;
+ assert getValue("#{booking.hotel}")!=null;
+ assert getValue("#{booking.checkinDate}")!=null;
+ assert getValue("#{booking.checkoutDate}")!=null;
+ assert getValue("#{booking.roomPreference}")!=null;
+ assert getValue("#{booking.creditCard}")==null;
+ assert getValue("#{booking.creditCardName}")==null;
+ }
+
+ }.run();
+
+ new FacesRequest("/payment.xhtml", nestedId)
+ {
+
+ @Override
+ protected void processValidations()
+ {
+ validateValue("#{booking.creditCard}", "123");
+ assert isValidationFailure();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Iterator messages = FacesContext.getCurrentInstance().getMessages();
+ assert messages.hasNext();
+ assert ( (FacesMessage) messages.next() ).getSummary().equals("Credit card number must 16 digits long");
+ assert !messages.hasNext();
+ assert Manager.instance().isLongRunningConversation();
+ assert Manager.instance().isNestedConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/payment.xhtml", nestedId)
+ {
+
+ @Override
+ protected void processValidations()
+ {
+ validateValue("#{booking.creditCardName}", "");
+ assert isValidationFailure();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Iterator messages = FacesContext.getCurrentInstance().getMessages();
+ assert messages.hasNext();
+ assert ( (FacesMessage) messages.next() ).getSummary().equals("Credit card name is required");
+ assert !messages.hasNext();
+ assert Manager.instance().isLongRunningConversation();
+ assert Manager.instance().isNestedConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/payment.xhtml", nestedId)
+ {
+ @Override
+ protected void updateModelValues()
+ {
+ setValue("#{booking.creditCard}", "1234567891021234");
+ setValue("#{booking.creditCardName}", "GAVIN KING");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert "confirm".equals(invokeAction("#{roomPreference.requestConfirmation}"));
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert Manager.instance().isLongRunningConversation();
+ assert Manager.instance().isNestedConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/confirm.xhtml", nestedId) {
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeMethod("#{hotelBooking.confirm}");
+ }
+
+ }.run();
+
+ new NonFacesRequest("/main.xhtml") {
+
+ @Override
+ protected void renderResponse()
+ {
+ ListDataModel bookings = (ListDataModel) getInstance("bookings");
+ assert bookings.getRowCount()==1;
+ bookings.setRowIndex(0);
+ Booking booking = (Booking) bookings.getRowData();
+ assert booking.getHotel().getCity().equals("NY");
+ assert booking.getUser().getUsername().equals("gavin");
+ assert !Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/main.xhtml") {
+
+ @Override
+ protected void invokeApplication()
+ {
+ ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ bookings.setRowIndex(0);
+ invokeMethod("#{bookingList.cancel}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ assert bookings.getRowCount()==0;
+ assert !Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,138 @@
+//$Id: ChangePasswordTest.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.nestedbooking.test;
+
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.mock.SeamTest;
+import org.testng.annotations.Test;
+
+public class ChangePasswordTest extends SeamTest
+{
+
+ @Test
+ public void testChangePassword() throws Exception
+ {
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void processValidations() throws Exception
+ {
+ validateValue("#{user.password}", "xxx");
+ assert isValidationFailure();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{user.password}", "xxxyyy");
+ setValue("#{changePassword.verify}", "xxyyyx");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert invokeMethod("#{changePassword.changePassword}")==null;
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{user.password}", "xxxyyy");
+ setValue("#{changePassword.verify}", "xxxyyy");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeMethod("#{changePassword.changePassword}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("xxxyyy");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ assert getValue("#{user.password}").equals("xxxyyy");
+ setValue("#{user.password}", "foobar");
+ setValue("#{changePassword.verify}", "foobar");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeMethod("#{changePassword.changePassword}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,88 @@
+//$Id: LoginTest.java 6826 2007-11-25 13:12:07Z pmuir $
+package org.jboss.seam.example.nestedbooking.test;
+
+import org.jboss.seam.Seam;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.mock.SeamTest;
+import org.testng.annotations.Test;
+
+public class LoginTest extends SeamTest
+{
+
+ @Test
+ public void testLogin() throws Exception
+ {
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert !isSessionInvalid();
+ assert getValue("#{identity.loggedIn}").equals(false);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ assert !isSessionInvalid();
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeMethod("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert !isSessionInvalid();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert !Manager.instance().isLongRunningConversation();
+ assert !isSessionInvalid();
+ invokeMethod("#{identity.logout}");
+ assert Seam.isSessionInvalid();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{identity.loggedIn}").equals(false);
+ assert Seam.isSessionInvalid();
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedConversationTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedConversationTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedConversationTest.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.nestedbooking.test.selenium;
+
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.assertFalse;
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.jboss.seam.example.common.test.booking.selenium.SeleniumBookingTest;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * This class tests only nested conversations
+ *
+ * @author mgencur
+ */
+public class NestedConversationTest extends SeamSeleniumTest
+{
+ protected final int timeout = 5000;
+ protected final String CREDIT_CARD = "0123456789012345";
+ protected final String CREDIT_CARD_NAME = "visa";
+
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ super.tearDown();
+ }
+
+ @Test
+ public void nestedConversationTest()
+ {
+ browser.open(CONTEXT_PATH + getProperty("MAIN_PAGE"));
+ pause(timeout);
+ browser.openWindow(CONTEXT_PATH + getProperty("MAIN_PAGE"), "0");
+ pause(timeout);
+ browser.selectWindow("0");
+ login("demo", "demo");
+ SeleniumBookingTest t = new SeleniumBookingTest();
+ t.enterSearchQuery("W Hotel");
+ browser.click(getProperty("SEARCH_RESULT_TABLE_SECOND_ROW_LINK"));
+ pause(timeout);
+
+ //open the url in a second window
+ String url = browser.getLocation();
+ browser.openWindow(url, "1");
+
+ //go next to confirm button in browser 1
+ browser.selectWindow("0");
+ browser.clickAndWait(getProperty("BOOKING_BOOK"));
+ browser.clickAndWait(getProperty("SELECT_ROOM_BUTTON"));
+ browser.clickAndWait(getProperty("SELECT_WONDERFUL_ROOM"));
+ browser.type(getProperty("PAYMENT_CREDIT_CARD"), CREDIT_CARD);
+ browser.type(getProperty("PAYMENT_CREDIT_CARD_NAME"), CREDIT_CARD_NAME);
+ browser.click(getProperty("PAYMENT_PROCEED"));
+
+ //go next to confirm button in browser 2
+ browser.selectWindow("1");
+ browser.clickAndWait(getProperty("BOOKING_BOOK"));
+ browser.clickAndWait(getProperty("SELECT_ROOM_BUTTON"));
+ browser.clickAndWait(getProperty("SELECT_FANTASTIC_ROOM"));
+ browser.type(getProperty("PAYMENT_CREDIT_CARD"), CREDIT_CARD);
+ browser.type(getProperty("PAYMENT_CREDIT_CARD_NAME"), CREDIT_CARD_NAME);
+ browser.click(getProperty("PAYMENT_PROCEED"));
+
+ //confirm in browser 1 (WONDERFUL room should be selected)
+ browser.selectWindow("0");
+ browser.clickAndWait(getProperty("CONFIRM_CONFIRM"));
+ assertTrue(browser.isTextPresent("$450.00") && browser.isTextPresent("Wonderful Room"));
+ assertFalse(browser.isTextPresent("$1,000.00") || browser.isTextPresent("Fantastic Suite"));
+ logout();
+ }
+
+ public void login(String username, String password)
+ {
+ //browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("LOGIN_USERNAME_FIELD"), username);
+ browser.type(getProperty("LOGIN_PASSWORD_FIELD"), password);
+ browser.click(getProperty("LOGIN_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+ private void pause(int millis)
+ {
+ try
+ {
+ Thread.sleep(millis);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+
+ public void logout()
+ {
+ browser.click(getProperty("LOGOUT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/selenium/NestedSimpleBookingTest.java 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.nestedbooking.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest;
+
+/**
+ * This class alters behaviour of SimpleBookingTest to match nestedbooking example
+ *
+ * @author jharting
+ */
+public class NestedSimpleBookingTest extends SimpleBookingTest {
+
+ @Override
+ protected int bookHotel(String hotelName) {
+ return bookHotel(hotelName, 0, CREDIT_CARD, CREDIT_CARD_NAME);
+ }
+
+ protected int bookHotel(String hotelName, int room, String creditCard, String creditCardName) {
+ if (!isLoggedIn()) {
+ return -1;
+ }
+
+ if (!browser.isElementPresent(getProperty("SEARCH_SUBMIT"))) {
+ browser.open(CONTEXT_PATH + getProperty("MAIN_PAGE"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+ enterSearchQuery(hotelName);
+ browser.click(getProperty("SEARCH_RESULT_TABLE_FIRST_ROW_LINK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // hotel page
+ browser.click(getProperty("BOOKING_BOOK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // book page
+ browser.click(getProperty("BOOKING_SELECT_ROOM"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // room select page
+ browser.click(MessageFormat.format(getProperty("ROOM_LINK"), room));
+ browser.waitForPageToLoad(TIMEOUT);
+ // payment page
+ browser.type(getProperty("PAYMENT_CREDIT_CARD"), creditCard);
+ browser.type(getProperty("PAYMENT_CREDIT_CARD_NAME"), creditCardName);
+ browser.click(getProperty("PAYMENT_PROCEED"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // confirm page
+ browser.click(getProperty("CONFIRM_CONFIRM"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // main page
+ String message = browser.getText(getProperty("HOTEL_MESSAGE"));
+ if (message.matches(MessageFormat.format(
+ getProperty("BOOKING_CONFIRMATION_MESSAGE"), EXPECTED_NAME, hotelName))) {
+ String[] messageParts = message.split(" ");
+ int confirmationNumber = Integer.parseInt(messageParts[messageParts.length - 1]);
+ return confirmationNumber;
+ } else {
+ return -1;
+ }
+ }
+
+ @Override
+ protected void populateBookingFields() {}
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/WEB-INF/components.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:transaction="http://jboss.com/products/seam/transaction"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.3.xsd
+ http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.3.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.3.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.3.xsd">
+
+ <core:init jndi-pattern="#{ejbName}/local" debug="true"/>
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500"
+ conversation-id-parameter="cid"/>
+
+ <security:identity authenticate-method="#{authenticator.authenticate}"/>
+
+</components>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/nestedbooking.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/nestedbooking.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/nestedbooking.properties 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,92 @@
+ #
+ # JBoss, Home of Professional Open Source
+ # Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ # by the @authors tag. See the copyright.txt in the distribution for a
+ # full listing of individual contributors.
+ #
+ # This is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU Lesser General Public License as
+ # published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # This software is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this software; if not, write to the Free
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ #
+HOME_PAGE /home.seam
+MAIN_PAGE /main.seam
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD id=login:username
+LOGIN_PASSWORD_FIELD id=login:password
+LOGIN_SUBMIT id=login:login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Password updated
+PASSWORD_REENTER_MESSAGE Re-enter new password
+PASSWORD_VALUE_REQUIRED_MESSAGE //*[@id='setpassword:PasswordDecorate:message' or @id='setpassword:VerifyDecorate:message']
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD id=setpassword:PasswordDecorate:password
+PASSWORD_VERIFY id=setpassword:VerifyDecorate:verify
+PASSWORD_SUBMIT id=setpassword:change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=main:searchString
+SEARCH_SUBMIT id=main:findHotels
+NO_HOTELS_FOUND id=NoHotelsFoundMessage
+SEARCH_RESULT_TABLE xpath=//table[@id = 'hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK id=hotels:0:viewHotel
+SEARCH_RESULT_TABLE_SECOND_ROW_LINK id=hotels:1:viewHotel
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+BOOKING_SELECT_ROOM id=booking:room_preference
+HOTEL_BED_FIELD id=booking:bedsDecorate:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA value=
+HOTEL_CHECKIN_DATE_FIELD id=booking:checkinDateDecorate:checkinDateInputDate
+HOTEL_CHECKIN_DATE_MESSAGE id=booking:checkinDateDecorate:message
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:checkoutDateDecorate:message
+HOTEL_SMOKING id=booking:smokingDecorate:smoking:
+HOTEL_PROCEED id=booking:room_preference
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+ROOM_LINK id=room_selections_form:rooms:{0}:selectRoomPreference
+PAYMENT_CREDIT_CARD id=payment:creditCardDecorate:creditCard
+PAYMENT_CREDIT_CARD_NAME id=payment:creditCardNameDecorate:creditCardName
+PAYMENT_PROCEED id=payment:proceed
+CONFIRM_CONFIRM id=confirm:buttonDecorate:confirm
+REGISTRATION id=login:register
+REGISTRATION_USERNAME id=register:usernameDecorate:username
+REGISTRATION_USERNAME_MESSAGE id=register:usernameDecorate:message
+REGISTRATION_NAME id=register:nameDecorate:name
+REGISTRATION_NAME_MESSAGE id=register:nameDecorate:message
+REGISTRATION_PASSWORD id=register:passwordDecorate:password
+REGISTRATION_PASSWORD_MESSAGE id=register:passwordDecorate:message
+REGISTRATION_VERIFY id=register:verifyDecorate:verify
+REGISTRATION_VERIFY_MESSAGE id=register:verifyDecorate:message
+REGISTRATION_SUBMIT id=register:register
+REGISTRATION_REENTER_MESSAGE Re-enter your password
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE
+REGISTRATION_USER_EXISTS_MESSAGE Username {0} already exists
+NOT_LOGGED_IN_MESSAGE Please log in first
+CONVERSATION_TIMEOUT_MESSAGE The conversation ended, timed out or was processing another request
+BOOKING_TABLE_ITEM xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings\:bookings"]/tbody/tr[normalize-space(td[6]/text()) \= "{0}"][normalize-space(td[1]/text()) \= "{1}"]/td[7]/a
+BOOKING_CANCELLED_MESSAGE Booking cancelled for confirmation number {0}
+BOOKING_CONFIRMATION_MESSAGE Thank you, {0}, your confimation number for {1} is \\d+
+BOOKING_INVALID_DATE_MESSAGE1 Check out date must be later than check in date
+BOOKING_INVALID_DATE_MESSAGE2 Check in date must be a future date
+WORKSPACE_BOOKING_TEXT Book hotel: {0}
+WORKSPACE_VIEW_TEXT View hotel: {0}
+WORKSPACE_TABLE_LINK_BY_ID id=ConversationListForm:ConversationListDataTable:{0}:EntryDescriptionLink
+WORKSPACE_TABLE_ROW_COUNT = //table[@id\='ConversationListForm\:ConversationListDataTable']/tbody/tr
+SPINNER id\=main\:SpinnerGif
+SELECT_ROOM_BUTTON id=booking:room_preference
+SELECT_WONDERFUL_ROOM id=room_selections_form:rooms:0:selectRoomPreference
+SELECT_FANTASTIC_ROOM id=room_selections_form:rooms:2:selectRoomPreference
+
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/nestedbooking.properties
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/seam.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/seam.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources/seam.properties 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,3 @@
+#debug is explicitly disabled in test to avoid JBIDE-3623
+#Thu Dec 31 16:24:37 CET 2009
+org.jboss.seam.core.init.debug=false
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-ftest/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-ftest/testng.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-ftest/testng.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,36 @@
+
+ <!--
+ JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+ Middleware LLC, and individual contributors by the @authors tag. See
+ the copyright.txt in the distribution for a full listing of individual
+ contributors. This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version. This software is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Nested booking example" verbose="2" parallel="false">
+ <test name="nestedbooking_tests">
+ <parameter name="PROPERTY_FILE"
+ value="/nestedbooking.properties" />
+ <classes>
+ <class
+ name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest" />
+ <class
+ name="org.jboss.seam.example.common.test.booking.selenium.ChangePasswordTest" />
+ <class
+ name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class
+ name="org.jboss.seam.example.nestedbooking.test.selenium.NestedSimpleBookingTest" />
+ <class
+ name="org.jboss.seam.example.nestedbooking.test.selenium.NestedConversationTest" />
+ </classes>
+ </test>
+</suite>
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-ftest/testng.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/testng.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/testng.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,13 @@
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+
+<suite name="Nested Hotel Booking" verbose="2" parallel="false">
+
+ <test name="Nested Hotel Booking">
+ <classes>
+ <!-- <class name="org.jboss.seam.example.nestedbooking.test.LoginTest"/>-->
+ <class name="org.jboss.seam.example.nestedbooking.test.BookingTest"/>
+ <!-- <class name="org.jboss.seam.example.nestedbooking.test.ChangePasswordTest"/>-->
+ </classes>
+ </test>
+
+</suite>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/pom.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>nestedbooking</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0.Beta2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-web</artifactId>
+ <packaging>war</packaging>
+ <name>Nested Booking Web Module (EE6)</name>
+
+ <properties>
+ <!-- filtering property for components.xml -->
+ <jndiPattern>java:app/nestedbooking-ejb/#{ejbName}</jndiPattern>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ejb</artifactId>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-jul</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>src/main/webapp</directory>
+ <filtering>true</filtering>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/components.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:transaction="http://jboss.com/products/seam/transaction"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.3.xsd
+ http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.3.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.3.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.3.xsd">
+
+ <core:init jndi-pattern="@jndiPattern@" debug="true"/>
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500"
+ conversation-id-parameter="cid"/>
+
+ <security:identity authenticate-method="#{authenticator.authenticate}"/>
+
+</components>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/faces-config.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="2.1"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ 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_1.xsd">
+
+</faces-config>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/pages.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/pages.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,140 @@
+<pages xmlns="http://jboss.com/products/seam/pages"
+ no-conversation-view-id="/main.xhtml"
+ login-view-id="/home.xhtml">
+
+ <page view-id="/register.xhtml">
+
+ <action if="#{validation.failed}" execute="#{register.invalid}"/>
+
+ <navigation>
+ <rule if="#{register.registered}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/home.xhtml" action="#{identity.isLoggedIn}">
+
+ <navigation from-action="#{identity.isLoggedIn}">
+ <rule if-outcome="true">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ <rule if-outcome="false">
+ <render view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/password.xhtml"
+ login-required="true">
+
+ <navigation>
+ <rule if="#{changePassword.changed}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/main.xhtml"
+ login-required="true">
+
+ <navigation from-action="#{hotelBooking.selectHotel(hot)}">
+ <redirect view-id="/hotel.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/hotel.xhtml"
+ conversation-required="true">
+
+ <description>View hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.bookHotel}">
+ <redirect view-id="/book.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/book.xhtml"
+ conversation-required="true">
+
+ <description>Book hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.setBookingDates}">
+ <rule if-outcome="rooms">
+ <redirect view-id="/rooms.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
+ <page view-id="/rooms.xhtml"
+ conversation-required="true">
+
+ <description>Room Preference: #{hotel.name}</description>
+
+ <navigation from-action="#{roomPreference.cancel}">
+ <redirect view-id="/book.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{roomPreference.selectPreference}">
+ <rule if-outcome="payment">
+ <redirect view-id="/payment.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
+ <page view-id="/payment.xhtml"
+ conversation-required="true">
+
+ <description>Payment: #{hotel.name}, #{roomSelection.name}</description>
+
+ <navigation from-action="#{roomPreference.cancel}">
+ <redirect view-id="/rooms.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{roomPreference.requestConfirmation}">
+ <rule if-outcome="confirm">
+ <redirect view-id="/confirm.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
+ <page view-id="/confirm.xhtml"
+ conversation-required="true">
+
+ <description>Confirm booking: #{booking.description}</description>
+
+ <navigation from-action="#{hotelBooking.confirm}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="*">
+
+ <navigation from-action="#{identity.logout}">
+ <redirect view-id="/home.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{hotelBooking.cancel}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <exception class="org.jboss.seam.security.NotLoggedInException">
+ <redirect view-id="/home.xhtml">
+ <message severity="warn">You must be logged in to use this feature</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.faces.application.ViewExpiredException">
+ <redirect view-id="/home.xhtml">
+ <message severity="warn">Session expired, please log in again</message>
+ </redirect>
+ </exception>
+
+</pages>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/WEB-INF/web.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ 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-app_3_0.xsd">
+
+ <display-name>Seam Booking Example</display-name>
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- JSF -->
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/book.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/book.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/book.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,85 @@
+<ui:composition 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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:a="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>Book Hotel</h1>
+</div>
+<div class="section">
+ <h:form id="booking">
+ <fieldset>
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Name:</ui:define>
+ #{hotel.name}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Address:</ui:define>
+ #{hotel.address}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">City, State:</ui:define>
+ #{hotel.city}, #{hotel.state}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Zip:</ui:define>
+ #{hotel.zip}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Country:</ui:define>
+ #{hotel.country}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Nightly rate:</ui:define>
+ <h:outputText value="#{hotel.minPrice}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ -
+ <h:outputText value="#{hotel.maxPrice}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+ <s:decorate id="checkinDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <rich:calendar id="checkinDate" value="#{booking.checkinDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkinDateDecorate" style="width: auto;"/>
+ </s:decorate>
+
+ <s:decorate id="checkoutDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <rich:calendar id="checkoutDate" value="#{booking.checkoutDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkoutDateDecorate" style="width: auto;"/>
+ </s:decorate>
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <h:commandButton id="room_preference" value="Select Room" action="#{hotelBooking.setBookingDates}"/> 
+ <s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </div>
+ </div>
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar"></ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/confirm.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/confirm.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/confirm.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,81 @@
+<ui:composition 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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>Confirm Hotel Booking</h1>
+</div>
+<div class="section">
+ <h:form id="confirm">
+ <fieldset>
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Name:</ui:define>
+ #{hotel.name}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Address:</ui:define>
+ #{hotel.address}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">City, State:</ui:define>
+ #{hotel.city}, #{hotel.state}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Zip:</ui:define>
+ #{hotel.zip}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Country:</ui:define>
+ #{hotel.country}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Room Preference:</ui:define>
+ #{roomSelection.name}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Total payment:</ui:define>
+ <h:outputText value="#{roomPreference.expectedPrice}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <h:outputText value="#{booking.checkinDate}"/>
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <h:outputText value="#{booking.checkoutDate}"/>
+ </s:decorate>
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ #{booking.creditCard}
+ </s:decorate>
+ <s:decorate id="buttonDecorate" template="output.xhtml">
+ <ui:define name="label"> </ui:define>
+ <h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/> 
+ <s:button id="revise" value="Revise" view="/payment.xhtml"/> 
+ <h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </s:decorate>
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar"></ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/conversations.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/conversations.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/conversations.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,33 @@
+<div xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:c="http://java.sun.com/jstl/core"
+ 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:s="http://jboss.com/products/seam/taglib">
+
+<div class="section">
+ <h1><h:outputText rendered="#{not empty conversationList}" value="Workspaces"/></h1>
+</div>
+
+<div class="section">
+ <h:form>
+ <h:dataTable value="#{conversationList}" var="entry">
+ <h:column>
+ <h:commandLink action="#{entry.select}" value="#{entry.description}"/>
+  
+ <h:outputText value="[current]" rendered="#{entry.current}"/>
+ </h:column>
+ <h:column>
+ <h:outputText value="#{entry.startDatetime}">
+ <s:convertDateTime type="time" pattern="hh:mm"/>
+ </h:outputText>
+ -
+ <h:outputText value="#{entry.lastDatetime}">
+ <s:convertDateTime type="time" pattern="hh:mm"/>
+ </h:outputText>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+</div>
+
+</div>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/date.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/date.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/date.css 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,186 @@
+div.seam-date
+{
+ margin-top: 5px;
+ border: 1px solid #AAAAAA;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+ background-color: #FFFFFF;
+ color: #505050;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+table.seam-date td {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: 11px;
+ border: 0px;
+}
+
+.seam-date-monthNames
+{
+ width: 70px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-monthNameLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+.seam-date-years
+{
+ height: 10em;
+ overflow: auto;
+ width: 60px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-yearLink, a.seam-date-yearLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-yearLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+tr.seam-date-header
+{
+ padding: 2px 0px 2px 0px;
+}
+
+td.seam-date-header
+{
+ padding: 0px 8px 0px 8px;
+ text-align: center;
+ color: gray;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+td.seam-date-header-prevMonth
+{
+ background-image: url("../img/cal-prev.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-left: 2px;
+}
+
+td.seam-date-header-nextMonth
+{
+ background-image: url("../img/cal-next.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-right: 2px;
+}
+
+tr.seam-date-headerDays
+{
+ color: white;
+ font-weight: normal;
+}
+
+tr.seam-date-headerDays > td
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: white;
+ text-align: center;
+ width: 26px;
+}
+
+tr.seam-date-footer
+{
+ background-color: white;
+ color: #505050;
+ font-weight: bold;
+}
+
+tr.seam-date-footer > td
+{
+ text-align: center;
+}
+
+td.seam-date-inMonth
+{
+ background-color: white;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-outMonth
+{
+ background-color: white;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-selected
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: black;
+ font-weight: normal;
+}
+
+td.seam-date-dayOff-inMonth
+{
+ background-color: #efefef;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-dayOff-outMonth
+{
+ background-color: #efefef;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-hover
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ cursor: pointer;
+ color: red;
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/screen.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/screen.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/screen.css 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,272 @@
+/* Setup defaults since variable in browsers
+----------------------------------------------- */
+body, div, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset {
+ margin: 0;
+ padding: 0;
+}
+/* Element Defaults
+----------------------------------------------- */
+html {
+ height: 100%;
+ background-color: #DBD4C6;
+}
+img {
+ border: 0;
+}
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: small;
+ line-height: 1.25em;
+ color: #362F2D;
+ position: relative;
+ width: 760px;
+ height: 100%;
+ margin-left: auto;
+ margin-right: auto;
+}
+label {
+ font-weight: bold;
+ color: #5E5147;
+}
+input {
+ border: 1px solid #C3BBB6;
+ padding: 4px;
+ margin: 5px 0;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}
+select {
+ border: 1px solid #C3BBB6;
+ padding: 4px;
+ margin: 5px 0;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}ol, ul {
+ margin: 10px 0px 10px 6px;
+}
+li {
+ margin: 10px 12px;
+}
+fieldset {
+ border: 0;
+}
+/* Layout
+----------------------------------------------- */
+#document {
+ padding: 0 1px;
+ background: #fff url(../img/bg.gif) 0 0 repeat-y;
+ float: left;
+ border-bottom: 1px solid #C3BBB6;
+}
+#header {
+ float: left;
+ width: 758px;
+ height: 46px;
+ background: url(../img/hdr.bg.gif) 0 0 repeat-x;
+}
+#container {
+ float: left;
+ width: 758px;
+ background: url(../img/hdr.bar.jpg) 0 0 repeat-x;
+}
+#sidebar {
+ float: left;
+ width: 190px;
+ margin-top: 96px;
+ padding: 20px 10px 0 10px;
+ background: url(../img/sdb.bg.gif) 0 0 no-repeat;
+}
+#content {
+ float: left;
+ width: 548px;
+ margin-top: 75px;
+ padding-top: 5px;
+ background: #fff url(../img/cnt.bg.gif) 0 0 repeat-x;
+}
+#footer {
+ clear: both;
+ margin-top: 40px;
+ float: left;
+ padding: 20px;
+ border-top: 1px solid #C3BBB6;
+ background-color: #fff;
+ width: 718px;
+ text-align: right;
+}
+/* General
+----------------------------------------------- */
+input[type="submit"], input[type="button"] {
+ font-weight: bold;
+ color: #fff;
+ border: 1px solid #5D1414;
+ height: 26px;
+ background: #fff url(../img/btn.bg.gif) 0 0 repeat-x;
+ border-style: none;
+}
+.center {
+ text-align: center;
+}
+.entry {
+ clear: both;
+ padding-top: 10px;
+}
+.entry .label {
+ float: left;
+ padding-top: 10px;
+ padding-right: 5px;
+ font-weight: bold;
+ width: 150px;
+ text-align: right;
+}
+.entry .output {
+ float: left;
+ width: 250px;
+ padding-top: 10px;
+ text-align: left;
+}
+.entry .input {
+ float: left;
+ width: 250px;
+ text-align: left;
+}
+/* Sidebar
+----------------------------------------------- */
+.notes {
+ text-align: center;
+ font-size: small;
+}
+.subnotes {
+ margin-top: 1em;
+ font-size: small;
+}
+.errors {
+ font-size: small;
+ font-weight: bold;
+ text-align: center;
+ color: #600;
+}
+.errors div {
+ text-align: left;
+}
+.errors input {
+ border: 1px solid #600;
+}
+.errors ul {
+ list-style: none;
+}
+.buttonBox {
+ text-align: center;
+ padding: 5px 0;
+}
+#sidebar p {
+ font-size: small;
+ color: #8B7869;
+ line-height: 150%;
+ padding-bottom: 10px;
+}
+#sidebar li {
+ font-size: small;
+ color: #8B7869;
+}
+#sidebar h1 {
+ line-height: normal;
+ font-weight: bold;
+ font-size: small;
+}
+/*
+#sidebar p:hover {
+ color: #362F2D;
+}
+*/
+/* Content
+----------------------------------------------- */
+#content .section {
+ float: left;
+ width: 518px;
+ padding: 15px 15px 0 15px;
+}
+#content .section h1 {
+ font-family: "Trebuchet MS", Arial, sans-serif;
+ line-height: normal;
+ font-weight: normal;
+ font-size: large;
+}
+#content .section p {
+ line-height: 150%;
+ padding: 10px 0;
+ font-size: small;
+}
+#content table {
+ width: 100%;
+ border: 1px solid #D2C9C4;
+ border-collapse: collapse;
+}
+#content table caption {
+ padding-bottom: 6px;
+ text-align: left;
+ font-weight: bold;
+}
+#content table thead th {
+ border-left: 1px solid #D2C9C4;
+ background: #fff url(../img/th.bg.gif) 0 100% repeat-x;
+ border-bottom: 1px solid #D2C9C4;
+ padding: 6px;
+ text-align: left;
+ font-size: small;
+}
+#content table tbody td {
+ border-left: 1px solid #E4DBD5;
+ padding: 4px;
+ border-bottom: 1px solid #D2C9C4;
+ font-size: small;
+}
+#content dt {
+ font-weight: bold;
+ float: left;
+ width: 33%;
+}
+#content dd {
+ padding-left: 10px;
+ float: left;
+ width: 66%;
+}
+#radio table {
+ border: 0px;
+}
+#radio table tr td {
+ border: 0px;
+ border-left: 0px;
+ border-bottom: 0px;
+}
+/* Header
+----------------------------------------------- */
+#title {
+ float: left;
+ padding: 1px 0 6px 15px;
+}
+#status {
+ color: #C7B299;
+ float: right;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: x-small;
+ text-align: right;
+ padding-top: 14px;
+ padding-right: 15px;
+}
+#status a {
+ color: #C7B299;
+ text-decoration: none;
+}
+/* Homepage Modifications
+----------------------------------------------- */
+#pgHome #container {
+ background: url(../img/hdr.ad.jpg) 0 0 repeat-x;
+}
+#pgHome #sidebar {
+ margin-top: 207px;
+}
+#pgHome #content {
+ margin-top: 183px;
+}
+#pgHome #sidebar input[type="submit"] {
+ height: 30px;
+}
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/trailblazer_main.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/trailblazer_main.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/css/trailblazer_main.css 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,148 @@
+* {
+ margin: 0px;
+ padding: 0px;
+ border: none;
+}
+
+body {
+ font: 1em verdana, arial, sans-serif;
+ background: #CCCCCC;
+}
+
+div#main {
+ margin-left: 0px;
+ width: 751px;
+ background: #ecefdf;
+}
+
+div#top,div#pictures{
+}
+
+div#pictures img {
+ float:left;
+}
+
+img#head1 {
+ margin-right: 3px;
+}
+
+img#head2 {
+ margin-right: 4px;
+}
+
+div.trail {
+ clear:both;
+ margin-left: 50px;
+ margin-top: 0px;
+ margin-right: 50px
+}
+
+div.foot {
+ margin-left: 50px;
+ margin-right: 50px;
+ margin-top: 50px;
+ text-align: center;
+ font-size: .5em;
+ height: 36px;
+}
+
+div.trail h1 {
+ margin-top: -30px;
+ margin-left: -50px;
+ font-size: 1.2em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h2 {
+ float: left;
+ font-size: 1em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h3 {
+ float: left;
+ font-size: .8em;
+ font-weight: bold;
+ margin-left: -1.4em;
+ margin-bottom: 1em;
+}
+
+
+div.trail p {
+ clear: both;
+ margin-top: 20px;
+ font-size: .8em;
+ text-decoration: none;
+}
+
+div#next_trail {
+ margin-left: 36px;
+}
+
+div.numbox {
+ border: thin solid black;
+ margin-left: -.8em;
+ float: left;
+ background: #ffffff;
+ padding: .2em .35em .3em;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 1.4em;
+}
+
+div.figure {
+ text-align: center;
+ font-size: .6em;
+ margin-top: 30px;
+}
+
+div.figure img {
+ display: block;
+ margin-right: auto;
+ margin-left: auto;
+}
+
+code {
+ font: 1.1em "Courier New", Courier, mono;
+}
+
+code.block {
+ white-space: pre;
+ font: 10pt "Courier New", Courier, mono;
+ display: block;
+ border-style: dashed;
+ border-width: thin;
+ padding: .5em;
+ background: #ffffff;
+ margin: 20px;
+}
+
+div.foot_image {
+ float: left;
+ height: 86px;
+}
+
+a:active {
+ color : #666666;
+ text-decoration: none;
+}
+
+a:hover {
+ color : #000000;
+ background-color : #D6E0FE;
+ text-decoration: none;
+}
+
+a:link {
+ color : #005EB6;
+ text-decoration: none;
+}
+
+a:visited {
+ color : #888888;
+ text-decoration: none;
+}
+
+
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/edit.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/edit.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/edit.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,21 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <s:label id="Label" styleClass="label #{invalid?'errors':''}">
+ <ui:insert name="label"/>
+ <s:span id="RequiredStyle" styleClass="required" rendered="#{required}">*</s:span>
+ </s:label>
+ <span class="input #{invalid?'errors':''}">
+ <s:validateAll id="ValidateAll">
+ <ui:insert/>
+ </s:validateAll>
+ </span>
+ <s:message id="message" styleClass="error errors"/>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/home.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/home.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/home.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>JBoss Suites: Seam Framework</title>
+ <link href="css/screen.css" rel="stylesheet" type="text/css" />
+</h:head>
+<body id="pgHome">
+<f:view>
+<div id="document">
+ <div id="header">
+ <div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <h:form id="login">
+ <fieldset>
+ <div>
+ <h:outputLabel for="username">Login Name</h:outputLabel>
+ <h:inputText id="username" value="#{identity.username}" style="width: 175px;"/>
+ <div class="errors"><h:message for="username"/></div>
+ </div>
+ <div>
+ <h:outputLabel for="password">Password</h:outputLabel>
+ <h:inputSecret id="password" value="#{identity.password}" style="width: 175px;"/>
+ </div>
+ <div class="errors"><h:messages globalOnly="true"/></div>
+ <div class="buttonBox"><h:commandButton id="login" action="#{identity.quietLogin}" value="Account Login"/></div>
+ <div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
+ <div class="subnotes">
+ Or use a demo account:
+ <ul>
+ <li>gavin/foobar</li>
+ <li>demo/demo</li>
+ </ul>
+ </div>
+ </fieldset>
+ </h:form>
+ </div>
+ <div id="content">
+ </div>
+ </div>
+ <div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
+</div>
+</f:view>
+</body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/hotel.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/hotel.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/hotel.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,65 @@
+<ui:composition 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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>View Hotel</h1>
+</div>
+<div class="section">
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Name:</ui:define>
+ #{hotel.name}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Address:</ui:define>
+ #{hotel.address}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">City, State:</ui:define>
+ #{hotel.city}, #{hotel.state}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Zip:</ui:define>
+ #{hotel.zip}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Country:</ui:define>
+ #{hotel.country}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Nightly rate:</ui:define>
+ <h:outputText value="#{hotel.minPrice}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ -
+ <h:outputText value="#{hotel.maxPrice}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+</div>
+<div class="section">
+ <h:form id="hotel">
+ <fieldset class="buttonBox">
+ <h:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/> 
+ <h:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar"></ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/btn.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cal-next.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cal-prev.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/cnt.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.ad.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.bar.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/hdr.title.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/header_line.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/input.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/sdb.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/spinner.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/img/th.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/index.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/index.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/index.html 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=home.seam">
+</head>
+</html>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/main.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/main.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/main.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,121 @@
+<ui:composition 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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:a="http://richfaces.org/a4j"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h:form id="main">
+
+ <span class="errors">
+ <h:messages id="messages" globalOnly="true"/>
+ </span>
+
+ <h1>Search Hotels</h1>
+ <fieldset>
+ <h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
+ <a:ajax event="keyup" listener="#{hotelSearch.find}" render="searchResults" />
+ </h:inputText>
+  
+ <a:commandButton id="findHotels" value="Find Hotels" actionListener="#{hotelSearch.find}" render="searchResults"/>
+  
+ <a:status>
+ <f:facet name="start">
+ <h:graphicImage id="SpinnerGif" value="/img/spinner.gif"/>
+ </f:facet>
+ </a:status>
+ <br/>
+ <h:outputLabel for="pageSize">Maximum results:</h:outputLabel> 
+ <h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize">
+ <f:selectItem itemLabel="5" itemValue="5"/>
+ <f:selectItem itemLabel="10" itemValue="10"/>
+ <f:selectItem itemLabel="20" itemValue="20"/>
+ </h:selectOneMenu>
+ </fieldset>
+
+ </h:form>
+</div>
+
+<a:outputPanel id="searchResults">
+ <div class="section">
+ <h:outputText id="NoHotelsFoundMessage" value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
+ <h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
+ <h:column id="column1">
+ <f:facet id="NameFacet" name="header">Name</f:facet>
+ #{hot.name}
+ </h:column>
+ <h:column id="column2">
+ <f:facet id="AddressFacet" name="header">Address</f:facet>
+ #{hot.address}
+ </h:column>
+ <h:column id="column3">
+ <f:facet id="CityStateFacet" name="header">City, State</f:facet>
+ #{hot.city}, #{hot.state}, #{hot.country}
+ </h:column>
+ <h:column id="column4">
+ <f:facet id="ZipFacet" name="header">Zip</f:facet>
+ #{hot.zip}
+ </h:column>
+ <h:column id="column5">
+ <f:facet id="ActionFacet" name="header">Action</f:facet>
+ <s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+ </h:column>
+ </h:dataTable>
+ <s:link value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
+ </div>
+</a:outputPanel>
+
+<div class="section">
+ <h1>Current Hotel Bookings</h1>
+</div>
+<div class="section">
+ <h:form id="bookings">
+ <h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
+ <h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ #{book.hotel.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
+ #{book.hotel.address}<br/>
+ #{book.hotel.city}, #{book.hotel.state}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check in date<br/>Check out date</f:facet>
+ <h:outputText value="#{book.checkinDate}"/><br/>
+ <h:outputText value="#{book.checkoutDate}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Room Preference</f:facet>
+ #{book.roomPreference.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Payment</f:facet>
+ <h:outputText value="#{book.total}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Conf #</f:facet>
+ #{book.id}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <h:commandLink id="cancel" value="Cancel" action="#{bookingList.cancel}"/>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar"></ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/output.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/output.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/output.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,17 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <div class="label">
+ <ui:insert name="label"/>
+ </div>
+ <div class="output">
+ <ui:insert/>
+ </div>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/password.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/password.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/password.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,48 @@
+<ui:composition 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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>Change Your Password</h1>
+</div>
+<div class="section">
+ <h:form id="setpassword">
+ <fieldset>
+
+ <s:decorate id="PasswordDecorate" template="edit.xhtml">
+ <ui:define name="label">Password</ui:define>
+ <h:inputSecret id="password" value="#{user.password}" required="true" />
+ </s:decorate>
+
+ <s:decorate id="VerifyDecorate" template="edit.xhtml">
+ <ui:define name="label">Verify:</ui:define>
+ <h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
+ </s:decorate>
+
+ <div class="entry errors">
+ <h:messages id="messages" globalOnly="true"/>
+ </div>
+
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/> 
+ <s:button id="cancel" value="Cancel" view="/main.xhtml"/>
+ </div>
+ </div>
+
+ </fieldset>
+
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar"></ui:define>
+
+</ui:composition>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/payment.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/payment.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/payment.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,138 @@
+<ui:composition 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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:a="http://richfaces.org/a4j"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h1>Payment</h1>
+</div>
+
+<div class="section">
+ <h:form id="payment">
+ <fieldset>
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Name:</ui:define>
+ #{hotel.name}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Address:</ui:define>
+ #{hotel.address}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">City, State:</ui:define>
+ #{hotel.city}, #{hotel.state}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Zip:</ui:define>
+ #{hotel.zip}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Country:</ui:define>
+ #{hotel.country}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Room Preference:</ui:define>
+ #{roomSelection.name}
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Total payment:</ui:define>
+ <h:outputText value="#{roomPreference.expectedPrice}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <h:outputText value="#{booking.checkinDate}"/>
+ </s:decorate>
+
+ <s:decorate template="output.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <h:outputText value="#{booking.checkoutDate}"/>
+ </s:decorate>
+
+ <s:decorate template="edit.xhtml" id="creditCardDecorate">
+ <ui:define name="label">Credit Card #:</ui:define>
+ <h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
+ <a:ajax event="blur" render="creditCardDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate template="edit.xhtml" id="creditCardNameDecorate">
+ <ui:define name="label">Credit Card Name:</ui:define>
+ <h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
+ <a:ajax event="blur" render="creditCardNameDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Credit Card Expiry:</ui:define>
+ <h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
+ <f:selectItem itemLabel="Jan" itemValue="1"/>
+ <f:selectItem itemLabel="Feb" itemValue="2"/>
+ <f:selectItem itemLabel="Mar" itemValue="3"/>
+ <f:selectItem itemLabel="Apr" itemValue="4"/>
+ <f:selectItem itemLabel="May" itemValue="5"/>
+ <f:selectItem itemLabel="Jun" itemValue="6"/>
+ <f:selectItem itemLabel="Jul" itemValue="7"/>
+ <f:selectItem itemLabel="Aug" itemValue="8"/>
+ <f:selectItem itemLabel="Sep" itemValue="9"/>
+ <f:selectItem itemLabel="Oct" itemValue="10"/>
+ <f:selectItem itemLabel="Nov" itemValue="11"/>
+ <f:selectItem itemLabel="Dec" itemValue="12"/>
+ </h:selectOneMenu>
+ <h:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
+ <f:selectItem itemLabel="2005" itemValue="2005"/>
+ <f:selectItem itemLabel="2006" itemValue="2006"/>
+ <f:selectItem itemLabel="2007" itemValue="2007"/>
+ <f:selectItem itemLabel="2008" itemValue="2008"/>
+ <f:selectItem itemLabel="2009" itemValue="2009"/>
+ </h:selectOneMenu>
+ </s:decorate>
+
+ </fieldset>
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <h:commandButton id="proceed" value="Proceed" action="#{roomPreference.requestConfirmation}"/> 
+ <s:button id="cancel" value="Revise Room" action="#{roomPreference.cancel}"/>
+ </div>
+ </div>
+ </h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>Nesting conversations</h1>
+
+<p>Nested conversations allow the application to capture a consistent continuable state at various points in a user interaction, thus insuring truly correct behavior in the face of backbuttoning and workspace management.</p>
+
+<p><b>Continuing the conversation</b></p>
+
+<p>Try going back and selecting a different room. You will notice a new nested conversation in the list of workspace entries. Each nested conversation is associated with the specific room selected ensuring consistent behavior.</p>
+
+
+</ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/register.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/register.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/register.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,74 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:a="http://richfaces.org/a4j">
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>JBoss Suites: Seam Framework</title>
+ <link href="css/screen.css" rel="stylesheet" type="text/css" />
+</h:head>
+<body id="pgHome">
+<div id="document">
+ <div id="header">
+ <div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+ </div>
+ <div id="container">
+ <div id="sidebar"></div>
+ <div id="content">
+ <div class="section">
+ <h1>Register</h1>
+ </div>
+ <div class="section">
+
+ <h:form id="register">
+ <fieldset>
+
+ <s:decorate template="edit.xhtml" id="usernameDecorate">
+ <ui:define name="label">Username:</ui:define>
+ <h:inputText id="username" value="#{user.username}" required="true">
+ <a:ajax event="blur" reRender="usernameDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate template="edit.xhtml" id="nameDecorate">
+ <ui:define name="label">Real Name:</ui:define>
+ <h:inputText id="name" value="#{user.name}" required="true">
+ <a:ajax event="blur" reRender="nameDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate id="passwordDecorate" template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <h:inputSecret id="password" value="#{user.password}" required="true"/>
+ </s:decorate>
+
+ <s:decorate id="verifyDecorate" template="edit.xhtml">
+ <ui:define name="label">Verify Password:</ui:define>
+ <h:inputSecret id="verify" value="#{register.verify}" required="true"/>
+ </s:decorate>
+
+ <div class="entry errors">
+ <h:messages id="messages" globalOnly="true"/>
+ </div>
+
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <h:commandButton id="register" value="Register" action="#{register.register}"/> 
+ <s:button id="cancel" value="Cancel" view="/home.xhtml"/>
+ </div>
+ </div>
+
+ </fieldset>
+ </h:form>
+
+ </div>
+ </div>
+ </div>
+ <div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
+</div>
+</body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/rooms.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/rooms.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/rooms.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,71 @@
+<ui:composition 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"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:a="https://ajax4jsf.dev.java.net/ajax"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h1>Room Preference</h1>
+</div>
+
+<div class="section">
+ <h:form id="room_selections_form">
+ <div class="section">
+ <h:outputText styleClass="output" value="No rooms available for the dates selected: " rendered="#{availableRooms != null and availableRooms.rowCount == 0}"/>
+ <h:outputText styleClass="output" value="Rooms available for the dates selected: " rendered="#{availableRooms != null and availableRooms.rowCount > 0}"/>
+ <h:outputText styleClass="output" value="#{booking.checkinDate}"/> -
+ <h:outputText styleClass="output" value="#{booking.checkoutDate}"/>
+
+ <br/><br/>
+
+ <h:dataTable id="rooms" value="#{availableRooms}" var="room" rendered="#{availableRooms.rowCount > 0}">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ #{room.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Description</f:facet>
+ #{room.description}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Per Night</f:facet>
+ <h:outputText value="#{room.price}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <h:commandLink id="selectRoomPreference" action="#{roomPreference.selectPreference}">Select</h:commandLink>
+ </h:column>
+ </h:dataTable>
+ </div>
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <s:button id="cancel" value="Revise Dates" view="/book.xhtml"/>
+ </div>
+ </div>
+ </h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>Nesting conversations</h1>
+<p>Nested conversations allow the application to capture a consistent continuable state at various points in a user interaction, thus insuring truly correct behavior in the face of backbuttoning and workspace management.</p>
+
+<p><b>How Seam manages continuable state</b></p>
+
+<p>Seam provides a container for context state for each nested conversation. Any contextual variable in the outer conversations context will not be overwritten by a new value, the value will simply be stored in the new context container. This allows each nested conversation to maintain its own unique state.</p>
+
+
+</ui:define>
+
+</ui:composition>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/template.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/template.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-web/src/main/webapp/template.xhtml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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:s="http://jboss.com/products/seam/taglib">
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>JBoss Suites: Seam Framework</title>
+ <link href="css/screen.css" rel="stylesheet" type="text/css" />
+ <link href="css/date.css" rel="stylesheet" type="text/css" />
+</h:head>
+<body>
+
+<div id="document">
+ <div id="header">
+ <div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+ <div id="status">
+ Welcome #{user.name}
+ | <s:link id="search" view="/main.xhtml" value="Search" propagation="none"/>
+ | <s:link id="settings" view="/password.xhtml" value="Settings" propagation="none"/>
+ | <s:link id="logout" action="#{identity.logout}" value="Logout"/>
+ </div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <ui:insert name="sidebar"/>
+ </div>
+ <div id="content">
+ <ui:insert name="content"/>
+ <ui:include src="conversations.xhtml" />
+ </div>
+ </div>
+ <div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
+</div>
+</body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/pom.xml 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>nestedbooking</artifactId>
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>examples-ee6</artifactId>
+ <version>2.3.0.Beta2-SNAPSHOT</version>
+ </parent>
+ <packaging>pom</packaging>
+ <name>Nested Booking Example (EE6)</name>
+
+ <properties>
+ <example.name>nestedbooking</example.name>
+ </properties>
+
+ <modules>
+ <module>nestedbooking-ear</module>
+ <module>nestedbooking-ejb</module>
+ <module>nestedbooking-web</module>
+ <module>nestedbooking-tests</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.nestedbooking</groupId>
+ <artifactId>nestedbooking-ear</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/readme.txt
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/readme.txt (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/readme.txt 2012-04-02 10:27:17 UTC (rev 14462)
@@ -0,0 +1,20 @@
+Seam NestedBooking Example
+==========================
+
+This example demonstrates the use of Seam nested conversations and runs
+on JBoss AS as an EAR.
+
+To deploy the example to JBoss AS, follow these steps:
+
+* In the example root directory run:
+
+ mvn clean package
+
+* Set JBOSS_HOME environment property.
+
+* In the nestedbooking-ear directory run:
+
+ mvn jboss:hard-deploy
+
+* Open this URL in a web browser: http://localhost:8080/seam-nestedbooking
+
More information about the seam-commits
mailing list