[seam-commits] Seam SVN: r14420 - in branches/community/Seam_2_3/examples-ee6: contactlist and 33 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Fri Mar 16 17:08:40 EDT 2012
Author: dhinojosa
Date: 2012-03-16 17:08:39 -0400 (Fri, 16 Mar 2012)
New Revision: 14420
Added:
branches/community/Seam_2_3/examples-ee6/contactlist/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ear/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ear/pom.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/pom.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Comment.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Contact.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/ejb-jar.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/persistence.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/import.sql
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-ftest/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-integration/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-integration/testng.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/WEB-INF/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/WEB-INF/components.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/seam.properties
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/pom.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/resources/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/resources/messages.properties
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/components.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/faces-config.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/pages.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/web.xml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/editContact.xhtml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/index.html
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/screen.css
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/search.xhtml
branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/viewContact.xhtml
branches/community/Seam_2_3/examples-ee6/contactlist/pom.xml
branches/community/Seam_2_3/examples-ee6/contactlist/readme.txt
Modified:
branches/community/Seam_2_3/examples-ee6/pom.xml
Log:
added contact list module to examples-ee6
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ear/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ear/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ear/pom.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,158 @@
+<?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>contactlist</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ear</artifactId>
+ <packaging>ear</packaging>
+ <name>Contact List EAR Module (EE6)</name>
+
+ <properties>
+ <jboss.home>${env.JBOSS_HOME}</jboss.home>
+ <jboss.domain>default</jboss.domain>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3_min</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>seam-contactlist</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <version>5</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>
+ <jboss>
+ <version>5</version>
+ <loader-repository>seam.jboss.org:loader=seam-contactlist.ear</loader-repository>
+ </jboss>
+ <modules>
+ <webModule>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-web</artifactId>
+ <contextRoot>/seam-contactlist</contextRoot>
+ <bundleFileName>contactlist-web.war</bundleFileName>
+ </webModule>
+ <ejbModule>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <bundleFileName>contactlist-ejb.jar</bundleFileName>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
+ <configuration>
+ <jbossHome>${jboss.home}</jbossHome>
+ <serverName>${jboss.domain}</serverName>
+ <fileNames>
+ <param>${project.build.directory}/${project.build.finalName}.${project.packaging}</param>
+ </fileNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>exploded</id>
+ <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</groupId>
+ <artifactId>contactlist-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</groupId>
+ <artifactId>contactlist-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</groupId>
+ <artifactId>contactlist-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>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
+ <configuration>
+ <jbossHome>${jboss.home}</jbossHome>
+ <serverName>${jboss.domain}</serverName>
+ <fileNames>
+ <directory>${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear</directory>
+ </fileNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/pom.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,40 @@
+<?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>contactlist</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <packaging>ejb</packaging>
+ <name>Contact List EJB Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Comment.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Comment.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Comment.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,66 @@
+package org.jboss.seam.example.contactlist;
+
+import org.hibernate.validator.constraints.Length;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.validation.constraints.NotNull;
+
+
+ at Entity
+public class Comment
+{
+ @Id @GeneratedValue
+ private Long id;
+
+ @NotNull
+ @ManyToOne
+ private Contact contact;
+
+ @NotNull @Length(max=1500)
+ private String text;
+
+ @NotNull
+ private Date created;
+
+ public Contact getContact()
+ {
+ return contact;
+ }
+
+ public void setContact(Contact contact)
+ {
+ this.contact = contact;
+ contact.getComments().add(this);
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ public void setText(String text)
+ {
+ this.text = text;
+ }
+
+ public Date getCreated()
+ {
+ return created;
+ }
+
+ public void setCreated(Date created)
+ {
+ this.created = created;
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Contact.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Contact.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/java/org/jboss/seam/example/contactlist/Contact.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,143 @@
+package org.jboss.seam.example.contactlist;
+
+import org.hibernate.validator.constraints.Length;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Version;
+
+
+ at Entity
+public class Contact
+{
+ @Id @GeneratedValue
+ private Long id;
+
+ @Length(max=50)
+ private String firstName;
+ @Length(max=50)
+ private String lastName;
+ @Length(max=250)
+ private String address;
+ @Length(max=50)
+ private String city;
+ @Length(max=50)
+ private String state;
+ @Length(max=6)
+ private String zip;
+ @Length(max=50)
+ private String country;
+ @Length(max=20)
+ private String homePhone;
+ @Length(max=20)
+ private String businessPhone;
+ @Length(max=20)
+ private String cellPhone;
+
+ @Version
+ private int version;
+
+ @OneToMany(mappedBy="contact", cascade=CascadeType.REMOVE)
+ @OrderBy("created")
+ private List<Comment> comments = new ArrayList<Comment>();
+
+ public String getAddress()
+ {
+ return address;
+ }
+ public void setAddress(String address)
+ {
+ this.address = address;
+ }
+ public String getBusinessPhone()
+ {
+ return businessPhone;
+ }
+ public void setBusinessPhone(String businessPhone)
+ {
+ this.businessPhone = businessPhone;
+ }
+ public String getCellPhone()
+ {
+ return cellPhone;
+ }
+ public void setCellPhone(String cellPhone)
+ {
+ this.cellPhone = cellPhone;
+ }
+ public String getCity()
+ {
+ return city;
+ }
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+ public String getCountry()
+ {
+ return country;
+ }
+ public void setCountry(String country)
+ {
+ this.country = country;
+ }
+ public String getFirstName()
+ {
+ return firstName;
+ }
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+ public String getHomePhone()
+ {
+ return homePhone;
+ }
+ public void setHomePhone(String homePhone)
+ {
+ this.homePhone = homePhone;
+ }
+ public String getLastName()
+ {
+ return lastName;
+ }
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+ public String getState()
+ {
+ return state;
+ }
+ public void setState(String state)
+ {
+ this.state = state;
+ }
+ public String getZip()
+ {
+ return zip;
+ }
+ public void setZip(String zip)
+ {
+ this.zip = zip;
+ }
+ public Long getId()
+ {
+ return id;
+ }
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+ public List<Comment> getComments()
+ {
+ return comments;
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/ejb-jar.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/ejb-jar.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -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/contactlist/contactlist-ejb/src/main/resources/META-INF/persistence.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/persistence.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/META-INF/persistence.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,15 @@
+<?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="userDatabase" transaction-type="JTA">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="jboss.entity.manager.factory.jndi.name" value="java:/contactlistEntityManagerFactory"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/import.sql
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/import.sql (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/import.sql 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,12 @@
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Gavin', 'King', null, 'Peachtree Rd', 'Atlanta', 'GA', '30305', 'USA', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Norman', 'Richards', null, null, 'Austin', 'TX', '78701', 'USA', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Shane', 'Bryzak', null, null, 'Brisbane', 'QLD', null, 'Australia', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Pete', 'Muir', null, null, 'Edinburgh', 'Scotland', null, 'UK', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Michael', 'Yuan', null, null, 'Austin', 'TX', '78701', 'USA', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Steve', 'Ebersole', null, null, 'Austin', 'TX', '78701', 'USA', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Christian', 'Bauer', null, null, 'Zurich', null, null, 'Switzerland', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Max', 'Andersen', null, null, 'Neuchatel', null, null, 'Switzerland', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Emmanuel', 'Bernard', null, null, 'Atlanta', 'GA', null, 'USA', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Michael', 'Youngstrom', null, null, 'Salt Lake City', 'UT', null, 'USA', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Jacob', 'Hookom', null, null, 'Minneapolis', 'MN', null, 'USA', 1 )
+insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Dan', 'Allen', null, null, 'Laurel', 'MD', 20724, 'USA', 1 )
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-ejb/src/main/resources/seam.properties
===================================================================
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/pom.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,200 @@
+<?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>contactlist</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-tests</artifactId>
+ <name>Contact List Integration Tests Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>jboss-embedded-all</artifactId>
+ <version>beta3.SP15</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.embedded</groupId>
+ <artifactId>thirdparty-all</artifactId>
+ <version>beta3.SP15</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.embedded</groupId>
+ <artifactId>hibernate-all</artifactId>
+ <version>beta3.SP15</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <type>ejb</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</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>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>functional-tests</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ <testResource>
+ <directory>src/test/bootstrap</directory>
+ <filtering>false</filtering>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>false</skipTests>
+ <argLine>-Dsun.lang.ClassLoader.allowArraySyntax=true -Xms512m -Xmx512m</argLine>
+ <additionalClasspathElements>
+ <additionalClasspathElement>${basedir}/../contactlist-web/src/main/webapp</additionalClasspathElement>
+ <additionalClasspathElement>${project.build.directory}/dependency/bootstrap</additionalClasspathElement>
+ </additionalClasspathElements>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources-integration/testng.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-seam-bootstrap</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <includes>bootstrap/**</includes>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-embedded-bootstrap</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>ftest-jbossas</id>
+ <properties>
+ <example.context.path>seam-contactlist</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}/../contactlist-ear/target/seam-contactlist.ear</param>
+ </fileNames>
+ </configuration>
+ </plugin>
+ <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>
+ <profile>
+ <id>ftest-tomcat</id>
+ <properties>
+ <example.context.path>seam-contactlist</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/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,150 @@
+package org.jboss.seam.example.contactlist.test;
+
+import java.util.List;
+
+import org.jboss.seam.example.contactlist.Contact;
+import org.jboss.seam.mock.SeamTest;
+import org.testng.annotations.Test;
+
+public class ContactListTest extends SeamTest
+{
+ @Test
+ public void testList() throws Exception
+ {
+ new NonFacesRequest("/search.xhtml")
+ {
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ List<Contact> contacts = (List<Contact>) getValue("#{contacts.resultList}");
+ assert contacts.size()==5;
+ }
+ }.run();
+ }
+
+ @Test
+ public void testSearch() throws Exception
+ {
+ new FacesRequest("/search.xhtml")
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{exampleContact.firstName}", "Norman");
+ }
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ setOutcome("/search.xhtml");
+ }
+ @Override
+ protected void afterRequest()
+ {
+ assert !isRenderResponseBegun();
+ }
+ }.run();
+
+ new NonFacesRequest("/search.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("firstName", "Norman");
+ }
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ List<Contact> contacts = (List<Contact>) getValue("#{contacts.resultList}");
+ assert contacts.size()==1;
+ }
+ }.run();
+
+ new FacesRequest("/search.xhtml")
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{exampleContact.lastName}", "King");
+ }
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ setOutcome("/search.xhtml");
+ }
+ @Override
+ protected void afterRequest()
+ {
+ assert !isRenderResponseBegun();
+ }
+ }.run();
+
+ new NonFacesRequest("/search.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("lastName", "King");
+ }
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ List<Contact> contacts = (List<Contact>) getValue("#{contacts.resultList}");
+ assert contacts.size()==1;
+ }
+ }.run();
+ }
+
+ String contactId;
+
+ @Test
+ public void testCreateDeleteContact() throws Exception
+ {
+ new FacesRequest("/editContact.xhtml")
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{contact.firstName}", "Emmanuel");
+ setValue("#{contact.lastName}", "Bernard");
+ setValue("#{contact.city}", "Paris");
+ }
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert invokeMethod("#{contactHome.persist}").equals("persisted");
+ contactId = getValue("#{contactHome.id}").toString();
+ }
+ }.run();
+
+ new NonFacesRequest("/viewContact.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("contactId", contactId);
+ }
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert getValue("#{contact.firstName}").equals("Emmanuel");
+ assert getValue("#{contact.lastName}").equals("Bernard");
+ assert getValue("#{contact.city}").equals("Paris");
+ }
+ }.run();
+
+ new FacesRequest("/viewContact.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setPageParameter( "contactId", new Long(contactId) );
+ }
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert invokeMethod("#{contactHome.remove}").equals("removed");
+ }
+ }.run();
+ }
+
+}
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,62 @@
+/*
+ * 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.contactlist.test.selenium;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.*;
+
+import com.thoughtworks.selenium.Wait;
+
+public class CommentTest extends SeleniumContactlistTest {
+
+ @Test
+ public void testComment() {
+ String firstName = "Gavin";
+ String lastName = "King";
+ String message = "founder of the Hibernate open source object/relational mapping project";
+ // find contact
+ browser.open(CONTEXT_PATH + START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_SUBMIT);
+ }
+ }.wait("Search submit link not found.");
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // submit comment
+ browser.type(COMMENT_TEXTAREA, message);
+ browser.click(COMMENT_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ // assert comment is stored
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(firstName, lastName);
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ assertTrue("Comment is not stored.", browser
+ .isTextPresent(message));
+ }
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,154 @@
+/*
+ * 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.contactlist.test.selenium;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.*;
+import com.thoughtworks.selenium.Wait;
+
+public class ContactCRUDTest extends SeleniumContactlistTest {
+
+ // used for creation test
+ private Person john = new Person("John", "Doe", "0123456789", "0123456789",
+ "Street", "City", "State", "01234", "US");
+ private Person jane = new Person("Jane", "Doe", "0123456789", "0123456789",
+ "Street", "City", "State", "01234", "US");
+ // used for edit test
+ private Person jozef = new Person("Jozef", "Hartinger", "0123456789",
+ "0123456789", "Cervinkova 99", "Brno", "Czech Republic", "01234",
+ "CZ");
+
+ @Test
+ public void testCreateContact() {
+ browser.open(CONTEXT_PATH + START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(CREATE_CONTACT_PAGE);
+ }
+ }.wait("Create contact link not found.");
+ browser.click(CREATE_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ fillCreateContactForm(john);
+ browser.click(CREATE_CONTACT_SUBMIT);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_CONTACT_PAGE);
+ }
+ }.wait("Search link not found.");
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(john);
+ assertTrue("Creating new contact failed.", searchResultPresent(john));
+ }
+
+ @Test
+ public void testCreationCanceling() {
+ browser.open(CONTEXT_PATH + START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(CREATE_CONTACT_PAGE);
+ }
+ }.wait("Create contact link not found.");
+ browser.click(CREATE_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ fillCreateContactForm(jane);
+ browser.click(CREATE_CONTACT_CANCEL);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_CONTACT_PAGE);
+ }
+ }.wait("Search link not found.");
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.type(SEARCH_FIRST_NAME_FIELD, jane.getFirstName());
+ browser.type(SEARCH_LAST_NAME_FIELD, jane.getLastName());
+ browser.click(SEARCH_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ assertFalse("New contact created despite cancel.", searchResultPresent(jane));
+ }
+
+ @Test
+ public void testEditContact() {
+ String firstName = "Shane";
+ String lastName = "Bryzak";
+ // find contact
+ browser.open(CONTEXT_PATH + START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_SUBMIT);
+ }
+ }.wait("Search submit link not found.");
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ browser.click(EDIT_CONTACT_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // update form fields
+ fillCreateContactForm(jozef);
+ browser.click(UPDATE_CONTACT_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ // make sure new values are present
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(jozef);
+ assertTrue("Contact update failed. New values missing", searchResultPresent(jozef));
+ // make sure old values are not present
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(firstName, lastName);
+ assertFalse("Contact update failed. Old values still present", searchResultPresent(firstName, lastName));
+ }
+
+ @Test
+ public void testRemoveContact() {
+ String firstName = "Norman";
+ String lastName = "Richards";
+ // find contact
+ browser.open(CONTEXT_PATH + START_PAGE);
+ new Wait() {
+ @Override
+ public boolean until() {
+ return browser.isElementPresent(SEARCH_SUBMIT);
+ }
+ }.wait("Search submit link not found.");
+ search(firstName, lastName);
+ assertTrue("Contact not found. Application is in unexpected state.",
+ searchResultPresent(firstName, lastName));
+ browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // remove contact
+ browser.click(REMOVE_CONTACT_LINK);
+ browser.waitForPageToLoad(TIMEOUT);
+ // assert contact is removed
+ browser.click(SEARCH_CONTACT_PAGE);
+ browser.waitForPageToLoad(TIMEOUT);
+ search(firstName, lastName);
+ assertFalse("Contact present despite it should be removed.", searchResultPresent(firstName, lastName));
+ }
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,57 @@
+/*
+ * 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.contactlist.test.selenium;
+
+public interface ContactlistConstants {
+
+ public static String START_PAGE = "/";
+ public static String SEARCH_CONTACT_PAGE = "id=search";
+ public static String SEARCH_FIRST_NAME_FIELD = "id=searchForm:firstName";
+ public static String SEARCH_LAST_NAME_FIELD = "id=searchForm:lastName";
+ public static String SEARCH_SUBMIT = "id=searchForm:submit";
+ public static String CREATE_CONTACT_PAGE = "id=create";
+ public static String CREATE_CONTACT_SUBMIT = "id=editForm:createContact";
+ public static String CREATE_CONTACT_CANCEL = "id=editForm:cancel";
+ public static String FIRST_NAME_FIELD = "id=editForm:firstNameDecorate:firstName";
+ public static String LAST_NAME_FIELD = "id=editForm:lastNameDecorate:lastName";
+ public static String CELL_PHONE_FIELD = "id=editForm:cellPhoneDecorate:cellPhone";
+ public static String HOME_PHONE_FIELD = "id=editForm:homePhoneDecorate:homePhone";
+ public static String ADDRESS_FIELD = "id=editForm:addressDecorate:address";
+ public static String CITY_FIELD = "id=editForm:cityDecorate:city";
+ public static String STATE_FIELD = "id=editForm:stateDecorate:state";
+ public static String ZIP_FIELD = "id=editForm:zipDecorate:zip";
+ public static String COUNTRY_FIELD = "id=editForm:countryDecorate:country";
+ public static String EDIT_CONTACT_LINK = "editContact";
+ public static String UPDATE_CONTACT_SUBMIT = "editForm:updateContact";
+ public static String EDIT_FORM_REMOVE_CONTACT_LINK = "id=editForm:deleteContact";
+ public static String REMOVE_CONTACT_LINK = "id=deleteContact";
+ public static String SEARCH_RESULT_FIRST_ROW_LINK = "id=searchResult:0:link";
+ public static String SEARCH_RESULT_FIRST_ROW_CELL_PHONE = "id=searchResult:0:cellPhone";
+ public static String SEARCH_RESULT_FIRST_ROW_HOME_PHONE = "id=searchResult:0:homePhone";
+ public static String SEARCH_RESULT_FIRST_ROW_ADDRESS = "id=searchResult:0:address";
+ public static String SEARCH_RESULT_FIRST_ROW_CITY = "id=searchResult:0:city";
+ public static String SEARCH_RESULT_FIRST_ROW_STATE = "id=searchResult:0:state";
+ public static String SEARCH_RESULT_FIRST_ROW_ZIP = "id=searchResult:0:zip";
+ public static String SEARCH_RESULT_FIRST_ROW_COUNTRY = "id=searchResult:0:country";
+ public static String COMMENT_TEXTAREA = "commentForm:text";
+ public static String COMMENT_SUBMIT = "commentForm:submit";
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,121 @@
+/*
+ * 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.contactlist.test.selenium;
+
+public class Person {
+ private String firstName;
+ private String lastName;
+ private String cellPhone;
+ private String homePhone;
+ private String address;
+ private String city;
+ private String state;
+ private String zip;
+ private String country;
+
+ public Person(String firstName, String lastName, String cellPhone, String homePhone,
+ String address, String city, String state, String zip, String country) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.cellPhone = cellPhone;
+ this.homePhone = homePhone;
+ this.address = address;
+ this.city = city;
+ this.state = state;
+ this.zip = zip;
+ this.country = country;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+
+ public String getCellPhone() {
+ return cellPhone;
+ }
+
+ public void setCellPhone(String cellPhone) {
+ this.cellPhone = cellPhone;
+ }
+
+ public String getHomePhone() {
+ return homePhone;
+ }
+
+ public void setHomePhone(String homePhone) {
+ this.homePhone = homePhone;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+}
Property changes on: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,66 @@
+/*
+ * 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.contactlist.test.selenium;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+
+public class SeleniumContactlistTest extends SeamSeleniumTest implements ContactlistConstants {
+
+ public boolean searchResultPresent(String firstName, String lastName) {
+ return browser.isElementPresent(SEARCH_RESULT_FIRST_ROW_LINK) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_LINK).equals(firstName + " " + lastName);
+ }
+
+ public boolean searchResultPresent(Person person) {
+ return searchResultPresent(person.getFirstName(), person.getLastName()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_CELL_PHONE).equals(person.getCellPhone()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_HOME_PHONE).equals(person.getHomePhone()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_ADDRESS).equals(person.getAddress()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_CITY).equals(person.getCity()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_STATE).equals(person.getState()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_ZIP).equals(person.getZip()) &&
+ browser.getText(SEARCH_RESULT_FIRST_ROW_COUNTRY).equals(person.getCountry());
+ }
+
+ public void fillCreateContactForm(Person person) {
+ browser.type(FIRST_NAME_FIELD, person.getFirstName());
+ browser.type(LAST_NAME_FIELD, person.getLastName());
+ browser.type(CELL_PHONE_FIELD, person.getCellPhone());
+ browser.type(HOME_PHONE_FIELD, person.getHomePhone());
+ browser.type(ADDRESS_FIELD, person.getAddress());
+ browser.type(CITY_FIELD, person.getCity());
+ browser.type(STATE_FIELD, person.getState());
+ browser.type(ZIP_FIELD, person.getZip());
+ browser.type(COUNTRY_FIELD, person.getCountry());
+ }
+
+ public void search(String firstName, String lastName) {
+ browser.type(SEARCH_FIRST_NAME_FIELD, firstName);
+ browser.type(SEARCH_LAST_NAME_FIELD, lastName);
+ browser.click(SEARCH_SUBMIT);
+ browser.waitForPageToLoad(TIMEOUT);
+ }
+
+ public void search(Person person) {
+ search(person.getFirstName(), person.getLastName());
+ }
+}
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/WEB-INF/components.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:fwk="http://jboss.com/products/seam/framework"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ 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/framework http://jboss.com/products/seam/framework-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">
+
+ <persistence:managed-persistence-context name="entityManager"
+ persistence-unit-jndi-name="java:/contactlistEntityManagerFactory"/>
+
+ <core:init jndi-pattern="#{ejbName}/local"/>
+
+ <factory name="contact" value="#{contactHome.instance}"/>
+ <fwk:entity-home name="contactHome"
+ entity-class="org.jboss.seam.example.contactlist.Contact"/>
+
+
+ <factory name="comment" value="#{commentHome.instance}"/>
+ <fwk:entity-home name="commentHome"
+ entity-class="org.jboss.seam.example.contactlist.Comment"
+ new-instance="#{newComment}"/>
+
+ <component name="newComment"
+ class="org.jboss.seam.example.contactlist.Comment">
+ <property name="contact">#{contact}</property>
+ <property name="created">#{currentDatetime}</property>
+ </component>
+
+
+ <fwk:entity-query name="contacts"
+ max-results="5">
+ <fwk:ejbql>select c from Contact c</fwk:ejbql>
+ <fwk:order>lastName</fwk:order>
+ <fwk:restrictions>
+ <value>lower(c.firstName) like lower( concat( #{exampleContact.firstName}, '%' ) )</value>
+ <value>lower(c.lastName) like lower( concat( #{exampleContact.lastName}, '%' ) )</value>
+ </fwk:restrictions>
+ </fwk:entity-query>
+
+ <component name="exampleContact"
+ class="org.jboss.seam.example.contactlist.Contact"/>
+
+</components>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/seam.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/seam.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources/seam.properties 2012-03-16 21:08:39 UTC (rev 14420)
@@ -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
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,28 @@
+
+ <!--
+ 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="Contactlist example" verbose="2" parallel="false">
+ <test name="contactlist_jboss5">
+ <parameter name="PROPERTY_FILE" value="empty" />
+ <classes>
+ <class
+ name="org.jboss.seam.example.contactlist.test.selenium.ContactCRUDTest" />
+ <class name="org.jboss.seam.example.contactlist.test.selenium.CommentTest" />
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Property changes on: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-integration/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-integration/testng.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-tests/src/test/resources-integration/testng.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,11 @@
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+
+<suite name="Contact List" verbose="2" parallel="false">
+
+ <test name="Contact List">
+ <classes>
+ <class name="org.jboss.seam.example.contactlist.test.ContactListTest"/>
+ </classes>
+ </test>
+
+</suite>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/pom.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>contactlist</artifactId>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <version>2.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-web</artifactId>
+ <packaging>war</packaging>
+ <name>Contact List Web Module (EE6)</name>
+
+ <properties>
+ <!-- filtering property for components.xml -->
+ <jndiPattern>seam-contactlist/#{ejbName}/local</jndiPattern>
+ <distributable>false</distributable>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-jul</artifactId>
+ </exclusion>
+ </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>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</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>tomcat</id>
+ <properties>
+ <!-- filtering property for components.xml -->
+ <jndiPattern>#{ejbName}/local</jndiPattern>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3_min</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>seam-contactlist</finalName>
+ </build>
+ </profile>
+ </profiles>
+</project>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/resources/messages.properties
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/resources/messages.properties (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/resources/messages.properties 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,21 @@
+Contact_created New contact #{contact.firstName} #{contact.lastName} created
+Contact_deleted Contact #{contact.firstName} #{contact.lastName} deleted
+Contact_updated Contact #{contact.firstName} #{contact.lastName} updated
+Comment_created New comment posted
+
+javax.faces.component.UIInput.REQUIRED=value is required
+
+validator.assertFalse=assertion failed
+validator.assertTrue=assertion failed
+validator.future=must be a future date
+validator.length=length must be between {min} and {max}
+validator.max=must be less than or equal to {value}
+validator.min=must be greater than or equal to {value}
+validator.notNull=may not be null
+validator.past=must be a past date
+validator.pattern=must match "{regex}"
+validator.range=must be between {min} and {max}
+validator.size=size must be between {min} and {max}
+validator.email=not a well-formed email address
+
+validator.zip=not a valid zipcode
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/components.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:fwk="http://jboss.com/products/seam/framework"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ 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/framework http://jboss.com/products/seam/framework-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">
+
+ <persistence:managed-persistence-context name="entityManager"
+ persistence-unit-jndi-name="java:/contactlistEntityManagerFactory"/>
+
+ <core:init jndi-pattern="@jndiPattern@"/>
+
+ <factory name="contact" value="#{contactHome.instance}"/>
+ <fwk:entity-home name="contactHome"
+ entity-class="org.jboss.seam.example.contactlist.Contact"/>
+
+
+ <factory name="comment" value="#{commentHome.instance}"/>
+ <fwk:entity-home name="commentHome"
+ entity-class="org.jboss.seam.example.contactlist.Comment"
+ new-instance="#{newComment}"/>
+
+ <component name="newComment"
+ class="org.jboss.seam.example.contactlist.Comment">
+ <property name="contact">#{contact}</property>
+ <property name="created">#{currentDatetime}</property>
+ </component>
+
+
+ <fwk:entity-query name="contacts"
+ max-results="5">
+ <fwk:ejbql>select c from Contact c</fwk:ejbql>
+ <fwk:order>lastName</fwk:order>
+ <fwk:restrictions>
+ <value>lower(c.firstName) like lower( concat( #{exampleContact.firstName}, '%' ) )</value>
+ <value>lower(c.lastName) like lower( concat( #{exampleContact.lastName}, '%' ) )</value>
+ </fwk:restrictions>
+ </fwk:entity-query>
+
+ <component name="exampleContact"
+ class="org.jboss.seam.example.contactlist.Contact"/>
+
+</components>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/faces-config.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2"
+ 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">
+
+ <!-- Facelets support -->
+
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/pages.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/pages.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,80 @@
+<?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">
+
+ <page view-id="/viewContact.xhtml">
+
+ <param name="contactId"
+ value="#{contactHome.id}"
+ converterId="javax.faces.Long"/>
+
+ <navigation>
+ <rule if-outcome="persisted">
+ <redirect/>
+ </rule>
+ <rule if-outcome="removed">
+ <redirect view-id="/search.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/editContact.xhtml">
+
+ <param name="contactId"
+ value="#{contactHome.id}"
+ converterId="javax.faces.Long"/>
+
+ <navigation>
+ <rule if-outcome="updated">
+ <redirect view-id="/viewContact.xhtml"/>
+ </rule>
+ <rule if-outcome="persisted">
+ <redirect view-id="/viewContact.xhtml"/>
+ </rule>
+ <rule if-outcome="removed">
+ <redirect view-id="/search.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/search.xhtml">
+
+ <param name="firstName"
+ value="#{exampleContact.firstName}"/>
+ <param name="lastName"
+ value="#{exampleContact.lastName}"/>
+ <param name="firstResult"
+ value="#{contacts.firstResult}"/>
+
+
+ <navigation>
+ <rule if-outcome="newsearch">
+ <redirect view-id="/search.xhtml">
+ <param name="firstResult" value="0"/>
+ </redirect>
+ </rule>
+ </navigation>
+ </page>
+
+ <exception class="javax.persistence.PersistenceException">
+ <end-conversation/>
+ <redirect>
+ <message>Database access failed</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.framework.EntityNotFoundException">
+ <http-error error-code="404"/>
+ </exception>
+
+ <exception>
+ <end-conversation/>
+ <redirect view-id="/search.xhtml">
+ <message>Unexpected failure</message>
+ </redirect>
+ </exception>
+
+</pages>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/WEB-INF/web.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+ 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">
+
+ <display-name>Seam Contact List Example</display-name>
+
+ <!-- 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>
+
+ <!-- Facelets -->
+
+ <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>false</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/editContact.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/editContact.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/editContact.xhtml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,120 @@
+<!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"
+ template="template.xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Edit Contact</title>
+ <link href="screen.css" rel="stylesheet" type="text/css" />
+ </head>
+ <body>
+
+ <div class="menuButtons">
+ <s:link id="search" view="/search.xhtml" value="Search Contacts"/>
+ <s:link id="create" view="/editContact.xhtml" value="Create New Contact">
+ <f:param name="contactId"/> <!-- suppress propagation of contact id page parameter -->
+ </s:link>
+ <s:link id="view" view="/viewContact.xhtml" value="View Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="edit" view="/editContact.xhtml" value="Edit Contact" rendered="#{contactHome.managed}"/>
+ </div>
+
+ <div class="body">
+
+ <h1>Edit Contact</h1>
+
+ <h:form id="editForm">
+
+ <h:messages id="messages" globalOnly="true" styleClass="message"/>
+
+ <!-- editable fields -->
+ <s:validateAll>
+
+ <f:facet name="aroundInvalidField">
+ <s:span styleClass="errors"/>
+ </f:facet>
+ <f:facet name="afterInvalidField">
+ <s:span> <s:message/></s:span>
+ </f:facet>
+
+ <div class="dialog">
+ <table>
+ <tr class="prop">
+ <td class="name">First Name:</td>
+ <td class="value">
+ <s:decorate id="firstNameDecorate"><h:inputText id="firstName" value="#{contact.firstName}" required="true"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Last Name:</td>
+ <td class="value">
+ <s:decorate id="lastNameDecorate"><h:inputText id="lastName" value="#{contact.lastName}" required="true"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Cell Phone:</td>
+ <td class="value">
+ <s:decorate id="cellPhoneDecorate"><h:inputText id="cellPhone" value="#{contact.cellPhone}"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Home Phone:</td>
+ <td class="value">
+ <s:decorate id="homePhoneDecorate"><h:inputText id="homePhone" value="#{contact.homePhone}"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Address:</td>
+ <td class="value">
+ <s:decorate id="addressDecorate"><h:inputText id="address" value="#{contact.address}"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">City:</td>
+ <td class="value">
+ <s:decorate id="cityDecorate"><h:inputText id="city" value="#{contact.city}"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">State:</td>
+ <td class="value">
+ <s:decorate id="stateDecorate"><h:inputText id="state" value="#{contact.state}"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Zip:</td>
+ <td class="value">
+ <s:decorate id="zipDecorate"><h:inputText id="zip" value="#{contact.zip}"/></s:decorate>
+ </td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Country:</td>
+ <td class="value">
+ <s:decorate id="countryDecorate"><h:inputText id="country" value="#{contact.country}"/></s:decorate>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </s:validateAll>
+
+ <!-- actions -->
+ <div class="actionButtons">
+
+ <h:commandLink id="updateContact" action="#{contactHome.update}" value="Update Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="deleteContact" action="#{contactHome.remove}" value="Delete Contact" rendered="#{contactHome.managed}"/>
+ <s:link id="cancelManaged" view="/viewContact.xhtml" value="Cancel" rendered="#{contactHome.managed}"/>
+
+ <h:commandLink id="createContact" action="#{contactHome.persist}" value="Create Contact" rendered="#{!contactHome.managed}"/>
+ <s:link id="cancel" view="/search.xhtml" value="Cancel" rendered="#{!contactHome.managed}"/>
+
+ </div>
+
+ </h:form>
+
+ </div>
+
+ </body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/index.html
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/index.html (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/index.html 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=search.seam">
+</head>
+</html>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/screen.css
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/screen.css (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/screen.css 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,142 @@
+a:active, a:link, a:visited {
+ color: #0D5798;
+}
+a:hover {
+ color: #8CAFCD;
+}
+
+.menuButtons {
+ background-color: #FF6600; /*#8CAFCD*/
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+.menuButtons a {
+ font-weight: bold;
+ text-decoration: none;
+ padding-left: 25px;
+ padding-right: 25px;
+}
+.menuButtons a:active, .menuButtons a:link, .menuButtons a:visited {
+ font-family: Arial,sans-serif;
+ background-color: #FF6600; /*#8CAFCD*/
+ color: white;
+ border-right: 1px solid white;
+}
+.menuButtons a:hover {
+ font-family: Arial,sans-serif;
+ background-color: white;
+ color: #FF6600; /*#8CAFCD*/
+}
+
+.actionButtons {
+ width: 100%;
+ text-align: center;
+ padding-top: 10px;
+}
+.tableControl {
+ width: 100%;
+ text-align: right;
+ padding-top: 15px;
+}
+.actionButtons a, .tableControl a {
+ font-family: Arial,sans-serif;
+ font-weight: bold;
+ color: #578BB8;
+ border: 1px solid #578BB8;
+ text-decoration: none;
+ padding: 5px;
+ margin: 5px;
+}
+.actionButtons a:hover, .tableControl a:hover {
+ color: white;
+ background-color: #578BB8;
+ margin: 5px;
+}
+
+h1 {
+ font-family: Arial,sans-serif;
+ color: #578BB8;
+ font-size: 1.6em;
+ margin-top: 0;
+}
+
+body {
+ margin: 0px;
+ font-family: Arial,sans-serif;
+ color: #616161;
+}
+
+.body {
+ padding: 30px;
+}
+
+
+table {
+ width: 100%;
+}
+th {
+ background-color: #578BB8;
+ color: white;
+ font-family: Arial,sans-serif;
+ padding: 5px;
+
+}
+td {
+ background-color: #F0F0F0;
+ text-align: center;
+}
+.narrow {
+ width: 20%;
+}
+.wide {
+ width: 80%;
+}
+.first td {
+ background-color: #F0F0F0;
+}
+.second td {
+ background-color: white;
+}
+
+.dialog
+{
+ padding: 15px;
+ background-color: #F0F0F0;
+ margin: 10px;
+}
+.dialog table
+{
+ width: auto;
+}
+
+.message {
+ border: 1px solid #FFCC00;
+ padding: 5px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ background-color: #F0F0F0;
+}
+
+.message:empty { display: none; }
+
+.prop {
+ padding: 5px;
+}
+.prop .name {
+ font-weight: bold;
+ text-align: left;
+ width: 115px;
+}
+.prop .value {
+ text-align: left;
+}
+.prop .errors {
+ color: red;
+ text-align: left;
+}
+.value input {
+ width:190px;
+}
+.errors input {
+ border: 1px solid red;
+}
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/search.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/search.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/search.xhtml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,104 @@
+<!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">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Contact List</title>
+ <link href="screen.css" rel="stylesheet" type="text/css" />
+ </head>
+ <body>
+
+ <div class="menuButtons">
+ <s:link id="search" view="/search.xhtml" value="Search Contacts">
+ <f:param name="firstName" />
+ <f:param name="lastName" />
+ <f:param name="firstResult" />
+ </s:link>
+
+ <s:link id="create" view="/editContact.xhtml" value="Create New Contact">
+ <f:param name="contactId"/> <!-- suppress propagation of contact id page parameter -->
+ </s:link>
+ </div>
+
+ <div class="body">
+
+ <h1>ContactList</h1>
+
+ <h:messages id="messages" styleClass="message"/>
+
+ <!-- search box -->
+ <div class="dialog">
+ <h:form id="searchForm">
+ <span class="prop">
+ <span class="name">First Name:</span>
+ <span class="value"><h:inputText id="firstName" value="#{exampleContact.firstName}"/></span>
+ </span>
+ <span class="prop">
+ <span class="name">Last Name :</span>
+ <span class="value"><h:inputText id="lastName" value="#{exampleContact.lastName}"/></span>
+ </span>
+
+
+ <h:commandButton id="submit" value="Search" action="newsearch"/>
+ </h:form>
+ </div>
+
+ <!-- search results -->
+ <table>
+ <tr>
+ <th>Name</th>
+ <th>Cell Phone</th>
+ <th>Home Phone</th>
+ <th>Address</th>
+ <th>City</th>
+ <th>State</th>
+ <th>Zip</th>
+ <th>Country</th>
+ </tr>
+ <ui:repeat id="searchResult" value="#{contacts.resultList}" var="cont">
+ <tr>
+ <td>
+ <s:link id="link" view="/viewContact.xhtml" value="#{cont.firstName} #{cont.lastName}">
+ <f:param name="contactId" value="#{cont.id}"/>
+ </s:link>
+ </td>
+ <td><h:outputText id="cellPhone" value="#{cont.cellPhone}" /></td>
+ <td><h:outputText id="homePhone" value="#{cont.homePhone}" /></td>
+ <td><h:outputText id="address" value="#{cont.address}" /></td>
+ <td><h:outputText id="city" value="#{cont.city}" /></td>
+ <td><h:outputText id="state" value="#{cont.state}" /></td>
+ <td><h:outputText id="zip" value="#{cont.zip}" /></td>
+ <td><h:outputText id="country" value="#{cont.country}" /></td>
+ </tr>
+ </ui:repeat>
+ </table>
+ <h:outputText value="No contacts to display" rendered="#{empty contacts.resultList}" styleClass="message"/>
+
+ <!-- pagination control -->
+ <div class="tableControl">
+
+ <s:link view="/search.xhtml" rendered="#{contacts.previousExists}" value="<< First Page">
+ <f:param name="firstResult" value="0"/>
+ </s:link>
+
+ <s:link view="/search.xhtml" rendered="#{contacts.previousExists}" value="< Previous Page">
+ <f:param name="firstResult" value="#{contacts.previousFirstResult}"/>
+ </s:link>
+
+ <s:link view="/search.xhtml" rendered="#{contacts.nextExists}" value="Next Page >">
+ <f:param name="firstResult" value="#{contacts.nextFirstResult}"/>
+ </s:link>
+
+ <s:link view="/search.xhtml" rendered="#{contacts.nextExists}" value="Last Page >>">
+ <f:param name="firstResult" value="#{contacts.lastFirstResult}"/>
+ </s:link>
+
+ </div>
+
+ </div>
+
+ </body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/viewContact.xhtml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/viewContact.xhtml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/contactlist-web/src/main/webapp/viewContact.xhtml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,126 @@
+<!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"
+ template="template.xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>View Contact</title>
+ <link href="screen.css" rel="stylesheet" type="text/css" />
+ </head>
+ <body>
+
+ <div class="menuButtons">
+ <s:link id="search" view="/search.xhtml" value="Search Contacts"/>
+ <s:link id="create" view="/editContact.xhtml" value="Create New Contact">
+ <f:param name="contactId"/> <!-- suppress propagation of contact id page parameter -->
+ </s:link>
+ <s:link id="view" view="/viewContact.xhtml" value="View Contact"/>
+ <s:link id="edit" view="/editContact.xhtml" value="Edit Contact"/>
+ </div>
+
+ <div class="body">
+
+ <h1>View Contact</h1>
+
+ <h:messages id="messages" styleClass="message"/>
+
+ <!-- fields -->
+ <div class="dialog">
+ <table>
+ <tr class="prop">
+ <td class="name">First Name:</td>
+ <td class="value">#{contact.firstName}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Last Name:</td>
+ <td class="value">#{contact.lastName}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Cell Phone:</td>
+ <td class="value">#{contact.cellPhone}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Home Phone:</td>
+ <td class="value">#{contact.homePhone}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Address:</td>
+ <td class="value">#{contact.address}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">City:</td>
+ <td class="value">#{contact.city}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">State:</td>
+ <td class="value">#{contact.state}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Zip:</td>
+ <td class="value">#{contact.zip}</td>
+ </tr>
+ <tr class="prop">
+ <td class="name">Country:</td>
+ <td class="value">#{contact.country}</td>
+ </tr>
+ </table>
+ </div>
+
+ <!-- actions -->
+ <div class="actionButtons">
+ <s:link id="editContact" view="/editContact.xhtml" value="Edit Contact"/>
+ <s:link id="deleteContact" action="#{contactHome.remove}" value="Delete Contact" rendered="#{contactHome.managed}"/>
+ </div>
+
+ <!-- associations -->
+ <h3>
+ <h:outputText value="Comments" rendered="#{not empty contact.comments}"/>
+ <h:outputText value="No Comments" rendered="#{empty contact.comments}"/>
+ </h3>
+
+ <h:dataTable value="#{contact.comments}" var="c" rendered="#{not empty contact.comments}"
+ rowClasses="first,second" columnClasses="narrow,wide">
+ <h:column>
+ <f:facet name="header">Posted</f:facet>
+ <h:outputText value="#{c.created}">
+ <s:convertDateTime type="both"/>
+ </h:outputText>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Comment</f:facet>
+ #{c.text}
+ </h:column>
+ </h:dataTable>
+
+ <h:form id="commentForm">
+
+ <!-- editable fields -->
+ <div class="dialog">
+ <s:validateAll>
+
+ <table>
+ <tr class="prop">
+ <td class="name">New Comment:</td>
+ <td class="value">
+ <h:inputTextarea id="text" value="#{comment.text}" rows="15" cols="100"/>
+ </td>
+ </tr>
+ </table>
+
+ </s:validateAll>
+ </div>
+
+ <!-- actions -->
+ <div class="actionButtons">
+ <h:commandLink id="submit" action="#{commentHome.persist}" value="Create Comment"/>
+ </div>
+
+ </h:form>
+
+ </div>
+
+ </body>
+</html>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/pom.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/pom.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,48 @@
+<?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">
+ <parent>
+ <artifactId>examples-ee6</artifactId>
+ <groupId>org.jboss.seam</groupId>
+ <version>2.3.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist</artifactId>
+ <packaging>pom</packaging>
+ <name>Contact List Example (EE6)</name>
+
+ <modules>
+ <module>contactlist-ejb</module>
+ <module>contactlist-web</module>
+ <module>contactlist-ear</module>
+ <module>contactlist-tests</module>
+ </modules>
+
+ <properties>
+ <example.name>contactlist</example.name>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples-ee6</groupId>
+ <artifactId>contactlist-ear</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+</project>
Added: branches/community/Seam_2_3/examples-ee6/contactlist/readme.txt
===================================================================
--- branches/community/Seam_2_3/examples-ee6/contactlist/readme.txt (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/contactlist/readme.txt 2012-03-16 21:08:39 UTC (rev 14420)
@@ -0,0 +1,29 @@
+Seam Contact List Example
+=========================
+
+This example demonstrates the Seam CRUD framework. It runs on JBoss AS as an
+EAR and Tomcat with JBoss Embedded as a WAR.
+
+To deploy the example to JBossAS 4, JBossAS 5 or JBossAS 6, follow these steps:
+
+* In the example root directory run:
+
+ mvn clean package
+
+* Set JBOSS_HOME environment property.
+
+* In the contactlist-ear directory run:
+
+ mvn jboss:hard-deploy
+
+* Open this URL in a web browser: http://localhost:8080/seam-contactlist
+
+To deploy the example to Tomcat with Embedded JBoss, follow these steps:
+
+* In the example root directory run:
+
+ mvn clean package -Ptomcat
+
+* Deploy the resulting war from contactlist-web/target directory to Tomcat manually
+
+* Open this URL in a web browser: http://localhost:8080/jboss-seam-contactlist
Modified: branches/community/Seam_2_3/examples-ee6/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/pom.xml 2012-03-16 20:33:10 UTC (rev 14419)
+++ branches/community/Seam_2_3/examples-ee6/pom.xml 2012-03-16 21:08:39 UTC (rev 14420)
@@ -17,6 +17,7 @@
<modules>
<module>blog</module>
<module>booking</module>
+ <module>contactlist</module>
<!-- <module>dvdstore</module> -->
<module>excel</module>
<module>mail</module>
More information about the seam-commits
mailing list