geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r897762 [1/3] - in /geronimo/samples/trunk/samples: DataCDInfo/ DataCDInfo/DataCDInfo-JTA-ear/ DataCDInfo/DataCDInfo-JTA-ear/src/ DataCDInfo/DataCDInfo-JTA-ear/src/main/ DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/ DataCDInfo/DataCDInf...
Date Mon, 11 Jan 2010 06:16:43 GMT
Author: delos
Date: Mon Jan 11 06:16:40 2010
New Revision: 897762

URL: http://svn.apache.org/viewvc?rev=897762&view=rev
Log:
GERONIMO-4741 Make a new samples release with G 2.2 server

Added:
    geronimo/samples/trunk/samples/DataCDInfo/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_derby.sql
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_mysql.sql
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/DuplicatedDataCDException.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/InvalidPasswordException.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/MANIFEST.MF
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/ejb-jar.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/openejb-jar.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/pom.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.removed.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/treeListing.txt
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-tomcat/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-tomcat/pom.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/pom.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/DataCDInfoAdminServlet.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/ListOwnerServlet.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/struts1/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/struts1/DataCDForm.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/struts1/DataCDInfoContextListener.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/struts1/OwnerActions.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/struts1/OwnerForm.java
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/resources/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/resources/DataCDInfoResources_en_US.properties
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/resources/DataCDInfoResources_zh.properties.template
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/resources/DataCDInfoResources_zh_CN.properties
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/META-INF/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/META-INF/LICENSE
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/META-INF/MANIFEST.MF
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/WEB-INF/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/WEB-INF/geronimo-web.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/WEB-INF/validation.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/WEB-INF/web.xml
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/admin/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/admin/showCDs.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/admin/showOwners.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/admin/showPasswd.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/auth/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/auth/logonError.html
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/header.html
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/index.html
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/jsp/
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/jsp/AddCD.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/jsp/ListCDs.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/jsp/Logon.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/jsp/Logout.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/jsp/Register.jsp
    geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/webapp/view/jsp/UpdateCD.jsp
    geronimo/samples/trunk/samples/DataCDInfo/pom.xml
    geronimo/samples/trunk/samples/DataCDInfo/readme.txt
    geronimo/samples/trunk/samples/csa-activemq/
    geronimo/samples/trunk/samples/csa-activemq/pom.xml
    geronimo/samples/trunk/samples/csa-activemq/readme.txt
    geronimo/samples/trunk/samples/jms-mdb/jms-mdb-ear/src/main/resources/META-INF/geronimo-application.xml
    geronimo/samples/trunk/samples/jms-mdb/jms-mdb-ear/src/main/resources/jms-resources.xml
    geronimo/samples/trunk/samples/jms-mdb/jms-mdb-ejb/src/main/resources/META-INF/openejb-jar.xml
