You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2007/12/02 18:01:15 UTC
svn commit: r600336 [1/2] - in /openejb/trunk/openejb3/examples/moviefun: ./
moviefun-lib/ moviefun-lib/src/ moviefun-lib/src/main/
moviefun-lib/src/main/java/ moviefun-lib/src/main/java/org/
moviefun-lib/src/main/java/org/apache/ moviefun-lib/src/main...
Author: jlaskowski
Date: Sun Dec 2 09:01:12 2007
New Revision: 600336
URL: http://svn.apache.org/viewvc?rev=600336&view=rev
Log:
Add the already-announced (in the previous commit), enhanced, m2-based moviefun
Added:
openejb/trunk/openejb3/examples/moviefun/
openejb/trunk/openejb3/examples/moviefun/README.txt (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/resources/
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/index.jsp (with props)
openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/setup.jsp (with props)
openejb/trunk/openejb3/examples/moviefun/pom.xml (with props)
Added: openejb/trunk/openejb3/examples/moviefun/README.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/README.txt?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/README.txt (added)
+++ openejb/trunk/openejb3/examples/moviefun/README.txt Sun Dec 2 09:01:12 2007
@@ -0,0 +1,17 @@
+Take the moviefun.war and put it into Tomcat's webapps directory.
+
+When the archive expands, update the openejb.home init-parameter in
+the web.xml to point to the directory where you installed OpenEJB.
+
+For example, if you have unpacked this distribution of OpenEJB in the
+directory /home/jsmith/openejb-1.0-beta1 then you would set the
+openejb.home init parameter as follows:
+
+ <init-param>
+ <param-name>openejb.home</param-name>
+ <param-value>/home/jsmith/openejb-1.0-beta1</param-value>
+ </init-param>
+
+This example has been tested on Tomcat 4.x. The status of Tomcat
+5.5.x is unknown at this time, but will be fully tested before
+OpenEJB 1.0 final is released.
Propchange: openejb/trunk/openejb3/examples/moviefun/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/README.txt
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/README.txt
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml Sun Dec 2 09:01:12 2007
@@ -0,0 +1,50 @@
+<?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>
+ <parent>
+ <artifactId>moviefun</artifactId>
+ <groupId>org.apache.openejb.examples</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.openejb.examples.moviefun</groupId>
+ <artifactId>moviefun-lib</artifactId>
+ <name>OpenEJB :: Examples :: Movie Fun :: Library</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ejb_3.0_spec</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-loader</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java Sun Dec 2 09:01:12 2007
@@ -0,0 +1,219 @@
+/**
+ * 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.openejb.examples.moviefun;
+
+import javax.ejb.SessionBean;
+import javax.ejb.EJBException;
+import javax.ejb.SessionContext;
+import javax.ejb.EJBLocalHome;
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalObject;
+import javax.ejb.RemoveException;
+import javax.naming.NamingException;
+import javax.naming.InitialContext;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NameParser;
+import java.rmi.RemoteException;
+import java.util.Hashtable;
+import java.util.Properties;
+
+/**
+ * @author David Blevins <db...@visi.com>
+ *
+ * @version $Rev$ $Date$
+ */
+public interface JndiContext extends Context {
+ public static final String LOCAL_NAME = "ContextEJBLocal";
+
+
+ /**
+ * Nested EJBLocalHome interface
+ */
+ public interface LocalHome extends EJBLocalHome {
+ JndiContext.Local create() throws CreateException;
+ }
+
+ /**
+ * Nested EJBLocalObject Interface
+ */
+ public interface Local extends EJBLocalObject, JndiContext {
+ }
+
+ /**
+ * Static LocalObject Facade
+ */
+ public static final Local LOCAL = new Local(){
+ private Local object;
+ private Local object(){
+ if (object == null){
+ object = getObject();
+ }
+ return object;
+ }
+ private Local getObject() {
+ try {
+ Properties p = new Properties(System.getProperties());
+ p.put("java.naming.factory.initial", "org.openejb.client.LocalInitialContextFactory");
+ InitialContext initialContext = new InitialContext(p);
+ LocalHome home = (LocalHome) initialContext.lookup(LOCAL_NAME);
+ return home.create();
+ } catch (NamingException e) {
+ throw (IllegalStateException) new IllegalStateException(LOCAL_NAME + " cannot be retrieved from JNDI.").initCause(e);
+ } catch (CreateException e) {
+ throw (IllegalStateException) new IllegalStateException("Cannot create session bean "+LOCAL_NAME).initCause(e);
+ }
+ }
+
+ public EJBLocalHome getEJBLocalHome() throws EJBException {
+ return getObject().getEJBLocalHome();
+ }
+
+ public java.lang.Object getPrimaryKey() throws EJBException {
+ return getObject().getPrimaryKey();
+ }
+
+ public boolean isIdentical(EJBLocalObject ejbLocalObject) throws EJBException {
+ return getObject().isIdentical(ejbLocalObject);
+ }
+
+ public void remove() throws RemoveException, EJBException {
+ getObject().remove();
+ }
+
+ public java.lang.Object lookup(Name name) throws NamingException {
+ return getObject().lookup(name);
+ }
+
+ public java.lang.Object lookup(String name) throws NamingException {
+ return getObject().lookup(name);
+ }
+
+ public void bind(Name name, java.lang.Object obj) throws NamingException {
+ getObject().bind(name, obj);
+ }
+
+ public void bind(String name, java.lang.Object obj) throws NamingException {
+ getObject().bind(name, obj);
+ }
+
+ public void rebind(Name name, java.lang.Object obj) throws NamingException {
+ getObject().rebind(name, obj);
+ }
+
+ public void rebind(String name, java.lang.Object obj) throws NamingException {
+ getObject().rebind(name, obj);
+ }
+
+ public void unbind(Name name) throws NamingException {
+ getObject().unbind(name);
+ }
+
+ public void unbind(String name) throws NamingException {
+ getObject().unbind(name);
+ }
+
+ public void rename(Name oldName, Name newName) throws NamingException {
+ getObject().rename(oldName, newName);
+ }
+
+ public void rename(String oldName, String newName) throws NamingException {
+ getObject().rename(oldName, newName);
+ }
+
+ public NamingEnumeration list(Name name) throws NamingException {
+ return getObject().list(name);
+ }
+
+ public NamingEnumeration list(String name) throws NamingException {
+ return getObject().list(name);
+ }
+
+ public NamingEnumeration listBindings(Name name) throws NamingException {
+ return getObject().listBindings(name);
+ }
+
+ public NamingEnumeration listBindings(String name) throws NamingException {
+ return getObject().listBindings(name);
+ }
+
+ public void destroySubcontext(Name name) throws NamingException {
+ getObject().destroySubcontext(name);
+ }
+
+ public void destroySubcontext(String name) throws NamingException {
+ getObject().destroySubcontext(name);
+ }
+
+ public Context createSubcontext(Name name) throws NamingException {
+ return getObject().createSubcontext(name);
+ }
+
+ public Context createSubcontext(String name) throws NamingException {
+ return getObject().createSubcontext(name);
+ }
+
+ public java.lang.Object lookupLink(Name name) throws NamingException {
+ return getObject().lookupLink(name);
+ }
+
+ public java.lang.Object lookupLink(String name) throws NamingException {
+ return getObject().lookupLink(name);
+ }
+
+ public NameParser getNameParser(Name name) throws NamingException {
+ return getObject().getNameParser(name);
+ }
+
+ public NameParser getNameParser(String name) throws NamingException {
+ return getObject().getNameParser(name);
+ }
+
+ public Name composeName(Name name, Name prefix) throws NamingException {
+ return getObject().composeName(name, prefix);
+ }
+
+ public String composeName(String name, String prefix)
+ throws NamingException {
+ return getObject().composeName(name, prefix);
+ }
+
+ public java.lang.Object addToEnvironment(String propName, java.lang.Object propVal)
+ throws NamingException {
+ return getObject().addToEnvironment(propName, propVal);
+ }
+
+ public java.lang.Object removeFromEnvironment(String propName)
+ throws NamingException {
+ return getObject().removeFromEnvironment(propName);
+ }
+
+ public Hashtable getEnvironment() throws NamingException {
+ return getObject().getEnvironment();
+ }
+
+ public void close() throws NamingException {
+ getObject().close();
+ }
+
+ public String getNameInNamespace() throws NamingException {
+ return getObject().getNameInNamespace();
+ }
+ };
+
+}
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java Sun Dec 2 09:01:12 2007
@@ -0,0 +1,181 @@
+/**
+ * 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.openejb.examples.moviefun;
+
+import javax.ejb.SessionBean;
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.ejb.SessionContext;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.NamingEnumeration;
+import javax.naming.Context;
+import javax.naming.NameParser;
+import javax.naming.InitialContext;
+import java.util.Hashtable;
+import java.rmi.RemoteException;
+
+/**
+ * Nested EJB implementation class
+ * Just delegates to this bean's java:comp/env namespace
+ *
+ * @author David Blevins <db...@visi.com>
+ *
+ * @version $Rev$ $Date$
+ */
+public class JndiContextBean implements SessionBean, JndiContext {
+ public java.lang.Object lookup(Name name) throws NamingException {
+ return context.lookup(name);
+ }
+
+ public java.lang.Object lookup(String name) throws NamingException {
+ return context.lookup(name);
+ }
+
+ public void bind(Name name, java.lang.Object obj) throws NamingException {
+ context.bind(name, obj);
+ }
+
+ public void bind(String name, java.lang.Object obj) throws NamingException {
+ context.bind(name, obj);
+ }
+
+ public void rebind(Name name, java.lang.Object obj) throws NamingException {
+ context.rebind(name, obj);
+ }
+
+ public void rebind(String name, java.lang.Object obj) throws NamingException {
+ context.rebind(name, obj);
+ }
+
+ public void unbind(Name name) throws NamingException {
+ context.unbind(name);
+ }
+
+ public void unbind(String name) throws NamingException {
+ context.unbind(name);
+ }
+
+ public void rename(Name oldName, Name newName) throws NamingException {
+ context.rename(oldName, newName);
+ }
+
+ public void rename(String oldName, String newName) throws NamingException {
+ context.rename(oldName, newName);
+ }
+
+ public NamingEnumeration list(Name name) throws NamingException {
+ return context.list(name);
+ }
+
+ public NamingEnumeration list(String name) throws NamingException {
+ return context.list(name);
+ }
+
+ public NamingEnumeration listBindings(Name name) throws NamingException {
+ return context.listBindings(name);
+ }
+
+ public NamingEnumeration listBindings(String name) throws NamingException {
+ return context.listBindings(name);
+ }
+
+ public void destroySubcontext(Name name) throws NamingException {
+ context.destroySubcontext(name);
+ }
+
+ public void destroySubcontext(String name) throws NamingException {
+ context.destroySubcontext(name);
+ }
+
+ public Context createSubcontext(Name name) throws NamingException {
+ return context.createSubcontext(name);
+ }
+
+ public Context createSubcontext(String name) throws NamingException {
+ return context.createSubcontext(name);
+ }
+
+ public java.lang.Object lookupLink(Name name) throws NamingException {
+ return context.lookupLink(name);
+ }
+
+ public java.lang.Object lookupLink(String name) throws NamingException {
+ return context.lookupLink(name);
+ }
+
+ public NameParser getNameParser(Name name) throws NamingException {
+ return context.getNameParser(name);
+ }
+
+ public NameParser getNameParser(String name) throws NamingException {
+ return context.getNameParser(name);
+ }
+
+ public Name composeName(Name name, Name prefix) throws NamingException {
+ return context.composeName(name, prefix);
+ }
+
+ public String composeName(String name, String prefix)
+ throws NamingException {
+ return context.composeName(name, prefix);
+ }
+
+ public java.lang.Object addToEnvironment(String propName, java.lang.Object propVal)
+ throws NamingException {
+ return context.addToEnvironment(propName, propVal);
+ }
+
+ public java.lang.Object removeFromEnvironment(String propName)
+ throws NamingException {
+ return context.removeFromEnvironment(propName);
+ }
+
+ public Hashtable getEnvironment() throws NamingException {
+ return context.getEnvironment();
+ }
+
+ public void close() throws NamingException {
+ context.close();
+ }
+
+ public String getNameInNamespace() throws NamingException {
+ return context.getNameInNamespace();
+ }
+
+ private Context context;
+ public void ejbCreate() throws CreateException{
+ try {
+ context = new InitialContext();
+ context = (Context) context.lookup("java:comp/env");
+ } catch (NamingException e) {
+ throw (CreateException)new CreateException().initCause(e);
+ }
+ }
+
+ public void ejbActivate() throws EJBException, RemoteException {
+ }
+
+ public void ejbPassivate() throws EJBException, RemoteException {
+ }
+
+ public void ejbRemove() throws EJBException, RemoteException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException, RemoteException {
+ }
+}
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/JndiContextBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java Sun Dec 2 09:01:12 2007
@@ -0,0 +1,50 @@
+/**
+ * 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.openejb.examples.moviefun;
+
+import java.util.Date;
+
+/**
+ * Business interface for the Movie EJB
+ *
+ * @author David Blevins <db...@visi.com>
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Movie {
+ Integer getMovieId();
+
+ String getTitle();
+
+ void setTitle(String title);
+
+ String getDirector();
+
+ void setDirector(String director);
+
+ String getGenre();
+
+ void setGenre(String genre);
+
+ int getRating();
+
+ void setRating(int rating);
+
+ Date getReleaseDate();
+
+ void setReleaseDate(Date releaseDate);
+}
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/Movie.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java Sun Dec 2 09:01:12 2007
@@ -0,0 +1,119 @@
+/**
+ * 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.openejb.examples.moviefun;
+
+import javax.ejb.CreateException;
+import javax.ejb.EntityContext;
+import javax.ejb.RemoveException;
+import java.util.Date;
+
+/**
+ * Bean class for the Movie EJB
+ *
+ * @author David Blevins <db...@visi.com>
+ *
+ * @version $Rev$ $Date$
+ */
+public class MovieBean implements javax.ejb.EntityBean, Movie {
+
+ private EntityContext entityContext;
+ public Integer movieId;
+ public String title;
+ public String director;
+ public String genre;
+ public int rating;
+ public Date releaseDate;
+
+ public Integer ejbCreate(String title, String director, String genre, int rating, Date releaseDate) throws CreateException {
+ this.title = title;
+ this.director = director;
+ this.genre = genre;
+ this.rating = rating;
+ this.releaseDate = releaseDate;
+ return null;
+ }
+
+ public Integer getMovieId() {
+ return movieId;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDirector() {
+ return director;
+ }
+
+ public void setDirector(String director) {
+ this.director = director;
+ }
+
+ public String getGenre() {
+ return genre;
+ }
+
+ public void setGenre(String genre) {
+ this.genre = genre;
+ }
+
+ public int getRating() {
+ return rating;
+ }
+
+ public void setRating(int rating) {
+ this.rating = rating;
+ }
+
+ public Date getReleaseDate() {
+ return releaseDate;
+ }
+
+ public void setReleaseDate(Date releaseDate) {
+ this.releaseDate = releaseDate;
+ }
+
+ public void ejbPostCreate(String title, String director, String genre, int rating, Date releaseDate) throws CreateException {
+ }
+
+ public void ejbActivate() {
+ }
+
+ public void ejbLoad() {
+ }
+
+ public void ejbPassivate() {
+ }
+
+ public void ejbRemove() throws RemoveException {
+ }
+
+ public void ejbStore() {
+ }
+
+ public void setEntityContext(EntityContext entityContext) {
+ this.entityContext = entityContext;
+ }
+
+ public void unsetEntityContext() {
+ this.entityContext = null;
+ }
+}
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java Sun Dec 2 09:01:12 2007
@@ -0,0 +1,110 @@
+/**
+ * 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.openejb.examples.moviefun;
+
+import javax.ejb.CreateException;
+import javax.ejb.FinderException;
+import javax.ejb.RemoveException;
+import javax.ejb.EJBException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Date;
+import java.util.Collection;
+import java.util.Properties;
+import java.text.SimpleDateFormat;
+
+/**
+ * This is actually our EJBs Local interface.
+ *
+ * Since local interfaces don't declare crazy EJB specific Exceptions
+ * in the throws clause we will choose to put our method declarations
+ * in an interface called Movie and make both the Local interface and
+ * Bean class implement it.
+ *
+ * @author David Blevins <db...@visi.com>
+ *
+ * @version $Rev$ $Date$
+ */
+public interface MovieEntity extends javax.ejb.EJBLocalObject, Movie {
+
+ /** This EJB's JNDI name */
+ public static final String NAME = "MovieEJBLocal";
+ public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy.MM.dd");
+
+ /**
+ * This is another fun trick. I prefer this to the standard service
+ * locator pattern. It makes for easy and neat looking entity creation
+ * and location, such as:
+ *
+ * MovieEntity movie = MovieEntity.Home.create(...);
+ *
+ * A home interface is essentially static, so why not really
+ * make it static.
+ *
+ * The easiest way to implement the MovieHome interface for this class
+ * declare the variable "private MovieHome home;" then use IntelliJ or
+ * Eclipse's "Delegate Methods" support.
+ */
+ public static final MovieHome Home = new MovieHome(){
+ private MovieHome home;
+ private MovieHome home(){
+ if (home == null){
+ home = lookup();
+ }
+ return home;
+ }
+ private MovieHome lookup() {
+ try {
+ Properties p = new Properties(System.getProperties());
+ p.put("java.naming.factory.initial", "org.openejb.client.LocalInitialContextFactory");
+ InitialContext initialContext = new InitialContext(p);
+ return (MovieHome) initialContext.lookup(NAME);
+ } catch (NamingException e) {
+ throw (IllegalStateException) new IllegalStateException(NAME + " cannot be retrieved from JNDI.").initCause(e);
+ }
+ }
+
+ public MovieEntity create(String title, String director, String genre, int rating, Date releaseDate) throws CreateException {
+ return home().create(title, director, genre, rating, releaseDate);
+ }
+
+ public Collection findByTitle(String title) throws FinderException {
+ return home().findByTitle(title);
+ }
+
+ public Collection findByDirector(String director) throws FinderException {
+ return home().findByDirector(director);
+ }
+
+ public Collection findByGenre(String genre) throws FinderException {
+ return home().findByGenre(genre);
+ }
+
+ public MovieEntity findByPrimaryKey(Integer key) throws FinderException {
+ return home().findByPrimaryKey(key);
+ }
+
+ public Collection findAllMovies() throws FinderException {
+ return home().findAllMovies();
+ }
+
+ public void remove(Object o) throws RemoveException, EJBException {
+ home().remove(o);
+ }
+ };
+
+}
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieEntity.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java Sun Dec 2 09:01:12 2007
@@ -0,0 +1,45 @@
+/**
+ * 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.openejb.examples.moviefun;
+
+import javax.ejb.FinderException;
+import javax.ejb.CreateException;
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * EJB Local Home interface for the Movie EJB
+ *
+ * @author David Blevins <db...@visi.com>
+ *
+ * @version $Rev$ $Date$
+ */
+public interface MovieHome extends javax.ejb.EJBLocalHome {
+
+ public MovieEntity create(String title, String director, String genre, int rating, Date releaseDate) throws CreateException;
+
+ public Collection findByTitle(String title) throws FinderException;
+
+ public Collection findByDirector(String director) throws FinderException;
+
+ public Collection findByGenre(String genre) throws FinderException;
+
+ public MovieEntity findByPrimaryKey(Integer key) throws FinderException;
+
+ public Collection findAllMovies() throws FinderException;
+
+}
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-lib/src/main/java/org/apache/openejb/examples/moviefun/MovieHome.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml Sun Dec 2 09:01:12 2007
@@ -0,0 +1,49 @@
+<?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>
+ <parent>
+ <artifactId>moviefun</artifactId>
+ <groupId>org.apache.openejb.examples</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.openejb.examples.moviefun</groupId>
+ <artifactId>moviefun-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>OpenEJB :: Examples :: Movie Fun :: WAR</name>
+ <build>
+ <finalName>moviefun</finalName>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb.examples.moviefun</groupId>
+ <artifactId>moviefun-lib</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml Sun Dec 2 09:01:12 2007
@@ -0,0 +1,73 @@
+<?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$ -->
+
+<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
+<ejb-jar>
+ <enterprise-beans>
+ <entity>
+ <ejb-name>MovieEJB</ejb-name>
+ <local-home>org.acme.movie.MovieHome</local-home>
+ <local>org.acme.movie.MovieEntity</local>
+ <ejb-class>org.acme.movie.MovieBean</ejb-class>
+ <persistence-type>Container</persistence-type>
+ <prim-key-class>java.lang.Integer</prim-key-class>
+ <reentrant>False</reentrant>
+<!-- <cmp-version>1.x</cmp-version>-->
+ <cmp-field>
+ <field-name>title</field-name>
+ </cmp-field>
+ <cmp-field>
+ <field-name>releaseDate</field-name>
+ </cmp-field>
+ <cmp-field>
+ <field-name>movieId</field-name>
+ </cmp-field>
+ <cmp-field>
+ <field-name>director</field-name>
+ </cmp-field>
+ <cmp-field>
+ <field-name>rating</field-name>
+ </cmp-field>
+ <cmp-field>
+ <field-name>genre</field-name>
+ </cmp-field>
+ <primkey-field>movieId</primkey-field>
+ <resource-ref>
+ <res-ref-name>jdbc/moviedb</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ </entity>
+ <session>
+ <ejb-name>ContextEJB</ejb-name>
+ <local-home>org.acme.movie.JndiContext$LocalHome</local-home>
+ <local>org.acme.movie.JndiContext$Local</local>
+ <ejb-class>org.acme.movie.JndiContextBean</ejb-class>
+ <session-type>Stateless</session-type>
+ <transaction-type>Bean</transaction-type>
+ <resource-ref>
+ <res-ref-name>jdbc/moviedb</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ </session>
+ </enterprise-beans>
+</ejb-jar>
\ No newline at end of file
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties Sun Dec 2 09:01:12 2007
@@ -0,0 +1,334 @@
+#
+# 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$
+#
+!---------------------------------------------------------------------
+!
+! BASIC PROPERTIES
+!
+!---------------------------------------------------------------------
+
+!
+! Path where index tables are held. Can be absolute or relative
+! to the properties file. Defaults to tablePath.
+!
+indexPath=./database/indexes
+!
+! Path where system tables are held. Can be absolute or relative to
+! the properties file. Defaults to tablePath.
+!
+systemPath=./database/system
+!
+! Path where database tables are held. Can be absolute or relative
+! to the properties file. Defaults to "current" directory.
+!
+tablePath=./database/tables
+!
+! Path where results set tables are held. Can be absolute or relative
+! to the properties file. Defaults to tablePath.
+!
+tmpPath=./database/tmp
+!
+! Non-zero means paths are relative to the properties file.
+! Default is absolute paths for files.
+!
+relativeToProperties=1
+!
+! Alternative partitions can be defined so that tables can be placed
+! in multiple locations. Each partition is numbered: 1, 2, 3,... Tables
+! can be created on partitions using the syntax
+!
+! CREATE TABLE <name> ON PARTITION <number>...
+!
+! The partition count has to be supplied.
+!
+!partitionCount=2
+!
+! The locations of each partition must be supplied. These are always
+! absolute path names.
+!
+!partition1=d:/petes
+!partition2=c:/temp
+
+
+!---------------------------------------------------------------------
+!
+! TUNING PROPERTIES
+!
+!---------------------------------------------------------------------
+
+!
+! The amount of each column to cache, expressed either as an absolute
+! number of rows or as a percentage figure. Defaults to 256 or 10 respectively.
+!
+! This value applies only when tables are first created. It has no effect
+! when a table is being re-opened.
+!
+cacheAmount=512
+!
+! CACHE_ROWS Must be one of CACHE_ROWS or CACHE_PERCENT. Determines whether
+! to cache columns in tables based on an absolute number of rows, or the
+! percentage number of rows in the table.
+!
+! This value applies only when tables are first created. It has no effect
+! when a table is being re-opened.
+!
+cacheCondition=CACHE_ROWS
+!
+! The amount of the system tables to be cached. Defaults to 100.
+!
+! This value applies only when tables are first created. It has no effect
+! when a table is being re-opened.
+!
+!systemCacheSize=10
+!
+! Similar to cacheCondition, but applies only to the system tables.
+!
+! This value applies only when tables are first created. It has no effect
+! when a table is being re-opened.
+!
+!systemCacheCondition=CACHE_ROWS
+!
+! The percentage cache hit improvement required in order to move the
+! cache to a new location in a column.
+!
+! (Currently not implemented).
+!
+cacheResetPercent=10
+!
+! Non-zero means that database changes do not get written to the
+! database immediately. See tuning.html.
+!
+fastUpdate=0
+!
+! Percentage of free space in an index that must be present before
+! the index reorganises itself. High values means frequent index
+! reorganisation. Low values means slow index inserts.
+!
+indexLoad=5
+!
+! The number of cache misses to include in calculations of the next
+! base for the cache.
+!
+! (Currently not implemented).
+!
+missesInCacheStats=100
+!
+! Non-zero means that results sets get instantiated on disk. By default
+! InstantDB holds results sets emtirely in memory (apart from Binary
+! columns). For large results sets this can be a problem. This property
+! forces all results sets to be held on disk.
+!
+resultsOnDisk=0
+!
+! Similar to cacheCondition but applies only to disk based
+! results sets. Default is CACHE_ROWS.
+!
+resultsSetCache=CACHE_ROWS
+!
+! Similar to cacheAmount but applies only to disk based
+! results sets. Default is 100.
+!
+resultsSetCacheAmount=100
+!
+! Number of rows to read into the disk read ahead buffer.
+! Recommended to be set somewhere around 128 to 256.
+! Default is 20.
+!
+rowCacheSize=128
+!
+! The read ahead buffer is effective at speeding up full
+! table scans. However for indexed lookups or multiple
+! simultaneous scans it is better to read a single row at
+! a time. Each table holds a small number of single row
+! buffers to improve such operations. Default is 8.
+!
+!singleRowCount=4
+!
+! Sometimes the look ahead buffer can be held by a single
+! thread even though it is not retrieveing many values from it.
+! If too many lookups retrieve data from the single row
+! buffers then it is better to flush the look ahead buffer and
+! make it available for re-use. Default is 128.
+!
+!flushAfterCacheMisses=64
+!
+! Number of rows to read ahead for system tables. By default
+! system tables cache everything, so it is wasteful to have large
+! read ahead buffers since they will very rarely be used. This
+! allows the size of the system read ahead buffers to be reduced
+! if necessary. Defaults to rowCacheSize.
+!
+!systemRows=20
+!
+! The control column in all tables normally has a large cache
+! since this speeds up all operation on that table. This can be
+! varied to either improve performance or to reduce space.
+! default is 8192.
+!
+! This value applies only when tables are first created. It has no effect
+! when a table is being re-opened.
+!
+!controlColCacheSize=512
+!
+! By default, InstantDB only does a cursory search for deleted rows during
+! UPDATE statements. Setting searchDeletes=1 causes more detailed searches
+! for deleted rows. This slows down UPDATE executions, but reults in more
+! compact tables. Default is 0.
+!
+searchDeletes=0
+!
+! The interval, in milliseconds, between checks for statement execution
+! timeouts. Default is 5000.
+!
+!timerCheck=5000
+
+!---------------------------------------------------------------------
+!
+! LOGGING AND DEBUGGING PROPERTIES
+!
+!---------------------------------------------------------------------
+
+!
+! Non-zero means include SQL statements in the export file.
+!
+exportSQL=0
+!
+! Non-zero means trace output also directed to console.
+! Defaults to 0.
+!
+traceConsole=0
+!
+! Relative or absolute path where exporting and tracing goes.
+!
+!traceFile=./logs/trace.log
+!
+! Bitmap of various items that can be traced. See debug.html.
+! Defaults to 0.
+!
+traceLevel=0
+
+!---------------------------------------------------------------------
+!
+! TRANSACTION AND RECOVERY PROPERTIES
+!
+!---------------------------------------------------------------------
+
+!
+! 0 means do not perform recovery on startup.
+! 1 means perform automatic recovery
+! 2 (default) means prompt the user using standard in
+!
+recoveryPolicy=1
+!
+! Sets the level of transaction journalling. See trans.html.
+! Defaults to 1.
+!
+! 0 - No journalling takes place.
+! 1 - Normal journalling (default).
+! 2 - Full journalling.
+!
+transLevel=2
+!
+! When doing an import, defines the number of rows imported
+! before the transaction is committed. Recommended value 8192.
+! defaults to 100.
+!
+transImports=100
+
+!---------------------------------------------------------------------
+!
+! DATE, TIME AND CURRENCY PROPERTIES
+!
+!---------------------------------------------------------------------
+
+!
+! Number of digits after decimal point in currency outputs. Defaults to 2.
+!
+currencyDecimal=2
+!
+! Currency symbol used in currency outputs. Defaults to $.
+!
+currencySymbol=$
+!
+! Default format for date columns. Defaults to "yyyy-mm-dd".
+!
+dateFormat=yyyy-mm-dd
+!
+! Default format for timestamp columns. Defaults to "yyyy-mm-dd hh:mm:ss.lll".
+!
+dateTimeFormat=yyyy-mm-dd hh:mm:ss.lll
+!
+! If set, then all two digit dates less than its value are interpreted
+! as 21st century dates.
+!
+!milleniumBoundary=50
+!
+! Set to 1 causes the date string "now" to store a full timestamp.
+! Default is to store only the date for fields with now hour in the
+! format string.
+!
+nowMeansTime=0
+
+!---------------------------------------------------------------------
+!
+! STRING HANDLING PROPERTIES
+!
+!---------------------------------------------------------------------
+
+!
+! If set to 1 then String hashes use the JDK Object.hashCode() function.
+! By default, uses InstantDB's String hashing.
+!
+altStringHashing=0
+!
+! Set to 1 to cause LIKE clauses to always perform case insensitive
+! comparisons.
+!
+likeIgnoreCase=0
+!
+! Same as SET LITERAL STRICT_ON. Prevents string literals being interpreted
+! as column names or numbers. Default is 0.
+!
+strictLiterals=0
+!
+! Set this value to 1 (one) if you would like PreparedStatement.setString()
+! to ignore "\" (backslash) characters when proceesing string constants.
+! When set, InstantDB will not attempt to interpret \ as the start of an
+! escape sequence. Default is 0.
+!
+!prepareIgnoresEscapes=1
+
+!---------------------------------------------------------------------
+!
+! MISCELLANEOUS PROPERTIES
+!
+!---------------------------------------------------------------------
+
+!
+! Allows selected InstantDB keywords to be un-reserved.
+! e.g. ignoreKeywords=url,quote would allow the keywords
+! url and quote to be used as table or column names.
+!
+! This faciliy is provided for compatatbility reasons only.
+! It's use is not recommended AND IS NOT SUPPORTED.
+!
+!ignoreKeywords
+!
+! Non-zero means database is opened in read only mode.
+!
+readOnly=0
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/instantdb.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties Sun Dec 2 09:01:12 2007
@@ -0,0 +1,61 @@
+#
+# 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$
+#
+###########################################################################
+# Configuration file for logging in OpenEJB
+#
+# OpenEJB uses Apache Log4j to provide logging services
+# to the container system.
+#
+# This file configures log4j using the properties file
+# format declared by the class PropertyConfigurator
+#
+# For a complete reference on log4j property
+# configuration, visit:
+#
+# http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html
+#
+# This file is designated as the log4j configuration file
+# when the system property, log4j.configuration, is set
+# as follows:
+#
+# java -Dlog4j.configuration=file:conf/logging.conf
+#
+# Any other file could be set as the log4j configuration
+# file using that file name instead. For example, to
+# set the logging configuration using logging.xml, set
+# the log4j.configuration system property as follows:
+#
+# java -Dlog4j.configuration=file:conf/logging.xml
+#
+# For more information on specifying log4j configuration
+# files, visit:
+#
+# http://jakarta.apache.org/log4j/docs/manual.html
+#
+#
+
+log4j.category.OpenEJB = warn, R
+log4j.category.OpenEJB.startup = debug
+
+log4j.appender.R = org.apache.log4j.RollingFileAppender
+log4j.appender.R.File = openejb.log
+log4j.appender.R.MaxFileSize = 1000KB
+log4j.appender.R.MaxBackupIndex = 3
+log4j.appender.R.layout = org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern = %d [%t] %-5p - %m%n
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/log4j.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml Sun Dec 2 09:01:12 2007
@@ -0,0 +1,58 @@
+<?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$ -->
+
+<!-- The purpose of this file is essentially to map you ejb-jar.xml to the openejb.xml -->
+<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
+ <ejb-deployment ejb-name="MovieEJB" deployment-id="MovieEJB" container-id="Movie CMP Container">
+ <resource-link res-ref-name="jdbc/moviedb" res-id="Movie Database Connector"/>
+ <query>
+ <query-method>
+ <method-name>findByTitle</method-name>
+ <method-params><method-param>java.lang.String</method-param></method-params>
+ </query-method>
+ <object-ql>SELECT movie FROM org.acme.movie.MovieBean movie WHERE movie.title = $1</object-ql>
+ </query>
+ <query>
+ <query-method>
+ <method-name>findByDirector</method-name>
+ <method-params><method-param>java.lang.String</method-param></method-params>
+ </query-method>
+ <object-ql>SELECT movie FROM org.acme.movie.MovieBean movie WHERE movie.director = $1</object-ql>
+ </query>
+ <query>
+ <query-method>
+ <method-name>findByGenre</method-name>
+ <method-params><method-param>java.lang.String</method-param></method-params>
+ </query-method>
+ <object-ql>SELECT movie FROM org.acme.movie.MovieBean movie WHERE movie.genre = $1</object-ql>
+ </query>
+ <query>
+ <query-method>
+ <method-name>findAllMovies</method-name>
+ <method-params/>
+ </query-method>
+ <object-ql>SELECT movie FROM org.acme.movie.MovieBean movie</object-ql>
+ </query>
+ </ejb-deployment>
+ <ejb-deployment ejb-name="ContextEJB" deployment-id="ContextEJB" container-id="Default Stateless Container">
+ <resource-link res-ref-name="jdbc/moviedb" res-id="Movie Database Connector"/>
+ </ejb-deployment>
+</openejb-jar>
\ No newline at end of file
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml Sun Dec 2 09:01:12 2007
@@ -0,0 +1,40 @@
+<?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$ -->
+
+<openejb>
+
+<Container id="Movie CMP Container" ctype="CMP_ENTITY">
+ Global_TX_Database META-INF/cmp.global-database.xml
+ Local_TX_Database META-INF/cmp.local-database.xml
+</Container>
+
+<Container id="Default Stateless Container" ctype="STATELESS"/>
+
+<Connector id="Movie Database Connector">
+ JdbcDriver org.enhydra.instantdb.jdbc.idbDriver
+ JdbcUrl jdbc:idb:META-INF/instantdb.properties
+ UserName Admin
+ Password pass
+</Connector>
+
+<Deployments dir="." />
+
+</openejb>
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/META-INF/openejb.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml Sun Dec 2 09:01:12 2007
@@ -0,0 +1,48 @@
+<?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$ -->
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <servlet>
+ <servlet-name>loader</servlet-name>
+ <servlet-class>org.apache.openejb.loader.LoaderServlet</servlet-class>
+
+ <init-param>
+ <param-name>openejb.home</param-name>
+ <param-value>/Users/dblevins/work/openejb3/assembly-standalone/target/openejb-3.0-SNAPSHOT-incubating</param-value>
+ </init-param>
+
+ <init-param>
+ <param-name>openejb.loader</param-name>
+ <param-value>tomcat-webapp</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>loader</servlet-name>
+ <url-pattern>/remote/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css Sun Dec 2 09:01:12 2007
@@ -0,0 +1,180 @@
+<?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$ -->
+
+body, p, td, table, tr, .bodytext, .stepfield {
+ font-family: Verdana, arial, sans-serif;
+ font-size: 11px;
+ line-height: 16px;
+ color: #000000;
+ font-weight: normal;
+}
+
+body {
+ margin: 0px;
+ padding: 0px;
+ text-align: center;
+ background-color: #f0f0f0;
+}
+
+#Content {
+ text-align: left;
+ background-color: #fff;
+ padding: 0px;
+ margin: 0px;
+}
+
+HR {
+ color: 3c78b5;
+ height: 1;
+}
+
+A:link, A:visited, A:active, A:hover {
+ color: #003366;
+}
+
+h1 A:link, h1 A:visited, h1 A:active {
+ text-decoration: none;
+}
+
+h1 A:hover {
+ border-bottom: 1px dotted #003366;
+}
+
+input {
+ font-family: verdana, geneva, arial, sans-serif;
+ font-size: 11px;
+ color: #000000;
+}
+
+h1 {
+ font-size: 24px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ color: #003366;
+ border-bottom: 1px solid #3c78b5;
+ padding: 2px;
+ margin: 36px 0px 4px 0px;
+}
+
+h2 {
+ font-size: 18px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ border-bottom: 1px solid #3c78b5;
+ padding: 2px;
+ margin: 27px 0px 4px 0px;
+}
+
+h3 {
+ font-size: 14px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 21px 0px 4px 0px;
+}
+
+h4 {
+ font-size: 12px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 18px 0px 4px 0px;
+}
+
+h4.search {
+ font-size: 12px;
+ line-height: normal;
+ font-weight: normal;
+ background-color: #f0f0f0;
+ padding: 4px;
+ margin: 18px 0px 4px 0px;
+}
+
+h5 {
+ font-size: 10px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 14px 0px 4px 0px;
+}
+
+h6 {
+ font-size: 8px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 14px 0px 4px 0px;
+}
+
+.smalltext {
+ color: #666666;
+ font-size: 10px;
+}
+.smalltext a {
+ color: #666666;
+}
+
+.tableview table {
+ margin: 0;
+}
+
+.tableview th {
+ text-align: left;
+ color: #003366;
+ font-size: 12px;
+ padding: 5px 0px 0px 5px;
+ border-bottom: 2px solid #3c78b5;
+}
+.tableview td {
+ text-align: left;
+ border-color: #ccc;
+ border-width: 0px 0px 1px 0px;
+ border-style: solid;
+ margin: 0;
+ padding: 4px 10px 4px 5px;
+}
+
+.bottomshadow {
+ height: 12px;
+ background-image: url("/images/border/border_bottom.gif");
+ background-repeat: repeat-x;
+}
+
+.topBarDiv a:link {color: white;}
+.topBarDiv a:visited {color: white;}
+.topBarDiv a:active {color: white;}
+.topBarDiv a:hover {color: white;}
+.topBarDiv {color: white;}
+
+.topBar td {
+ background-color: #003366;
+}
+
+
+.basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%}
+.basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;}
+.basicPanelBody {padding: 5px; margin: 0px}
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css
------------------------------------------------------------------------------
svn:executable = *
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/default.css
------------------------------------------------------------------------------
svn:mime-type = text/css
Added: openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/index.jsp?rev=600336&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/index.jsp (added)
+++ openejb/trunk/openejb3/examples/moviefun/moviefun-webapp/src/main/webapp/index.jsp Sun Dec 2 09:01:12 2007
@@ -0,0 +1,224 @@
+<?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$ -->
+
+<%@ page import="java.util.Collection,
+ org.apache.openejb.examples.moviefun.MovieEntity,
+ java.util.Iterator,
+ org.apache.openejb.examples.moviefun.Movie,
+ java.util.Date,
+ java.io.PrintStream,
+ java.util.Map,
+ java.util.HashMap,
+ java.util.ListIterator,
+ java.util.List,
+ javax.ejb.FinderException"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+ List movies = null;
+ ListIterator listIterator = null;
+ int display = 5;
+ String action = request.getParameter("action");
+
+ if ("Add".equals(action)) {
+
+ String title = request.getParameter("title");
+ String director = request.getParameter("director");
+ String genre = request.getParameter("genre");
+ int rating = Integer.parseInt(request.getParameter("rating"));
+ String dateString = request.getParameter("releaseDate").replaceFirst("^([0-9]{4}$)","$1.01.01");
+ Date releaseDate = MovieEntity.DATE_FORMAT.parse(dateString);
+
+ MovieEntity.Home.create(title, director, genre, rating, releaseDate);
+
+ } else if ("Remove".equals(action)) {
+
+ String[] ids = request.getParameterValues("id");
+ for (int i = 0; i < ids.length; i++) {
+ String id = ids[i];
+ MovieEntity.Home.remove(new Integer(id));
+ }
+
+ } else if (">>".equals(action)) {
+
+ movies = (List) session.getAttribute("movies.collection");
+ listIterator = (ListIterator) session.getAttribute("movies.iterator");
+
+ } else if ("<<".equals(action)) {
+
+ movies = (List) session.getAttribute("movies.collection");
+ listIterator = (ListIterator) session.getAttribute("movies.iterator");
+ for (int i=display*2; i > 0 && listIterator.hasPrevious(); i-- ) {
+ listIterator.previous(); // backup
+ }
+
+ } else if ("findByTitle".equals(action)) {
+
+ movies = (List) MovieEntity.Home.findByTitle(request.getParameter("key"));
+
+ } else if ("findByDirector".equals(action)) {
+
+ movies = (List) MovieEntity.Home.findByDirector(request.getParameter("key"));
+
+ } else if ("findByGenre".equals(action)) {
+
+ movies = (List) MovieEntity.Home.findByGenre(request.getParameter("key"));
+ }
+
+ if (movies == null){
+ try {
+ movies = (List) MovieEntity.Home.findAllMovies();
+ } catch (Throwable e) {
+ // We must not have run setup yet
+ response.sendRedirect("setup.jsp");
+ return;
+ }
+ }
+
+ if (listIterator == null) {
+ listIterator = movies.listIterator();
+ }
+
+ session.setAttribute("movies.collection", movies);
+ session.setAttribute("movies.iterator", listIterator);
+%>
+<html>
+<head><title>Moviefun :: Index</title>
+<link rel="stylesheet" href="default.css" type="text/css" />
+
+</head>
+<body>
+<p/>
+<div id="Content">
+<table>
+<tr>
+<td>
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr class="topBar">
+ <td align="left" width="85%">
+ <span class="topBarDiv">Mini-Movie Application</span>
+ </td>
+ <td align="right" valign="middle" width="1%" nowrap>
+ <form method="POST" action="index.jsp" name="findMovie" style="padding: 1px; margin: 1px">
+ <select name="action">
+ <option value="findByTitle">Title</option>
+ <option value="findByDirector">Director</option>
+ <option value="findByGenre">Genre</option>
+ </select>
+ <input type="text" name="key" size="20"/>
+ <input type="submit" value="Search"/></td>
+ </form>
+ </td>
+ </tr>
+ </table>
+
+</td>
+</tr>
+<tr>
+<td>
+ <div class="basicPanelContainer" style="width: 100%">
+
+ <div class="basicPanelTitle">Movies</div>
+
+ <div class="basicPanelBody">
+ <form method="POST" action="index.jsp" name="listMovies" style="padding: 1px; margin: 1px">
+ <table class="tableview" width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
+ <tr>
+ <th>Title</th>
+ <th>Director</th>
+ <th>Genre</th>
+ <th>Rating</th>
+ <th>Year</th>
+ <th> </th>
+ </tr>
+ <%
+ int start = listIterator.nextIndex();
+ for (int i=display; i > 0 && listIterator.hasNext(); i-- ) {
+ Movie movie = (Movie) listIterator.next();
+ %>
+ <tr>
+ <td width="200"><%=movie.getTitle()%></td>
+ <td width="120"><%=movie.getDirector()%></td>
+ <td width="90"><%=movie.getGenre()%></td>
+ <td width="50"><%=movie.getRating()%></td>
+ <td width="50"><%=movie.getReleaseDate().getYear()+1900%></td>
+ <td><input type="checkbox" name="id" value="<%=movie.getMovieId()%>"></td>
+ </tr>
+
+ <% } %>
+ </table>
+ <table width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
+ <tr>
+ <td>
+ <% if (start!=0&&listIterator.hasPrevious()){%><input type="submit" name="action" value="<<"/><%}%>
+
+ <%=start+1%> - <%=listIterator.nextIndex()%> of <%=movies.size()%>
+
+ <% if (listIterator.hasNext()){%><input type="submit" name="action" value=">>"/><%}%>
+ </td>
+ <td align="right">
+ <input type="submit" name="action" value="Remove"/>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </div>
+</td>
+</tr>
+<tr>
+<td>
+ <div class="basicPanelContainer" style="width: 100%">
+ <div class="basicPanelTitle">Add</div>
+ <div class="basicPanelBody">
+ <form method="POST" action="index.jsp" name="addMovie" style="padding: 1px; margin: 1px">
+ <table width="100%" cellspacing="0" cellpadding="0" style="padding: 0px">
+ <tr>
+ <td width="200"><input type="text" name="title" size="29"/></td>
+ <td width="120"><input type="text" name="director" size="17"/></td>
+ <td width="90"><input type="text" name="genre" size="14"/></td>
+ <td width="50"><input type="text" name="rating" size="7"/></td>
+ <td width="50"><input type="text" name="releaseDate" size="7"/></td>
+ <td><input type="submit" name="action" value="Add"/></td>
+ </tr>
+ </table>
+ </form>
+
+ </div>
+ </div>
+</td>
+</tr>
+</table>
+
+
+ <div class="bottomshadow"></div>
+
+ <div id="poweredby" class="smalltext">
+ Powered by
+ <a href="http://jakarta.apache.org/tomcat" class="smalltext">Apache Tomcat</a> and
+ <a href="http://www.openejb.org" class="smalltext">OpenEJB</a>.
+ <a href="http://jira.codehaus.org/secure/BrowseProject.jspa?id=10401" class="smalltext">Bug/feature request</a>
+ <br/>
+ </div>
+
+
+</div>
+</body>
+</html>