Author: alexsmirnov
Date: 2007-11-02 17:06:30 -0400 (Fri, 02 Nov 2007)
New Revision: 3741
Added:
trunk/samples/seamPortletEar/seamBookingPortlet/
Removed:
trunk/samples/seamBookingPortlet/
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/pom.xml
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/META-INF/persistence.xml
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
Log:
convert seam portlet sample to EAR
Copied: trunk/samples/seamPortletEar/seamBookingPortlet (from rev 3725,
trunk/samples/seamBookingPortlet)
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/pom.xml
===================================================================
--- trunk/samples/seamBookingPortlet/pom.xml 2007-11-02 15:43:03 UTC (rev 3725)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/pom.xml 2007-11-02 21:06:30 UTC (rev
3741)
@@ -7,6 +7,9 @@
<groupId>org.richfaces</groupId>
<version>3.2.0-SNAPSHOT</version>
</parent>
+ <properties>
+ <seam>2.0.0.GA</seam>
+ </properties>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.samples</groupId>
<artifactId>seamBookingPortlet</artifactId>
@@ -79,22 +82,22 @@
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
- <version>2.0.1.SNAPSHOT</version>
+ <version>${seam}</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ui</artifactId>
- <version>2.0.1.SNAPSHOT</version>
+ <version>${seam}</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ioc</artifactId>
- <version>2.0.1.SNAPSHOT</version>
+ <version>${seam}</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-debug</artifactId>
- <version>2.0.1.SNAPSHOT</version>
+ <version>${seam}</version>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java 2007-11-02
15:43:03 UTC (rev 3725)
+++
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java 2007-11-02
21:06:30 UTC (rev 3741)
@@ -7,7 +7,6 @@
import java.util.Date;
import javax.persistence.Basic;
-import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
@@ -20,7 +19,6 @@
import org.hibernate.validator.Pattern;
import org.jboss.seam.annotations.Name;
-@Entity
@Name("booking")
public class Booking implements Serializable
{
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java 2007-11-02
15:43:03 UTC (rev 3725)
+++
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java 2007-11-02
21:06:30 UTC (rev 3741)
@@ -13,7 +13,6 @@
import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.Name;
-@Entity
@Name("hotel")
public class Hotel implements Serializable
{
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java 2007-11-02
15:43:03 UTC (rev 3725)
+++
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java 2007-11-02
21:06:30 UTC (rev 3741)
@@ -15,7 +15,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
-@Entity
@Name("user")
@Scope(SESSION)
@Table(name="Customer")
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/META-INF/persistence.xml
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/persistence.xml 2007-11-02
15:43:03 UTC (rev 3725)
+++
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/META-INF/persistence.xml 2007-11-02
21:06:30 UTC (rev 3741)
@@ -1,17 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
- <persistence-unit name="bookingDatabase">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>java:/bookingDatasource</jta-data-source>
- <properties>
- <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
- <property name="hibernate.show_sql" value="true"/>
- <!-- These are the default for JBoss EJB3, but not for HEM: -->
- <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
- <property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
- </properties>
- </persistence-unit>
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="bookingDatabase"
transaction-type="JTA">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/bookingDatasource</jta-data-source>
+ <properties>
+ <property name="hibernate.dialect"
+ value="org.hibernate.dialect.HSQLDialect" />
+ <!-- Logging -->
+ <property name="hibernate.use_sql_comments" value="true" />
+ <property name="hibernate.format_sql" value="false" />
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"
/>
+ <property name="hibernate.show_sql" value="true" />
+ <!-- These are the default for JBoss EJB3, but not for HEM: -->
+ <property name="hibernate.cache.provider_class"
+ value="org.hibernate.cache.HashtableCacheProvider" />
+ <property name="hibernate.transaction.manager_lookup_class"
+ value="org.hibernate.transaction.JBossTransactionManagerLookup" />
+ </properties>
+ </persistence-unit>
</persistence>
\ No newline at end of file
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/components.properties 2007-11-02
15:43:03 UTC (rev 3725)
+++
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/resources/components.properties 2007-11-02
21:06:30 UTC (rev 3741)
@@ -1 +0,0 @@
-jndiPattern #{ejbName}/local
\ No newline at end of file
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml 2007-11-02
15:43:03 UTC (rev 3725)
+++
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml 2007-11-02
21:06:30 UTC (rev 3741)
@@ -2,9 +2,11 @@
<components
xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:security="http://jboss.com/products/seam/security"
+
xmlns:persistence="http://jboss.com/products/seam/persistence"
xmlns:transaction="http://jboss.com/products/seam/transaction"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.0.xsd
+
http://jboss.com/products/seam/persistence
http://jboss.com/products/seam/persistence-2.0.xsd
http://jboss.com/products/seam/transaction
http://jboss.com/products/seam/transaction-2.0.xsd
http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-2.0.xsd
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.0.xsd">
@@ -13,15 +15,24 @@
debug="true" />
<core:manager conversation-timeout="120000"
- concurrent-request-timeout="500" conversation-id-parameter="cid"
/><!--
+ concurrent-request-timeout="500" conversation-id-parameter="cid"
/>
+ <!-- Use the Seam-started PU or look it up from JNDI if running in Embeddable
JBoss -->
+ <persistence:entity-manager-factory installed="true"
+ name="bookingEntityManagerFactory"
+
persistence-unit-name="bookingDatabase"/>
- <persistence:managed-persistence-context auto-create="true"
name="entityManager">
- <persistence:persistence-unit-jndi-name>java:/blogEntityManagerFactory</persistence:persistence-unit-jndi-name>
- </persistence:managed-persistence-context>
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+
entity-manager-factory="#{bookingEntityManagerFactory}"
+
persistence-unit-jndi-name="java:/entityManagerFactories/bookingDatabase">
+ </persistence:managed-persistence-context>
+ <!-- Enabled in embeddable JBoss container -->
+ <!--<transaction:ejb-transaction installed="false" />
-->
- <transaction:ejb-transaction />
-
+ <transaction:ejb-transaction />
+
+
<security:identity
authenticate-method="#{authenticator.authenticate}" />