Modified:
    geronimo/samples/trunk/samples/app-per-port/app-per-port-tomcat/src/main/plan/plan.xml
    geronimo/samples/trunk/samples/bank/bank-ejb/pom.xml

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to you under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<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>
+		<groupId>org.apache.geronimo.samples</groupId>
+		<artifactId>DataCDInfo</artifactId>
+		<version>3.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>DataCDInfo-JTA-ear</artifactId>
+	<name>Geronimo Samples :: DataCDInfo JTA + Struts1 :: EAR</name>
+	<packaging>ear</packaging>
+
+	<description>Geronimo Samples - DataCD Information Management Tool</description>
+
+	<dependencies>
+		
+	<dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>DataCDInfo-JTA-war</artifactId>
+            <version>${version}</version>
+            <type>war</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>DataCDInfo-JTA-ejb</artifactId>
+            <version>${version}</version>
+            <type>ejb</type>
+        </dependency>
+	</dependencies>
+
+	<build>
+	<plugins>
+            <plugin>
+                <artifactId>maven-ear-plugin</artifactId>
+                <configuration>
+                    <displayName>Geronimo Sample EAR for DataCDInfo JTA+Struts1</displayName>
+                    <description>Geronimo Sample EAR for DataCDInfo JTA+Struts1</description>
+                    <version>5</version>
+                    <modules>
+                        <ejbModule>
+                            <groupId>org.apache.geronimo.samples</groupId>
+                            <artifactId>DataCDInfo-JTA-ejb</artifactId>
+                            <bundleFileName>DataCDInfo-JTA-ejb.jar</bundleFileName>
+                        </ejbModule>
+
+                        <webModule>
+                            <groupId>org.apache.geronimo.samples</groupId>
+                            <artifactId>DataCDInfo-JTA-war</artifactId>
+                            <contextRoot>/DataCDInfoJTAStruts1</contextRoot>
+                            <bundleFileName>DataCDInfo-JTA-war.war</bundleFileName>
+                        </webModule>
+                    </modules>
+                    <!--
+                    HACK: Include legal muck from maven-remote-resources-plugin
+                    -->
+                    <resourcesDir>${project.build.outputDirectory}</resourcesDir>
+                </configuration>
+            </plugin>
+
+        </plugins>
+	</build>
+</project>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_derby.sql
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_derby.sql?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_derby.sql (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_derby.sql Mon Jan 11 06:16:40 2010
@@ -0,0 +1,35 @@
+CREATE TABLE OWNER_TABLE (
+		USERNAME VARCHAR(20) NOT NULL,
+		PASSWORD VARCHAR(20) NOT NULL
+	);
+
+CREATE UNIQUE INDEX SQL090923232106080 ON OWNER_TABLE (null);
+
+ALTER TABLE OWNER_TABLE ADD CONSTRAINT SQL090923232106080 PRIMARY KEY (USERNAME);
+
+CREATE TABLE DATACD_TABLE (
+		CDID INTEGER NOT NULL,
+		CDARCHIVEDATE TIMESTAMP,
+		CDDESC VARCHAR(255),
+		CDLABEL VARCHAR(255) NOT NULL,
+		CDSIZE INTEGER,
+		OWNER_USERNAME VARCHAR(255)
+	);
+
+CREATE INDEX I_DTCDTBL_OWNER ON DATACD_TABLE (null);
+
+CREATE UNIQUE INDEX SQL090923232105870 ON DATACD_TABLE (null);
+
+ALTER TABLE DATACD_TABLE ADD CONSTRAINT SQL090923232105870 PRIMARY KEY (CDID);
+
+CREATE TABLE OPENJPASEQ (
+		ID SMALLINT NOT NULL,
+		SEQUENCE_VALUE BIGINT
+	);
+
+CREATE UNIQUE INDEX SQL090923232106010 ON OPENJPASEQ (null);
+
+ALTER TABLE OPENJPASEQ ADD CONSTRAINT SQL090923232106010 PRIMARY KEY (ID);
+
+
+

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_mysql.sql
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_mysql.sql?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_mysql.sql (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/DataCDInfo_tables_mysql.sql Mon Jan 11 06:16:40 2010
@@ -0,0 +1,34 @@
+-- DROP TABLE OWNER_TABLE;
+-- DROP TABLE DATACD_TABLE;
+-- DROP TABLE OPENJPASEQ;
+
+CREATE TABLE OWNER_TABLE (
+	USERNAME VARCHAR(20) NOT NULL,
+	PASSWORD VARCHAR(20) NOT NULL,
+	PRIMARY KEY (USERNAME)
+) ENGINE=InnoDB;
+
+CREATE TABLE DATACD_TABLE (
+	CDID INT NOT NULL,
+	CDARCHIVEDATE DATETIME,
+	CDDESC VARCHAR(255),
+	CDLABEL VARCHAR(255) NOT NULL,
+	CDSIZE INT,
+	OWNER_USERNAME VARCHAR(255),
+	PRIMARY KEY (CDID)
+) ENGINE=InnoDB;
+
+CREATE INDEX I_DTCDTBL_OWNER ON DATACD_TABLE (OWNER_USERNAME ASC);
+
+CREATE TABLE OPENJPASEQ (
+	ID TINYINT NOT NULL,
+	SEQUENCE_VALUE BIGINT,
+	PRIMARY KEY (ID)
+) ENGINE=InnoDB;
+
+
+
+
+
+
+

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
+  <display-name> 
+DataCDInfo-JTA</display-name>
+  <module>
+    <web>
+      <web-uri>DataCDInfo-JTA-war.war</web-uri>
+      <context-root>DataCDInfoJTAStruts1</context-root>
+    </web>
+  </module>
+  <module>
+    <ejb>DataCDInfo-JTA-ejb.jar</ejb>
+  </module>
+</application>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<application application-name="DataCDInfo-JTA"
+	xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+	<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+		<dep:moduleId>
+			<dep:groupId>org.apache.geronimo.samples</dep:groupId>
+			<dep:artifactId>DataCDInfoJTA</dep:artifactId>
+			<dep:version>1.0</dep:version>
+			<dep:type>car</dep:type>
+		</dep:moduleId>
+		<dep:dependencies>
+			<dep:dependency>
+				<dep:groupId>mysql</dep:groupId>
+				<dep:artifactId>mysql-connector-java</dep:artifactId>
+				<dep:version>5.1.7</dep:version>
+				<dep:type>jar</dep:type>
+			</dep:dependency>
+		</dep:dependencies>
+	</dep:environment>
+
+	<module>
+		<ejb>DataCDInfo-JTA-ejb.jar</ejb>
+		<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2">
+			<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+				version="1.0">
+				<persistence-unit name="DataCDInfoUnit">
+					<properties>
+						<property name="openjpa.jdbc.DBDictionary" value="mysql" />
+					</properties>
+				</persistence-unit>
+			</persistence>
+		</openejb-jar>
+	</module>
+
+	<ext-module>
+		<connector>DataCDInfoDataSource</connector>
+		<external-path xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+			<dep:groupId>org.tranql</dep:groupId>
+			<dep:artifactId>tranql-connector-mysql-xa</dep:artifactId>
+			<dep:type>rar</dep:type>
+		</external-path>
+		<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
+			<resourceadapter>
+				<outbound-resourceadapter>
+					<connection-definition>
+						<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+						<connectiondefinition-instance>
+							<name>jdbc/DataCDInfoDS</name>
+							<config-property-setting name="UserName">cdadmin</config-property-setting>
+							<config-property-setting name="Password">passme</config-property-setting>
+							<config-property-setting name="PortNumber">3306</config-property-setting>
+							<config-property-setting name="ServerName">localhost</config-property-setting>
+							<config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
+							<connectionmanager>
+								<xa-transaction>
+									<transaction-caching />
+								</xa-transaction>
+								<single-pool>
+									<max-size>100</max-size>
+									<min-size>0</min-size>
+									<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+									<idle-timeout-minutes>30</idle-timeout-minutes>
+									<match-one />
+								</single-pool>
+							</connectionmanager>
+						</connectiondefinition-instance>
+						<!-- This non-transaction data source is for sequence generation use. Without it,
+						the geronimo will throw exception when persisting entities which require sequence
+						generation. -->
+						<connectiondefinition-instance>
+                            <name>jdbc/NoTxDataCDInfoDS</name>
+                            <config-property-setting name="UserName">cdadmin</config-property-setting>
+							<config-property-setting name="Password">passme</config-property-setting>
+							<config-property-setting name="PortNumber">3306</config-property-setting>
+							<config-property-setting name="ServerName">localhost</config-property-setting>
+							<config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
+                            <connectionmanager>
+                                <no-transaction/>
+                                <single-pool>
+                                    <max-size>10</max-size>
+                                    <min-size>0</min-size>
+                                    <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+                                    <idle-timeout-minutes>30</idle-timeout-minutes>
+                                    <match-one/>
+                                </single-pool>
+                            </connectionmanager>
+                        </connectiondefinition-instance>
+					</connection-definition>
+				</outbound-resourceadapter>
+			</resourceadapter>
+		</connector>
+	</ext-module>
+	
+	
+
+  <security xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0">
+    <sec:default-principal>
+      <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="anonymous"/>
+    </sec:default-principal>
+    <sec:role-mappings>
+      <sec:role role-name="admin">
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin"/>
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>        
+      </sec:role>
+      <sec:role role-name="superadmin">
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="superadmin"/>
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="superman"/>        
+      </sec:role>
+    </sec:role-mappings>
+  </security>
+	
+	<gbean name="DBInitialization" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
+        <attribute name="path">DataCDInfo_tables_mysql.sql</attribute>
+        <reference name="DataSource">
+            <name>jdbc/NoTxDataCDInfoDS</name>
+        </reference>
+    </gbean>
+</application>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to you under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<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>
+		<groupId>org.apache.geronimo.samples</groupId>
+		<artifactId>DataCDInfo</artifactId>
+		<version>3.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>DataCDInfo-JTA-ejb</artifactId>
+	<name>Geronimo Samples :: DataCDInfo JTA + Struts1 :: EJB</name>
+	<packaging>jar</packaging>
+
+	<description>Geronimo Samples - DataCD Information Management Tool</description>
+
+	<dependencies>	
+		
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-annotation_1.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-ejb_3.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jpa_1.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jta_1.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+	
+</project>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,114 @@
+package org.apache.geronimo.samples.datacdinfo.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.*;
+
+/**
+ * Demo how to code JPA entity bean, including various JPA annotations:
+ * NamedQueries, Id, JoinColumn
+ * 
+ * @author forrestxm
+ *
+ */
+
+@Entity(name="DataCD")
+@Table(name="DATACD_TABLE")
+@NamedQueries( {        
+   @NamedQuery(name = "DataCD.findByOwnerId", query = "SELECT cd FROM DataCD cd WHERE cd.owner.username = :ownername"),
+   @NamedQuery(name = "DataCD.findByOwnerIdandCDLabel", query = "SELECT cd FROM DataCD cd WHERE cd.owner.username = :ownername and cd.cdLabel = :cdlabel"),
+   @NamedQuery(name = "DataCD.deleteByOwnerId", query = "DELETE FROM DataCD cd WHERE cd.owner.username = :ownername"),
+   @NamedQuery(name = "DataCD.getAllCDs", query = "SELECT cd FROM DataCD cd")
+})
+public class DataCDBean implements Serializable{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7665259395127908808L;
+	@Id
+	@Column(name = "CDID")
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	private Integer cdID;
+	
+	@JoinColumn(name = "OWNER_USERNAME")
+	@ManyToOne(fetch=FetchType.EAGER, optional=false)
+	private OwnerBean owner;
+	
+	@Column(name = "CDLABEL", nullable=false)
+	private String cdLabel;
+	
+	@Column(name = "CDDESC")
+	private String cdDescription;
+	
+	@Column(name = "CDARCHIVEDATE")
+	private Date cdArchiveDate;
+	
+	@Column(name = "CDSIZE")
+	private Integer cdSize;
+	
+	public DataCDBean(){
+		
+	}
+	
+	public DataCDBean(Integer cdID, String cdLabel,
+			String cdDescription, Date cdArchiveDate, Integer cdSize) {
+		super();
+		this.cdID = cdID;
+		this.cdLabel = cdLabel;
+		this.cdDescription = cdDescription;
+		this.cdArchiveDate = cdArchiveDate;
+		this.cdSize = cdSize;
+	}
+	
+	public String toString(){
+		return "[cdID:" + this.getCdID()
+				+ " cdLabel:" + this.getCdLabel()
+				+ " cdDescription:" + this.getCdDescription()
+				+ " cdArchiveDate:" + this.getCdArchiveDate().toString()
+				+ " cdSize:" + this.getCdSize()
+				+ " Owner:" + this.getOwner().getUsername()
+				+ "]";
+		
+	}
+	public Integer getCdID() {
+		return cdID;
+	}
+	public void setCdID(Integer cdID) {
+		this.cdID = cdID;
+	}
+	public OwnerBean getOwner() {
+		return owner;
+	}
+	public void setOwner(OwnerBean owner) {
+		this.owner = owner;
+	}
+	public String getCdLabel() {
+		return cdLabel;
+	}
+	public void setCdLabel(String cdLabel) {
+		this.cdLabel = cdLabel;
+	}
+	public String getCdDescription() {
+		return cdDescription;
+	}
+	public void setCdDescription(String cdDescription) {
+		this.cdDescription = cdDescription;
+	}
+	public Date getCdArchiveDate() {
+		return cdArchiveDate;
+	}
+	public void setCdArchiveDate(Date cdArchiveDate) {
+		this.cdArchiveDate = cdArchiveDate;
+	}
+	public Integer getCdSize() {
+		return cdSize;
+	}
+	public void setCdSize(Integer cdSize) {
+		this.cdSize = cdSize;
+	}
+	
+	
+	
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,89 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.samples.datacdinfo.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateful;
+
+import org.apache.geronimo.samples.datacdinfo.beans.DataCDBean;
+import org.apache.geronimo.samples.datacdinfo.beans.OwnerBean;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+
+/**
+ * Session Bean implementation class DataCDInfoAdmin
+ * 
+ * Demo how to use security annotations and container-managed extended-scoped persistence context,
+ * and using JTA transaction.
+ */
+//@Stateful(name="ejb/DataCDInfoAdmin")
+@Stateful
+public class DataCDInfoAdmin implements DataCDInfoAdminLocal {
+	
+	@PersistenceContext(unitName="DataCDInfoUnit", type = PersistenceContextType.EXTENDED)	
+	private EntityManager em;
+
+    /**
+     * Default constructor. 
+     */
+    public DataCDInfoAdmin() {
+        // do nothing
+    }
+    
+    @RolesAllowed("superadmin")
+	public String findpasswd(String username) {
+		OwnerBean owner = em.find(OwnerBean.class, username);
+		String passwd = owner.getPassword();
+		return passwd;
+	}
+    
+	@RolesAllowed("superadmin")
+	public String[] listAllDataCDs() {
+		ArrayList<String> allcdstring = new ArrayList<String>();
+		Query query = em.createNamedQuery("DataCD.getAllCDs");
+		List<DataCDBean> allcds = query.getResultList();
+		for (DataCDBean cd : allcds){
+			allcdstring.add(cd.toString());
+		}
+		
+		String[] result = allcdstring.toArray(new String[0]);
+		return result;
+	}
+	
+	@RolesAllowed({"admin","superadmin"})
+	public String[] listOwners() {
+		ArrayList<String> allusers = new ArrayList<String>();
+		List<Object> owners = new ArrayList<Object>();
+		Query query = em.createNativeQuery("SELECT USERNAME FROM OWNER_TABLE");
+		owners = query.getResultList(); 
+		for (Object owner : owners ) {
+			String ownername = owner.toString();
+			allusers.add(ownername);
+		}
+		String[] result = allusers.toArray(new String[0]);
+		return result;
+	}
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,228 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.samples.datacdinfo.core;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import javax.persistence.PersistenceContext;
+
+import org.apache.geronimo.samples.datacdinfo.beans.DataCDBean;
+import org.apache.geronimo.samples.datacdinfo.beans.OwnerBean;
+import org.apache.geronimo.samples.datacdinfo.exceptions.DuplicatedDataCDException;
+import org.apache.geronimo.samples.datacdinfo.exceptions.IncorrectPasswordException;
+import org.apache.geronimo.samples.datacdinfo.exceptions.InvalidOwnerException;
+import org.apache.geronimo.samples.datacdinfo.exceptions.InvalidPasswordException;
+
+/**
+ * @author forrestxm
+ * 
+ * Demo how to use container-managed transaction-scoped persistence context with JTA transaction.
+ * 
+ */
+@Stateless(name="ejb/DataCDInfoJTAImpl")
+@Remote(DataCDInfoRemote.class)
+@Local(DataCDInfoLocal.class)
+@TransactionAttribute(TransactionAttributeType.REQUIRED)
+@TransactionManagement(TransactionManagementType.CONTAINER)
+public class DataCDInfoJTAImpl implements DataCDInfoLocal, DataCDInfoRemote {
+
+	@PersistenceContext(unitName = "DataCDInfoUnit", type = PersistenceContextType.TRANSACTION)
+	private EntityManager em;
+
+	public DataCDInfoJTAImpl() {
+		// do nothing
+	}
+
+	public OwnerBean login(String username, String passwd)
+			throws InvalidOwnerException, IncorrectPasswordException {
+		// check if the owner is registered
+		OwnerBean owner = em.find(OwnerBean.class, username);
+		if (owner == null) {
+			String error = "No such user: " + username + "!";
+			throw new InvalidOwnerException(error);
+		}
+
+		if (!passwd.equals(owner.getPassword())) {
+			String error = "Incorrect password!";
+			throw new IncorrectPasswordException(error);
+		}
+
+		// Load CDs to cache
+		populateCDs(owner);
+
+		return owner;
+	}
+
+	public void logout(String username) {
+		// do nothing
+
+	}
+
+	public OwnerBean register(String username, String passwd)
+			throws InvalidOwnerException, InvalidPasswordException {
+
+		OwnerBean user = em.find(OwnerBean.class, username);
+		if (user != null) {
+			String error = "Can not register existing user:" + username;
+			throw new InvalidOwnerException(error);
+		}
+
+		if (passwd.length() < 6) {
+			String error = "Invalid password:" + passwd
+					+ ". Password must be at least 6 chars";
+			throw new InvalidPasswordException(error);
+		}
+
+		OwnerBean newuser = new OwnerBean(username, passwd);
+		try {
+			em.persist(newuser);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		return newuser;
+	}
+
+	public boolean unregister(String username) {
+
+		// Delete owner as well as cascadely deleting CDs owned by the owner.
+		OwnerBean deluser = em.find(OwnerBean.class, username.toLowerCase());
+		populateCDs(deluser);
+		try {
+			em.remove(deluser);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return true;
+	}
+
+	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize,
+			String cddesc, Date cdarchivedate)
+			throws DuplicatedDataCDException, InvalidOwnerException {
+
+		DataCDBean newcd = new DataCDBean();
+
+		Query query = em.createNamedQuery("DataCD.findByOwnerIdandCDLabel");
+		query.setParameter("ownername", ownername.toLowerCase());
+		query.setParameter("cdlabel", cdlabel);
+		Collection<DataCDBean> cd = query.getResultList();
+
+		Iterator<DataCDBean> itr = cd.iterator();
+
+		if (!itr.hasNext()) {
+
+			newcd.setCdArchiveDate(cdarchivedate);
+			newcd.setCdDescription(cddesc);
+			newcd.setCdLabel(cdlabel);
+			newcd.setCdSize(cdsize);
+
+			OwnerBean theowner = em.find(OwnerBean.class, ownername
+					.toLowerCase());
+			newcd.setOwner(theowner);
+
+			try {
+				em.persist(newcd);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+
+		} else {
+			newcd = null;
+		}
+
+		return newcd;
+	}
+
+	public Collection<DataCDBean> listCDs(String ownername) {
+
+		OwnerBean owner = em.find(OwnerBean.class, ownername);
+		Query query = em.createNamedQuery("DataCD.findByOwnerId");
+		query.setParameter("ownername", owner.getUsername());
+		Collection<DataCDBean> cds = query.getResultList();
+		if (cds == null) {
+			cds = new ArrayList<DataCDBean>();
+		}
+		return cds;
+	}
+
+	public boolean removeCD(Integer cdid) {
+		boolean success = false;
+
+		DataCDBean datacd = em.find(DataCDBean.class, cdid);
+		if (datacd != null) {
+			try {
+				em.remove(datacd);
+				success = true;
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+
+		return success;
+	}
+
+	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc,
+			Date cdarchivedate) {
+
+		DataCDBean datacd = em.find(DataCDBean.class, cdid);
+		if (datacd != null) {
+			datacd.setCdArchiveDate(cdarchivedate);
+			datacd.setCdDescription(cddesc);
+			datacd.setCdSize(cdsize);
+			try {
+				em.persist(datacd);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+		return datacd;
+	}
+
+	public OwnerBean refreshCDInfo(String ownername) {
+		OwnerBean owner = null;
+		owner = em.find(OwnerBean.class, ownername);
+		if (owner != null) {
+			populateCDs(owner);
+		}
+		return owner;
+	}
+
+	private void populateCDs(OwnerBean owner) {
+		Collection<DataCDBean> ownedcds = owner.getDataCDs();
+		Iterator<DataCDBean> itr = ownedcds.iterator();
+		while (itr.hasNext()) {
+			((DataCDBean) itr.next()).getCdLabel();
+		}
+	}
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,24 @@
+package org.apache.geronimo.samples.datacdinfo.core;
+
+import java.util.Collection;
+import java.util.Date;
+
+import javax.ejb.Local;
+
+import org.apache.geronimo.samples.datacdinfo.beans.*;
+import org.apache.geronimo.samples.datacdinfo.exceptions.*;
+
+@Local
+public interface DataCDInfoLocal {
+	public OwnerBean login(String username, String passwd) throws InvalidOwnerException, IncorrectPasswordException;
+	public void logout(String username);
+	public OwnerBean register(String username, String passwd) throws InvalidOwnerException, InvalidPasswordException;
+	public boolean unregister(String username);
+	
+	public Collection<DataCDBean> listCDs(String ownername);
+	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize, String cddesc, Date cdarchivedate) throws DuplicatedDataCDException, InvalidOwnerException;
+	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc, Date cdarchivedate);
+	public boolean removeCD(Integer cdid);
+	public OwnerBean refreshCDInfo(String ownername);
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,24 @@
+package org.apache.geronimo.samples.datacdinfo.core;
+
+import java.util.Collection;
+import java.util.Date;
+
+import javax.ejb.Remote;
+
+import org.apache.geronimo.samples.datacdinfo.beans.*;
+import org.apache.geronimo.samples.datacdinfo.exceptions.*;
+
+@Remote
+public interface DataCDInfoRemote {
+	public OwnerBean login(String username, String passwd) throws InvalidOwnerException, IncorrectPasswordException;
+	public void logout(String username);
+	public OwnerBean register(String username, String passwd) throws InvalidOwnerException, InvalidPasswordException;
+	public boolean unregister(String username);
+	
+	public Collection<DataCDBean> listCDs(String ownername);
+	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize, String cddesc, Date cdarchivedate) throws DuplicatedDataCDException, InvalidOwnerException;
+	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc, Date cdarchivedate);
+	public boolean removeCD(Integer cdid);
+	public OwnerBean refreshCDInfo(String ownername);
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/DuplicatedDataCDException.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/DuplicatedDataCDException.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/DuplicatedDataCDException.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/DuplicatedDataCDException.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,29 @@
+package org.apache.geronimo.samples.datacdinfo.exceptions;
+
+public class DuplicatedDataCDException extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	public DuplicatedDataCDException() {
+		// TODO Auto-generated constructor stub
+	}
+
+	public DuplicatedDataCDException(String message) {
+		super(message);
+		// TODO Auto-generated constructor stub
+	}
+
+	public DuplicatedDataCDException(Throwable cause) {
+		super(cause);
+		// TODO Auto-generated constructor stub
+	}
+
+	public DuplicatedDataCDException(String message, Throwable cause) {
+		super(message, cause);
+		// TODO Auto-generated constructor stub
+	}
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/InvalidPasswordException.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/InvalidPasswordException.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/InvalidPasswordException.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/exceptions/InvalidPasswordException.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,29 @@
+package org.apache.geronimo.samples.datacdinfo.exceptions;
+
+public class InvalidPasswordException extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1878613214876245045L;
+
+	public InvalidPasswordException() {
+		// TODO Auto-generated constructor stub
+	}
+
+	public InvalidPasswordException(String message) {
+		super(message);
+		// TODO Auto-generated constructor stub
+	}
+
+	public InvalidPasswordException(Throwable cause) {
+		super(cause);
+		// TODO Auto-generated constructor stub
+	}
+
+	public InvalidPasswordException(String message, Throwable cause) {
+		super(message, cause);
+		// TODO Auto-generated constructor stub
+	}
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/MANIFEST.MF?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/MANIFEST.MF (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/MANIFEST.MF Mon Jan 11 06:16:40 2010
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/ejb-jar.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/ejb-jar.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/ejb-jar.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<ejb-jar version="3.0"
+    xmlns="http://java.sun.com/xml/ns/javaee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"> 
+    <display-name>DataCDInfo Enterprise Bean Definitions</display-name>
+    
+    <enterprise-beans>
+		<session>
+			<ejb-name>ejb/DataCDInfoJTAImpl</ejb-name>
+			<business-local>org.apache.geronimo.samples.datacdinfo.core.DataCDInfoLocal</business-local>
+			<business-remote>org.apache.geronimo.samples.datacdinfo.core.DataCDInfoRemote</business-remote>
+			<ejb-class>org.apache.geronimo.samples.datacdinfo.core.DataCDInfoJTAImpl</ejb-class>
+<!--			 Stateful|Stateless -->
+			<session-type>Stateless</session-type>
+<!--			 Who manages transanction? Bean|Container -->
+			<transaction-type>Container</transaction-type>
+		</session>
+
+		<!-- In code, the stateful session bean "DataCDinfoAdmin" is annotated without name, 
+		so the geronimo server will assign a default name to it, it's the bean simple name. 
+		However, the interesting is following definition will add an additional entry to JNDI
+		and register a stateful session bean with name "ejb/DataCDInfoAdmin". Seems it does
+		not override the annotated one. Why?  -->
+		<session>
+			<ejb-name>ejb/DataCDInfoAdmin</ejb-name>
+			<business-local>org.apache.geronimo.samples.datacdinfo.core.DataCDInfoAdminLocal</business-local>
+			<ejb-class>org.apache.geronimo.samples.datacdinfo.core.DataCDInfoAdmin</ejb-class>
+<!--			 Stateful|Stateless -->
+			<session-type>Stateful</session-type>
+<!--			 Who manages transanction? Bean|Container -->
+			<transaction-type>Container</transaction-type>
+		</session>		
+	</enterprise-beans>
+	
+	<assembly-descriptor>
+			<method-permission>
+				<role-name>superadmin</role-name>
+				<method>
+					<ejb-name>ejb/DataCDInfoAdmin</ejb-name>
+					<method-name>*</method-name>
+				</method>
+			</method-permission>
+			<!-- In code, role "admin" only has right to access listOwners method
+				but via this xml definition, the role could also access listAllDataCDs method -->
+			<method-permission>
+				<role-name>admin</role-name>
+				<method>
+					<ejb-name>ejb/DataCDInfoAdmin</ejb-name>
+					<method-name>listAllDataCDs</method-name>					
+				</method>
+			</method-permission>
+	</assembly-descriptor>     
+</ejb-jar>
+

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/openejb-jar.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/openejb-jar.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-ejb/src/main/resources/META-INF/openejb-jar.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<openejb-jar xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
+	xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
+	xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
+	xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
+	xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pers="http://java.sun.com/xml/ns/persistence"
+	xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
+	xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
+	<dep:environment>
+		<dep:moduleId>
+			<dep:groupId>org.apache.geronimo.samples</dep:groupId>
+			<dep:artifactId>DataCDInfo-JTA-ejb</dep:artifactId>
+			<dep:version>1.0</dep:version>
+			<dep:type>car</dep:type>
+		</dep:moduleId>
+	</dep:environment>
+</openejb-jar>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/pom.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/pom.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/pom.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<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>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>DataCDInfo</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.geronimo.samples</groupId>
+    <artifactId>DataCDInfo-JTA-jetty</artifactId>
+    <name>Geronimo Samples :: DataCDInfo JTA + Struts1 Plugin for Jetty</name>
+    <packaging>car</packaging>
+
+    <description>Geronimo Samples DataCDInfo JTA+Struts1 Plugin for Jetty</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>DataCDInfo-JTA-ear</artifactId>
+            <version>2.2</version>
+            <type>ear</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>${jetty}-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>jasper-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>jasper</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openejb-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>persistence-jpa10-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${pom.basedir}/src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.buildsupport</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <configuration>
+                    <deploymentConfigs>
+                        <deploymentConfig>${gbeanDeployer}</deploymentConfig>
+                        <deploymentConfig>${j2eeDeployer}</deploymentConfig>
+                        <deploymentConfig>${jettyDeployer}</deploymentConfig>
+                        <deploymentConfig>${jasperDeployer}</deploymentConfig>
+                        <deploymentConfig>${openejbDeployer}</deploymentConfig>
+                        <deploymentConfig>${jpaDeployer}</deploymentConfig>
+                    </deploymentConfigs>
+                    <module>
+                        <groupId>org.apache.geronimo.samples</groupId>
+                        <artifactId>DataCDInfo-JTA-ear</artifactId>
+                        <version>2.2</version>
+                        <type>ear</type>
+                    </module>
+                    <useMavenDependencies>
+                        <value>true</value>
+                        <includeVersion>true</includeVersion>
+                    </useMavenDependencies>
+                    <category>Sample</category>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
+

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.removed.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.removed.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.removed.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.removed.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
+    <module-id>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>DataCDInfo-JTA-jetty</artifactId>
+        <version>2.2</version>
+        <type>car</type>
+    </module-id>
+    <dependency>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>DataCDInfo-war</artifactId>
+        <type>war</type>
+    </dependency>
+</plugin-artifact>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/dependencies.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
+    <module-id>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>DataCDInfo-JTA-jetty</artifactId>
+        <version>2.2</version>
+        <type>car</type>
+    </module-id>
+    <dependency>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>DataCDInfo-JTA-ear</artifactId>
+        <type>ear</type>
+    </dependency>
+</plugin-artifact>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/treeListing.txt
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/treeListing.txt?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/treeListing.txt (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-jetty/src/main/history/treeListing.txt Mon Jan 11 06:16:40 2010
@@ -0,0 +1,7 @@
+local:active project artifact:
+	artifact = active project artifact:
+	artifact = active project artifact:
+	artifact = org.apache.geronimo.samples:DataCDInfo-JTA-ear:ear:2.2:compile;
+	project: MavenProject: org.apache.geronimo.samples:DataCDInfo-JTA-ear:2.2 @ /home/forrestxm/localbuild/rsaws/gsamplestrunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml;
+	project: MavenProject: org.apache.geronimo.samples:DataCDInfo-JTA-ear:2.2 @ /home/forrestxm/localbuild/rsaws/gsamplestrunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml;
+	project: MavenProject: org.apache.geronimo.samples:DataCDInfo-JTA-ear:2.2 @ /home/forrestxm/localbuild/rsaws/gsamplestrunk/samples/DataCDInfo/DataCDInfo-JTA-ear/pom.xml

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-tomcat/pom.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-tomcat/pom.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-tomcat/pom.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<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>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>DataCDInfo</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.geronimo.samples</groupId>
+    <artifactId>DataCDInfo-JTA-tomcat</artifactId>
+    <name>Geronimo Samples :: DataCDInfo JTA + Struts1 Plugin for Tomcat</name>
+    <packaging>car</packaging>
+
+    <description>Geronimo Samples DataCDInfo JTA+Struts1 Plugin for Tomcat</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>DataCDInfo-JTA-ear</artifactId>
+            <version>2.2</version>
+            <type>ear</type>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>tomcat6-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>jasper-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>jasper</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openejb-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>persistence-jpa10-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${pom.basedir}/src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.buildsupport</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <configuration>
+                    <deploymentConfigs>
+                        <deploymentConfig>${gbeanDeployer}</deploymentConfig>
+                        <deploymentConfig>${j2eeDeployer}</deploymentConfig>
+                        <deploymentConfig>${tomcatDeployer}</deploymentConfig>
+                        <deploymentConfig>${jasperDeployer}</deploymentConfig>
+                        <deploymentConfig>${openejbDeployer}</deploymentConfig>
+                        <deploymentConfig>${jpaDeployer}</deploymentConfig>
+                    </deploymentConfigs>
+                    <module>
+                        <groupId>org.apache.geronimo.samples</groupId>
+                        <artifactId>DataCDInfo-JTA-ear</artifactId>
+                        <version>2.2</version>
+                        <type>ear</type>
+                    </module>
+                    <useMavenDependencies>
+                        <value>true</value>
+                        <includeVersion>true</includeVersion>
+                    </useMavenDependencies>
+                    <category>Sample</category>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
+

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/pom.xml?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/pom.xml (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/pom.xml Mon Jan 11 06:16:40 2010
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to you under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<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>
+		<groupId>org.apache.geronimo.samples</groupId>
+		<artifactId>DataCDInfo</artifactId>
+		<version>3.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>DataCDInfo-JTA-war</artifactId>
+	<name>Geronimo Samples :: DataCDInfo JTA + Struts1 :: WAR</name>
+	<packaging>war</packaging>
+
+	<description>Geronimo Samples - DataCD Information Management Tool</description>
+
+	<dependencies>
+		
+		<dependency> 
+			<groupId>org.apache.geronimo.samples</groupId>
+			<artifactId>DataCDInfo-JTA-ejb</artifactId> 
+			<version>${geronimoVersion}</version>
+			<scope>provided</scope> 
+		</dependency>
+		
+		<dependency>
+			<groupId>antlr</groupId>
+			<artifactId>antlr</artifactId>
+			<version>2.7.2</version>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-beanutils</groupId>
+			<artifactId>commons-beanutils</artifactId>
+			<version>1.8.0</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-chain</groupId>
+			<artifactId>commons-chain</artifactId>
+			<version>1.2</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-digester</groupId>
+			<artifactId>commons-digester</artifactId>
+			<version>1.8</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>1.1.1</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>1.1</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+			<version>1.0.4</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-validator</groupId>
+			<artifactId>commons-validator</artifactId>
+			<version>1.3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>jstl</artifactId>
+			<version>1.0.2</version>
+		</dependency>
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.1.10</version>
+		</dependency>
+		<dependency>
+			<groupId>oro</groupId>
+			<artifactId>oro</artifactId>
+			<version>2.0.8</version>
+		</dependency>
+		<dependency>
+			<groupId>taglibs</groupId>
+			<artifactId>standard</artifactId>
+			<version>1.0.6</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.struts</groupId>
+			<artifactId>struts-core</artifactId>
+			<version>1.3.10</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.struts</groupId>
+			<artifactId>struts-el</artifactId>
+			<version>1.3.10</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.struts</groupId>
+			<artifactId>struts-extras</artifactId>
+			<version>1.3.10</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.struts</groupId>
+			<artifactId>struts-faces</artifactId>
+			<version>1.3.10</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.struts</groupId>
+			<artifactId>struts-mailreader-dao</artifactId>
+			<version>1.3.10</version>
+		</dependency>
+		<!--		<dependency>-->
+		<!--			<groupId>org.apache.struts</groupId>-->
+		<!--			<artifactId>struts-scripting</artifactId>-->
+		<!--			<version>1.3.10</version>-->
+		<!--		</dependency>-->
+		<dependency>
+			<groupId>org.apache.struts</groupId>
+			<artifactId>struts-taglib</artifactId>
+			<version>1.3.10</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.struts</groupId>
+			<artifactId>struts-tiles</artifactId>
+			<version>1.3.10</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.velocity</groupId>
+			<artifactId>velocity-tools</artifactId>
+			<version>1.3</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-servlet_2.5_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jsp_2.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-annotation_1.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-ejb_3.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jpa_1.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jta_1.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>process-resources</phase>
+						<id>copy-parent-site</id>
+						<goals>
+							<goal>run</goal>
+						</goals>
+						<configuration>
+							<tasks>
+								<echo>Copying site directory from parent</echo>
+								<copy todir="${project.build.directory}/${pom.artifactId}-2.2"
+									failonerror="false" overwrite="true">
+									<fileset dir="${pom.basedir}/../docs" />
+								</copy>
+							</tasks>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-war-plugin</artifactId>
+				<configuration>
+					<archiveClasses>false</archiveClasses>
+					<webResources>
+						<resource>
+							<directory>${pom.basedir}/src/main/resources</directory>
+							<!-- override the destination directory for this resource -->
+							<targetPath>WEB-INF/classes</targetPath>
+							<!-- enable filtering -->
+							<filtering>true</filtering>
+							<!--
+								<excludes> <exclude>**/properties</exclude> </excludes>
+							-->
+						</resource>
+						<resource>
+							<directory>${project.build.outputDirectory}</directory>
+							<includes>
+								<include>META-INF/LICENSE*</include>
+								<include>META-INF/NOTICE*</include>
+								<include>META-INF/DISCLAIMER*</include>
+							</includes>
+						</resource>
+					</webResources>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/DataCDInfoAdminServlet.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/DataCDInfoAdminServlet.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/DataCDInfoAdminServlet.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/DataCDInfoAdminServlet.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,98 @@
+package org.apache.geronimo.samples.datacdinfo.web;
+
+import java.io.IOException;
+
+import javax.ejb.EJB;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.geronimo.samples.datacdinfo.core.DataCDInfoAdminLocal;
+
+/**
+ * Servlet implementation class DataCDInfoAdminServlet
+ * 
+ * This servlet is used to demo security annotation usage on EJB.
+ */
+public class DataCDInfoAdminServlet extends HttpServlet {
+	private static final long serialVersionUID = 1L;
+
+	@EJB
+	private DataCDInfoAdminLocal admin = null;
+
+	/**
+	 * @see HttpServlet#HttpServlet()
+	 */
+	public DataCDInfoAdminServlet() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * @see Servlet#init(ServletConfig)
+	 */
+	public void init(ServletConfig config) throws ServletException {
+		super.init(config);
+	}
+
+	/**
+	 * @see Servlet#destroy()
+	 */
+	public void destroy() {
+		// TODO Auto-generated method stub
+	}
+
+	/**
+	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse
+	 *      response)
+	 */
+	protected void service(HttpServletRequest request,
+			HttpServletResponse response) throws ServletException, IOException {
+		String action = request.getParameter("action");
+
+		if (action.equals("listOwners")) {
+			String[] owners = admin.listOwners();
+			request.setAttribute("owners", owners);
+
+			this.getServletConfig().getServletContext().getRequestDispatcher("/admin/showOwners.jsp").include(request, response);
+		}
+
+		if (action.equals("listCDs")) {
+			String[] cds = admin.listAllDataCDs();
+			request.setAttribute("cds", cds);
+
+			this.getServletConfig().getServletContext().getRequestDispatcher("/admin/showCDs.jsp").include(request, response);
+
+		}
+
+		if (action.equals("findpasswd")) {
+			String ownername = request.getParameter("ownername");
+			String passwd = admin.findpasswd(ownername);
+			request.setAttribute("passwd", passwd);
+			request.setAttribute("ownername", ownername);
+
+			this.getServletConfig().getServletContext().getRequestDispatcher("/admin/showPasswd.jsp").include(request, response);
+		}
+	}
+
+	/**
+	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
+	 *      response)
+	 */
+	protected void doGet(HttpServletRequest request,
+			HttpServletResponse response) throws ServletException, IOException {
+		service(request, response);
+	}
+
+	/**
+	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
+	 *      response)
+	 */
+	protected void doPost(HttpServletRequest request,
+			HttpServletResponse response) throws ServletException, IOException {
+		service(request, response);
+	}
+
+}

Added: geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/ListOwnerServlet.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/ListOwnerServlet.java?rev=897762&view=auto
==============================================================================
--- geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/ListOwnerServlet.java (added)
+++ geronimo/samples/trunk/samples/DataCDInfo/DataCDInfo-JTA-war/src/main/java/org/apache/geronimo/samples/datacdinfo/web/ListOwnerServlet.java Mon Jan 11 06:16:40 2010
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.samples.datacdinfo.web;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnit;
+import javax.persistence.Query;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.transaction.UserTransaction;
+
+/**
+ * Servlet implementation class ListOwnerServlet
+ * 
+ * This servlet demo how to use application-managed persistence context
+ * to access database. Note that there must inject an UserTransaction resource
+ * to manually manage transaction before using EntityManager to query database.
+ */
+public class ListOwnerServlet extends HttpServlet {
+	private static final long serialVersionUID = 1L;
+    
+	@PersistenceUnit(unitName="DataCDInfoUnit") 
+	private EntityManagerFactory emf;
+	@Resource 
+	private UserTransaction utx;
+
+    /**
+     * @see HttpServlet#HttpServlet()
+     */
+    public ListOwnerServlet() {
+        super();
+        // TODO Auto-generated constructor stub
+    }
+
+	/**
+	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
+	 */
+	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		// TODO Auto-generated method stub
+		service(request,response);
+	}
+
+	/**
+	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
+	 */
+	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		// TODO Auto-generated method stub
+		service(request,response);
+	}
+	
+	protected void service(HttpServletRequest req, HttpServletResponse res)
+	  throws ServletException, IOException {		
+		
+		List<Object[]> owners = new ArrayList<Object[]>();
+		
+		EntityManager em = emf.createEntityManager();
+		try {
+			utx.begin();
+			Query query = em.createNativeQuery("select * from OWNER_TABLE");
+			owners = query.getResultList();
+			utx.commit();			
+		} catch (Exception e){
+			e.printStackTrace();
+		}
+
+		res.setContentType("text/html");
+		PrintWriter out = res.getWriter();
+	    
+	    out.print("<html>");
+	    out.print("<head><title>Registered Owners</title></head>");
+	    out.print("<body>");	    
+
+	    for (Object[] owner : owners)
+	    {
+	      out.print(owner[0].toString() + "/" + owner[1].toString() + "<br>");
+	    }
+	    
+	    //out.print(System.getProperties());
+	    out.print("</body>");
+	    out.print("</html>");
+	  }
+
+}



Mime
View raw message