You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ec...@apache.org on 2008/03/22 23:43:57 UTC
svn commit: r640109 - in /geronimo/samples/branches/1.0/migration-ejb-cmp:
./ dd/ dd/META-INF/ src/com/ src/org/ src/org/apache/
src/org/apache/geronimo/ src/org/apache/geronimo/demo/
src/org/apache/geronimo/demo/entity/ src/org/apache/geronimo/demo/en...
Author: ecraig
Date: Sat Mar 22 15:43:55 2008
New Revision: 640109
URL: http://svn.apache.org/viewvc?rev=640109&view=rev
Log:
Removed ibm classname references for migration-ejb-cmp
Added:
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java (with props)
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java (with props)
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java (with props)
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java (with props)
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/
geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java (with props)
Removed:
geronimo/samples/branches/1.0/migration-ejb-cmp/src/com/
Modified:
geronimo/samples/branches/1.0/migration-ejb-cmp/dd/META-INF/ejb-jar.xml
geronimo/samples/branches/1.0/migration-ejb-cmp/dd/customer-ejb.xml
geronimo/samples/branches/1.0/migration-ejb-cmp/maven.xml
geronimo/samples/branches/1.0/migration-ejb-cmp/project.properties
geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/WEB-INF/web.xml
geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/list.jsp
Modified: geronimo/samples/branches/1.0/migration-ejb-cmp/dd/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/dd/META-INF/ejb-jar.xml?rev=640109&r1=640108&r2=640109&view=diff
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/dd/META-INF/ejb-jar.xml (original)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/dd/META-INF/ejb-jar.xml Sat Mar 22 15:43:55 2008
@@ -7,16 +7,16 @@
</description>
<ejb-name>CustomerEJB</ejb-name>
<abstract-schema-name>customer</abstract-schema-name>
- <home>com.ibm.demo.entity.cmp.CustomerHomeRemote</home>
- <remote>com.ibm.demo.entity.cmp.CustomerRemote</remote>
- <ejb-class>com.ibm.demo.entity.cmp.CustomerBean</ejb-class>
+ <home>org.apache.geronimo.demo.entity.cmp.CustomerHomeRemote</home>
+ <remote>org.apache.geronimo.demo.entity.cmp.CustomerRemote</remote>
+ <ejb-class>org.apache.geronimo.demo.entity.cmp.CustomerBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<security-identity><use-caller-identity/></security-identity>
<resource-ref>
<description>DataSource for Demo Database</description>
- <res-ref-name>jdbc/ibm-cmp-demo</res-ref-name>
+ <res-ref-name>jdbc/geronimo-demo</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Modified: geronimo/samples/branches/1.0/migration-ejb-cmp/dd/customer-ejb.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/dd/customer-ejb.xml?rev=640109&r1=640108&r2=640109&view=diff
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/dd/customer-ejb.xml (original)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/dd/customer-ejb.xml Sat Mar 22 15:43:55 2008
@@ -29,7 +29,7 @@
<jndi-name>CustomerHomeRemote</jndi-name>
<local-jndi-name>CustomerRemote</local-jndi-name>
<resource-ref>
- <ref-name>jdbc/ibm-demo</ref-name>
+ <ref-name>jdbc/geronimo-demo</ref-name>
<resource-link>SystemDatasource</resource-link>
</resource-ref>
</entity>
Modified: geronimo/samples/branches/1.0/migration-ejb-cmp/maven.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/maven.xml?rev=640109&r1=640108&r2=640109&view=diff
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/maven.xml (original)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/maven.xml Sat Mar 22 15:43:55 2008
@@ -51,7 +51,7 @@
<goal name="run:client">
<!--<attainGoal name="jboss:start"/>-->
- <ant:java classname="com.ibm.demo.entity.client.EntityBeanClient"
+ <ant:java classname="org.apache.geronimo.demo.entity.client.EntityBeanClient"
fork="true"
failonerror="true"
classpathref="client.classpath">
Modified: geronimo/samples/branches/1.0/migration-ejb-cmp/project.properties
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/project.properties?rev=640109&r1=640108&r2=640109&view=diff
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/project.properties (original)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/project.properties Sat Mar 22 15:43:55 2008
@@ -13,14 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-maven.ejb.includes=com/ibm/demo/entity/cmp/**, com/ibm/demo/session/**
-maven.ejb.excludes=com/ibm/demo/entity/client/**
+maven.ejb.includes=org/apache/geronimo/demo/entity/cmp/**, org/apache/geronimo/demo/session/**
+maven.ejb.excludes=org/apache/geronimo/demo/entity/client/**
#maven.war.classes.includes=com/ibm/demo/mdb/servlet/**
-maven.war.classes.includes=com/ibm/demo/entity/servlet/**
+maven.war.classes.includes=org/apache/geronimo/demo/entity/servlet/**
-maven.war.classes.excludes=com/ibm/demo/entity/cmp/**, com/ibm/demo/entity/client/**
+maven.war.classes.excludes=org/apache/geronimo/demo/entity/cmp/**, org/apache/geronimo/demo/entity/client/**
maven.ejb.src=dd
Added: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java?rev=640109&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java (added)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java Sat Mar 22 15:43:55 2008
@@ -0,0 +1,98 @@
+/*
+* 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.
+*/
+/*
+ * Created on Sep 27, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.geronimo.demo.entity.client;
+
+/**
+ * @author cpineda
+ *
+ * TODO To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Style - Code Templates
+ */
+import java.rmi.RemoteException;
+import java.util.Date;
+
+import javax.naming.InitialContext;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+
+import org.apache.geronimo.demo.entity.cmp.*;
+
+public class EntityBeanClient {
+
+ public static void main(String[] arg) {
+ try {
+ Context jndiContext = getInitialContext();
+
+ String name = "CustomerHomeRemote";
+
+ Object ref = jndiContext.lookup(name);
+ System.out.println("creating home...");
+ CustomerHomeRemote home = (CustomerHomeRemote) PortableRemoteObject
+ .narrow(ref, CustomerHomeRemote.class);
+ CustomerRemote customerRemote = null;
+ System.out.println("creating customer...");
+ try{
+ System.out.println("INSERTING RECORD :"+ "1, Customer 1, 11/11/11, 2323232 , NO INFO, "+ new Double(0.0)+" , "+new Double(0.0));
+ customerRemote = home.create(new Integer(1), "Customer 1", new Date("11/11/11"), "2323232", "NO INFO", new Double(0.0),new Double(0.0));
+ System.out.println("DONE WITH THE INSERT");
+ }catch(Exception e){/* this will most likely be because the customer already exists in the database. */
+
+ }
+ System.out.print("done.");
+
+ System.out.println("findByPrimaryKeyTest... 1");
+ customerRemote = null;
+ customerRemote = home.findByPrimaryKey(new Integer(1));
+ System.out.println("customer name: "+customerRemote.getName());
+ System.out.println("customer sss no: "+customerRemote.getSssNo());
+ System.out.println("customer loan amount: "+customerRemote.getLoanAmount());
+ System.out.println("customer annual salary: "+customerRemote.getAnnualSalary());
+ System.out.println("customer birthdate: "+customerRemote.getBirthdate());
+
+ System.out.println("updating ejb...");
+ customerRemote.setName("Customer 2");
+ System.out.print("done.");
+
+ System.out.println("findBySssNoTest... 2323232");
+ customerRemote = null;
+ customerRemote = home.findBySssNo("2323232");
+ System.out.println("customer name: "+customerRemote.getName());
+ System.out.println("customer sss no: "+customerRemote.getSssNo());
+ System.out.println("customer loan amount: "+customerRemote.getLoanAmount());
+ System.out.println("customer annual salary: "+customerRemote.getAnnualSalary());
+ System.out.println("customer birthdate: "+customerRemote.getBirthdate());
+
+ customerRemote.remove();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public static Context getInitialContext()
+ throws javax.naming.NamingException {
+ return new javax.naming.InitialContext();
+ }
+}
\ No newline at end of file
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/client/EntityBeanClient.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java?rev=640109&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java (added)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java Sat Mar 22 15:43:55 2008
@@ -0,0 +1,252 @@
+/*
+* 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.
+*/
+/*
+ * Created on Sep 26, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.geronimo.demo.entity.cmp;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.Collection;
+import java.util.ArrayList;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import javax.ejb.FinderException;
+import javax.ejb.ObjectNotFoundException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+
+/**
+ * @author cpineda
+ *
+ * TODO To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Style - Code Templates
+ */
+public abstract class CustomerBean implements EntityBean {
+
+ public Integer id;
+ public String name;
+
+ public String address;
+
+ public Date birthdate;
+
+ public String sssNo;
+
+ public Double annualSalary;
+
+ public Double loanAmount;
+
+ public EntityContext context;
+
+ /**
+ *
+ * @param id
+ * @param name
+ * @param sssNo
+ * @param address
+ * @param birthdate
+ * @param annualSalary
+ * @param loanAmount
+ * @return @throws
+ * CreateException
+ */
+ public Integer ejbCreate(Integer id,String name,Date birthdate,String sssNo,String address,
+ Double annualSalary,Double loanAmount) throws CreateException{
+ setId(id);
+ setName(name);
+ setBirthdate(birthdate);
+ setSssNo(sssNo);
+ setAddress(address);
+ setAnnualSalary(annualSalary);
+ setLoanAmount(loanAmount);
+
+ return id;
+ }
+
+ /**
+ *
+ * @param id
+ * @return @throws
+ * CreateException
+ */
+ /**
+ *
+ * @param id
+ * @return @throws
+ * CreateException
+ */
+ public Integer ejbCreate(Integer id) throws CreateException {
+
+ setId(id);
+ return id;
+ }
+
+
+ /**
+ *
+ * @param id
+ * @param name
+ * @param sssNo
+ * @param address
+ * @param birthdate
+ * @param annualSalary
+ * @param loanAmount
+ */
+ public void ejbPostCreate(Integer id, String name,Date birthdate,String sssNo,String address,
+ Double annualSalary,Double loanAmount) {
+
+ }
+
+
+
+ /**
+ *
+ * @param id
+ */
+ public void ejbPostCreate(Integer id) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
+ */
+ public void setEntityContext(EntityContext context) {
+ this.context = context;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.ejb.EntityBean#unsetEntityContext()
+ */
+ public void unsetEntityContext() {
+ this.context = null;
+ }
+
+
+ public void ejbActivate() {
+ // Not implemented.
+ }
+
+ public void ejbPassivate() {
+ // Not implemented.
+ }
+
+ public void ejbLoad() {
+
+
+ }
+
+ public void ejbStore() {
+
+ }
+
+ public void ejbRemove() {}
+
+ /**
+ * @return Returns the address.
+ */
+ public abstract String getAddress();
+
+ /**
+ * @param address
+ * The address to set.
+ */
+ public abstract void setAddress(String address);
+
+ /**
+ * @return Returns the annualSalary.
+ */
+ public abstract Double getAnnualSalary();
+
+ /**
+ * @param annualSalary
+ * The annualSalary to set.
+ */
+ public abstract void setAnnualSalary(Double annualSalary);
+
+ /**
+ * @return Returns the birthdate.
+ */
+ public abstract Date getBirthdate();
+
+ /**
+ * @param birthdate
+ * The birthdate to set.
+ */
+ public abstract void setBirthdate(Date birthdate);
+
+ /**
+ * @return Returns the loanAmount.
+ */
+ public abstract Double getLoanAmount();
+
+ /**
+ * @param loanAmount
+ * The loanAmount to set.
+ */
+ public abstract void setLoanAmount(Double loanAmount);
+
+ /**
+ * @return Returns the name.
+ */
+ public abstract String getName();
+
+ /**
+ * @param name
+ * The name to set.
+ */
+ public abstract void setName(String name);
+
+ /**
+ * @return Returns the sssNo.
+ */
+ public abstract String getSssNo();
+
+ /**
+ * @param sssNo
+ * The sssNo to set.
+ */
+ public abstract void setSssNo(String sssNo);
+
+
+ /**
+ * @return Returns the ID.
+ */
+ public abstract Integer getId();
+
+ /**
+ * @param Id
+ * The Id to set.
+ */
+ public abstract void setId(Integer id);
+
+}
\ No newline at end of file
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java?rev=640109&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java (added)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java Sat Mar 22 15:43:55 2008
@@ -0,0 +1,90 @@
+/*
+* 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.
+*/
+/*
+ * Created on Sep 26, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.geronimo.demo.entity.cmp;
+
+import java.rmi.RemoteException;
+import java.util.Date;
+import java.util.Collection;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+import javax.ejb.FinderException;
+
+/**
+ * @author cpineda
+ *
+ * TODO To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Style - Code Templates
+ */
+public interface CustomerHomeRemote extends EJBHome {
+
+ /**
+ *
+ * @param id
+ * @param name
+ * @param sssNo
+ * @param address
+ * @param birthdate
+ * @param annualSalary
+ * @param loanAmount
+ * @return
+ * @throws CreateException
+ * @throws RemoteException
+ */
+ public CustomerRemote create(Integer id,String name,Date birthdate,String sssNo,String address,
+ Double annualSalary,Double loanAmount) throws CreateException,RemoteException;
+
+ /**
+ *
+ * @param primaryKey
+ * @return
+ * @throws CreateException
+ * @throws RemoteException
+ */
+ public CustomerRemote create(Integer primaryKey)throws CreateException,RemoteException;
+
+
+ /**
+ *
+ * @param pk
+ * @return @throws
+ * FinderException
+ * @throws RemoteException
+ */
+ public CustomerRemote findByPrimaryKey(Integer pk) throws FinderException,
+ RemoteException;
+
+ public Collection findAll() throws FinderException,
+ RemoteException;
+
+ /**
+ *
+ * @param sssNo
+ * @return @throws
+ * FinderException
+ * @throws RemoteException
+ */
+ public CustomerRemote findBySssNo(String sssNo) throws FinderException,
+ RemoteException;
+
+}
\ No newline at end of file
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerHomeRemote.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java?rev=640109&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java (added)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java Sat Mar 22 15:43:55 2008
@@ -0,0 +1,58 @@
+/*
+* 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.
+*/
+/*
+ * Created on Sep 26, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.geronimo.demo.entity.cmp;
+
+import java.util.Date;
+
+import javax.ejb.EJBObject;
+import java.rmi.RemoteException;
+
+/**
+ * @author cpineda
+ *
+ * TODO To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Style - Code Templates
+ */
+public interface CustomerRemote extends EJBObject {
+
+
+ public void setName(String name) throws RemoteException;
+ public String getName() throws RemoteException;
+
+ public void setSssNo(String sssNo) throws RemoteException;
+ public String getSssNo() throws RemoteException;
+
+ public void setAddress(String address) throws RemoteException;
+ public String getAddress() throws RemoteException;
+
+ public void setBirthdate(Date birthdate) throws RemoteException;
+ public Date getBirthdate() throws RemoteException;
+
+ public void setAnnualSalary(Double annualSalary) throws RemoteException;
+ public Double getAnnualSalary() throws RemoteException;
+
+ public void setLoanAmount(Double loanAmount) throws RemoteException;
+ public Double getLoanAmount() throws RemoteException;
+
+
+}
\ No newline at end of file
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/cmp/CustomerRemote.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java?rev=640109&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java (added)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java Sat Mar 22 15:43:55 2008
@@ -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.demo.entity.servlet;
+
+
+import javax.servlet.ServletException;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+
+import org.apache.geronimo.demo.entity.cmp.*;
+
+import java.text.SimpleDateFormat;
+
+import java.io.IOException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: simon
+ * Date: Nov 13, 2004
+ * Time: 10:07:03 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class PublisherServlet extends javax.servlet.http.HttpServlet {
+
+ private ServletContext ctx;
+
+ public void init() throws ServletException {
+
+ this.ctx = getServletContext();
+ }
+
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doGet(request, response);
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ RequestDispatcher rd = null;
+
+ try {
+ InitialContext jndiContext = new InitialContext();
+
+ String name = "java:comp/env/ejb/CustomerHome";
+
+ Object ref = jndiContext.lookup(name);
+ CustomerHomeRemote home = (CustomerHomeRemote) PortableRemoteObject.narrow(ref, CustomerHomeRemote.class);
+ CustomerRemote customerRemote = null;
+ System.out.println("creating customer...");
+ try{
+ Integer customerID = new Integer(request.getParameter("clientID"));
+ String customerName = request.getParameter("clientName");
+ String customerSSS = request.getParameter("clientSSS");
+ String customerAddress = request.getParameter("clientSSS");
+ String birthdate = request.getParameter("clientBirthdate");
+ Double customerSalary = new Double(request.getParameter("clientSalary"));
+ Double customerLoan = new Double(request.getParameter("loanAmt"));
+
+ customerRemote = home.create(customerID,customerName,new SimpleDateFormat("mm/dd/yyyy").parse(birthdate),customerSSS,customerAddress,customerSalary,customerLoan);
+ }catch(Exception e){/* this will most likely be because the customer already exists in the database. */ }
+
+ rd = ctx.getRequestDispatcher("/list.jsp");
+ rd.forward(request, response);
+ }
+ catch(Exception e) {
+ throw new ServletException(e);
+ }
+ }
+}
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/samples/branches/1.0/migration-ejb-cmp/src/org/apache/geronimo/demo/entity/servlet/PublisherServlet.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/WEB-INF/web.xml?rev=640109&r1=640108&r2=640109&view=diff
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/WEB-INF/web.xml (original)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/WEB-INF/web.xml Sat Mar 22 15:43:55 2008
@@ -24,7 +24,7 @@
<servlet>
<display-name>publisher</display-name>
<servlet-name>publisher</servlet-name>
- <servlet-class>com.ibm.demo.entity.servlet.PublisherServlet</servlet-class>
+ <servlet-class>org.apache.geronimo.demo.entity.servlet.PublisherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
@@ -36,8 +36,8 @@
<ejb-ref>
<ejb-ref-name>ejb/CustomerHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
- <home>com.ibm.demo.entity.cmp.CustomerHomeRemote</home>
- <remote>com.ibm.demo.entity.cmp.CustomerRemote</remote>
+ <home>org.apache.geronimo.demo.entity.cmp.CustomerHomeRemote</home>
+ <remote>org.apache.geronimo.demo.entity.cmp.CustomerRemote</remote>
</ejb-ref>
Modified: geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/list.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/list.jsp?rev=640109&r1=640108&r2=640109&view=diff
==============================================================================
--- geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/list.jsp (original)
+++ geronimo/samples/branches/1.0/migration-ejb-cmp/src/webapp/list.jsp Sat Mar 22 15:43:55 2008
@@ -16,7 +16,7 @@
-->
<%@ page import="java.util.*" %>
<%@ page import="javax.naming.*" %>
-<%@ page import="com.ibm.demo.entity.cmp.*" %>
+<%@ page import="org.apache.geronimo.demo.entity.cmp.*" %>
<%@ page import="javax.rmi.PortableRemoteObject" %>
<%