Seam SVN: r14505 - branches/community/Seam_2_3/examples-ee6.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-04 11:37:06 -0400 (Wed, 04 Apr 2012)
New Revision: 14505
Modified:
branches/community/Seam_2_3/examples-ee6/pom.xml
Log:
enable wicket example
Modified: branches/community/Seam_2_3/examples-ee6/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/pom.xml 2012-04-04 15:21:09 UTC (rev 14504)
+++ branches/community/Seam_2_3/examples-ee6/pom.xml 2012-04-04 15:37:06 UTC (rev 14505)
@@ -40,6 +40,7 @@
<module>tasks</module>
<module>todo</module>
<module>ui</module>
+ <module>wicket</module>
</modules>
<build>
12 years, 1 month
Seam SVN: r14504 - in branches/community/Seam_2_3/examples-ee6: wicket and 49 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-04 11:21:09 -0400 (Wed, 04 Apr 2012)
New Revision: 14504
Added:
branches/community/Seam_2_3/examples-ee6/wicket/
branches/community/Seam_2_3/examples-ee6/wicket/pom.xml
branches/community/Seam_2_3/examples-ee6/wicket/readme.txt
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/pom.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/jboss-deployment-structure.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/jboss-seam-wicket-ds.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/pom.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Authenticator.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/AuthenticatorAction.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Booking.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingList.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingListAction.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePassword.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePasswordAction.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Hotel.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBooking.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBookingAction.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearching.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearchingAction.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Register.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/RegisterAction.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/User.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/ejb-jar.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/persistence.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/import.sql
branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/test/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/test/selenium/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources-ftest/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources-ftest/testng.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/wicket.properties
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/pom.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Book.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Confirm.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/FormInputBorder.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Home.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Hotel.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/HotelViewPanel.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Main.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/OutputBorder.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Password.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Register.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/SimpleDataProvider.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Template.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/WicketBookingApplication.java
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/messages.properties
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Book.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Confirm.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/FormInputBorder.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Home.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Hotel.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/HotelViewPanel.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Main.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/OutputBorder.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Password.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Register.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Template.html
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/components.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/web.xml
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/screen.css
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/trailblazer_main.css
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/bg.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/btn.bg.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cal-next.png
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cal-prev.png
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cnt.bg.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/dtpick.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.ad.jpg
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.bar.jpg
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.bg.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.title.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/header_line.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/input.bg.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/sdb.bg.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/spinner.gif
branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/th.bg.gif
Log:
add wicket example to the ee6 examples
Added: branches/community/Seam_2_3/examples-ee6/wicket/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/pom.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -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>wicket</artifactId>
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>examples-ee6</artifactId>
+ <version>2.3.0.Beta2-SNAPSHOT</version>
+ </parent>
+ <packaging>pom</packaging>
+ <name>Wicket Booking Example (EE6)</name>
+
+ <properties>
+ <example.name>wicket</example.name>
+ </properties>
+
+ <modules>
+ <module>wicket-ear</module>
+ <module>wicket-ejb</module>
+ <module>wicket-web</module>
+ <module>wicket-tests</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.wicket</groupId>
+ <artifactId>wicket-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.wicket</groupId>
+ <artifactId>wicket-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.wicket</groupId>
+ <artifactId>wicket-ear</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
Added: branches/community/Seam_2_3/examples-ee6/wicket/readme.txt
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/readme.txt (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/readme.txt 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,33 @@
+Seam Wicket Booking Example
+===========================
+
+This is a port of the Booking example to Wicket. This example 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 wicket-ear directory run:
+
+ mvn jboss:hard-deploy
+
+* Open this URL in a web browser: http://localhost:8080/seam-wicket
+
+By default, Java classes are instrumented by Wicket at compile time. You can use
+a runtime instrumentation issuing -Pruntime-instrumentation when building the
+application, though:
+
+ mvn clean package -Pruntime-instrumentation
+
+You can also execute functional tests using runtime instrumentation:
+
+ mvn clean verify -Pruntime-instrumentation,ftest-jbossas
+
+In order to run functional tests with compile instrumentation, you must use:
+
+ mvn clean verify -Pcompile-instrumentation,ftest-jbossas
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/pom.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,122 @@
+<?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>wicket</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.wicket</groupId>
+ <artifactId>wicket-ear</artifactId>
+ <packaging>ear</packaging>
+ <name>Wicket Booking EAR Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.wicket</groupId>
+ <artifactId>wicket-web</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.wicket</groupId>
+ <artifactId>wicket-ejb</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>seam-wicket</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.wicket</groupId>
+ <artifactId>wicket-web</artifactId>
+ <contextRoot>/seam-wicket</contextRoot>
+ <bundleFileName>wicket-web.war</bundleFileName>
+ </webModule>
+ <ejbModule>
+ <groupId>org.jboss.seam.examples-ee6.wicket</groupId>
+ <artifactId>wicket-ejb</artifactId>
+ <bundleFileName>wicket-ejb.jar</bundleFileName>
+ </ejbModule>
+ <ejbModule>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <bundleFileName>jboss-seam.jar</bundleFileName>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>exploded</id>
+ <properties>
+ <example.name>wicket</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.wicket</groupId>
+ <artifactId>wicket-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.wicket</groupId>
+ <artifactId>wicket-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.wicket</groupId>
+ <artifactId>wicket-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/wicket/wicket-ear/src/main/application/META-INF/jboss-deployment-structure.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/jboss-deployment-structure.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,8 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.dom4j" export="true"/>
+ <module name="javax.faces.api" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/jboss-seam-wicket-ds.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/jboss-seam-wicket-ds.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ear/src/main/application/META-INF/jboss-seam-wicket-ds.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources xmlns="http://www.jboss.org/ironjacamar/schema">
+ <datasource
+ jndi-name="java:/wicketDatasource"
+ enabled="true"
+ use-java-context="true" pool-name="wicketdb">
+ <connection-url>jdbc:h2:mem:wicketdb;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/wicket/wicket-ejb/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/pom.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,70 @@
+<?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>wicket</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.wicket</groupId>
+ <artifactId>wicket-ejb</artifactId>
+ <packaging>ejb</packaging>
+ <name>Wicket Booking EJB Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.ejb</groupId>
+ <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-wicket</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-ioc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-extensions</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-datetime</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Authenticator.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Authenticator.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Authenticator.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,9 @@
+package org.jboss.seam.example.wicket.action;
+
+import javax.ejb.Local;
+
+@Local
+public interface Authenticator
+{
+ boolean authenticate();
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/AuthenticatorAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/AuthenticatorAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/AuthenticatorAction.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,41 @@
+package org.jboss.seam.example.wicket.action;
+
+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;
+
+@Stateless
+@Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+ @PersistenceContext
+ private EntityManager em;
+
+ @SuppressWarnings("unused")
+ @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/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Booking.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Booking.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Booking.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,189 @@
+//$Id: Booking.java,v 1.15 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+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;
+
+@Entity
+@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 String creditCardExpiryMonth;
+ private int creditCardExpiryYear;
+ private boolean smoking;
+ private int beds;
+
+ public Booking() {}
+
+ public Booking(Hotel hotel, User user)
+ {
+ this.hotel = hotel;
+ this.user = user;
+ }
+
+ @Transient
+ public BigDecimal getTotal()
+ {
+ return hotel.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() );
+ }
+
+ public boolean isSmoking()
+ {
+ return smoking;
+ }
+
+ public void setSmoking(boolean smoking)
+ {
+ this.smoking = smoking;
+ }
+
+ public int getBeds()
+ {
+ return beds;
+ }
+
+ public void setBeds(int beds)
+ {
+ this.beds = beds;
+ }
+ @NotNull(message="Credit card 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 String getCreditCardExpiryMonth()
+ {
+ return creditCardExpiryMonth;
+ }
+
+ public void setCreditCardExpiryMonth(String 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 + ")";
+ }
+
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Booking.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingList.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingList.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingList.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,14 @@
+//$Id: BookingList.java,v 1.7 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+import javax.ejb.Local;
+
+@Local
+public interface BookingList
+{
+ public void getBookings();
+ public Booking getBooking();
+ public void cancel();
+ public void cancel(Booking booking);
+ public void destroy();
+}
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingList.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingListAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingListAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingListAction.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,84 @@
+//$Id: BookingListAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+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.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.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.international.StatusMessages;
+import org.jboss.seam.log.Log;
+
+@Stateful
+@Scope(SESSION)
+@Name("bookingList")
+@Restrict("#{identity.loggedIn}")
+@TransactionAttribute(REQUIRES_NEW)
+public class BookingListAction implements BookingList, Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @In
+ private User user;
+
+ @SuppressWarnings("unused")
+ @Out
+ private List<Booking> bookings;
+
+ 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();
+ StatusMessages.instance().addToControl("body", "Booking cancelled for confirmation number #0", booking.getId());
+ }
+
+ // TODO replace this with @Out in Wicket
+ public void cancel(Booking booking)
+ {
+ this.booking = booking;
+ cancel();
+ }
+
+ public Booking getBooking()
+ {
+ return booking;
+ }
+
+ @Remove
+ public void destroy() {}
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/BookingListAction.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePassword.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePassword.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePassword.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,12 @@
+//$Id: ChangePassword.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+import javax.ejb.Local;
+
+@Local
+public interface ChangePassword
+{
+ public void changePassword();
+
+ public void destroy();
+}
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePassword.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePasswordAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePasswordAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePasswordAction.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,41 @@
+//$Id: ChangePasswordAction.java,v 1.22 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+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.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.international.StatusMessages;
+
+@Stateful
+@Scope(EVENT)
+@Name("changePassword")
+@Restrict("#{identity.loggedIn}")
+public class ChangePasswordAction implements ChangePassword
+{
+ @In @Out
+ private User user;
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @In(create=true)
+ private StatusMessages statusMessages;
+
+ public void changePassword()
+ {
+ user = em.merge(user);
+ statusMessages.add("Password updated");
+ }
+
+ @Remove
+ public void destroy() {}
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/ChangePasswordAction.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Hotel.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Hotel.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Hotel.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,114 @@
+//$Id: Hotel.java,v 1.13 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+import org.jboss.seam.annotations.Name;
+
+@Entity
+@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 BigDecimal price;
+
+ @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;
+ }
+
+ @Column(precision=6, scale=2)
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ public void setPrice(BigDecimal price)
+ {
+ this.price = price;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
+ }
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Hotel.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBooking.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBooking.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBooking.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,22 @@
+//$Id: HotelBooking.java,v 1.14 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+import javax.ejb.Local;
+
+@Local
+public interface HotelBooking
+{
+ public void selectHotel(Hotel hotel);
+
+ public void bookHotel();
+
+ public void setBookingDetails();
+ public boolean isBookingValid();
+
+ public void confirm();
+
+ public void cancel();
+
+ public void destroy();
+
+}
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBooking.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBookingAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBookingAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBookingAction.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,102 @@
+//$Id: HotelBookingAction.java,v 1.53 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+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.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.international.StatusMessages;
+import org.jboss.seam.log.Log;
+
+@Stateful
+@Name("hotelBooking")
+@Restrict("#{identity.loggedIn}")
+public class HotelBookingAction implements HotelBooking
+{
+
+ @PersistenceContext(type=EXTENDED)
+ private EntityManager em;
+
+ @In
+ private User user;
+
+ @Out
+ private Hotel hotel;
+
+ @In(required=false)
+ @Out(required=false)
+ private Booking booking;
+
+ @In(create=true)
+ private StatusMessages statusMessages;
+
+ @Logger
+ private Log log;
+
+ private boolean bookingValid;
+
+ public void selectHotel(Hotel hotel)
+ {
+ StatusMessages.instance().add("foo");
+ this.hotel = hotel;
+ }
+
+ 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() );
+ }
+
+ public void setBookingDetails()
+ {
+ Calendar calendar = Calendar.getInstance();
+ calendar.add(Calendar.DAY_OF_MONTH, -1);
+ if ( booking.getCheckinDate().before( calendar.getTime() ) )
+ {
+ statusMessages.addToControl("checkinDate", "Check in date must be a future date");
+ bookingValid=false;
+ }
+ else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
+ {
+ statusMessages.addToControl("checkoutDate", "Check out date must be later than check in date");
+ bookingValid=false;
+ }
+ else
+ {
+ bookingValid=true;
+ }
+ }
+
+ public boolean isBookingValid()
+ {
+ return bookingValid;
+ }
+
+ @End
+ public void confirm()
+ {
+ em.persist(booking);
+ StatusMessages.instance().add("Thank you, #{user.name}, your confimation number for #{hotel.name} is #{booking.id}");
+ log.info("New booking: #{booking.id} for #{user.username}");
+ }
+
+ @End
+ public void cancel() {}
+
+ @Remove
+ public void destroy() {}
+}
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelBookingAction.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearching.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearching.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearching.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,23 @@
+//$Id: HotelSearching.java,v 1.12 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+@Local
+public interface HotelSearching
+{
+
+ public String getSearchString();
+ public void setSearchString(String searchString);
+
+ public String getSearchPattern();
+
+ public List<Hotel> getHotels();
+
+ public void find();
+
+ public void destroy();
+
+}
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearching.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearchingAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearchingAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearchingAction.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,67 @@
+//$Id: HotelSearchingAction.java,v 1.20 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+import java.util.ArrayList;
+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.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
+
+@Stateful
+@Name("hotelSearch")
+(a)Scope(ScopeType.SESSION)
+@Restrict("#{identity.loggedIn}")
+public class HotelSearchingAction implements HotelSearching
+{
+
+ @PersistenceContext
+ private EntityManager em;
+
+ private String searchString;
+
+ private List<Hotel> hotels = new ArrayList<Hotel>();
+
+ public void find()
+ {
+ 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}")
+ .getResultList();
+ }
+
+ @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;
+ }
+
+ public List<Hotel> getHotels()
+ {
+ return hotels;
+ }
+
+ @Remove
+ public void destroy() {}
+}
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/HotelSearchingAction.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Register.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Register.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Register.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,14 @@
+//$Id: Register.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+import javax.ejb.Local;
+
+@Local
+public interface Register
+{
+ public void register();
+ public void invalid();
+ public boolean isRegistered();
+
+ public void destroy();
+}
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/Register.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/RegisterAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/RegisterAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/RegisterAction.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,74 @@
+//$Id: RegisterAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+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.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.international.StatusMessages;
+
+@Stateful
+@Scope(EVENT)
+@Name("register")
+public class RegisterAction implements Register
+{
+ @In
+ private User user;
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @In(create=true)
+ private StatusMessages statusMessages;
+
+ @In
+ 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);
+ statusMessages.addToControl("login", "Successfully registered as #{user.username}");
+ registered = true;
+ }
+ else
+ {
+ statusMessages.addToControl("username", "Username #{user.username} already exists");
+ }
+ }
+ else
+ {
+ statusMessages.addToControl("verify", "Re-enter your password");
+ verify=null;
+ }
+ }
+
+ public void invalid()
+ {
+ statusMessages.add("Please try again");
+ }
+
+ public boolean isRegistered()
+ {
+ return registered;
+ }
+
+
+ @Remove
+ public void destroy() {}
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/RegisterAction.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/User.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/User.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/User.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,76 @@
+//$Id: User.java,v 1.8 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.wicket.action;
+
+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;
+
+@Entity
+@Name("user")
+@Scope(SESSION)
+@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=5, 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 + ")";
+ }
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/java/org/jboss/seam/example/wicket/action/User.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/ejb-jar.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/ejb-jar.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -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/wicket/wicket-ejb/src/main/resources/META-INF/persistence.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/persistence.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/persistence.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -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="wicketDatabase">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/wicketDatasource</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>
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/META-INF/persistence.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/import.sql
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/import.sql (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/import.sql 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,22 @@
+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, price, name, address, city, state, zip, country) values (1, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160, 'MarriottDowntown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130, 'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250, 'Meli� White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/import.sql
___________________________________________________________________
Added: svn:executable
+ *
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-ejb/src/main/resources/seam.properties
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/pom.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,74 @@
+<?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>wicket</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.wicket</groupId>
+ <artifactId>wicket-tests</artifactId>
+ <name>Wicket Booking Integration Tests Module (EE6)</name>
+
+ <dependencies>
+ <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>
+ <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-wicket</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/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/java/org/jboss/seam/example/wicket/test/selenium/WicketSimpleBookingTest.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,77 @@
+/*
+ * 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.wicket.test.selenium;
+
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import java.text.MessageFormat;
+
+import org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest;
+
+/**
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class WicketSimpleBookingTest extends SimpleBookingTest {
+
+ @Override
+ protected void populateBookingFields(int bed, int smoking,
+ String creditCard, String creditCardName) {
+ super.populateBookingFields(bed, smoking, creditCard, creditCardName);
+ browser.select(getProperty("HOTEL_CREDIT_CARD_EXPIRY_MONTH"),
+ "index=1");
+ browser.select(getProperty("HOTEL_CREDIT_CARD_EXPIRY_YEAR"), "index=1");
+ }
+
+ @Override
+ protected int bookHotel(String hotelName, int bed, int smoking,
+ String creditCard, String creditCardName) {
+ if (!isLoggedIn())
+ fail();
+ 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);
+ // booking page
+ browser.click(getProperty("BOOKING_BOOK"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // hotel page
+ populateBookingFields(bed, smoking, creditCard, creditCardName);
+ browser.click(getProperty("HOTEL_PROCEED"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // confirm page
+ browser.click(getProperty("HOTEL_CONFIRM"));
+ browser.waitForPageToLoad(TIMEOUT);
+ // main page
+ String message = browser.getText(MessageFormat.format(getProperty("ORDER_CONFIRMATION_NUMBER"), hotelName));
+
+ int confirmationNumber = Integer.parseInt(message);
+ return confirmationNumber;
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/seam.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/seam.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/seam.properties 2012-04-04 15:21:09 UTC (rev 14504)
@@ -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/wicket/wicket-tests/src/test/resources/wicket.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/wicket.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/wicket.properties 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,86 @@
+ #
+ # 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 /
+MAIN_PAGE /
+PAGE_TITLE JBoss Suites: Seam Framework
+LOGIN_USERNAME_FIELD identifier=username
+LOGIN_PASSWORD_FIELD identifier=password
+LOGIN_SUBMIT identifier=login
+LOGOUT id=logout
+PASSWORD_UPDATED_MESSAGE Search Hotels
+PASSWORD_REENTER_MESSAGE must be equal
+PASSWORD_VALUE_REQUIRED_MESSAGE //span[@name='message']//span
+PASSWORD_LENGTH_MESSAGE size must be between
+PASSWORD_PASSWORD identifier=passwordBorder:password
+PASSWORD_VERIFY identifier=verifyBorder:verify
+PASSWORD_SUBMIT id=change
+SETTINGS id=settings
+SEARCH_STRING_FIELD id=searchString
+SEARCH_SUBMIT identifier=:submit
+NO_HOTELS_FOUND xpath=//table[@id ='hotels']/tbody[count(./*) = 0]
+SEARCH_RESULT_TABLE xpath=//table[@id ='hotels']/tbody
+SEARCH_RESULT_TABLE_FIRST_ROW_LINK xpath=//table[@id ='hotels']/tbody/tr[1]/td[5]/a
+BOOKING_BOOK id=bookHotel
+BOOKING_CANCEL id=cancel
+HOTEL_BED_FIELD identifier=bedsBorder:beds
+HOTEL_BED_FIELD_SELECT_CRITERIA index=
+HOTEL_CHECKIN_DATE_FIELD identifier=checkinDateBorder:checkinDate:date
+HOTEL_CHECKIN_DATE_MESSAGE xpath=//span[@id='message']//span
+HOTEL_CHECKOUT_DATE_FIELD identifier=checkoutDateBorder:checkoutDate:date
+HOTEL_CHECKOUT_DATE_MESSAGE xpath=//span[@id='message']//span
+HOTEL_SMOKING_1 xpath\=//span[@id\='smoking']/input[@value\='true']
+HOTEL_SMOKING_2 xpath\=//span[@id\='smoking']/input[@value\='false']
+HOTEL_CREDIT_CARD identifier=creditCardBorder:creditCard
+HOTEL_CREDIT_CARD_NAME identifier=creditCardNameBorder:creditCardName
+HOTEL_CREDIT_CARD_EXPIRY_MONTH xpath\=//select[contains(@id,'creditCardExpiryMonth')]
+HOTEL_CREDIT_CARD_EXPIRY_YEAR xpath\=//select[contains(@id,'creditCardExpiryYear')]
+HOTEL_PROCEED id=proceed
+HOTEL_CANCEL id=cancel
+HOTEL_CONFIRM id=confirm
+HOTEL_MESSAGE xpath=//span[@wicket:id='messages']//span[@wicket:id='message']
+REGISTRATION identifier=register
+REGISTRATION_USERNAME identifier=usernameDecorate:username
+REGISTRATION_NAME identifier=nameDecorate:name
+REGISTRATION_PASSWORD identifier=passwordDecorate:password
+REGISTRATION_VERIFY identifier=verifyDecorate:verify
+REGISTRATION_SUBMIT id=register
+REGISTRATION_REENTER_MESSAGE Password and Verify Password must be equal.
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+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"]/tbody/tr[normalize-space(td[6]/span/text()) \= "{0}"][normalize-space(td[1]/span/text()) \= "{1}"]
+BOOKING_TABLE_ITEM_LINK xpath\=//table[@id\="bookings"]/tbody/tr[normalize-space(td[6]/span/text()) \= "{0}"][normalize-space(td[1]/span/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 = xpath=//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr
+SPINNER xpath=//span[contains(@id, 'ajax-indicator')]
+# ajax is used in wicket example but search button has to be clicked
+USE_AJAX_SEARCH TRUE
+USE_SEARCH_BUTTON TRUE
+ORDER_CONFIRMATION_NUMBER=xpath\=//table[@id\="bookings"]/tbody/tr[normalize-space(td[1]/span/text()) \= "{0}"]/td[6]/span
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources/wicket.properties
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources-ftest/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources-ftest/testng.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources-ftest/testng.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,27 @@
+<!--
+ 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="Wicket example" verbose="2" parallel="false">
+ <test name="wicket_tests_buildtime_instrumentation">
+ <parameter name="PROPERTY_FILE" value="/wicket.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.wicket.test.selenium.WicketSimpleBookingTest" />
+ </classes>
+ </test>
+</suite>
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-tests/src/test/resources-ftest/testng.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/pom.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,169 @@
+<?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>wicket</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.wicket</groupId>
+ <artifactId>wicket-web</artifactId>
+ <packaging>war</packaging>
+ <name>Wicket Booking Web Module (EE6)</name>
+
+ <properties>
+ <!-- filtering property for components.xml -->
+ <jndiPattern>java:app/wicket-ejb/#{ejbName}</jndiPattern>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.wicket</groupId>
+ <artifactId>wicket-ejb</artifactId>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</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>
+
+ <profiles>
+ <profile>
+ <id>compile-instrumentation</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>wicket-instrument-classes</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <taskdef name="instrumentWicket" classname="org.jboss.seam.wicket.ioc.WicketInstrumentationTask" classpathref="maven.compile.classpath">
+ </taskdef>
+ <path id="instrument.path">
+ <path refid="maven.compile.classpath" />
+ <pathelement location="${project.build.sourceDirectory}" />
+ </path>
+ <property name="output.dir" value="${basedir}/target/classes-instrumented" />
+ <mkdir dir="${output.dir}" />
+ <!-- instrument classes and place them to a special directory -->
+ <instrumentWicket outputDirectory="${output.dir}">
+ <classpath refid="instrument.path" />
+ <fileset dir="${project.build.outputDirectory}">
+ <include name="**/*.class" />
+ </fileset>
+ </instrumentWicket>
+ <!-- copy instrumented classes back to standard output directory -->
+ <copy todir="${project.build.outputDirectory}" overwrite="true">
+ <fileset dir="${output.dir}">
+ <include name="**/*.class" />
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>runtime-instrumentation</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>wicket-instrument-classes</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <!-- move non-instrumented classes and other resources to WEB-INF/wicket -->
+ <move todir="${project.build.directory}/${project.build.finalName}/WEB-INF/wicket" overwrite="true">
+ <fileset dir="${project.build.outputDirectory}">
+ <include name="**/*.*" />
+ <exclude name="**/*.properties" />
+ </fileset>
+ </move>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>ftest-jbossas</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>wait-for-application</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>stop-selenium</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Book.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Book.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Book.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,132 @@
+package org.jboss.seam.example.wicket;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.extensions.yui.calendar.DateField;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.RadioChoice;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
+import org.apache.wicket.model.PropertyModel;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.example.wicket.action.Booking;
+import org.jboss.seam.example.wicket.action.HotelBooking;
+import org.jboss.seam.wicket.annotations.NoConversationPage;
+
+@Restrict("#{identity.loggedIn}")
+(a)NoConversationPage(Main.class)
+public class Book extends WebPage
+{
+
+ private static final List<String> bedOptionsDisplayValues = Arrays.asList("One king-sized bed", "Two double beds", "Three beds");
+ private static final List<Integer> bedOptions = Arrays.asList(1, 2, 3);
+ private static final List<String> monthOptions = Arrays.asList("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
+ private static final List<Integer> yearOptions = Arrays.asList(2008, 2009);
+
+ @In
+ private Booking booking;
+
+ @In(create=true)
+ private HotelBooking hotelBooking;
+
+ public Book(final PageParameters parameters)
+ {
+ super(parameters);
+ Template body = new Template("body");
+ add(body);
+ body.add(new HotelViewPanel("hotelView", booking.getHotel()));
+ body.add(new HotelBookingForm("booking"));
+ }
+
+ public class HotelBookingForm extends Form
+ {
+
+ public HotelBookingForm(String id)
+ {
+ super(id);
+ add(new ComponentFeedbackPanel("messages", this));
+ add(new FormInputBorder("checkinDateBorder", "Check in date", new DateField("checkinDate").setRequired(true), new PropertyModel(booking, "checkinDate"), false));
+ add(new FormInputBorder("checkoutDateBorder", "Check out date", new DateField("checkoutDate").setRequired(true), new PropertyModel(booking, "checkoutDate"), false));
+ add(new FormInputBorder("bedsBorder", "Room Preference", new DropDownChoice("beds", bedOptions, new IChoiceRenderer()
+ {
+
+ public Object getDisplayValue(Object object)
+ {
+ return bedOptionsDisplayValues.get(((Integer) object - 1));
+ }
+
+ public String getIdValue(Object object, int index)
+ {
+ return object.toString();
+ }
+
+ }
+ ).setRequired(true), new PropertyModel(booking, "beds")));
+ add(new FormInputBorder("smokingBorder", "Smoking Preference", new RadioChoice("smoking", Arrays.asList(new Boolean[] {true, false}), new IChoiceRenderer()
+ {
+
+ public Object getDisplayValue(Object object)
+ {
+ if (new Boolean(true).equals(object))
+ {
+ return "Smoking";
+ }
+ else
+ {
+ return "Non Smoking";
+ }
+ }
+
+ public String getIdValue(Object object, int index)
+ {
+ if (new Boolean(true).equals(object))
+ {
+ return "true";
+ }
+ else
+ {
+ return "false";
+ }
+ }
+
+ }), new PropertyModel(booking, "smoking"), false));
+ add(new FormInputBorder("creditCardBorder", "Credit Card #", new TextField("creditCard").setRequired(true), new PropertyModel(booking, "creditCard")));
+ add(new FormInputBorder("creditCardNameBorder", "Credit Card Name", new TextField("creditCardName").setRequired(true), new PropertyModel(booking, "creditCardName")));
+ add(new FormInputBorder("creditCardExpiryBorder", "Credit Card Expiry", new DropDownChoice("creditCardExpiryMonth", monthOptions).setRequired(true), new PropertyModel(booking, "creditCardExpiryMonth")).add(new DropDownChoice("creditCardExpiryYear", yearOptions).setRequired(true), new PropertyModel(booking, "creditCardExpiryYear")));
+ add(new Link("cancel")
+ {
+
+ @Override
+ @End
+ public void onClick()
+ {
+ setResponsePage(Main.class);
+ }
+
+ });
+ }
+
+
+
+ @Override
+ protected void onSubmit()
+ {
+ hotelBooking.setBookingDetails();
+ if (hotelBooking.isBookingValid())
+ {
+ setResponsePage(new Confirm(new PageParameters()));
+ }
+ }
+
+
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Confirm.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Confirm.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Confirm.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,71 @@
+
+package org.jboss.seam.example.wicket;
+
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.Locale;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.RaiseEvent;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.example.wicket.action.Booking;
+import org.jboss.seam.example.wicket.action.HotelBooking;
+import org.jboss.seam.wicket.annotations.NoConversationPage;
+
+@Restrict("#{identity.loggedIn}")
+(a)NoConversationPage(Main.class)
+public class Confirm extends WebPage
+{
+
+ @In
+ private Booking booking;
+
+ @In(create=true)
+ private HotelBooking hotelBooking;
+
+ public Confirm(final PageParameters parameters)
+ {
+ super(parameters);
+ Template body = new Template("body");
+ body.add(new HotelViewPanel("hotel", booking.getHotel()));
+ body.add(new OutputBorder("totalBorder", "Total Payment", new Label("total", DecimalFormat.getCurrencyInstance(Locale.US).format(booking.getTotal()))));
+ body.add(new OutputBorder("checkinDateBorder", "Check in", new Label("checkinDate", new SimpleDateFormat().format(booking.getCheckinDate()))));
+ body.add(new OutputBorder("checkoutDateBorder", "Check out", new Label("checkoutDate", new SimpleDateFormat().format(booking.getCheckoutDate()))));
+ body.add(new OutputBorder("creditCardNumberBorder", "Credit Card #", new Label("creditCardNumber", booking.getCreditCard())));
+ body.add(new Link("revise")
+ {
+ @Override
+ public void onClick()
+ {
+ setResponsePage(new Book(new PageParameters()));
+ }
+ });
+ body.add(new Link("confirm")
+ {
+ @Override
+ @RaiseEvent("bookingConfirmed")
+ public void onClick()
+ {
+ hotelBooking.confirm();
+ setResponsePage(Main.class);
+ }
+ });
+ body.add(new Link("cancel")
+ {
+ @Override
+ public void onClick()
+ {
+ hotelBooking.cancel();
+ setResponsePage(Main.class);
+ }
+
+ });
+
+ add(body);
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/FormInputBorder.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/FormInputBorder.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/FormInputBorder.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,134 @@
+package org.jboss.seam.example.wicket;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.feedback.ContainerFeedbackMessageFilter;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.border.Border;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.jboss.seam.wicket.ModelValidator;
+import org.jboss.seam.wicket.SeamPropertyModel;
+
+/**
+ * Wicket allows you to build powerful custom components easily.
+ *
+ * Here we've built generic border you can use to decorate a form input with
+ * a label, a * if the field is required and an feedback panel for displaying
+ * any error messages.
+ *
+ * It also attaches a model validator (which asks Seam to validate the input against
+ * Hibernate Validator).
+ * based
+ *
+ * @author Pete Muir
+ *
+ */
+public class FormInputBorder extends Border
+{
+
+ private FeedbackPanel feedbackPanel;
+ private boolean ajaxValidate;
+ private Model labelModel;
+
+ /**
+ * Create a new form input border which validates using ajax
+ * @param id Id of border component on page
+ * @param label Label to add
+ * @param component The component to wrap
+ * @param model The model to attach the component to
+ */
+ public FormInputBorder(String id, String label, FormComponent component, PropertyModel model, boolean ajaxValidate)
+ {
+ this(id, label, component, model, ajaxValidate, model.getTarget().getClass(), model.getPropertyExpression());
+ }
+
+ public FormInputBorder(String id, String label, FormComponent component, SeamPropertyModel model, boolean ajaxValidate)
+ {
+ this(id, label, component, model, ajaxValidate, model.getTarget().getClass(), model.getPropertyExpression());
+ }
+
+ public FormInputBorder(String id, String label, FormComponent component, PropertyModel model)
+ {
+ this(id, label, component, model, true, model.getTarget().getClass(), model.getPropertyExpression());
+ }
+
+ public FormInputBorder(String id, String label, FormComponent component, SeamPropertyModel model)
+ {
+ this(id, label, component, model, true, model.getTarget().getClass(), model.getPropertyExpression());
+ }
+
+ /**
+ * Create a new form input border which validates
+ * @param id Id of border component on page
+ * @param label Label to add
+ * @param component The component to wrap
+ * @param model The model to attach the component to
+ * @param ajaxValidate Whether to use ajax validation
+ */
+ public FormInputBorder(String id, String label, FormComponent component, IModel model, boolean ajaxValidate, Class modelClass, String propertyExpression)
+ {
+ super(id);
+ this.ajaxValidate = ajaxValidate;
+ labelModel = new Model(label);
+ component.setLabel(labelModel);
+ if (component.isRequired())
+ {
+ label += ":*";
+ }
+ else
+ {
+ label += ":";
+ }
+ Label labelComponent = new Label("label", label);
+ add(labelComponent);
+ feedbackPanel = new FeedbackPanel("message", new ContainerFeedbackMessageFilter(this));
+ add(component, model, modelClass, propertyExpression);
+ add(feedbackPanel);
+ }
+
+ public FormInputBorder add(FormComponent component, PropertyModel model)
+ {
+ return add(component, model, model.getTarget().getClass(), model.getPropertyExpression());
+ }
+
+ public FormInputBorder add(FormComponent component, IModel model, Class modelClass, String expression)
+ {
+ component.add(new ModelValidator(modelClass, expression));
+ component.setModel(model);
+ component.setLabel(labelModel);
+ add(component);
+ if (ajaxValidate)
+ {
+ feedbackPanel.setOutputMarkupId(true);
+ component.add(new AjaxFormComponentUpdatingBehavior("onblur")
+ {
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target)
+ {
+ getFormComponent().validate();
+ target.addComponent(feedbackPanel);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, RuntimeException e)
+ {
+ target.addComponent(feedbackPanel);
+ }
+
+ @Override
+ protected boolean getUpdateModel()
+ {
+ return true;
+ }
+
+ });
+ }
+ return this;
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Home.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Home.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Home.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.seam.example.wicket;
+
+import javax.security.auth.login.LoginException;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.PropertyModel;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.security.Identity;
+
+public class Home extends WebPage
+{
+
+ @In
+ private Identity identity;
+
+ @Logger
+ private Log log;
+
+ private static final long serialVersionUID = 1L;
+
+ public Home(final PageParameters parameters)
+ {
+ add(new LoginForm("login"));
+ }
+
+ public class LoginForm extends Form
+ {
+ public LoginForm(String id)
+ {
+ super(id);
+ add(new TextField("username", new PropertyModel(identity, "username")));
+ add(new PasswordTextField("password", new PropertyModel(identity, "password")));
+ add(new BookmarkablePageLink("register", Register.class));
+ add(new FeedbackPanel("messages"));
+ }
+
+ @Override
+ protected void onSubmit()
+ {
+ try
+ {
+ identity.authenticate();
+ log.info("Login succeeded");
+ setResponsePage(Main.class);
+ }
+ catch (LoginException e)
+ {
+ error("Login failed");
+ log.error("Login failed", e);
+ }
+ }
+
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Hotel.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Hotel.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Hotel.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,58 @@
+
+package org.jboss.seam.example.wicket;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.link.Link;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.example.wicket.action.HotelBooking;
+import org.jboss.seam.wicket.annotations.NoConversationPage;
+
+@Restrict("#{identity.loggedIn}")
+(a)NoConversationPage(Main.class)
+public class Hotel extends WebPage
+{
+
+ @In
+ private org.jboss.seam.example.wicket.action.Hotel hotel;
+
+ @In(create=true)
+ private HotelBooking hotelBooking;
+
+ public Hotel(final PageParameters parameters)
+ {
+ super(parameters);
+ Template body = new Template("body");
+ body.add(new Link("bookHotel")
+ {
+ @Override
+ public void onClick()
+ {
+ hotelBooking.bookHotel();
+ setResponsePage(new Book(new PageParameters()));
+ }
+ });
+ body.add(new Link("cancel")
+ {
+ @Override
+ @End
+ public void onClick()
+ {
+ setResponsePage(Main.class);
+ }
+
+ });
+ body.add(new HotelViewPanel("hotel", hotel));
+ add(body);
+ }
+
+ @Override
+ protected void onBeforeRender()
+ {
+ super.onBeforeRender();
+ }
+
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/HotelViewPanel.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/HotelViewPanel.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/HotelViewPanel.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,25 @@
+package org.jboss.seam.example.wicket;
+
+import java.text.DecimalFormat;
+import java.util.Locale;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.jboss.seam.example.wicket.action.Hotel;
+
+public class HotelViewPanel extends Panel
+{
+
+ public HotelViewPanel(String id, Hotel hotel)
+ {
+ super(id);
+ add(new OutputBorder("hotelNameBorder", "Name", new Label("hotelName", hotel.getName())));
+ add(new OutputBorder("hotelAddressBorder", "Address", new Label("hotelAddress", hotel.getAddress())));
+ add(new OutputBorder("hotelCityBorder", "City", new Label("hotelCity", hotel.getCity())));
+ add(new OutputBorder("hotelStateBorder", "State", new Label("hotelState", hotel.getState())));
+ add(new OutputBorder("hotelZipBorder", "Zip", new Label("hotelZip", hotel.getZip())));
+ add(new OutputBorder("hotelCountryBorder", "Country", new Label("hotelCountry", hotel.getCountry())));
+ add(new OutputBorder("hotelPriceBorder", "Nightly Rate", new Label("hotelPrice", DecimalFormat.getCurrencyInstance(Locale.US).format(hotel.getPrice()))));
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Main.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Main.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Main.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.seam.example.wicket;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.feedback.ContainerFeedbackMessageFilter;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.markup.repeater.data.DataView;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.PageParameters;
+import org.jboss.seam.wicket.annotations.Begin;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.core.Conversation;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.wicket.action.Booking;
+import org.jboss.seam.example.wicket.action.BookingList;
+import org.jboss.seam.example.wicket.action.Hotel;
+import org.jboss.seam.example.wicket.action.HotelBooking;
+import org.jboss.seam.example.wicket.action.HotelSearching;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.wicket.SeamPropertyModel;
+
+@Restrict("#{identity.loggedIn}")
+public class Main extends WebPage
+{
+
+ @In(create = true)
+ private HotelSearching hotelSearch;
+
+ @In(create=true)
+ private List<Booking> bookings;
+
+ @In(create=true)
+ private BookingList bookingList;
+
+ @In(create=true)
+ private HotelBooking hotelBooking;
+
+ private DataView hotelDataView;
+ private DataView bookedHotelDataView;
+ private HotelSearchForm hotelSearchForm;
+ private WebMarkupContainer hotels;
+ private Component noHotelsFound;
+ private Component messages;
+
+
+ public Main(final PageParameters parameters)
+ {
+ Template body = new Template("body");
+ add(body);
+ hotelSearchForm = new HotelSearchForm("searchCriteria");
+ body.add(hotelSearchForm);
+
+ messages = new FeedbackPanel("messages", new ContainerFeedbackMessageFilter(this)).setOutputMarkupId(true);
+ body.add(messages);
+
+ /*
+ * Hotel Search results
+ */
+ noHotelsFound = new Label("noResults", "No Hotels Found")
+ {
+ /**
+ * Only display the message if no hotels are found
+ *
+ */
+ @Override
+ public boolean isVisible()
+ {
+ return Identity.instance().isLoggedIn() && hotelSearch.getHotels().size() == 0;
+ }
+ };
+ body.add(noHotelsFound.setOutputMarkupId(true));
+ hotelDataView = new DataView("hotel", new SimpleDataProvider() // A DataProvider adapts between your data and Wicket's internal representation
+ {
+ public Iterator iterator(int from, int count)
+ {
+ return hotelSearch.getHotels().subList(from, from + count).iterator();
+ }
+
+ public int size()
+ {
+ return hotelSearch.getHotels().size();
+ }
+
+ })
+ {
+ /**
+ * You specify the tr in the html, and populate each one here
+ */
+ @Override
+ protected void populateItem(Item item)
+ {
+ final Hotel hotel = (Hotel) item.getModelObject();
+ item.add(new Label("hotelName", hotel.getName()));
+ item.add(new Label("hotelAddress", hotel.getAddress()));
+ item.add(new Label("hotelCityStateCountry", hotel.getCity() + ", " + hotel.getState() + ", " + hotel.getCountry()));
+ item.add(new Label("hotelZip", hotel.getZip()));
+ //item.add(new BookmarkablePageLink("viewHotel", org.jboss.seam.example.wicket.Hotel.class).setParameter("hotelId", hotel.getId()));
+ item.add(new Link("viewHotel")
+ {
+
+ @Begin
+ @Override
+ public void onClick()
+ {
+ hotelBooking.selectHotel(hotel);
+ setResponsePage(new org.jboss.seam.example.wicket.Hotel(new PageParameters()));
+ }
+
+ });
+ }
+
+ };
+
+ // Set the maximum items per page
+ hotelDataView.setItemsPerPage(hotelSearchForm.getPageSize());
+ hotelDataView.setOutputMarkupId(true);
+ hotels = new WebMarkupContainer("hotels");
+ hotels.add(hotelDataView).setOutputMarkupId(true);
+
+
+ // Add a pager
+ hotels.add(new AjaxPagingNavigator("hotelPager", hotelDataView)
+ {
+ @Override
+ public boolean isVisible()
+ {
+ return hotelDataView.isVisible();
+ }
+
+ });
+
+ body.add(hotels);
+
+ /*
+ * Existing hotel booking
+ */
+ bookedHotelDataView = new DataView("bookedHotel", new SimpleDataProvider()
+ {
+ public Iterator iterator(int from, int count)
+ {
+ return bookings.subList(from, from + count).iterator();
+ }
+
+ public int size()
+ {
+ return bookings.size();
+ }
+
+
+
+ })
+ {
+
+ @Override
+ protected void populateItem(Item item)
+ {
+ final Booking booking = (Booking) item.getModelObject();
+ item.add(new Label("hotelName", booking.getHotel().getName()));
+ item.add(new Label("hotelAddress", booking.getHotel().getAddress()));
+ item.add(new Label("hotelCityStateCountry", booking.getHotel().getCity() + ", " + booking.getHotel().getState() + ", " + booking.getHotel().getState()));
+ item.add(new Label("hotelCheckInDate", booking.getCheckinDate().toString()));
+ item.add(new Label("hotelCheckOutDate", booking.getCheckoutDate().toString()));
+ item.add(new Label("hotelConfirmationNumber", booking.getId().toString()));
+ item.add(new Link("cancel")
+ {
+
+ @Override
+ public void onClick()
+ {
+ bookingList.cancel(booking);
+ }
+
+ });
+ }
+
+ @Override
+ public boolean isVisible()
+ {
+ return Identity.instance().isLoggedIn() && bookings.size() > 0;
+ }
+
+ };
+ body.add(bookedHotelDataView);
+ body.add(new Label("noHotelsBooked", "No Bookings Found")
+ {
+ @Override
+ public boolean isVisible()
+ {
+ return Identity.instance().isLoggedIn() && bookings.size() == 0;
+ }
+ });
+ }
+
+ public class HotelSearchForm extends Form
+ {
+
+ private Integer pageSize = 10;
+
+ public Integer getPageSize()
+ {
+ return pageSize;
+ }
+
+ public void setPageSize(Integer pageSize)
+ {
+ this.pageSize = pageSize;
+ }
+
+ public HotelSearchForm(String id)
+ {
+ super(id);
+ add(new TextField("searchString", new SeamPropertyModel("searchString")
+ {
+
+ @Override
+ public Object getTarget()
+ {
+ return hotelSearch;
+ }
+
+ }));
+ List<Integer> pageSizes = Arrays.asList(new Integer[] { 5, 10, 20 });
+ add(new DropDownChoice("pageSize", new PropertyModel(this, "pageSize"), pageSizes));
+ add(new IndicatingAjaxButton("submit", this)
+ {
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form form)
+ {
+ target.addComponent(messages);
+ hotelSearch.find();
+ hotelDataView.setCurrentPage(0);
+ hotelDataView.setItemsPerPage(getPageSize());
+ hotelDataView.modelChanged();
+ hotels.modelChanged();
+ target.addComponent(hotels);
+ target.addComponent(noHotelsFound);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form form)
+ {
+ target.addComponent(messages);
+ }
+
+ });
+ }
+
+ @Override
+ protected void onSubmit()
+ {
+ hotelDataView.setCurrentPage(0);
+ hotelDataView.setItemsPerPage(getPageSize());
+ hotelSearch.find();
+ }
+
+ }
+}
+
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/OutputBorder.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/OutputBorder.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/OutputBorder.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,31 @@
+package org.jboss.seam.example.wicket;
+
+import org.apache.wicket.markup.html.WebComponent;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.border.Border;
+
+/**
+ * Wicket allows you to build powerful custom components easily.
+ *
+ * Here we've built generic border you can use to decorate an output
+ *
+ * @author Pete Muir
+ *
+ */
+public class OutputBorder extends Border
+{
+
+ /**
+ * Create a new form input border
+ * @param id Id of border component on page
+ * @param label Label to add
+ * @param component The component to wrap
+ */
+ public OutputBorder(String id, String label, WebComponent component)
+ {
+ super(id);
+ add(new Label("label", label + ": "));
+ add(component);
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Password.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Password.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Password.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,70 @@
+package org.jboss.seam.example.wicket;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.validation.EqualInputValidator;
+import org.apache.wicket.markup.html.link.PageLink;
+import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
+import org.apache.wicket.model.PropertyModel;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.example.wicket.action.ChangePassword;
+import org.jboss.seam.example.wicket.action.User;
+
+@Restrict("#{identity.loggedIn}")
+public class Password extends WebPage
+{
+
+ @In(create=true)
+ private User user;
+
+ @In(create=true)
+ private ChangePassword changePassword;
+
+
+ public Password()
+ {
+ Template body = new Template("body");
+ body.add(new RegisterForm("setpassword"));
+ add(body);
+ }
+
+ public class RegisterForm extends Form
+ {
+
+ private String verify;
+
+ public String getVerify()
+ {
+ return verify;
+ }
+
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+
+ public RegisterForm(String id)
+ {
+ super(id);
+ add(new PageLink("cancel", Main.class));
+ FormComponent password = new PasswordTextField("password").setRequired(true);
+ FormComponent verify = new PasswordTextField("verify").setRequired(true);
+ add(new FormInputBorder("passwordBorder", "Password", password , new PropertyModel(user, "password")));
+ add(new FormInputBorder("verifyBorder", "Verify Password", verify, new PropertyModel(this, "verify")));
+ add(new ComponentFeedbackPanel("messages", this));
+ add(new EqualInputValidator(password, verify));
+ }
+
+ @Override
+ protected void onSubmit()
+ {
+ changePassword.changePassword();
+ setResponsePage(Main.class);
+ }
+
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Register.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Register.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Register.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,103 @@
+package org.jboss.seam.example.wicket;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator;
+import org.apache.wicket.markup.html.link.PageLink;
+import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
+import org.apache.wicket.model.PropertyModel;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.example.wicket.action.User;
+import org.jboss.seam.wicket.SeamPropertyModel;
+
+public class Register extends WebPage
+{
+
+ @In(create=true)
+ private User user;
+
+ @In(create=true)
+ private org.jboss.seam.example.wicket.action.Register register;
+
+ private TextField username;
+
+
+ public Register()
+ {
+ Form registerForm = new RegisterForm("registration");
+ add(registerForm);
+ registerForm.add(new ComponentFeedbackPanel("messages", this));
+ }
+
+ public class RegisterForm extends Form
+ {
+
+ @Out(scope=ScopeType.EVENT, required=false)
+ private String verify;
+
+ public String getVerify()
+ {
+ return verify;
+ }
+
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+
+ public RegisterForm(String id)
+ {
+ super(id);
+ add(new PageLink("cancel", Home.class));
+ username = new TextField("username");
+ username.setRequired(true);
+ add(new FormInputBorder("usernameDecorate", "Username", username, new SeamPropertyModel("username")
+ {
+
+ @Override
+ public Object getTarget()
+ {
+ return user;
+ }
+
+ }));
+ add(new FormInputBorder("nameDecorate", "Real Name", new TextField("name").setRequired(true), new SeamPropertyModel("name")
+ {
+ @Override
+ public Object getTarget()
+ {
+ return user;
+ }
+ }));
+ FormComponent password = new PasswordTextField("password").setRequired(true);
+ FormComponent verify = new PasswordTextField("verify").setRequired(true);
+ add(new FormInputBorder("passwordDecorate", "Password", password , new SeamPropertyModel("password")
+ {
+ @Override
+ public Object getTarget()
+ {
+ return user;
+ }
+ }));
+ add(new FormInputBorder("verifyDecorate", "Verify Password", verify, new PropertyModel(this, "verify")));
+ add(new EqualPasswordInputValidator(password, verify));
+ }
+
+ @Override
+ protected void onSubmit()
+ {
+ register.register();
+ if (register.isRegistered())
+ {
+ setResponsePage(Home.class);
+ }
+ }
+
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/SimpleDataProvider.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/SimpleDataProvider.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/SimpleDataProvider.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,22 @@
+package org.jboss.seam.example.wicket;
+
+import java.io.Serializable;
+
+import org.apache.wicket.markup.repeater.data.IDataProvider;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public abstract class SimpleDataProvider implements IDataProvider
+{
+
+ public IModel model(Object object)
+ {
+ return new Model((Serializable) object);
+ }
+
+ public void detach()
+ {
+ // No - op
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Template.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Template.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/Template.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,53 @@
+package org.jboss.seam.example.wicket;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.border.Border;
+import org.apache.wicket.markup.html.link.Link;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.wicket.action.User;
+import org.jboss.seam.security.Identity;
+
+public class Template extends Border
+{
+
+ @In
+ private User user;
+
+ @In
+ private Identity identity;
+
+ public Template(String id)
+ {
+ super(id);
+ add(new Link("search")
+ {
+ @Override
+ public void onClick()
+ {
+ Manager.instance().leaveConversation();
+ setResponsePage(Main.class);
+ }
+ });
+ add(new Link("settings")
+ {
+ @Override
+ public void onClick()
+ {
+ Manager.instance().leaveConversation();
+ setResponsePage(Password.class);
+ }
+ });
+ add(new Link("logout")
+ {
+ @Override
+ public void onClick()
+ {
+ identity.logout();
+ setResponsePage(Home.class);
+ }
+ });
+ add(new Label("userName", user.getName()));
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/WicketBookingApplication.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/WicketBookingApplication.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/java/org/jboss/seam/example/wicket/WicketBookingApplication.java 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,25 @@
+package org.jboss.seam.example.wicket;
+
+
+
+import org.jboss.seam.wicket.SeamWebApplication;
+
+/**
+ * Port of Booking Application to Wicket
+ */
+public class WicketBookingApplication extends SeamWebApplication
+{
+
+ @Override
+ public Class getHomePage()
+ {
+ return Home.class;
+ }
+
+ @Override
+ protected Class getLoginPage()
+ {
+ return Home.class;
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/messages.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/messages.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/messages.properties 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,50 @@
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.REQUIRED_detail=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be a number
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character
+javax.faces.convert.DateTimeConverter.CONVERSION value must be a datetime
+javax.faces.convert.DateTimeConverter.CONVERSION_detail value must be a datetime
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be a number
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be a number between -2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be a number
+javax.faces.converter.LongConverter.LONG_detail=must be a number between -9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be a number
+javax.faces.converter.ShortConverter.SHORT_detail=value must be a number between -32768 and 32767
+
+
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Book.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Book.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Book.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,74 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head></head>
+
+<body>
+
+<div wicket:id="body">
+
+<div class="section">
+ <h1>Book Hotel</h1>
+</div>
+
+<div class="section">
+
+ <div wicket:id="hotelView" />
+
+ <div style="clear:both"/>
+
+ <form wicket:id="booking">
+ <div class="entry errors" wicket:id="messages" />
+ <fieldset>
+
+ <div wicket:id="checkinDateBorder">
+ <span wicket:id="checkinDate" />
+ </div>
+
+ <div wicket:id="checkoutDateBorder">
+ <span wicket:id="checkoutDate" />
+ </div>
+
+ <div wicket:id="bedsBorder">
+ <select id="beds" wicket:id="beds">
+ <option>One king-size bed</option>
+ </select>
+ </div>
+
+ <div wicket:id="smokingBorder">
+ <span id="smoking" wicket:id="smoking">
+ <input type="radio" value="Smoking" />
+ <input type="radio" value="Non Smoking" />
+ </span>
+ </div>
+
+ <div wicket:id="creditCardBorder">
+ <input wicket:id="creditCard" />
+ </div>
+
+ <div wicket:id="creditCardNameBorder">
+ <input wicket:id="creditCardName" />
+ </div>
+
+ <div wicket:id="creditCardExpiryBorder">
+ <select wicket:id="creditCardExpiryMonth">
+ <option>Jan</option>
+ </select>
+ <select wicket:id="creditCardExpiryYear">
+ <option>2005</option>
+ </select>
+ </div>
+
+ <div class="buttonBox">
+ <input id="proceed" type="submit" value="Proceed" />
+  
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel" />
+ </div>
+
+ </fieldset>
+ </form>
+</div>
+
+</div>
+</body>
+</html>
+
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Book.html
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Confirm.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Confirm.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Confirm.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,46 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head></head>
+
+<body>
+
+<!-- content -->
+<div wicket:id="body">
+
+<div class="section">
+ <h1>Confirm Hotel Booking</h1>
+</div>
+
+<div class="section">
+
+ <div wicket:id="hotel">[include hotel details]</div>
+
+ <div wicket:id="totalBorder">
+ <span wicket:id="total">[total payment]</span>
+ </div>
+
+ <div wicket:id="checkinDateBorder">
+ <span wicket:id="checkinDate">[checkin date]</span>
+ </div>
+
+ <div wicket:id="checkoutDateBorder">
+ <span wicket:id="checkoutDate">[checkout date]</span>
+ </div>
+
+ <div wicket:id="creditCardNumberBorder">
+ <span wicket:id="creditCardNumber">[credit card number]</span>
+ </div>
+
+ <div class="buttonBox">
+ <input id="confirm" type="button" wicket:id="confirm" value="Confirm" />
+  
+ <input id="revise" type="button" wicket:id="revise" value="Revise" />
+  
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel" />
+ </div>
+
+</div>
+
+</div>
+</body>
+</html>
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Confirm.html
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/FormInputBorder.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/FormInputBorder.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/FormInputBorder.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,17 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <wicket:border>
+ <div class="entry">
+ <label class="label #{invalid?'errors':''}" wicket:id="label" />
+ <span class="input #{invalid?'errors':''}">
+ <wicket:body />
+ </span>
+ <span id="message" name="message" wicket:id="message" class="error errors"/>
+ </div>
+ </wicket:border>
+ </body>
+</html>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Home.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Home.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Home.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>JBoss Suites: Seam Framework</title>
+ <wicket:link>
+ <link href="css/screen.css" rel="stylesheet" type="text/css" />
+ </wicket:link>
+</head>
+<body id="pgHome">
+<div id="document">
+ <div id="header">
+ <div id="title"><wicket:link><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></wicket:link></div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <form wicket:id="login">
+ <fieldset>
+ <div>
+ <label for="username">Login Name</label>
+ <input id="username" wicket:id="username" style="width: 175px;"/>
+ </div>
+ <div>
+ <label for="password">Password</label>
+ <input id="password" wicket:id="password" type="password" style="width: 175px;"/>
+ </div>
+ <div class="errors" wicket:id="messages" />
+ <div class="buttonBox"><input id="login" type="submit" value="Account Login"/></div>
+ <div class="notes"><a id="register" wicket:id="register">Register New User</a></div>
+ <div class="subnotes">
+ Or use a demo account:
+ <ul>
+ <li>gavin/foobar</li>
+ <li>demo/demo</li>
+ </ul>
+ </div>
+ </fieldset>
+ </form>
+ </div>
+ <div id="content">
+ <div class="section">
+
+ <h1>About this example application</h1>
+
+ <p>
+ This sample application demonstrates how easy it is to develop stateful web
+ applications using JBoss Seam. Just register, login, and book a room to see
+ Seam with Wicket in action.
+ </p>
+
+ <p>
+ Note: Please do NOT enter personal information or your credit card number in
+ this sample application.
+ </p>
+
+ </div>
+ </div>
+ </div>
+ <div id="footer">Created with Seam 2.0, JBoss EJB 3.0 and Apache Wicket</div>
+</div>
+</body>
+</html>
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Home.html
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Hotel.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Hotel.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Hotel.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,21 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!-- content -->
+<div wicket:id="body">
+
+<div class="section">
+ <h1>View Hotel</h1>
+</div>
+
+<div class="section">
+ <span wicket:id="hotel">[hotel details]</span>
+
+ <div class="buttonBox">
+
+ <input id="bookHotel" type="button" wicket:id="bookHotel" value="Book Hotel"/>
+  
+ <input id="cancel" type="button" wicket:id="cancel" value="Back to Search"/>
+ </div>
+
+</div>
+</div>
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Hotel.html
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/HotelViewPanel.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/HotelViewPanel.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/HotelViewPanel.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,36 @@
+<html>
+
+ <body>
+ <wicket:panel>
+
+ <span wicket:id="hotelNameBorder">
+ <span wicket:id="hotelName">[hotel name]</span>
+ </span>
+
+ <span wicket:id="hotelAddressBorder">
+ <span wicket:id="hotelAddress">[hotel address]</span>
+ </span>
+
+ <span wicket:id="hotelCityBorder">
+ <span wicket:id="hotelCity">[hotel city]</span>
+ </span>
+
+ <span wicket:id="hotelStateBorder">
+ <span wicket:id="hotelState">[hotel state]</span>
+ </span>
+
+ <span wicket:id="hotelZipBorder">
+ <span wicket:id="hotelZip">[hotel zip code]</span>
+ </span>
+
+ <span wicket:id="hotelCountryBorder">
+ <span wicket:id="hotelCountry">[hotel country]</span>
+ </span>
+
+ <span wicket:id="hotelPriceBorder">
+ <span wicket:id="hotelPrice">[hotel nightly rate]</span>
+ </span>
+
+ </wicket:panel>
+</body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Main.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Main.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Main.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,148 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head></head>
+<body>
+
+ <div wicket:id="body">
+
+ <!-- content -->
+ <div class="section">
+
+ <span class="errors" wicket:id="messages" />
+
+ <form wicket:id="searchCriteria">
+
+ <h1>Search Hotels</h1>
+
+
+ <fieldset>
+ <input id="searchString" wicket:id="searchString" style="width: 165px;" />
+  
+ <input type="submit" wicket:id="submit" value="Find Hotels" />
+  
+ <br/>
+ <label for="pageSize">Maximum results:</label> 
+ <select wicket:id="pageSize" />
+ </fieldset>
+ </form>
+
+ </div>
+
+ <div class="section">
+ <wicket:enclosure>
+ <span wicket:id="noResults" />
+ </wicket:enclosure>
+ <div wicket:id="hotels">
+ <wicket:enclosure child="hotel">
+ <table id="hotels">
+ <thead>
+ <tr>
+ <th>
+ Name
+ </th>
+ <th>
+ Address
+ </th>
+ <th>
+ City, State
+ </th>
+ <th>
+ Zip
+ </th>
+ <th>
+ Action
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr wicket:id="hotel">
+ <td>
+ <span wicket:id="hotelName">[name]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelAddress">[address]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelCityStateCountry">[city, state, country]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelZip">[zip]</span>
+ </td>
+ <td>
+ <a wicket:id="viewHotel">View Hotel</a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <span wicket:id="hotelPager" />
+ </wicket:enclosure>
+ </div>
+ </div>
+
+ <div class="section">
+ <h1>Current Hotel Bookings</h1>
+ </div>
+ <div class="section">
+ <wicket:enclosure>
+ <span wicket:id="noHotelsBooked" />
+ </wicket:enclosure>
+ <wicket:enclosure child="bookedHotel">
+ <table id="bookings">
+ <thead>
+ <tr>
+ <th>
+ Name
+ </th>
+ <th>
+ Address
+ </th>
+ <th>
+ City, State
+ </th>
+ <th>
+ Check in date
+ </th>
+ <th>
+ Check out date
+ </th>
+ <th>
+ Conf number
+ </th>
+ <th>
+ Action
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr wicket:id="bookedHotel">
+ <td>
+ <span wicket:id="hotelName">[name]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelAddress">[address]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelCityStateCountry">[city, state, country]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelCheckInDate">[check in date]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelCheckOutDate">[check out date]</span>
+ </td>
+ <td>
+ <span wicket:id="hotelConfirmationNumber">[confirmation number]</span>
+ </td>
+ <td>
+ <a wicket:id="cancel">Cancel</a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </wicket:enclosure>
+ </div>
+
+ </div>
+</body>
+</html>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/OutputBorder.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/OutputBorder.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/OutputBorder.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,14 @@
+<html>
+ <body>
+ <wicket:border>
+ <div class="entry">
+ <span class="label">
+ <span wicket:id="label" />
+ </span>
+ <span class="input">
+ <wicket:body />
+ </span>
+ </div>
+ </wicket:border>
+ </body>
+</html>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Password.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Password.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Password.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,44 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+</head>
+
+<body>
+
+<!-- content -->
+<div wicket:id="body">
+
+<div class="section">
+ <h1>Change Your Password</h1>
+</div>
+
+<div class="section">
+
+ <form wicket:id="setpassword">
+
+ <div class="entry errors" id="messages" wicket:id="messages" />
+
+ <fieldset>
+
+ <span wicket:id="passwordBorder">
+ <input type="password" wicket:id="password" />
+ </span>
+
+ <span wicket:id="verifyBorder">
+ <input type="password" wicket:id="verify" />
+ </span>
+
+ <div class="buttonBox">
+ <input id="change" type="submit" value="Change" />
+  
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel" />
+ </div>
+
+ </fieldset>
+
+ </form>
+</div>
+
+</div>
+</body>
+</html>
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Password.html
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Register.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Register.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Register.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,79 @@
+<!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">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>JBoss Suites: Seam Framework</title>
+ <wicket:link>
+ <link href="css/screen.css" rel="stylesheet" type="text/css" />
+ </wicket:link>
+</head>
+
+<body id="pgHome">
+
+<div id="document">
+
+ <div id="header">
+ <div id="title"><img src="/seam-wicket/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">
+
+ <form wicket:id="registration">
+ <fieldset>
+
+ <div wicket:id="usernameDecorate">
+ <input wicket:id="username" />
+ </div>
+
+ <span wicket:id="nameDecorate">
+ <input wicket:id="name" />
+ </span>
+
+ <span wicket:id="passwordDecorate">
+ <input type="password" wicket:id="password" />
+ </span>
+
+ <span wicket:id="verifyDecorate">
+ <input type="password" wicket:id="verify" />
+ </span>
+
+ <div class="buttonBox">
+ <input id="register" type="submit" value="Register"/>
+  
+ <input id="cancel" type="button" wicket:id="cancel" value="Cancel"/>
+ </div>
+
+ </fieldset>
+ <div class="errors" wicket:id="messages" />
+ </form>
+
+ </div>
+
+ </div>
+
+ </div>
+
+ <div id="footer">Created with Seam 2.0, JBoss EJB 3.0 and Apache Wicket</div>
+
+</div>
+
+</body>
+
+</html>
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Register.html
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Template.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Template.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Template.html 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,41 @@
+<wicket:border>
+<!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">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>JBoss Suites: Seam Framework</title>
+ <wicket:link>
+ <link href="css/screen.css" rel="stylesheet" type="text/css" />
+ </wicket:link>
+</head>
+
+
+
+<body>
+
+<div id="document">
+ <div id="header">
+ <div id="title"><wicket:link><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></wicket:link></div>
+ <div id="status">
+ Welcome <span wicket:id="userName" />
+ | <a id="search" wicket:id="search">Search</a>
+ | <a id="settings" wicket:id="settings">Settings</a>
+ | <a id="logout" wicket:id="logout">Logout</a>
+ </div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <!-- <ui:insert name="sidebar"/>-->
+ </div>
+ <div id="content">
+ <wicket:body />
+ </div>
+ </div>
+ <div id="footer">Created with Seam 2.0, JBoss EJB 3.0 and Apache Wicket</div>
+</div>
+</body>
+</html>
+</wicket:border>
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/resources/org/jboss/seam/example/wicket/Template.html
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/components.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,31 @@
+<?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:web="http://jboss.com/products/seam/web"
+ xmlns:wicket="http://jboss.com/products/seam/wicket"
+ 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/web http://jboss.com/products/seam/web-2.3.xsd
+ http://jboss.com/products/seam/wicket http://jboss.com/products/seam/wicket-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"/>
+
+ <transaction:ejb-transaction/>
+
+ <security:identity authenticate-method="#{authenticator.authenticate}"/>
+
+ <wicket:web-application application-class="org.jboss.seam.example.wicket.WicketBookingApplication" />
+
+ <component class="org.jboss.seam.transaction.EjbSynchronizations" jndi-name="java:app/jboss-seam/EjbSynchronizations"/>
+
+</components>
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/components.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/web.xml 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,41 @@
+<?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 -->
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/screen.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/screen.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/screen.css 2012-04-04 15:21:09 UTC (rev 14504)
@@ -0,0 +1,278 @@
+/* Setup defaults since variable in browsers
+----------------------------------------------- */
+body, div, span, 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-right: 5px;
+ font-weight: bold;
+ width: 150px;
+ text-align: right;
+}
+.entry .output {
+ float: right;
+ width: 360px;
+ padding-top: 10px;
+ text-align: left;
+}
+.entry .input {
+ float: right;
+ width: 360px;
+ text-align: left;
+}
+.entry .error {
+ float: right;
+ width: 360px;
+ 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 span {
+ text-align: left;
+}
+.errors input {
+ border: 1px solid #600;
+}
+.errors ul {
+ list-style: none;
+}
+.buttonBox {
+ text-align: center;
+ padding: 5px 0;
+ clear: both;
+}
+#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%;
+}
+#content table.radio {
+ border: 0px;
+}
+#content table.radio tbody 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;
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/screen.css
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/trailblazer_main.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/trailblazer_main.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/css/trailblazer_main.css 2012-04-04 15:21:09 UTC (rev 14504)
@@ -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/wicket/wicket-web/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/bg.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/btn.bg.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cal-next.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cal-prev.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/cnt.bg.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.ad.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.bar.jpg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.bg.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/hdr.title.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/header_line.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/input.bg.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/sdb.bg.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/spinner.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/wicket/wicket-web/src/main/webapp/img/th.bg.gif
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
12 years, 1 month
[seam/social] 82f628: Supporting ServicesHub created thru producers
by GitHub
Branch: refs/heads/develop
Home: https://github.com/seam/social
Commit: 82f62815a7ed49c14b4bfb17e20285a414dfa020
https://github.com/seam/social/commit/82f62815a7ed49c14b4bfb17e20285a414d...
Author: Antoine Sabot-Durand <antoine(a)sabot-durand.net>
Date: 2012-04-04 (Wed, 04 Apr 2012)
Changed paths:
A examples/web-client/src/main/java/org/jboss/seam/social/examples/webclient/HubProducer.java
M examples/web-client/src/main/resources/META-INF/seam-beans.xml
M impl/src/main/java/org/jboss/seam/social/SeamSocialExtension.java
M services/twitter/src/test/java/org/jboss/seam/social/twitter/test/TwitterServiceProducer.java
M services/twitter/src/test/java/org/jboss/seam/social/twitter/test/TwitterTest.java
M services/twitter/src/test/resources/META-INF/beans.xml
Log Message:
-----------
Supporting ServicesHub created thru producers
12 years, 1 month
Seam SVN: r14503 - in branches/community/Seam_2_3/examples-ee6/jpa: jpa-tests/src/test/java/org/jboss/seam/example/jpa/test and 5 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-04 09:27:32 -0400 (Wed, 04 Apr 2012)
New Revision: 14503
Added:
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/resources-integration/arquillian.xml
Modified:
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/faces-config.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/web.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/book.xhtml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml
Log:
update jpa example to a mostly working state
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -93,6 +93,12 @@
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
@@ -175,23 +181,12 @@
<profile>
<id>ftest-jbossas</id>
<properties>
- <example.context.path>seam-guice</example.context.path>
+ <example.context.path>jboss-seam-jpa</example.context.path>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
- <artifactId>jboss-maven-plugin</artifactId>
- <configuration>
- <jbossHome>${jboss.home}</jbossHome>
- <serverName>${jboss.domain}</serverName>
- <fileNames>
- <param>${basedir}/../guice-ear/target/jpa-web.war</param>
- </fileNames>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
</plugin>
<plugin>
@@ -208,7 +203,7 @@
<profile>
<id>ftest-tomcat</id>
<properties>
- <example.context.path>jboss-seam-guice</example.context.path>
+ <example.context.path>jboss-seam-jpa</example.context.path>
</properties>
<build>
<plugins>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java 2012-04-04 13:27:32 UTC (rev 14503)
@@ -12,6 +12,7 @@
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Manager;
import org.jboss.seam.example.jpa.Booking;
@@ -25,6 +26,9 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
public class BookingTest extends JUnitSeamTest
{
@Deployment(name="BookingTest")
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java 2012-04-04 13:27:32 UTC (rev 14503)
@@ -1,6 +1,7 @@
//$Id: ChangePasswordTest.java 6505 2007-10-12 11:24:54Z pmuir $
package org.jboss.seam.example.jpa.test;
+import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.seam.contexts.Contexts;
@@ -12,7 +13,9 @@
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
+import org.junit.runner.RunWith;
+(a)RunWith(Arquillian.class)
public class ChangePasswordTest extends JUnitSeamTest
{
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java 2012-04-04 13:27:32 UTC (rev 14503)
@@ -9,7 +9,7 @@
public class Deployments {
public static WebArchive jpaDeployment() {
- return ShrinkWrap.create(ZipImporter.class, "jpa.war").importFrom(new File("../booking-ear/target/jpa.war"))
+ return ShrinkWrap.create(ZipImporter.class, "jboss-seam-jpa.war").importFrom(new File("../jpa-web/target/jboss-seam-jpa.war"))
.as(WebArchive.class);
}
}
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java 2012-04-04 13:27:32 UTC (rev 14503)
@@ -1,6 +1,7 @@
//$Id: LoginTest.java 6505 2007-10-12 11:24:54Z pmuir $
package org.jboss.seam.example.jpa.test;
+import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.seam.core.Manager;
@@ -11,7 +12,9 @@
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
+import org.junit.runner.RunWith;
+(a)RunWith(Arquillian.class)
public class LoginTest extends JUnitSeamTest
{
Added: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/resources-integration/arquillian.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/resources-integration/arquillian.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/resources-integration/arquillian.xml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://jboss.org/schema/arquillian"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+ <engine>
+ <property name="deploymentExportPath">target/</property>
+ </engine>
+
+ <container qualifier="jboss" default="true">
+ <configuration>
+ <property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=512m</property>
+ <property name="jbossHome">target/jboss-as-${version.jbossas7}</property>
+ </configuration>
+ </container>
+
+</arquillian>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -23,16 +23,6 @@
<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>
<dependency>
<groupId>org.jboss.seam</groupId>
@@ -44,11 +34,18 @@
</exclusion>
</exclusions>
</dependency>
+<!--
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-debug</artifactId>
</dependency>
+-->
<dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<exclusions>
@@ -59,54 +56,33 @@
</exclusions>
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.15</version>
- </dependency>
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>3.3.3.Final</version>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui</artifactId>
- <version>3.3.3.Final</version>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.jboss.el</groupId>
<artifactId>jboss-el</artifactId>
</dependency>
<dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_15</version>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.0_spec</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -240,9 +216,6 @@
</profile>
<profile>
<id>jbossas51</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
<build>
<plugins>
<plugin>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/resources/META-INF/persistence.xml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -5,7 +5,7 @@
version="1.0">
<persistence-unit name="bookingDatabase" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <non-jta-data-source>java:/DefaultDS</non-jta-data-source>
+ <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/faces-config.xml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/faces-config.xml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -1,12 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="1.2"
+<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_1_2.xsd">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd">
- <!-- Facelets support -->
- <application>
- <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
- </application>
-
</faces-config>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -1,16 +1,12 @@
<jboss-deployment-structure>
<deployment>
- <exclusions>
- <module name="javax.faces.api" slot="main"/>
- <module name="com.sun.jsf-impl" slot="main"/>
- </exclusions>
- <dependencies>
- <module name="org.apache.log4j" />
- <module name="org.dom4j" />
- <module name="org.apache.commons.logging" />
- <module name="org.apache.commons.collections" />
- <module name="javax.faces.api" slot="1.2"/>
- <module name="com.sun.jsf-impl" slot="1.2"/>
- </dependencies>
+ <dependencies>
+ <module name="org.apache.log4j" />
+ <module name="org.dom4j" />
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.commons.collections" />
+ <module name="javax.faces.api"/>
+ <module name="com.sun.jsf-impl"/>
+ </dependencies>
</deployment>
</jboss-deployment-structure>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/web.xml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/WEB-INF/web.xml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.5"
+<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_2_5.xsd">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<!-- Seam -->
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/book.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/book.xhtml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/book.xhtml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -104,7 +104,7 @@
<div class="input">
<s:decorate id="creditCardDecorate">
<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
- <a:support id="onblur" event="onblur" reRender="creditCardDecorate"/>
+ <a:ajax event="blur" render="creditCardDecorate"/>
</h:inputText>
</s:decorate>
</div>
@@ -115,7 +115,7 @@
<div class="input">
<s:decorate id="creditCardNameDecorate">
<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
- <a:support id="onblur" event="onblur" reRender="creditCardNameDecorate"/>
+ <a:ajax event="blur" render="creditCardNameDecorate"/>
</h:inputText>
</s:decorate>
</div>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/home.xhtml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -4,12 +4,12 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib">
-<head>
+<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" />
-</head>
-<body id="pgHome">
+</h:head>
+<h:body id="pgHome">
<f:view>
<div id="document">
<div id="header">
@@ -45,5 +45,5 @@
<div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
</div>
</f:view>
-</body>
+</h:body>
</html>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/main.xhtml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -20,7 +20,7 @@
<h1>Search Hotels</h1>
<fieldset>
<h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
- <a:support id="onkeyup" event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />
+ <a:ajax id="onkeyup" event="keyup" listener="#{hotelSearch.find}" render="searchResults" />
</h:inputText>
 
<a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" reRender="searchResults"/>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/register.xhtml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -5,12 +5,12 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a="http://richfaces.org/a4j">
-<head>
+<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" />
-</head>
-<body id="pgHome">
+</h:head>
+<h: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>
@@ -43,7 +43,7 @@
<div class="input">
<s:decorate id="usernameDecorate">
<h:inputText id="username" value="#{user.username}" required="true">
- <a:support id="onblur" event="onblur" reRender="usernameDecorate"/>
+ <a:ajax event="blur" render="usernameDecorate"/>
</h:inputText>
</s:decorate>
</div>
@@ -54,7 +54,7 @@
<div class="input">
<s:decorate id="nameDecorate">
<h:inputText id="name" value="#{user.name}" required="true">
- <a:support id="onblur" event="onblur" reRender="nameDecorate"/>
+ <a:ajax event="blur" render="nameDecorate"/>
</h:inputText>
</s:decorate>
</div>
@@ -100,5 +100,5 @@
</div>
<div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
</div>
-</body>
+</h:body>
</html>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml 2012-04-04 12:36:58 UTC (rev 14502)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/webapp/template.xhtml 2012-04-04 13:27:32 UTC (rev 14503)
@@ -3,12 +3,12 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.com/products/seam/taglib">
-<head>
+<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" />
-</head>
-<body>
+</h:head>
+<h:body>
<div id="document">
<div id="header">
@@ -31,5 +31,5 @@
</div>
<div id="footer">Created with JBoss Seam, JSF 1.2, Hibernate 3 and Facelets</div>
</div>
-</body>
+</h:body>
</html>
12 years, 1 month
Seam SVN: r14502 - branches/enterprise.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-04 08:36:58 -0400 (Wed, 04 Apr 2012)
New Revision: 14502
Added:
branches/enterprise/WFK_2_0_PRE/
Log:
branching for WFK2
12 years, 1 month
Seam SVN: r14501 - branches/community/Seam_2_3/examples-ee6.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-04 08:32:20 -0400 (Wed, 04 Apr 2012)
New Revision: 14501
Modified:
branches/community/Seam_2_3/examples-ee6/pom.xml
Log:
enable spring example
Modified: branches/community/Seam_2_3/examples-ee6/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/pom.xml 2012-04-04 12:04:24 UTC (rev 14500)
+++ branches/community/Seam_2_3/examples-ee6/pom.xml 2012-04-04 12:32:20 UTC (rev 14501)
@@ -36,6 +36,7 @@
<module>seambay</module>
<module>seampay</module>
<module>seamspace</module>
+ <module>spring</module>
<module>tasks</module>
<module>todo</module>
<module>ui</module>
12 years, 1 month
Seam SVN: r14500 - in branches/community/Seam_2_3/examples-ee6: spring and 28 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-04 08:04:24 -0400 (Wed, 04 Apr 2012)
New Revision: 14500
Added:
branches/community/Seam_2_3/examples-ee6/spring/
branches/community/Seam_2_3/examples-ee6/spring/pom.xml
branches/community/Seam_2_3/examples-ee6/spring/readme.txt
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/example/spring/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/example/spring/test/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/example/spring/test/selenium/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources-ftest/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources-ftest/testng.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/spring.properties
branches/community/Seam_2_3/examples-ee6/spring/spring-web/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/pom.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Booking.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingListAction.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingService.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ChangePasswordAction.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HibernateTestService.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Hotel.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelBookingAction.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelSearchingAction.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/LoginAction.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/RegisterAction.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/User.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/UserService.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ValidationException.java
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/META-INF/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/META-INF/persistence-spring.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/import.sql
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/applicationContext.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/components.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/faces-config.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/navigation.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/pages.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/web.xml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/book.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/confirm.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/conversations.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/date.css
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/screen.css
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/trailblazer_main.css
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/home.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotel.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotels.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/bg.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/btn.bg.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cal-next.png
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cal-prev.png
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cnt.bg.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/dtpick.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.ad.jpg
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.bar.jpg
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.bg.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.title.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/header_line.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/input.bg.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/sdb.bg.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/spinner.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/th.bg.gif
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/index.html
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/main.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/password.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/register.xhtml
branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/template.xhtml
Log:
Add spring to ee6 examples
Added: branches/community/Seam_2_3/examples-ee6/spring/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/pom.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,34 @@
+<?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>spring</artifactId>
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>examples-ee6</artifactId>
+ <version>2.3.0.Beta2-SNAPSHOT</version>
+ </parent>
+ <packaging>pom</packaging>
+ <name>Spring Example (EE6)</name>
+
+ <properties>
+ <example.name>spring</example.name>
+ </properties>
+
+ <modules>
+ <module>spring-web</module>
+ <module>spring-tests</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6.spring</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/spring/readme.txt
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/readme.txt (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/readme.txt 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,22 @@
+Seam Spring Example
+===================
+
+This example shows Seam/Spring integration. This application runs on JBoss AS as
+a WAR file.
+
+To deploy the example to JBossAS 5, follow these steps:
+
+* In the example root directory run:
+
+ mvn clean package
+
+* Set JBOSS_HOME environment property.
+
+* In the spring-web directory run:
+
+ mvn jboss:hard-deploy
+
+When deploying to JBossAS 4, use a -Pjbossas42 maven profile to package the
+application. Use -Pjbossas6 for JBossAS 6 accordingly.
+
+* Open this URL in a web browser: http://localhost:8080/jboss-seam-spring
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-tests/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-tests/pom.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,90 @@
+<?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>spring</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.spring</groupId>
+ <artifactId>spring-tests</artifactId>
+ <name>Spring Integration Tests Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </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>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.0_spec</artifactId>
+ <scope>provided</scope>
+ </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>
+ <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>jboss-seam-spring</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/spring/spring-tests/src/test/java/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/java/org/jboss/seam/example/spring/test/selenium/SpringChangePasswordTest.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,108 @@
+/*
+ * 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.spring.test.selenium;
+
+import org.jboss.seam.example.common.test.booking.selenium.SeleniumBookingTest;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This class tests change password funcionality.
+ *
+ * @author jbalunas
+ * @author jharting
+ *
+ */
+public class SpringChangePasswordTest extends SeleniumBookingTest {
+
+ private final static String LONG_TEXT = "testertestertest";
+ private final static String SHORT_TEXT = "tt";
+ // overriding default values
+ private final String USERNAME = "gavin";
+ private final String PASSWORD = "foobar";
+
+ @Override
+ @BeforeMethod
+ public void setUp() {
+ browser = startBrowser();
+ login(USERNAME, PASSWORD);
+ }
+
+ /**
+ * Verifies that changing password works well. If clean-up part of this
+ * method fails it may affect other methods.
+ */
+ @Test
+ public void changePasswordTest() {
+ String newPassword = "password";
+ changePassword(newPassword, PASSWORD);
+ assertTrue("Password change failed.", browser
+ .isTextPresent(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, newPassword));
+ // cleanup - set default password
+ changePassword(PASSWORD, newPassword);
+ assertTrue("Password change failed.", browser
+ .isTextPresent(getProperty("PASSWORD_UPDATED_MESSAGE")));
+ logout();
+ assertTrue("Login failed.", login(USERNAME, PASSWORD));
+ }
+
+ @Test
+ public void usingIncorrectOldPasswordTest() {
+ changePassword("password", "foobar1");
+ assertTrue("Password verification failed", browser
+ .isTextPresent(getProperty("PASSWORD_REENTER_MESSAGE")));
+ }
+
+ @Test
+ public void usingEmptyPasswordsTest() {
+ changePassword("", "");
+ assertEquals("Password verification failed", 2, browser
+ .getXpathCount(getProperty("PASSWORD_VALUE_REQUIRED_MESSAGE")));
+ }
+
+ @Test
+ public void usingLongPasswordTest() {
+ changePassword(LONG_TEXT, LONG_TEXT);
+ assertTrue("Password verification failed", browser
+ .isTextPresent(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ @Test
+ public void usingShortPasswordTest() {
+ changePassword(SHORT_TEXT, SHORT_TEXT);
+ assertTrue("Password verification failed", browser
+ .isTextPresent(getProperty("PASSWORD_LENGTH_MESSAGE")));
+ }
+
+ public void changePassword(String newPassword, String oldpassword) {
+ browser.click(getProperty("SETTINGS"));
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(getProperty("PASSWORD_PASSWORD"), newPassword);
+ browser.type(getProperty("PASSWORD_VERIFY"), oldpassword);
+ browser.click(getProperty("PASSWORD_SUBMIT"));
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/seam.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/seam.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/seam.properties 2012-04-04 12:04:24 UTC (rev 14500)
@@ -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/spring/spring-tests/src/test/resources/spring.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/spring.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/spring.properties 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,86 @@
+ #
+ # 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:Message' or @id='setpassword:PasswordDecorate: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
+BOOKING_BOOK id=hotel:bookHotel
+BOOKING_CANCEL id=hotel:cancel
+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:Messages
+HOTEL_CHECKOUT_DATE_FIELD id=booking:checkoutDateDecorate:checkoutDateInputDate
+HOTEL_CHECKOUT_DATE_MESSAGE id=booking:Messages
+HOTEL_SMOKING_1 id=booking:smokingDecorate:smoking:0
+HOTEL_SMOKING_2 id=booking:smokingDecorate:smoking:1
+HOTEL_CREDIT_CARD id=booking:creditCardDecorate:creditCard
+HOTEL_CREDIT_CARD_NAME id=booking:creditCardNameDecorate:creditCardName
+HOTEL_PROCEED id=booking:proceed
+HOTEL_CANCEL id=booking:cancel
+HOTEL_CONFIRM id=confirm:confirm
+HOTEL_MESSAGE xpath=//ul[@id='main:messages']/li
+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 verify
+REGISTRATION_LENGTH_MESSAGE size must be between
+REGISTRATION_SUCCESSFUL_MESSAGE Successfully registered as {0}
+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:Spinner
+# ajax not present in spring example - false required
+USE_AJAX_SEARCH FALSE
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources/spring.properties
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources-ftest/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources-ftest/testng.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources-ftest/testng.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,30 @@
+<!--
+ 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="Spring example" verbose="2" parallel="false">
+ <test name="spring_tests">
+ <parameter name="PROPERTY_FILE"
+ value="/spring.properties" />
+ <classes>
+ <class name="org.jboss.seam.example.common.test.booking.selenium.RegistrationTest" />
+ <class name="org.jboss.seam.example.spring.test.selenium.SpringChangePasswordTest" />
+ <class name="org.jboss.seam.example.common.test.booking.selenium.BackButtonTest" />
+ <class name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest" />
+ <class name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest" />
+ </classes>
+ </test>
+</suite>
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-tests/src/test/resources-ftest/testng.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/pom.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,128 @@
+<?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>spring</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.spring</groupId>
+ <artifactId>spring-web</artifactId>
+ <packaging>war</packaging>
+ <name>Spring Web Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ </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>
+ </exclusions>
+ </dependency>
+<!-- <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ </dependency>-->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ioc</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ </exclusions>
+ </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>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>jboss-seam-spring</finalName>
+ <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/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Booking.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Booking.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Booking.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,193 @@
+//$Id: Booking.java 3955 2007-02-20 06:16:28Z nrichards $
+package org.jboss.seam.example.spring;
+
+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;
+
+@Entity
+@Name("booking")
+public class Booking
+ implements Serializable
+{
+ private static final long serialVersionUID = 2149196747007576668L;
+ 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 boolean smoking;
+ private int beds;
+
+ public Booking() {}
+
+ public Booking(Hotel hotel, User user)
+ {
+ this.hotel = hotel;
+ this.user = user;
+ }
+
+ @Transient
+ public BigDecimal getTotal()
+ {
+ return hotel.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() );
+ }
+
+ public boolean isSmoking()
+ {
+ return smoking;
+ }
+
+ public void setSmoking(boolean smoking)
+ {
+ this.smoking = smoking;
+ }
+
+ public int getBeds()
+ {
+ return beds;
+ }
+
+ public void setBeds(int beds)
+ {
+ this.beds = beds;
+ }
+ @NotNull(message="Credit card 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/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingListAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingListAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingListAction.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,62 @@
+//$Id: BookingListAction.java 8748 2008-08-20 12:08:30Z pete.muir(a)jboss.org $
+package org.jboss.seam.example.spring;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.io.Serializable;
+import java.util.List;
+
+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.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+@Scope(SESSION)
+@Name("bookingList")
+public class BookingListAction
+ implements Serializable
+{
+ private static final long serialVersionUID = 8037511081807516466L;
+
+ @In
+ private BookingService bookingService;
+
+ @In
+ private User user;
+
+ @SuppressWarnings("unused")
+ @DataModel
+ private List<Booking> bookings;
+ @DataModelSelection
+ private Booking booking;
+
+ @Logger
+ private Log log;
+
+ @Factory("bookings")
+ @Observer("bookingConfirmed")
+ public void getBookings()
+ {
+ bookings = bookingService.findBookingsByUsername(user.getUsername());
+ }
+
+ public void cancel()
+ {
+ log.info("Cancel booking: #{bookingList.booking.id} for #{user.username}");
+ bookingService.cancelBooking(booking.getId());
+ getBookings();
+ FacesMessages.instance().add("Booking cancelled for confirmation number #0", booking.getId());
+ }
+
+ public Booking getBooking()
+ {
+ return booking;
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingService.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingService.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/BookingService.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,113 @@
+package org.jboss.seam.example.spring;
+
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceException;
+
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.async.Asynchronous;
+import org.jboss.seam.core.Expressions;
+import org.jboss.seam.log.Log;
+import org.springframework.orm.jpa.JpaCallback;
+import org.springframework.orm.jpa.support.JpaDaoSupport;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Example of using the JpaDaoSupport.
+ *
+ * @author Mike Youngstrom
+ */
+public class BookingService extends JpaDaoSupport {
+
+ public static ThreadLocal<Boolean> currentThread = new ThreadLocal<Boolean>();
+
+ @Logger
+ private static Log logger;
+
+ @SuppressWarnings("unchecked")
+ @Transactional
+ public List<Hotel> findHotels(final String searchPattern, final int firstResult, final int maxResults) {
+ logger.debug("Looking for a Hotel.");
+ return getJpaTemplate().executeFind(new JpaCallback() {
+ public Object doInJpa(EntityManager em) throws PersistenceException {
+ return em
+ .createQuery(
+ "select h from Hotel h where lower(h.name) like :search or lower(h.city) like :search or lower(h.zip) like :search or lower(h.address) like :search")
+ .setParameter("search", searchPattern).setMaxResults(maxResults).setFirstResult(firstResult)
+ .getResultList();
+ }
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ @Transactional
+ public List<Booking> findBookingsByUsername(String username) {
+ logger.debug("Finding Bookings for user {0}", username);
+ return getJpaTemplate().findByNamedParams(
+ "select b from Booking b where b.user.username = :username order by b.checkinDate",
+ Collections.singletonMap("username", username));
+
+ }
+
+ @Transactional
+ public void cancelBooking(Long bookingId) {
+ logger.debug("Cancelling booking id: {0}", bookingId);
+ if (bookingId == null) {
+ throw new IllegalArgumentException("BookingId cannot be null");
+ }
+
+ Booking cancelled = getJpaTemplate().find(Booking.class, bookingId);
+ if (cancelled != null) {
+ getJpaTemplate().remove(cancelled);
+ }
+ }
+
+ public void validateBooking(Booking booking) throws ValidationException {
+ Calendar calendar = Calendar.getInstance();
+ calendar.add(Calendar.DAY_OF_MONTH, -1);
+
+ if (booking.getCheckinDate().before(calendar.getTime())) {
+ throw new ValidationException("Check in date must be a future date");
+ } else if (!booking.getCheckinDate().before(booking.getCheckoutDate())) {
+ throw new ValidationException("Check out date must be later than check in date");
+ }
+ }
+
+ @Transactional
+ public void bookHotel(Booking booking) throws ValidationException {
+ validateBooking(booking);
+
+ getJpaTemplate().persist(booking);
+ getJpaTemplate().flush();
+ }
+
+ @Asynchronous
+ @Transactional
+ public void sendRegisterEmail(String username) {
+ if (currentThread.get() != null) {
+ throw new RuntimeException("Not really happening asyncronously");
+ }
+ logger.info("pretending to send email asyncronously");
+ //Could be injected using spring injection just fine but wanted to test
+ //the use of Expressions Asynchronously
+ UserService userService = (UserService)Expressions.instance().createValueExpression("#{userService}").getValue();
+ User user = userService.findUser(username);
+ if (user != null) {
+ logger.info("Asynchronously found User: {0}", user.getName());
+ return;
+ }
+ throw new RuntimeException("Didn't find the user that made the asynchronous call");
+ }
+
+ @Transactional
+ public Hotel findHotelById(Long hotelId) {
+ if (hotelId == null) {
+ throw new IllegalArgumentException("hotelId cannot be null");
+ }
+
+ return getJpaTemplate().find(Hotel.class, hotelId);
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ChangePasswordAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ChangePasswordAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ChangePasswordAction.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,52 @@
+package org.jboss.seam.example.spring;
+
+import static org.jboss.seam.ScopeType.EVENT;
+
+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.faces.FacesMessages;
+
+@Scope(EVENT)
+@Name("changePassword")
+public class ChangePasswordAction
+{
+
+ @In @Out
+ private User user;
+
+ @In("#{userService}")
+ private UserService userService;
+
+ private String verify;
+
+ private boolean changed;
+
+ public void changePassword()
+ {
+ if (userService.changePassword(user.getUsername(), verify, user.getPassword())) {
+ FacesMessages.instance().add("Password updated");
+ changed = true;
+ } else {
+ FacesMessages.instance().addToControl("verify", "Re-enter new password");
+ verify=null;
+ }
+ user = userService.findUser(user.getUsername());
+ }
+
+ public boolean isChanged()
+ {
+ return changed;
+ }
+
+ public String getVerify()
+ {
+ return verify;
+ }
+
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HibernateTestService.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HibernateTestService.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HibernateTestService.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,97 @@
+/**
+ *
+ */
+package org.jboss.seam.example.spring;
+
+import java.sql.SQLException;
+import java.util.List;
+
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.springframework.transaction.TransactionStatus;
+import org.springframework.transaction.support.TransactionCallback;
+import org.springframework.transaction.support.TransactionTemplate;
+
+/**
+ * A Service to demonstrate/test some different methods of accessing Seam Managed Hibernate Session in Spring.
+ * @author Mike Youngstrom
+ */
+public class HibernateTestService
+{
+ public static final String HIBERNATE_HOTEL_NAME = "This is the Hibernate Hotel";
+
+ public static final String HIBERNATE_HOTEL_ADDRESS = "Hibernate Address";
+
+ private TransactionTemplate hibernateTransactionTemplate;
+
+ private SessionFactory sessionFactory;
+
+ public void testHibernateIntegration()
+ {
+ hibernateTransactionTemplate.execute(new TransactionCallback()
+ {
+ public Object doInTransaction(TransactionStatus status)
+ {
+ // Testing access through SessionFactory.getCurrentSession()
+ Hotel hotel = getFirstHotel(sessionFactory.getCurrentSession());
+ hotel.setName(HIBERNATE_HOTEL_NAME);
+ return null;
+ }
+ });
+ hibernateTransactionTemplate.execute(new TransactionCallback()
+ {
+ public Object doInTransaction(TransactionStatus status)
+ {
+ // Testing access through SessionFactory.getCurrentSession()
+ Hotel hotel = getFirstHotel(sessionFactory.getCurrentSession());
+ if (!HIBERNATE_HOTEL_NAME.equals(hotel.getName()))
+ {
+ throw new RuntimeException("Hotel name not set. Hibernate integration not working.");
+ }
+ hotel.setAddress(HIBERNATE_HOTEL_ADDRESS);
+ return null;
+ }
+ });
+ hibernateTransactionTemplate.execute(new TransactionCallback()
+ {
+ public Object doInTransaction(TransactionStatus status)
+ {
+ // Testing access through SessionFactory.getCurrentSession()
+ Hotel hotel = getFirstHotel(sessionFactory.getCurrentSession());
+ if (!HIBERNATE_HOTEL_ADDRESS.equals(hotel.getAddress()))
+ {
+ throw new RuntimeException("Hotel address not set. Hibernate integration not working.");
+ }
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @return
+ */
+ private Hotel getFirstHotel(Session session)
+ {
+ List<Hotel> results = session.createQuery("from Hotel").list();
+ if (results.size() <= 0)
+ {
+ throw new RuntimeException("Hibernate integration is broken");
+ }
+ Hotel hotel = results.get(0);
+ return hotel;
+ }
+
+ /**
+ * @param transactionTemplate the transactionTemplate to set
+ */
+ public void setTransactionTemplate(TransactionTemplate transactionTemplate)
+ {
+ this.hibernateTransactionTemplate = transactionTemplate;
+ }
+
+ public void setSessionFactory(SessionFactory sessionFactory)
+ {
+ this.sessionFactory = sessionFactory;
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Hotel.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Hotel.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/Hotel.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,114 @@
+//$Id: Hotel.java 3945 2007-02-19 21:59:13Z nrichards $
+package org.jboss.seam.example.spring;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+import org.jboss.seam.annotations.Name;
+
+@Entity
+@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 BigDecimal price;
+
+ @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;
+ }
+
+ @Column(precision=6, scale=2)
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ public void setPrice(BigDecimal price)
+ {
+ this.price = price;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelBookingAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelBookingAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelBookingAction.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,96 @@
+//$Id: HotelBookingAction.java 8033 2008-04-28 09:40:19Z pete.muir(a)jboss.org $
+package org.jboss.seam.example.spring;
+
+import java.util.Calendar;
+import javax.faces.application.FacesMessage;
+
+import org.jboss.seam.annotations.Begin;
+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.core.Events;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+@Name("hotelBooking")
+public class HotelBookingAction {
+ @In("#{bookingService}")
+ private BookingService bookingService;
+
+ @In
+ private User user;
+
+ @In(required = false)
+ @Out
+ private Hotel hotel;
+
+ @In(required = false)
+ @Out(required = false)
+ private Booking booking;
+
+ @In
+ private FacesMessages facesMessages;
+
+ @In
+ private Events events;
+
+ @Logger
+ private Log log;
+
+ private boolean bookingValid;
+
+ @Begin
+ public void selectHotel(Hotel selectedHotel) {
+ hotel = bookingService.findHotelById(selectedHotel.getId());
+ }
+
+ 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());
+ }
+
+ public void setBookingDetails() {
+ bookingValid = true;
+ try {
+ bookingService.validateBooking(booking);
+ } catch (ValidationException e) {
+ facesMessages.add(FacesMessage.SEVERITY_ERROR, e.getMessage());
+ bookingValid = false;
+ }
+ }
+
+ public boolean isBookingValid() {
+ return bookingValid;
+ }
+
+ @End
+ public String confirm() {
+ try {
+ bookingService.bookHotel(booking);
+ } catch (ValidationException e) {
+ facesMessages.add(FacesMessage.SEVERITY_ERROR, e.getMessage());
+ return null;
+ }
+
+ BookingService.currentThread.set(true);
+ //Cannot call this.sendRegisterEmail because it won't hit the @Asynchronous intercepter
+ bookingService.sendRegisterEmail(booking.getUser().getUsername());
+ BookingService.currentThread.set(null);
+
+ 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.raiseEvent("bookingConfirmed");
+ return "main";
+ }
+
+ @End
+ public void cancel() {
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelSearchingAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelSearchingAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/HotelSearchingAction.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,64 @@
+//$Id: HotelSearchingAction.java 5848 2007-07-17 18:43:56Z myoungstrom $
+package org.jboss.seam.example.spring;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.datamodel.DataModel;
+
+public class HotelSearchingAction implements Serializable
+{
+ @In("#{bookingService}")
+ private BookingService bookingService;
+
+ private String searchString;
+ private int pageSize;
+ private int page;
+
+ @DataModel
+ private List<Hotel> hotels;
+
+ public void find()
+ {
+ page = 0;
+ queryHotels();
+ }
+
+ public void nextPage()
+ {
+ page++;
+ queryHotels();
+ }
+
+ private void queryHotels()
+ {
+ String searchPattern = searchString==null ? "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
+ hotels = bookingService.findHotels(searchPattern, page * pageSize, pageSize);
+ }
+
+ public boolean isNextPageAvailable()
+ {
+ return hotels!=null && hotels.size()==pageSize;
+ }
+
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ public String getSearchString()
+ {
+ return searchString;
+ }
+
+ public void setSearchString(String searchString)
+ {
+ this.searchString = searchString;
+ }
+
+}
+
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/LoginAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/LoginAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/LoginAction.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,60 @@
+//$Id: LoginAction.java 8033 2008-04-28 09:40:19Z pete.muir(a)jboss.org $
+package org.jboss.seam.example.spring;
+
+import java.io.Serializable;
+
+import org.jboss.seam.ScopeType;
+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.Synchronized;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.web.Session;
+
+(a)Scope(ScopeType.SESSION)
+@Synchronized
+@Name("login")
+public class LoginAction implements Serializable {
+
+ @In(required = false)
+ @Out(required = false)
+ private User user;
+
+ @In("#{userService}")
+ private UserService userService;
+
+ @In
+ private FacesMessages facesMessages;
+
+ private boolean loggedIn;
+
+ public void login() {
+ User candidateUser = userService.findUser(user.getUsername(), user.getPassword());
+
+ if (candidateUser == null) {
+ facesMessages.add("Invalid login");
+ } else {
+ user = candidateUser;
+ loggedIn = true;
+ facesMessages.add("Welcome, #{user.name}");
+ }
+
+ }
+
+ public void logout() {
+ loggedIn = false;
+ Session.instance().invalidate();
+ }
+
+ public void validateLogin() {
+ if (!loggedIn) {
+ facesMessages.add("Please log in first");
+ }
+ }
+
+ public boolean isLoggedIn() {
+ return loggedIn;
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/RegisterAction.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/RegisterAction.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/RegisterAction.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,75 @@
+//$Id: RegisterAction.java 8033 2008-04-28 09:40:19Z pete.muir(a)jboss.org $
+package org.jboss.seam.example.spring;
+
+import static org.jboss.seam.ScopeType.EVENT;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.FacesMessages;
+
+@Scope(EVENT)
+@Name("register")
+public class RegisterAction
+{
+ @In
+ private User user;
+
+ @In("#{userService}")
+ private UserService userService;
+
+ @In("#{hibernateTestService}")
+ private HibernateTestService hibernateTestService;
+
+ @SuppressWarnings("unused")
+ @In("hotelSearch")
+ private HotelSearchingAction hotelSearchingAction;
+
+ @In
+ private FacesMessages facesMessages;
+
+ private String verify;
+
+ private boolean registered;
+
+ public void register()
+ {
+ if ( user.getPassword().equals(verify) )
+ {
+
+ try {
+ userService.createUser(user);
+ hibernateTestService.testHibernateIntegration();
+ registered = true;
+ } catch(ValidationException e) {
+ facesMessages.add(e.getMessage());
+ }
+ }
+ else
+ {
+ facesMessages.add("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;
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/User.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/User.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/User.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,77 @@
+//$Id: User.java 3972 2007-02-21 14:37:49Z nrichards $
+package org.jboss.seam.example.spring;
+
+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;
+
+@Entity
+@Name("user")
+@Scope(SESSION)
+@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/spring/spring-web/src/main/java/org/jboss/seam/example/spring/UserService.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/UserService.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/UserService.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,71 @@
+package org.jboss.seam.example.spring;
+
+import java.util.List;
+
+import org.springframework.dao.DataAccessException;
+import org.springframework.orm.jpa.support.JpaDaoSupport;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author Mike Youngstrom
+ * @author Marek Novotny
+ *
+ */
+public class UserService extends JpaDaoSupport {
+
+ @Transactional
+ public boolean changePassword(String username, String oldPassword, String newPassword) {
+ System.out.println("change password " + oldPassword + " to " + newPassword);
+ if (newPassword == null || newPassword.length()==0) {
+ throw new IllegalArgumentException("newPassword cannot be null.");
+ }
+
+ User user = findUser(username);
+ System.out.println("USER" + user);
+ if (user.getPassword().equals(oldPassword)) {
+ user.setPassword(newPassword);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Transactional
+ public User findUser(String username) {
+ if (username == null || "".equals(username)) {
+ throw new IllegalArgumentException("Username cannot be null");
+ }
+ return getJpaTemplate().find(User.class, username);
+ }
+
+ @Transactional
+ public User findUser(String username, String password) {
+ try {
+ List result = getJpaTemplate().find("select u from User u where u.username=?1 and u.password=?2", username, password);
+ if (result.size() > 0)
+ {
+ return (User) result.get(0);
+ }
+ else
+ {
+ return null;
+ }
+ } catch (DataAccessException e) {
+ return null;
+ }
+ }
+
+ @Transactional
+ public void createUser(User user) throws ValidationException {
+ if (user == null) {
+ throw new IllegalArgumentException("User cannot be null");
+ }
+
+ User existingUser = findUser(user.getUsername());
+ if (existingUser != null) {
+ throw new ValidationException("Username "+user.getUsername()+" already exists");
+ }
+ getJpaTemplate().persist(user);
+ getJpaTemplate().flush();
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ValidationException.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ValidationException.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/java/org/jboss/seam/example/spring/ValidationException.java 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,13 @@
+package org.jboss.seam.example.spring;
+
+/**
+ * @author youngm
+ *
+ */
+public class ValidationException extends Exception {
+
+ public ValidationException(String message) {
+ super(message);
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/META-INF/persistence-spring.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/META-INF/persistence-spring.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/META-INF/persistence-spring.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,26 @@
+<?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" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <!-- classes must be enumerated due to a known bug in Spring 2.5.6, SPR-5787 -->
+ <class>org.jboss.seam.example.spring.Booking</class>
+ <class>org.jboss.seam.example.spring.Hotel</class>
+ <class>org.jboss.seam.example.spring.User</class>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
+
+ <!-- Use these vendor-specific properties to setup JDBC connection instead of using Spring configuration -->
+ <!--
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:defaultDB"/>
+ -->
+ </properties>
+ </persistence-unit>
+</persistence>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/import.sql
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/import.sql (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/import.sql 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,22 @@
+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, price, name, address, city, state, zip, country) values (1, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160, 'MarriottDowntown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130, 'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250, 'Meli� White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/resources/seam.properties
===================================================================
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/applicationContext.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/applicationContext.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/applicationContext.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:util="http://www.springframework.org/schema/util" xmlns:seam="http://jboss.com/products/seam/spring-seam"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:jee="http://www.springframework.org/schema/jee"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+ http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+ http://jboss.com/products/seam/spring-seam http://jboss.com/products/seam/spring-seam-2.3.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
+ default-lazy-init="true">
+
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="driverClassName" value="org.h2.Driver"/>
+ <property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value="sa"/>
+ </bean>
+
+ <!-- Here we are using a spring configured EMF you can just as easily use a Seam configured EMF using
+ <persistence:entity-manager-factory/> unless your project depends upon some functionality spring
+ provides an EMF such as the ability to inject a dataSource.
+ -->
+ <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="dataSource" ref="dataSource"/>
+ <property name="persistenceUnitName" value="bookingDatabase"/>
+ <!-- Use alternate location to prevent JBoss AS from automatically loading persistence units (in-container) -->
+ <property name="persistenceXmlLocation" value="classpath*:/META-INF/persistence-spring.xml"/>
+ </bean>
+
+ <bean id="entityManagerWrapper" class="org.springframework.orm.jpa.support.SharedEntityManagerBean">
+ <property name="entityManagerFactory" ref="entityManagerFactory"/>
+ </bean>
+
+
+ <!-- This example uses resource local JpaTransactionManager. You could just as easily use a JtaTransactionManager -->
+ <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+ <!-- Be sure to specify the SeamManagedEntityManagerFactory since that will manage the EM that will be
+ beginning and ending transactions.-->
+ <property name="entityManagerFactory" ref="seamEntityManagerFactory"/>
+ </bean>
+
+ <tx:annotation-driven proxy-target-class="true" />
+
+ <!-- Example using PersistenceAnnotationBeanPostProcessor for persistence -->
+ <bean id="userService" class="org.jboss.seam.example.spring.UserService">
+ <property name="entityManagerFactory" ref="seamEntityManagerFactory"/>
+ </bean>
+
+ <!-- Example using JpaDaoSupport for persistence -->
+ <bean id="bookingService" class="org.jboss.seam.example.spring.BookingService">
+ <property name="entityManagerFactory" ref="seamEntityManagerFactory" />
+ <seam:component/>
+ </bean>
+
+ <!-- Testing out a seam scoped spring bean -->
+ <bean id="hotelSearch" class="org.jboss.seam.example.spring.HotelSearchingAction" scope="seam.SESSION">
+ <!-- Testing creation time injection -->
+ <property name="pageSize" value="10" />
+ </bean>
+
+ <seam:configure-scopes default-auto-create="true" />
+
+ <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
+ <!-- Because we have multiple EntityManagerFactories in this applicationContext identify the
+ SeamManagedEntityManagerFactory as the default -->
+ <property name="defaultPersistenceUnitName" value="conversationScoped"/>
+ </bean>
+
+ <!-- EMF that wraps a Seam Managed EM instance for use in Spring -->
+ <bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
+ <!-- The Seam managed-persistence-context component name. -->
+ <property name="persistenceContextName" value="entityManager" />
+ <!-- Optionally provide a unit name. If not specified the default would be the persistenceContextName -->
+ <property name="persistenceUnitName" value="conversationScoped"/>
+ </bean>
+
+ <!-- TaskExecutor for example use of @Asynchronous -->
+ <bean id="springThreadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" />
+
+
+ <!-- Sample Hibernate Configuration -->
+
+ <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
+ <property name="dataSource" ref="dataSource"/>
+ <property name="annotatedClasses">
+ <list>
+ <value>org.jboss.seam.example.spring.Hotel</value>
+ <value>org.jboss.seam.example.spring.User</value>
+ <value>org.jboss.seam.example.spring.Booking</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="seamSessionFactory" class="org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean">
+ <property name="sessionName" value="hibernateSession"/>
+ </bean>
+
+ <bean id="hibernateTestService" class="org.jboss.seam.example.spring.HibernateTestService">
+ <property name="sessionFactory" ref="seamSessionFactory"/>
+ <property name="transactionTemplate" ref="hibernateTransactionTemplate"/>
+ </bean>
+
+ <bean id="hibernateTransactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
+ <property name="transactionManager" ref="hibernateTransactionManager"/>
+ </bean>
+
+ <bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
+ <property name="sessionFactory" ref="seamSessionFactory"/>
+ </bean>
+</beans>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/components.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ xmlns:spring="http://jboss.com/products/seam/spring"
+ xmlns:async="http://jboss.com/products/seam/async"
+ 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/persistence http://jboss.com/products/seam/persistence-2.3.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.3.xsd
+ http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-2.3.xsd
+ http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.3.xsd">
+
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500"
+ conversation-id-parameter="cid"/>
+
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+ entity-manager-factory="#{entityManagerFactory}" />
+
+ <!-- Sample Hibernate Session -->
+ <persistence:managed-hibernate-session name="hibernateSession" auto-create="true" session-factory="#{sessionFactory}"/>
+
+ <core:init debug="true"/>
+
+ <spring:context-loader />
+
+ <!-- Install a ThreadPoolDispatcher to handle scheduled asynchronous event -->
+ <component name="threadPoolDispatcher" class="org.jboss.seam.async.ThreadPoolDispatcher" />
+
+ <!-- Install the SpringDispatcher as default -->
+ <spring:spring-task-executor-dispatcher schedule-dispatcher="#{threadPoolDispatcher}" task-executor="#{springThreadPoolTaskExecutor}"/>
+
+ <spring:spring-transaction platform-transaction-manager="#{transactionManager}"/>
+
+</components>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/faces-config.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,89 @@
+<?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">
+
+ <!-- Facelets support -->
+ <application>
+ <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
+ </application>
+
+<!--
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>login</from-outcome>
+ <to-view-id>/home.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/register.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>password</from-outcome>
+ <to-view-id>/password.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>main</from-outcome>
+ <to-view-id>/main.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>hotel</from-outcome>
+ <to-view-id>/hotel.xhtml</to-view-id>
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/hotel.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>book</from-outcome>
+ <to-view-id>/book.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/book.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>confirm</from-outcome>
+ <to-view-id>/confirm.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+
+ <navigation-rule>
+ <from-view-id>/confirm.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>confirmed</from-outcome>
+ <to-view-id>/main.xhtml</to-view-id>
+
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>back</from-outcome>
+ <to-view-id>/book.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+ -->
+
+</faces-config>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/jboss-deployment-structure.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,16 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.javassist" export="true"/>
+ <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"/>
+ <module name="org.hibernate" export="true"/>
+ <module name="org.hibernate.envers" export="true"/>
+ <module name="com.h2database.h2" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/navigation.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/navigation.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/navigation.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,83 @@
+<?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">
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>login</from-outcome>
+ <to-view-id>/home.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/register.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>password</from-outcome>
+ <to-view-id>/password.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>main</from-outcome>
+ <to-view-id>/main.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>hotel</from-outcome>
+ <to-view-id>/hotel.xhtml</to-view-id>
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/hotel.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>book</from-outcome>
+ <to-view-id>/book.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+
+ <navigation-rule>
+ <from-view-id>/book.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-outcome>confirm</from-outcome>
+ <to-view-id>/confirm.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+
+
+ <navigation-rule>
+ <from-view-id>/confirm.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>confirmed</from-outcome>
+ <to-view-id>/main.xhtml</to-view-id>
+
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>back</from-outcome>
+ <to-view-id>/book.xhtml</to-view-id>
+
+ <redirect />
+ </navigation-case>
+ </navigation-rule>
+</faces-config>
+
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/pages.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/pages.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.3.xsd"
+ no-conversation-view-id="/main.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">
+
+ <navigation>
+ <rule if="#{login.loggedIn}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/password.xhtml">
+ <action execute="#{login.validateLogin}"/>
+
+ <navigation from-action="#{login.validateLogin}">
+ <rule if="#{not login.loggedIn}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+
+ <navigation>
+ <rule if="#{changePassword.changed}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/main.xhtml">
+
+ <action execute="#{login.validateLogin}"/>
+
+ <navigation from-action="#{login.validateLogin}">
+ <rule if="#{not login.loggedIn}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ <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.setBookingDetails}">
+ <rule if="#{hotelBooking.bookingValid}">
+ <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="#{login.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/spring/spring-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/WEB-INF/web.xml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,59 @@
+<?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" metadata-complete="true">
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <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>
+
+ <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>
+
+ <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>
+
+ <!-- JSF -->
+
+ <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/spring/spring-web/src/main/webapp/book.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/book.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/book.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,178 @@
+<!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"
+ 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>
+ <div class="entry">
+ <div class="label">Name:</div>
+ <div class="output">#{hotel.name}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Address:</div>
+ <div class="output">#{hotel.address}</div>
+ </div>
+ <div class="entry">
+ <div class="label">City, State:</div>
+ <div class="output">#{hotel.city}, #{hotel.state}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Zip:</div>
+ <div class="output">#{hotel.zip}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Country:</div>
+ <div class="output">#{hotel.country}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Nightly rate:</div>
+ <div class="output">
+ <h:outputText value="#{hotel.price}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ </div>
+ </div>
+
+ <s:validateAll>
+
+ <f:facet name="aroundInvalidField">
+ <s:span id="Error" styleClass="errors"/>
+ </f:facet>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="checkinDate">Check In Date:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="checkinDateDecorate">
+ <rich:calendar id="checkinDate" value="#{booking.checkinDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkinDateDecorate" />
+ <br/>
+ <s:message/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="checkoutDateDecorate">
+ <rich:calendar id="checkoutDate" value="#{booking.checkoutDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkoutDateDecorate" />
+ <br/>
+ <s:message/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="beds">Room Preference:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="bedsDecorate">
+ <h:selectOneMenu id="beds" value="#{booking.beds}">
+ <f:selectItem itemLabel="One king-size bed" itemValue="1"/>
+ <f:selectItem itemLabel="Two double beds" itemValue="2"/>
+ <f:selectItem itemLabel="Three beds" itemValue="3"/>
+ </h:selectOneMenu>
+ <br/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="smoking">Smoking Preference:</h:outputLabel></div>
+ <div id="radio" class="input">
+ <s:decorate id="smokingDecorate">
+ <h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection">
+ <f:selectItem itemLabel="Smoking" itemValue="true"/>
+ <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
+ </h:selectOneRadio>
+ <br/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="creditCard">Credit Card #:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="creditCardDecorate">
+ <h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
+ </h:inputText>
+ <br/>
+ <s:message />
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="creditCardName">Credit Card Name:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="creditCardNameDecorate">
+ <h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
+ </h:inputText>
+ <br/>
+ <s:message/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="creditCardExpiryMonth">Credit Card Expiry:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="creditCardExpiryDecorate">
+ <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>
+ <br/>
+ </s:decorate>
+ </div>
+ </div>
+
+ </s:validateAll>
+
+ <div class="entry errors">
+ <h:messages id="Messages" globalOnly="true"/>
+ </div>
+
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <h:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/> 
+ <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/spring/spring-web/src/main/webapp/confirm.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/confirm.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/confirm.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,84 @@
+<!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"
+ 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>
+ <div class="entry">
+ <div class="label">Name:</div>
+ <div class="output">#{hotel.name}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Address:</div>
+ <div class="output">#{hotel.address}</div>
+ </div>
+ <div class="entry">
+ <div class="label">City, State:</div>
+ <div class="output">#{hotel.city}, #{hotel.state}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Zip:</div>
+ <div class="output">#{hotel.zip}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Country:</div>
+ <div class="output">#{hotel.country}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Total payment:</div>
+ <div class="output">
+ <h:outputText value="#{booking.total}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ </div>
+ </div>
+ <div class="entry">
+ <div class="label">Check In Date:</div>
+ <div class="output"><h:outputText value="#{booking.checkinDate}"/></div>
+ </div>
+ <div class="entry">
+ <div class="label">Check Out Date:</div>
+ <div class="output"><h:outputText value="#{booking.checkoutDate}"/></div>
+ </div>
+ <div class="entry">
+ <div class="label">Credit Card #:</div>
+ <div class="output">#{booking.creditCard}</div>
+ </div>
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/> 
+ <s:button id="revise" value="Revise" view="/book.xhtml"/> 
+ <h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </div>
+ </div>
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+<h1>Back button navigation</h1>
+<p>
+ When you click "Confirm", the new booking is written to the database, the
+ conversation ends, and state associated with the conversation is automatically
+ destroyed by Seam. After you confirm your booking, try hitting the back button
+ on your web browser and clicking "Confirm" again. Seam makes it easy implement
+ applications that behave elegantly in response to the back, forward and refresh
+ buttons.
+</p>
+</ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/conversations.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/conversations.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/conversations.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,36 @@
+<!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: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>
+
+ <div class="section">
+ <h1><h:outputText rendered="#{not empty conversationList}" value="Workspaces"/></h1>
+ </div>
+
+ <div class="section">
+ <h:form id="ConversationListForm">
+ <h:dataTable id="ConversationListDataTable" value="#{conversationList}" var="entry">
+ <h:column id="column1">
+ <h:commandLink id="EntryDescriptionLink" action="#{entry.select}" value="#{entry.description}"/>
+  
+ <h:outputText id="CurrentEntry" value="[current]" rendered="#{entry.current}"/>
+ </h:column>
+ <h:column id="column2">
+ <h:outputText id="EntryStartDateTime" value="#{entry.startDatetime}">
+ <s:convertDateTime type="time" pattern="hh:mm"/>
+ </h:outputText>
+ -
+ <h:outputText id="EntryLastDateTime" value="#{entry.lastDatetime}">
+ <s:convertDateTime type="time" pattern="hh:mm"/>
+ </h:outputText>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ </div>
+
+ </div>
+</ui:composition>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/date.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/date.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/date.css 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,185 @@
+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-size: 11px;
+}
+
+.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/spring/spring-web/src/main/webapp/css/screen.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/screen.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/screen.css 2012-04-04 12:04:24 UTC (rev 14500)
@@ -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/spring/spring-web/src/main/webapp/css/trailblazer_main.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/trailblazer_main.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/css/trailblazer_main.css 2012-04-04 12:04:24 UTC (rev 14500)
@@ -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/spring/spring-web/src/main/webapp/home.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/home.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/home.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,69 @@
+<!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>
+<h: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="#{user.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="#{user.password}" style="width: 175px;"/>
+ </div>
+ <div class="errors"><h:messages globalOnly="true"/></div>
+ <div class="buttonBox"><h:commandButton id="login" action="#{login.login}" 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 class="section">
+
+ <h1>About this example application</h1>
+
+ <p>
+ This sample application demonstrates how easy it is to develop stateful web
+ applications using JBoss Seam. Just register, login, and book a room to see
+ Seam in action. Throughout the application you'll see popup links like
+ the ones at the bottom of this page. Click them to see how the application
+ works under the hood.
+ </p>
+
+ <p>
+ Note: Please do NOT enter personal information or your credit card number in
+ this sample application.
+ </p>
+
+ </div>
+ </div>
+ </div>
+ <div id="footer">Created with JBoss EJB 3.0, Seam, JSF (Mojarra), and Facelets</div>
+</div>
+</f:view>
+</h:body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotel.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotel.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotel.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,77 @@
+<!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"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>View Hotel</h1>
+</div>
+<div class="section">
+ <div class="entry">
+ <div class="label">Name:</div>
+ <div class="output">#{hotel.name}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Address:</div>
+ <div class="output">#{hotel.address}</div>
+ </div>
+ <div class="entry">
+ <div class="label">City:</div>
+ <div class="output">#{hotel.city}</div>
+ </div>
+ <div class="entry">
+ <div class="label">State:</div>
+ <div class="output">#{hotel.state}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Zip:</div>
+ <div class="output">#{hotel.zip}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Country:</div>
+ <div class="output">#{hotel.country}</div>
+ </div>
+ <div class="entry">
+ <div class="label">Nightly rate:</div>
+ <div class="output">
+ <h:outputText value="#{hotel.price}">
+ <f:convertNumber type="currency"
+ currencySymbol="$"/>
+ </h:outputText>
+ </div>
+ </div>
+</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">
+
+<h1>Don't kill your database</h1>
+<p>
+ Keeping conversational state in memory in the middle tier is a great way to
+ improve your application's scalability. It saves hitting the database every
+ time we refresh a page, to re-read the data we were just looking at five
+ seconds ago. By using Seam's conversation context, we get a natural cache
+ of data associated with the what the user is currently doing. By nature,
+ this cache has a more efficient eviction policy than the MRU-type algorithms
+ used by a typical second-level data cache in an O/R mapping engine like
+ Hibernate (at least for some kinds of data). Of course, you should use
+ a clever combination of second-level caching and conversational data
+ caching to achieve the best performance for your application.
+</p>
+</ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotels.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotels.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/hotels.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,132 @@
+<!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"
+ 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 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" action="#{hotelSearch.find}" reRender="searchResults"/>
+  
+ <a:status>
+ <f:facet name="start">
+ <h:graphicImage 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 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>
+ <f:facet name="header">Name</f:facet>
+ #{hot.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
+ #{hot.address}
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ #{hot.city}, #{hot.state}, #{hot.country}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Zip</f:facet>
+ #{hot.zip}
+ </h:column>
+ <h:column>
+ <f:facet 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}
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ #{book.hotel.city}, #{book.hotel.state}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check in date</f:facet>
+ <h:outputText value="#{book.checkinDate}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check out date</f:facet>
+ <h:outputText value="#{book.checkoutDate}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Confirmation number</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">
+
+<h1>State management in Seam</h1>
+<p>
+ State in Seam is <em>contextual</em>. When you click "Find Hotels", the application
+ retrieves a list of hotels from the database and caches it in the session context. When you
+ navigate to one of the hotel records by clicking the "View Hotel" link, a <em>conversation</em>
+ begins. The conversation is attached to a particular tab, in a particular browser window. You can
+ navigate to multiple hotels using "open in new tab" or "open in new window" in your web browser.
+ Each window will execute in the context of a different conversation. The application keeps state
+ associated with your hotel booking in the conversation context, which ensures that the concurrent
+ conversations do not interfere with each other.
+</p>
+
+</ui:define>
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/btn.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cal-next.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cal-prev.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/cnt.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.ad.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.bar.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/hdr.title.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/header_line.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/input.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/sdb.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/spinner.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)
Property changes on: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/img/th.bg.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/index.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/index.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/index.html 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,5 @@
+<html>
+<head>
+<meta http-equiv="Refresh" content="0; URL=home.seam" />
+</head>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/main.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/main.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/main.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,109 @@
+<!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"
+ 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;" />
+  
+ <h:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" />
+  
+
+ <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>
+
+
+ <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>
+ <f:facet name="header">Name</f:facet>
+ #{hot.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
+ #{hot.address}
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ #{hot.city}, #{hot.state}, #{hot.country}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Zip</f:facet>
+ #{hot.zip}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+ </h:column>
+ </h:dataTable>
+ <s:link id="MoreResultsLink" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
+ </div>
+
+ <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}
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ #{book.hotel.city}, #{book.hotel.state}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check in date</f:facet>
+ <h:outputText value="#{book.checkinDate}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check out date</f:facet>
+ <h:outputText value="#{book.checkoutDate}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Confirmation number</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>
+
+ <ui:define name="sidebar" />
+
+
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/password.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/password.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/password.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,68 @@
+<!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"
+ template="template.xhtml">
+
+ <!-- content -->
+ <ui:define name="content">
+ <div class="section">
+ <h1>Change Your Password</h1>
+ </div>
+ <div class="section">
+ <h:form id="setpassword">
+
+ <f:facet name="afterInvalidField">
+ <s:message id="Message"/>
+ </f:facet>
+ <f:facet name="aroundInvalidField">
+ <s:span id="Error" styleClass="errors"/>
+ </f:facet>
+
+ <fieldset>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="password">New Password:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="PasswordDecorate">
+ <h:inputSecret id="password" value="#{user.password}" required="true">
+ <s:validate />
+ </h:inputSecret>
+ <br/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="password">Old Password:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="VerifyDecorate">
+ <h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
+ <br/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <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>
+
+ <ui:define name="sidebar" />
+</ui:composition>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/register.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/register.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/register.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -0,0 +1,117 @@
+<!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>
+<h: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">
+ <h1>Integrated multi-layer validation</h1>
+ <p>
+ Robust applications need data validation in several different places. Seam integrates Hibernate Validator,
+ a set of annotations for expressing data model constraints in your domain model classes. Then, these
+ constraints are applied almost completely transparently at three levels of the application: by Seam when
+ the user first enters data, by EJB before persisting data to the database, and, if you use Hibernate to
+ generate your database schema, by the database constraints themselves. Multi-layer validation hardens
+ your application and protects your data. Even better, it's self-documenting, and easy to change when
+ your business rules change.
+ </p>
+ </div>
+ <div id="content">
+ <div class="section">
+ <h1>Register</h1>
+ </div>
+ <div class="section">
+
+ <h:form id="register">
+ <fieldset>
+
+ <s:validateAll>
+
+ <f:facet name="aroundInvalidField">
+ <s:span styleClass="errors"/>
+ </f:facet>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="username">Username:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="usernameDecorate">
+ <h:inputText id="username" value="#{user.username}" required="true">
+ <a:ajax event="blur" render="usernameErrors"/>
+ </h:inputText>
+ <br/>
+ <a:outputPanel id="usernameErrors"><s:message/></a:outputPanel>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="name">Real Name:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="nameDecorate">
+ <h:inputText id="name" value="#{user.name}" required="true">
+ <a:ajax event="blur" render="nameErrors"/>
+ </h:inputText>
+ <br/>
+ <a:outputPanel id="nameErrors"><s:message/></a:outputPanel>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="passwordDecorate">
+ <h:inputSecret id="password" value="#{user.password}" required="true"/>
+ <br/>
+ <h:message for="password"/>
+ </s:decorate>
+ </div>
+ </div>
+
+ <div class="entry">
+ <div class="label"><h:outputLabel for="verify">Verify Password:</h:outputLabel></div>
+ <div class="input">
+ <s:decorate id="verifyDecorate">
+ <h:inputSecret id="verify" value="#{register.verify}" required="true"/>
+ <br/>
+ <h:message for="verify"/>
+ </s:decorate>
+ </div>
+ </div>
+
+ </s:validateAll>
+
+ <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>
+</h:body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/template.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/template.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/spring/spring-web/src/main/webapp/template.xhtml 2012-04-04 12:04:24 UTC (rev 14500)
@@ -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>
+<h: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="#{login.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>
+</h:body>
+</html>
12 years, 1 month
Seam SVN: r14499 - branches/community/Seam_2_3/jboss-seam-parent.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-04 07:59:37 -0400 (Wed, 04 Apr 2012)
New Revision: 14499
Modified:
branches/community/Seam_2_3/jboss-seam-parent/pom.xml
Log:
update parent wrt spring 3.1 migration
Modified: branches/community/Seam_2_3/jboss-seam-parent/pom.xml
===================================================================
--- branches/community/Seam_2_3/jboss-seam-parent/pom.xml 2012-04-04 11:57:14 UTC (rev 14498)
+++ branches/community/Seam_2_3/jboss-seam-parent/pom.xml 2012-04-04 11:59:37 UTC (rev 14499)
@@ -44,7 +44,7 @@
<version.drools>5.1.1</version.drools>
<version.testng>5.10</version.testng>
<version.resteasy>2.0.1.GA</version.resteasy>
- <version.spring>2.5.6.SEC03</version.spring>
+ <version.spring>3.1.1.RELEASE</version.spring>
<version.jbossembedded>beta3.SP15</version.jbossembedded>
<version.jbossas7>7.1.1.Final</version.jbossas7>
<version.emma>2.0.5312</version.emma>
@@ -702,23 +702,71 @@
<dependency>
<groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
+ <artifactId>spring-beans</artifactId>
<version>${version.spring}</version>
- <exclusions>
- <!-- Prevent the insanity which is commons-logging pom introducing dependencies
- on weird stuff -->
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-tx</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jms</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+
+ <dependency>
<groupId>com.google.code.guice</groupId>
<artifactId>guice</artifactId>
<version>1.0</version>
12 years, 1 month
Seam SVN: r14498 - in branches/community/Seam_2_3/jboss-seam-ioc: src/main/java/org/jboss/seam/ioc/spring and 1 other directory.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-04 07:57:14 -0400 (Wed, 04 Apr 2012)
New Revision: 14498
Modified:
branches/community/Seam_2_3/jboss-seam-ioc/pom.xml
branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java
branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamScope.java
Log:
Naive migration of seam-ioc to spring3.1 and hibernate4
Modified: branches/community/Seam_2_3/jboss-seam-ioc/pom.xml
===================================================================
--- branches/community/Seam_2_3/jboss-seam-ioc/pom.xml 2012-04-04 02:46:59 UTC (rev 14497)
+++ branches/community/Seam_2_3/jboss-seam-ioc/pom.xml 2012-04-04 11:57:14 UTC (rev 14498)
@@ -13,11 +13,23 @@
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
+ <artifactId>spring-aop</artifactId>
<optional>true</optional>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<optional>true</optional>
Modified: branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java 2012-04-04 02:46:59 UTC (rev 14497)
+++ branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java 2012-04-04 11:57:14 UTC (rev 14498)
@@ -17,7 +17,6 @@
import org.jboss.seam.log.Logging;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.beans.factory.config.AbstractFactoryBean;
-import org.springframework.orm.hibernate3.SessionFactoryUtils;
import org.springframework.util.ClassUtils;
/**
@@ -175,7 +174,7 @@
{
try
{
- return SessionFactoryUtils.doGetSession((SessionFactory) proxy, false);
+ return getSession();
}
catch (IllegalStateException ex)
{
Modified: branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamScope.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamScope.java 2012-04-04 02:46:59 UTC (rev 14497)
+++ branches/community/Seam_2_3/jboss-seam-ioc/src/main/java/org/jboss/seam/ioc/spring/SeamScope.java 2012-04-04 11:57:14 UTC (rev 14498)
@@ -104,4 +104,9 @@
}
return bean;
}
+
+ public Object resolveContextualObject(String key)
+ {
+ return null;
+ }
}
12 years, 1 month
Seam SVN: r14497 - in branches/community/Seam_2_3/examples-ee6/jpa: jpa-tests and 3 other directories.
by seam-commits@lists.jboss.org
Author: dhinojosa
Date: 2012-04-03 22:46:59 -0400 (Tue, 03 Apr 2012)
New Revision: 14497
Added:
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java
Modified:
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Booking.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Hotel.java
branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/User.java
branches/community/Seam_2_3/examples-ee6/jpa/pom.xml
Log:
Added setup of integration testing, almost got it, require some new information
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/pom.xml 2012-04-04 02:46:59 UTC (rev 14497)
@@ -1,35 +1,43 @@
<?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>jpa</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</groupId>
- <artifactId>jpa-tests</artifactId>
- <name>JPA Integration Tests Module (EE6)</name>
-
- <dependencies>
+<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>jpa</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</groupId>
+ <artifactId>jpa-tests</artifactId>
+ <name>JPA Integration Tests Module (EE6)</name>
+
+ <dependencies>
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- </dependency>
- <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<type>ejb</type>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <scope>provided</scope>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.seleniumhq.selenium.server</groupId>
<artifactId>selenium-server</artifactId>
<classifier>standalone</classifier>
@@ -43,6 +51,7 @@
<artifactId>functional-tests</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -61,6 +70,29 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-api-maven</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.el</groupId>
+ <artifactId>jboss-el-api_2.2_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </dependency>
</dependencies>
<build>
@@ -81,6 +113,24 @@
<skip>true</skip>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-test-source</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/../jpa-web/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
@@ -136,7 +186,7 @@
<jbossHome>${jboss.home}</jbossHome>
<serverName>${jboss.domain}</serverName>
<fileNames>
- <param>${basedir}/../guice-ear/target/seam-guice.ear</param>
+ <param>${basedir}/../guice-ear/target/jpa-web.war</param>
</fileNames>
</configuration>
</plugin>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/BookingTest.java 2012-04-04 02:46:59 UTC (rev 14497)
@@ -10,17 +10,33 @@
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Manager;
import org.jboss.seam.example.jpa.Booking;
import org.jboss.seam.example.jpa.Hotel;
import org.jboss.seam.example.jpa.HotelBookingAction;
import org.jboss.seam.example.jpa.User;
+import org.jboss.seam.mock.JUnitSeamTest;
import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
-public class BookingTest extends SeamTest
+public class BookingTest extends JUnitSeamTest
{
+ @Deployment(name="BookingTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive web = Deployments.jpaDeployment();
+
+ web.addClasses(BookingTest.class);
+
+ return web;
+ }
@Test
public void testBookHotel() throws Exception
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/ChangePasswordTest.java 2012-04-04 02:46:59 UTC (rev 14497)
@@ -1,15 +1,32 @@
//$Id: ChangePasswordTest.java 6505 2007-10-12 11:24:54Z pmuir $
package org.jboss.seam.example.jpa.test;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Manager;
import org.jboss.seam.example.jpa.User;
+import org.jboss.seam.mock.JUnitSeamTest;
import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
-public class ChangePasswordTest extends SeamTest
+public class ChangePasswordTest extends JUnitSeamTest
{
-
+
+ @Deployment(name="ChangePasswordTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive er = Deployments.jpaDeployment();
+
+ er.addClasses(ChangePasswordTest.class);
+
+ return er;
+ }
+
@Test
public void testChangePassword() throws Exception
{
Copied: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java (from rev 14496, branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/Deployments.java)
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/Deployments.java 2012-04-04 02:46:59 UTC (rev 14497)
@@ -0,0 +1,15 @@
+package org.jboss.seam.example.jpa.test;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import java.io.File;
+
+public class Deployments {
+ public static WebArchive jpaDeployment() {
+ return ShrinkWrap.create(ZipImporter.class, "jpa.war").importFrom(new File("../booking-ear/target/jpa.war"))
+ .as(WebArchive.class);
+ }
+}
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-tests/src/test/java/org/jboss/seam/example/jpa/test/LoginTest.java 2012-04-04 02:46:59 UTC (rev 14497)
@@ -1,14 +1,32 @@
//$Id: LoginTest.java 6505 2007-10-12 11:24:54Z pmuir $
package org.jboss.seam.example.jpa.test;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.seam.core.Manager;
+import org.jboss.seam.mock.JUnitSeamTest;
import org.jboss.seam.web.Session;
import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
-public class LoginTest extends SeamTest
+public class LoginTest extends JUnitSeamTest
{
-
+
+ @Deployment(name="LoginTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive er = Deployments.jpaDeployment();
+
+ er.addClasses(LoginTest.class);
+
+ return er;
+ }
+
+
@Test
public void testLoginComponent() throws Exception
{
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/pom.xml 2012-04-04 02:46:59 UTC (rev 14497)
@@ -106,7 +106,7 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>2.1</version>
+ <version>1.2_15</version>
<scope>provided</scope>
</dependency>
</dependencies>
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Booking.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Booking.java 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Booking.java 2012-04-04 02:46:59 UTC (rev 14497)
@@ -14,10 +14,11 @@
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotNull;
-import org.hibernate.validator.Pattern;
+import org.hibernate.validator.constraints.Length;
import org.jboss.seam.annotations.Name;
@Entity
@@ -109,8 +110,8 @@
}
@NotNull(message="Credit card number is required")
- @Length(min=16, max=16, message="Credit card number must 16 digits long")
- @Pattern(regex="^\\d*$", message="Credit card number must be numeric")
+ @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;
@@ -150,7 +151,7 @@
this.beds = beds;
}
@NotNull(message="Credit card name is required")
- @Length(min=3, max=70, message="Credit card name is required")
+ @Size(min=3, max=70, message="Credit card name is required")
public String getCreditCardName()
{
return creditCardName;
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Hotel.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Hotel.java 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/Hotel.java 2012-04-04 02:46:59 UTC (rev 14497)
@@ -8,9 +8,9 @@
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.Name;
@Entity
@@ -36,7 +36,7 @@
this.id = id;
}
- @Length(max=50) @NotNull
+ @Size(max=50) @NotNull
public String getName()
{
return name;
@@ -46,7 +46,7 @@
this.name = name;
}
- @Length(max=100) @NotNull
+ @Size(max=100) @NotNull
public String getAddress()
{
return address;
@@ -56,7 +56,7 @@
this.address = address;
}
- @Length(max=40) @NotNull
+ @Size(max=40) @NotNull
public String getCity()
{
return city;
@@ -66,7 +66,7 @@
this.city = city;
}
- @Length(min=4, max=6) @NotNull
+ @Size(min=4, max=6) @NotNull
public String getZip()
{
return zip;
@@ -76,7 +76,7 @@
this.zip = zip;
}
- @Length(min=2, max=10) @NotNull
+ @Size(min=2, max=10) @NotNull
public String getState()
{
return state;
@@ -86,7 +86,7 @@
this.state = state;
}
- @Length(min=2, max=40) @NotNull
+ @Size(min=2, max=40) @NotNull
public String getCountry()
{
return country;
Modified: branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/User.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/User.java 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/jpa-web/src/main/java/org/jboss/seam/example/jpa/User.java 2012-04-04 02:46:59 UTC (rev 14497)
@@ -8,10 +8,10 @@
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotNull;
-import org.hibernate.validator.Pattern;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@@ -35,7 +35,7 @@
public User() {}
@NotNull
- @Length(max=100)
+ @Size(max=100)
public String getName()
{
return name;
@@ -46,7 +46,7 @@
}
@NotNull
- @Length(min=5, max=15)
+ @Size(min=5, max=15)
public String getPassword()
{
return password;
@@ -57,8 +57,8 @@
}
@Id
- @Length(min=5, max=15)
- @Pattern(regex="^\\w*$", message="not a valid username")
+ @Size(min=5, max=15)
+ @Pattern(regexp="^\\w*$", message="not a valid username")
public String getUsername()
{
return username;
Modified: branches/community/Seam_2_3/examples-ee6/jpa/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/jpa/pom.xml 2012-04-03 21:08:11 UTC (rev 14496)
+++ branches/community/Seam_2_3/examples-ee6/jpa/pom.xml 2012-04-04 02:46:59 UTC (rev 14497)
@@ -23,7 +23,7 @@
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.jboss.seam.examples</groupId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
<artifactId>jpa-web</artifactId>
<version>${project.version}</version>
<type>war</type>
12 years, 1 month