You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gi...@apache.org on 2006/07/05 18:12:03 UTC

svn commit: r419268 [1/2] - in /cocoon/whiteboard/example-apps/bricks-archetype: ./ src/main/java/org/apache/cocoon/apps/bricks/persistence/ src/main/java/org/apache/cocoon/apps/bricks/persistence/hsql/ src/main/java/org/apache/cocoon/apps/bricks/persi...

Author: giacomo
Date: Wed Jul  5 09:12:02 2006
New Revision: 419268

URL: http://svn.apache.org/viewvc?rev=419268&view=rev
Log:
added OJB support and OjbObjectStore implementation. Bertrand, it was that difficult, took me perhaps 4h

Added:
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/DAO.java
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/hsql/
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/hsql/HsqlProperties.java
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/OjbObjectStore.java
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB-logging.properties
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB.properties
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/repository.dtd
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/repository.xml
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/repository_bricks.xml
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/repository_database.xml
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/repository_internal.xml
Modified:
    cocoon/whiteboard/example-apps/bricks-archetype/pom.xml
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/ObjectStore.java
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/DummyObjectStore.java
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/flow/document-editor.js
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/sitemap.xmap
    cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/META-INF/spring/cocoon-bricks-application-components.xml

Modified: cocoon/whiteboard/example-apps/bricks-archetype/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/pom.xml?rev=419268&r1=419267&r2=419268&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/pom.xml (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/pom.xml Wed Jul  5 09:12:02 2006
@@ -1,39 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-  
-  Licensed 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.
--->
-<!--+
-  | @version $Id: pom.xml 410330 2006-05-30 17:57:42Z cziegeler $
-  |
-  +-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
-  <modelVersion>4.0.0</modelVersion>
-  
+<?xml version="1.0" encoding="UTF-8"?><project>
   <parent>
-    <groupId>org.apache.cocoon</groupId>
     <artifactId>cocoon-core-modules</artifactId>
-    <version>1-SNAPSHOT</version>    
+    <groupId>org.apache.cocoon</groupId>
+    <version>1-SNAPSHOT</version>
   </parent>
-  
+  <modelVersion>4.0.0</modelVersion>
   <artifactId>cocoon-bricks</artifactId>
-  <packaging>jar</packaging>
   <name>Cocoon Bricks Archetype Prototype</name>
-  
   <build>
+    <finalName>cocoon-webapp</finalName>
     <plugins>
       <plugin>
         <groupId>org.apache.cocoon</groupId>
@@ -59,9 +34,18 @@
         </configuration>
       </plugin>
     </plugins>
-    <finalName>cocoon-webapp</finalName>
   </build>
-  
+  <pluginRepositories>
+    <pluginRepository>
+      <id>snapshots</id>
+      <url>http://snapshots.maven.codehaus.org/maven2</url>
+    </pluginRepository>
+    <pluginRepository>
+      <id>mortbay-repo</id>
+      <name>mortbay-repo</name>
+      <url>http://www.mortbay.org/maven2/release</url>
+    </pluginRepository>
+  </pluginRepositories>
   <dependencies>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
@@ -78,18 +62,35 @@
       <artifactId>cocoon-forms-impl</artifactId>
       <version>1.0.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>aopalliance</groupId>
+      <artifactId>aopalliance</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>1.8.0.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-dao</artifactId>
+      <version>2.0-rc1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jdbc</artifactId>
+      <version>2.0-rc1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-ojb</artifactId>
+      <version>2.0-rc1</version>
+    </dependency>
+    <dependency>
+      <groupId>ojb</groupId>
+      <artifactId>db-ojb</artifactId>
+      <version>1.0.4</version>
+    </dependency>
   </dependencies>
-  
-  <pluginRepositories>
-    <pluginRepository>
-      <id>snapshots</id>
-      <url>http://snapshots.maven.codehaus.org/maven2</url>
-    </pluginRepository>
-    <pluginRepository>
-      <id>mortbay-repo</id>
-      <name>mortbay-repo</name>
-      <url>http://www.mortbay.org/maven2/release</url>
-    </pluginRepository>
-  </pluginRepositories>
-  
-</project>
+</project>
\ No newline at end of file

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/DAO.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/DAO.java?rev=419268&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/DAO.java (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/DAO.java Wed Jul  5 09:12:02 2006
@@ -0,0 +1,24 @@
+/*
+ * Copyright 1999-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cocoon.apps.bricks.persistence;
+
+/**
+ * Data Access Object (DAO) interface.   This is an empty interface
+ * used to tag our DAO classes.  Common methods for each interface
+ * could be added here.
+ */
+public interface DAO {
+}

Modified: cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/ObjectStore.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/ObjectStore.java?rev=419268&r1=419267&r2=419268&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/ObjectStore.java (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/ObjectStore.java Wed Jul  5 09:12:02 2006
@@ -20,7 +20,7 @@
 import java.util.Map;
 
 /** Store and retrieve java objects */
-public interface ObjectStore {
+public interface ObjectStore extends DAO {
 
     /** data objects implement this to provide a key object for retrieval */
     static interface TemplateObjectProvider {
@@ -31,7 +31,10 @@
     void store(Object o) throws Exception;
 
     /** generic object retrieval */
-    Object queryByKey(Object exampleHavingSpecifiedKey,boolean forWriting) throws Exception;
+    Object queryByKey(Object exampleHavingSpecifiedKey) throws Exception;
+
+    /** generic object retrieval */
+    Object queryByKeyForUpdate(Object exampleHavingSpecifiedKey) throws Exception;
 
     /** create a template object, as needed for queryByKey */
     Object getTemplateObject(Class clazz,int key) throws Exception;

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/hsql/HsqlProperties.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/hsql/HsqlProperties.java?rev=419268&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/hsql/HsqlProperties.java (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/hsql/HsqlProperties.java Wed Jul  5 09:12:02 2006
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2006 Otego AG, Switzerland
+ *
+ * Licensed 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.cocoon.apps.bricks.persistence.hsql;
+
+/**
+ * This class
+ *
+ * @author <a href="mailto:info@otego.com">Otego AG, Switzerland</a>
+ * @version $Id$
+  */
+public class HsqlProperties
+    extends org.hsqldb.persist.HsqlProperties
+{
+    //~ Methods -----------------------------------------------------------------------------------------
+
+    /**
+     * The method
+     *
+     * @param path The <code>path</code>
+     */
+    public void setDatabase0( final String path )
+    {
+        super.setProperty( "server.database.0", path );
+    }
+
+    /**
+     * The method
+     *
+     * @param path The <code>path</code>
+     */
+    public void setDatabase1( final String path )
+    {
+        super.setProperty( "server.database.1", path );
+    }
+
+    /**
+     * The method
+     *
+     * @param path The <code>path</code>
+     */
+    public void setDatabase2( final String path )
+    {
+        super.setProperty( "server.database.2", path );
+    }
+
+    /**
+     * The method
+     *
+     * @param path The <code>path</code>
+     */
+    public void setDatabase3( final String path )
+    {
+        super.setProperty( "server.database.3", path );
+    }
+
+    /**
+     * The method
+     *
+     * @param path The <code>path</code>
+     */
+    public void setDatabase4( final String path )
+    {
+        super.setProperty( "server.database.4", path );
+    }
+
+    /**
+     * The method
+     *
+     * @param name The <code>name</code>
+     */
+    public void setDbName0( final String name )
+    {
+        super.setProperty( "server.dbname.0", name );
+    }
+
+    /**
+     * The method
+     *
+     * @param name The <code>name</code>
+     */
+    public void setDbName1( final String name )
+    {
+        super.setProperty( "server.dbname.1", name );
+    }
+
+    /**
+     * The method
+     *
+     * @param name The <code>name</code>
+     */
+    public void setDbName2( final String name )
+    {
+        super.setProperty( "server.dbname.2", name );
+    }
+
+    /**
+     * The method
+     *
+     * @param name The <code>name</code>
+     */
+    public void setDbName3( final String name )
+    {
+        super.setProperty( "server.dbname.3", name );
+    }
+
+    /**
+     * The method
+     *
+     * @param name The <code>name</code>
+     */
+    public void setDbName4( final String name )
+    {
+        super.setProperty( "server.dbname.4", name );
+    }
+
+    /**
+     * The method
+     *
+     * @param port The <code>port</code>
+     */
+    public void setPort( final int port )
+    {
+        super.setProperty( "server.port", port );
+    }
+
+    /**
+     * The method
+     *
+     * @param silence The <code>silence</code>
+     */
+    public void setSilent( final boolean silent )
+    {
+        super.setProperty( "server.silent", silent );
+    }
+
+    /**
+     * The method
+     *
+     * @param trace The <code>trace</code>
+     */
+    public void setTrace( final boolean trace )
+    {
+        super.setProperty( "server.trace", trace );
+    }
+}

Modified: cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/DummyObjectStore.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/DummyObjectStore.java?rev=419268&r1=419267&r2=419268&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/DummyObjectStore.java (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/DummyObjectStore.java Wed Jul  5 09:12:02 2006
@@ -22,7 +22,6 @@
 
 import org.apache.cocoon.apps.bricks.data.BricksDocument;
 import org.apache.cocoon.apps.bricks.persistence.ObjectStore;
-import org.apache.cocoon.apps.bricks.persistence.ObjectStore.QueryParameters;
 
 /** Dummy object store, temporary until we get a database working */
 public class DummyObjectStore implements ObjectStore {
@@ -60,12 +59,19 @@
 		return null;
 	}
 
-	/* (non-Javadoc)
-	 * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#queryByKey(java.lang.Object, boolean)
-	 */
-	public Object queryByKey(Object exampleHavingSpecifiedKey, boolean forWriting) throws Exception {
-		return dummyDoc;
-	}
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#queryByKey(java.lang.Object)
+     */
+    public Object queryByKey(Object exampleHavingSpecifiedKey) throws Exception {
+        return dummyDoc;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#queryByKeyForUpdate(java.lang.Object)
+     */
+    public Object queryByKeyForUpdate(Object exampleHavingSpecifiedKey) throws Exception {
+        return dummyDoc;
+    }
 
 	/* (non-Javadoc)
 	 * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#runQuery(org.apache.cocoon.apps.bricks.persistence.ObjectStore.QueryParameters)

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/OjbObjectStore.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/OjbObjectStore.java?rev=419268&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/OjbObjectStore.java (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/java/org/apache/cocoon/apps/bricks/persistence/impl/OjbObjectStore.java Wed Jul  5 09:12:02 2006
@@ -0,0 +1,151 @@
+/*
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.cocoon.apps.bricks.persistence.impl;
+
+import org.apache.cocoon.apps.bricks.data.BricksDocument;
+import org.apache.cocoon.apps.bricks.persistence.ObjectStore;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ojb.broker.query.Criteria;
+import org.apache.ojb.broker.query.QueryByCriteria;
+import org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+/** Dummy object store, temporary until we get a database working */
+public class OjbObjectStore extends PersistenceBrokerDaoSupport implements ObjectStore {
+
+    private static Log log = LogFactory.getLog(OjbObjectStore.class);
+	private BricksDocument dummyDoc;
+    private DataSource dataSource;
+	
+    /** we'll build OJB Criterias our of this map each key corresponding a property */
+    static class QueryParametersImpl extends HashMap implements QueryParameters {
+    }
+
+    /* (non-Javadoc)
+	 * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#createNew(java.lang.Class)
+	 */
+	public Object createNew(Class clazz) throws Exception {
+		return clazz.newInstance();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#createParameters()
+	 */
+	public QueryParameters createParameters() {
+		return new QueryParametersImpl();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#getTemplateObject(java.lang.Class, int)
+	 */
+	public Object getTemplateObject(Class clazz, int key) throws Exception {
+		return null;
+	}
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#queryByKey(java.lang.Object)
+     */
+    public Object queryByKey(Object exampleHavingSpecifiedKey) throws Exception {
+        if (!(exampleHavingSpecifiedKey instanceof BricksDocument)) {
+            throw new IllegalArgumentException("cannot handle objects of class " + exampleHavingSpecifiedKey.getClass().getName());
+        }
+        return dummyDoc;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#queryByKeyForUpdate(java.lang.Object)
+     */
+    public Object queryByKeyForUpdate(Object exampleHavingSpecifiedKey) throws Exception {
+        return queryByKey(exampleHavingSpecifiedKey);
+    }
+
+	/* (non-Javadoc)
+	 * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#runQuery(org.apache.cocoon.apps.bricks.persistence.ObjectStore.QueryParameters)
+	 */
+	public Collection runQuery(QueryParameters params) throws Exception {
+        final Criteria criteria = new Criteria();
+        for (final Iterator entries = params.entrySet().iterator(); entries.hasNext();) {
+            final Map.Entry entry = (Map.Entry)entries.next();
+            criteria.addEqualTo((String)entry.getKey(), entry.getValue());
+        }
+        final QueryByCriteria query = new QueryByCriteria(BricksDocument.class,criteria);
+        return getPersistenceBrokerTemplate().getCollectionByQuery(query);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.cocoon.apps.bricks.persistence.ObjectStore#store(java.lang.Object)
+	 */
+	public void store(Object o) throws Exception {
+        getPersistenceBrokerTemplate().store(o);
+	}
+    
+    public void remove(Object o) {
+        getPersistenceBrokerTemplate().delete(o);
+    }
+
+    public Object getObjectById(final Long id) {
+        return getPersistenceBrokerTemplate().getObjectById(BricksDocument.class, id);
+    }
+    
+    /**
+     * This is just to make sure we do have the database initialized
+     *
+     */
+    public void initialize() throws Exception {
+        final Connection connection = getDataSource().getConnection();
+        final Statement statement = connection.createStatement();
+        try {
+            final ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM BRICKS_DOCUMENT");
+            resultSet.close();
+        } catch(final SQLException se) {
+            // create the table
+            final String createSQL = "CREATE TABLE BRICKS_DOCUMENT (" +
+            "OP_LOCK_VERSION INTEGER NOT NULL," +
+            "CREATED TIMESTAMP NOT NULL," +
+            "LAST_MODIFIED TIMESTAMP NOT NULL," +
+            "ID INTEGER NOT NULL," +
+            "TITLE VARCHAR(128) NOT NULL," +
+            "CONTENT VARCHAR(32767) NOT NULL," +
+            "PRIMARY KEY (ID))";
+            statement.execute(createSQL);
+        } finally {
+            statement.close();
+            connection.close();
+        }
+    }
+
+    public DataSource getDataSource()
+    {
+        return dataSource;
+    }
+
+    public void setDataSource(final DataSource dataSource)
+    {
+        this.dataSource = dataSource;
+    }
+}

Modified: cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/flow/document-editor.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/flow/document-editor.js?rev=419268&r1=419267&r2=419268&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/flow/document-editor.js (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/flow/document-editor.js Wed Jul  5 09:12:02 2006
@@ -17,10 +17,11 @@
 // document editor flowscript
 
 cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
-cocoon.load("example-text.js");
+cocoon.load("flow/example-text.js");
 
 var DOC_CLASS = Packages.org.apache.cocoon.apps.bricks.data.BricksDocument;
 var OS_BEAN = "ObjectStore";
+var OBJECT_STORE = "org.apache.cocoon.apps.bricks.persistence.ObjectStore";
 
 // called by the handleForm to run the document editor form
 function form_editDocument(form) {
@@ -28,7 +29,9 @@
     var docId = cocoon.parameters.docId;
     var formDisplayPipeline = cocoon.parameters.formDisplayURI;
     var nextURI = cocoon.parameters.nextURI;
-    var objectStore = cocoon.getComponent(OS_BEAN);
+    cocoon.log.info("@@@@@@@@ before " + OBJECT_STORE);
+    var objectStore = cocoon.getComponent("ObjectStore");
+    cocoon.log.info("@@@@@@@@ after " + objectStore);
     var document = null;
     var createDocument = (docId=="NEW_DOCUMENT");
 
@@ -94,5 +97,9 @@
 // retrieve document by ID
 function getDocument(objectStore,docId,forEditing) {
     var key = objectStore.getTemplateObject(DOC_CLASS,docId);
-    return objectStore.queryByKey(key,forEditing);
-}
\ No newline at end of file
+    if(forEditing) {
+        return objectStore.queryByKeyForUpdate(key);
+    } else {
+        return objectStore.queryByKey(key);
+    }
+}

Modified: cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/sitemap.xmap?rev=419268&r1=419267&r2=419268&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/sitemap.xmap (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/COB-INF/admin/document-editor/sitemap.xmap Wed Jul  5 09:12:02 2006
@@ -121,7 +121,7 @@
         <map:generate type="jx" src="forms/{1}-template.xml"/>
         <map:transform type="i18n"/>
         <map:transform src="../xslt/page-to-html.xsl"/>
-        <map:transform src="context://common/forms/form-styling.xsl">
+        <map:transform src="../../common/forms/form-styling.xsl">
           <map:parameter name="resources-uri" value="admin-resources"/>
         </map:transform>
         <map:transform type="i18n"/>

Modified: cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/META-INF/spring/cocoon-bricks-application-components.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/META-INF/spring/cocoon-bricks-application-components.xml?rev=419268&r1=419267&r2=419268&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/META-INF/spring/cocoon-bricks-application-components.xml (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/META-INF/spring/cocoon-bricks-application-components.xml Wed Jul  5 09:12:02 2006
@@ -4,17 +4,17 @@
 <!-- 
   Note the Spring bug (fixed now, but still present in the version we use:
   DOCTYPE has to be in the first 5 lines of this file.
- -->
+-->
 
 <!--
   Copyright 2006 The Apache Software Foundation
-
+  
   Licensed 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
-
+  
+  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.
@@ -24,12 +24,76 @@
 
 <!-- 
   Java components used for tests
- -->
+-->
 <beans>
-<bean id="ObjectStore"
-  class="org.apache.cocoon.apps.bricks.persistence.impl.DummyObjectStore"
-  singleton="true"/>
-<bean id="WikiParser"
-  class="org.apache.cocoon.apps.bricks.wikiparser.impl.TextileTextParserImpl"
-  singleton="true"/>
+  <bean id="ObjectStore" class="org.apache.cocoon.apps.bricks.persistence.impl.OjbObjectStore"
+    singleton="true" init-method="initialize" depends-on="hsqldbServer">
+    <property name="dataSource"><ref bean="dataSource"/></property>
+  </bean>
+
+  <bean id="WikiParser" class="org.apache.cocoon.apps.bricks.wikiparser.impl.TextileTextParserImpl"
+    singleton="true" />
+
+  <!--  The properties for the HSQL DB Server -->
+  <bean name="hsqldbProperties" class="org.apache.cocoon.apps.bricks.persistence.hsql.HsqlProperties">
+    <property name="port">
+      <value>9003</value>
+    </property>
+    <property name="silent">
+      <value>true</value>
+    </property>
+    <property name="trace">
+      <value>false</value>
+    </property>
+    <property name="database0">
+      <value>target/bricksdb</value>
+    </property>
+    <property name="dbName0">
+      <value>bricksdb</value>
+    </property>
+  </bean>
+
+  <!--  The HSQL DB Server for testing -->
+  <bean name="hsqldbServer" class="org.hsqldb.Server" init-method="start" destroy-method="stop">
+    <property name="properties">
+      <ref bean="hsqldbProperties" />
+    </property>
+  </bean>
+
+  <!--  The default DataSource for the transactionManager (we probably want to put there values into a properties file -->
+  <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" depends-on="hsqldbServer">
+    <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+    <property name="url" value="jdbc:hsqldb:hsql://localhost:9003/bricksdb" />
+    <property name="username" value="sa" />
+    <property name="password" value="" />
+  </bean>
+
+  <!-- OJB configurer that allows to use LocalDataSourceConnectionFactory in OJB.properties -->
+  <bean id="ojbConfigurer" class="org.springframework.orm.ojb.support.LocalOjbConfigurer" />
+
+  <!-- Transaction manager for a single OJB PersistenceBroker (alternative to JTA) -->
+  <bean id="transactionManager" class="org.springframework.orm.ojb.PersistenceBrokerTransactionManager"
+    depends-on="ojbConfigurer">
+  </bean>
+
+  <!-- The DAO implementation -->
+  <bean id="objectManagerTarget" class="org.apache.cocoon.apps.bricks.persistence.impl.OjbObjectStore" />
+  
+  <!-- The transactional interceptor for our ObjectStore DAO -->
+  <bean id="objectManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
+    <property name="transactionManager">
+      <ref local="transactionManager" />
+    </property>
+    <property name="target">
+      <ref local="objectManagerTarget" />
+    </property>
+    <property name="transactionAttributes">
+      <props>
+        <prop key="store*">PROPAGATION_REQUIRED</prop>
+        <prop key="queryByKeyForUpdate">PROPAGATION_REQUIRED</prop>
+        <prop key="remove*">PROPAGATION_REQUIRED</prop>
+        <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
+      </props>
+    </property>
+  </bean>
 </beans>

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB-logging.properties
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB-logging.properties?rev=419268&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB-logging.properties (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB-logging.properties Wed Jul  5 09:12:02 2006
@@ -0,0 +1,135 @@
+#<!--
+#/* Copyright 2002-2005 The Apache Software Foundation
+# *
+# * Licensed 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.
+# */
+#-->
+#
+# OJB-logging.properties -- configuration of the logging within the OJB runtime environment
+# @version $Id: OJB-logging.properties 373407 2006-01-30 00:51:39Z antonio $
+#----------------------------------------------------------------------------------------
+# The 'LoggerClass' entry tells OJB which concrete Logger implementation is to be used.
+# If it is not specified (or this file is not present/found, then OJB will check
+# whether there is a log4j.properties or commons-logging.properties file, in which
+# case it will use Log4J/commons-logging. If neither is present, then OJB will default
+# to commons-logging.
+#
+# Integrated with Cocoon logging. Ignores settings below, use
+# central configuration place: logkit.xconf or log4j.xconf
+#LoggerClass=org.apache.cocoon.ojb.components.LoggerImpl
+# Commons-logging
+LoggerClass=org.apache.ojb.broker.util.logging.CommonsLoggerImpl
+#
+# log4j based logging
+#LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl
+# specifiy the name of log4j properties file (only needed if file
+# name is different from "log4j.properties")
+#LoggerConfigFile=log4j.properties
+#
+# OJB's own simple looging support
+#LoggerClass=org.apache.ojb.broker.util.logging.PoorMansLoggerImpl
+#
+#----------------------------------------------------------------
+# all following properties are specific to PoorMansLoggerImpl
+#----------------------------------------------------------------
+# The LogLevel entries tells OJB which LogLevels are active
+# for the different loggers used within OJB
+# Loglevels: DEBUG < INFO < WARN < ERROR < FATAL
+# That is loglevel WARN won't log DEBUG and INFO messages,
+# but will log WARN, ERROR, and FATAL messages
+#
+# Global default log level used for all logging
+# entities if not specified
+ROOT.LogLevel=ERROR
+#
+# The boot log level used to initialize logging
+BOOT.LogLevel=INFO
+#
+# The Default Logger instance used within OJB
+DEFAULT.LogLevel=WARN
+#
+# PB-api and Kernel
+# -----------------
+# Logger for PB-api base classes
+org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.LogLevel=WARN
+org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl.LogLevel=WARN
+org.apache.ojb.broker.core.PersistenceBrokerImpl.LogLevel=WARN
+#
+# Logger for metadata classes, useful for debugging parsing of repository.xml!
+# persistence capable object metadata
+org.apache.ojb.broker.metadata.DescriptorRepository.LogLevel=WARN
+org.apache.ojb.broker.metadata.RepositoryXmlHandler.LogLevel=WARN
+org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler.LogLevel=WARN
+org.apache.ojb.broker.metadata.RepositoryPersistor.LogLevel=WARN
+org.apache.ojb.broker.metadata.SuperReferenceDescriptor$SuperReferenceField.LogLevel=WARN
+#
+# Logger for jdbc access querying and object materialization, useful
+# for debugging JDBC related problems
+org.apache.ojb.broker.accesslayer.JdbcAccessImpl.LogLevel=WARN
+org.apache.ojb.broker.accesslayer.RsIterator.LogLevel=WARN
+org.apache.ojb.broker.accesslayer.StatementsForClassImpl.LogLevel=WARN
+org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl.LogLevel=WARN
+org.apache.ojb.broker.core.QueryReferenceBroker.LogLevel=WARN
+#
+# Logger for connection handling
+org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.LogLevel=WARN
+org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.LogLevel=WARN
+org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.LogLevel=WARN
+org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl.LogLevel=WARN
+#
+# Logger for object caching
+org.apache.ojb.broker.cache.CacheDistributor.LogLevel=WARN
+org.apache.ojb.broker.cache.MaterializationCache.LogLevel=WARN
+org.apache.ojb.broker.cache.ObjectCacheDefaultImpl.LogLevel=WARN
+org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl.LogLevel=WARN
+#
+# Logger for Oracle9i platform, useful for tracing failing Oracle-extensions or large LOB-support
+org.apache.ojb.broker.platforms.PlatformOracle9iImpl.LogLevel=WARN
+#
+# Logger for proxy classes
+org.apache.ojb.broker.core.proxy.IndirectionHandlerJDKImpl.LogLevel=WARN
+org.apache.ojb.broker.core.proxy.IndirectionHandlerCGLIBImpl.LogLevel=WARN
+org.apache.ojb.broker.core.proxy.ProxyFactoryJDKImpl.LogLevel=WARN
+org.apache.ojb.broker.core.proxy.ProxyFactoryCGLIBImpl.LogLevel=WARN
+#
+# OJB locking implementations
+org.apache.ojb.broker.locking.LockManagerInMemoryImpl.LogLevel=WARN
+org.apache.ojb.broker.locking.LockManagerCommonsImpl.LogLevel=WARN
+org.apache.ojb.broker.locking.LockManagerRemoteImpl.LogLevel=WARN
+org.apache.ojb.broker.locking.CommonsOJBLockManager.LogLevel=WARN
+#
+# odmg-api
+# --------
+org.apache.ojb.odmg.TransactionImpl.LogLevel=WARN
+org.apache.ojb.odmg.J2EETransactionImpl.LogLevel=WARN
+org.apache.ojb.odmg.ImplementationImpl.LogLevel=WARN
+org.apache.ojb.odmg.DatabaseImpl.LogLevel=WARN
+org.apache.ojb.odmg.ObjectEnvelopeTable.LogLevel=WARN
+org.apache.ojb.odmg.ObjectEnvelope.LogLevel=WARN
+org.apache.ojb.odmg.Image.LogLevel=WARN
+org.apache.ojb.odmg.ObjectEnvelopeOrdering.LogLevel=WARN
+org.apache.ojb.odmg.LocalTxManager.LogLevel=WARN
+org.apache.ojb.odmg.JTATxManager.LogLevel=WARN
+#
+#
+# Special Logger categories used in test suite
+#
+# Logger for the performance tests
+performance.LogLevel=INFO
+# Logger for the failover tests
+failover.LogLevel=INFO
+#
+#
+#----------------------------------------------------------------------------------------
+# End of OJB.properties file
+#----------------------------------------------------------------------------------------

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB.properties
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB.properties?rev=419268&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB.properties (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/resources/OJB.properties Wed Jul  5 09:12:02 2006
@@ -0,0 +1,486 @@
+#<!--
+#/* Copyright 2002-2004 The Apache Software Foundation
+# *
+# * Licensed 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.
+# */
+#-->
+# OJB.properties -- configuration of the OJB runtime environment
+# Version: 1.0
+# (c) 2001, 2002, 2003 Apache Software Foundation
+# Author: Thomas Mahler and many others
+# @version $Id: OJB.properties,v 1.75.2.7 2005/04/03 02:40:57 arminw Exp $
+#
+#----------------------------------------------------------------------------------------
+# repository file settings
+#----------------------------------------------------------------------------------------
+# The repositoryFile entry tells OJB to use this file as as its standard mapping
+# repository. The file is looked up from the classpath.
+#
+repositoryFile=repository.xml
+#
+# If the useSerializedRepository entry is set to true, OJB tries to load a
+# serialized version of the repository for performance reasons.
+# if set to false, OJB always loads the xml file.
+# Setting this flag to true will accelerate the startup sequence of OJB.
+# If set to true changes to the repository.xml file will only be detected
+# after maually deleting the repository.xml.serialized file.
+useSerializedRepository=false
+#
+# If Repository serialization is used the entry serializedRepositoryPath defines the
+# directory where the Repository is written to and read from.
+# this entry is used only when the useSerializedRepository flag is set to true
+#
+serializedRepositoryPath=.
+#
+#----------------------------------------------------------------------------------------
+# PersistenceBrokerFactory / PersistenceBroker
+#----------------------------------------------------------------------------------------
+# The PersistenceBrokerFactoryClass entry decides which concrete
+# PersistenceBrokerFactory implemention is to be used.
+PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
+# If in managed environment *only* the PB-api was used it's recommended to use this factory
+# to enable the PersistenceBroker instances to participate in the JTA transaction. This makes
+# e.g. PBStateListener work properly in managed environments.
+#PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl
+#
+#
+# The PersistenceBrokerClass entry decides which concrete PersistenceBroker
+# implementation is to be served by the PersistenceBrokerFactory.
+# This is the singlevm implementation:
+PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
+#
+# This is an implementation that uses Prevayler (prevayler.sf.net) as the persistent storage.
+# Using this implementation OJB works as a simple OODBMS
+#PersistenceBrokerClass=org.apache.ojb.broker.prevayler.PBPrevaylerImpl
+#
+#
+# This setting can be helpful during development if the PersistenceBroker transaction
+# demarcation was used (this is true in most cases). If set 'true' on PB#store(...)
+# and PB#delete(...) methods calls OJB check for active PB-tx and if no active tx is
+# found a error is logged. This can help to avoid store/delete calls without a running
+# PB-tx while development. Default setting is 'false'. (Note: When using OJB in a managed
+# environment *without* OJB-caching, it's valid to use store/delete calls without a running PB-tx)
+TxCheck=false
+#
+#----------------------------------------------------------------------------------------
+# PersistenceBroker pool
+#----------------------------------------------------------------------------------------
+# PersistenceBroker pool configuration
+# This pool uses the jakarta-commons-pool api.
+# There you can find things described in detail.
+#
+# maximum number of brokers that can be borrowed from the
+# pool at one time. When non-positive, there is no limit.
+maxActive=100
+#
+# controls the maximum number of brokers that can sit idle in the
+# pool (per key) at any time. When non-positive, there is no limit
+maxIdle=-1
+#
+# max time block to get broker instance from pool, after that exception is thrown.
+# When non-positive, block till last judgement
+maxWait=2000
+#
+# indicates how long the eviction thread should sleep before "runs" of examining
+# idle objects. When non-positive, no eviction thread will be launched.
+timeBetweenEvictionRunsMillis=-1
+#
+# specifies the minimum amount of time that an broker may sit idle
+# in the pool before it is eligable for eviction due to idle time.
+# When non-positive, no object will be dropped from the pool due
+# to idle time alone (depends on timeBetweenEvictionRunsMillis > 0)
+minEvictableIdleTimeMillis=1000000
+#
+# specifies the behaviour of the pool when broker capacity is
+# exhausted (see maxActive above)
+# 0 - fail
+# 1 - block
+# 2 - grow
+whenExhaustedAction=0
+#
+#
+#----------------------------------------------------------------------------------------
+# ConnectionFactory / Default ConnectionPool
+#----------------------------------------------------------------------------------------
+# The ConnectionFactoryClass entry determines which kind of ConnectionFactory
+# is to be used within org.apache.ojb as connection factory.
+# A ConnectionFactory is responsible for creating
+# JDBC Connections. Current version ships four implementations:
+#
+# 1. ConnectionFactoryAvalonDatasource
+#    Uses a Cocoon configured DataSource specified with the jcd-alias attribute value in
+#    a jdbc-connection-descriptor element in the repository.xml file.
+# 2. ConnectionFactoryNotPooledImpl
+#    No pooling, no playing around.
+#    Every connection request returns a new connection,
+#    every connection release close the connection.
+# 3. ConnectionFactoryPooledImpl
+#    This implementation supports connection pooling.
+# 4. ConnectionFactoryDBCPImpl
+#    Using the jakarta-DBCP api for connection management, support
+#    connection- and prepared statement-pooling, abandoned connection handling.
+# 5. ConnectionFactoryManagedImpl
+#    Connection factory for use within managed environments - e.g. JBoss.
+#    Every obtained DataSource was wrapped within OJB (and ignore
+#    e.g. con.commit() calls within OJB).
+#    Use this implementation e.g if you use Datasources from an application server.
+#
+# Use the OJB performance tests to decide, which implementation is best for you.
+# The proper way of obtaining a connection is configured in
+# JDBCConnectionDescriptor entries in the repository.xml file.
+# If want a more fine grained control of each connection pool used by OJB,
+# take a look at the repository.dtd, there was a possibility to override
+# this default connection factory entry in each JDBCConnectionDescriptor.
+#
+ConnectionFactoryClass=org.springframework.orm.ojb.support.LocalDataSourceConnectionFactory
+#ConnectionFactoryClass=org.apache.cocoon.ojb.components.ConnectionFactoryImpl
+#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl
+#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl
+#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
+# Only needed when using OJB 1.0.3 or earlier in managed environments. Since version
+# 1.0.4 OJB detects datasources from managed environments automatically.
+#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl
+#
+#
+#----------------------------------------------------------------------------------------
+# ConnectionManager
+#----------------------------------------------------------------------------------------
+# The ConnectionManagerClass entry defines the ConnectionManager implemementation to be used
+ConnectionManagerClass=org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
+#
+#
+#----------------------------------------------------------------------------------------
+# SqlGenerator
+#----------------------------------------------------------------------------------------
+# The SqlGeneratorClass entry defines the SqlGenerator implemementation to be used
+SqlGeneratorClass=org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl
+#
+#
+#----------------------------------------------------------------------------------------
+# ProxyFactory and IndirectionHandler
+#----------------------------------------------------------------------------------------
+# The ProxyFactoryClass entry defines which ProxyFactory implementation is to be used.
+# By default, a 1.0 compatiable, JDK-based version is used. However, a the CGLIB based entry
+# is available.
+#
+#	- ProxyFactoryCGLIBImpl: Refernece proxies are generated using bytecode manipulation
+#			from the CGLIB library. Any class can become a dynamic proxy, and not just ones
+#			that implement an interface.
+#   - ProxyFactoryJDKImpl: OJB 1.0 compatiable Proxy implementation. Proxies in this method
+#			can only be generated from classes that implement an interface, and the generated
+#			Proxy will implement all methods of that interface.
+#
+# NOTE: The appropriate cooresponding IndirectionHandler must be choosen as well
+#
+#ProxyFactoryClass=org.apache.ojb.broker.core.proxy.ProxyFactoryCGLIBImpl
+ProxyFactoryClass=org.apache.ojb.broker.core.proxy.ProxyFactoryJDKImpl
+#
+# The IndirectionHandlerClass entry defines the class to be used by OJB's proxies to
+# handle method invocations
+#
+#IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerCGLIBImpl
+IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerJDKImpl
+#
+#----------------------------------------------------------------------------------------
+# ListProxy
+#----------------------------------------------------------------------------------------
+# The ListProxyClass entry defines the proxy class to be used for collections that
+# implement the java.util.List interface.
+#
+ListProxyClass=org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl
+#
+#----------------------------------------------------------------------------------------
+# SetProxy
+#----------------------------------------------------------------------------------------
+# The SetProxyClass entry defines the proxy class to be used for collections that
+# implement the java.util.Set interface.
+#
+SetProxyClass=org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl
+#
+#----------------------------------------------------------------------------------------
+# CollectionProxy
+#----------------------------------------------------------------------------------------
+# The CollectionProxyClass entry defines the proxy class to be used for collections that
+# do not implement java.util.List or java.util.Set.
+#
+CollectionProxyClass=org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl
+#
+#----------------------------------------------------------------------------------------
+# StatementManager
+#----------------------------------------------------------------------------------------
+# The StatementManagerClass entry defines the StatementManager implemementation to be used
+StatementManagerClass=org.apache.ojb.broker.accesslayer.StatementManager
+#
+#
+#----------------------------------------------------------------------------------------
+# StatementsForClass
+#----------------------------------------------------------------------------------------
+# The StatementsForClassClass entry defines the StatementsForClass implemementation to be used
+# to implement cached statements.
+StatementsForClassClass=org.apache.ojb.broker.accesslayer.StatementsForClassImpl
+#
+#
+#----------------------------------------------------------------------------------------
+# JdbcAccess
+#----------------------------------------------------------------------------------------
+# The JdbcAccessClass entry defines the JdbcAccess implemementation to be used
+JdbcAccessClass=org.apache.ojb.broker.accesslayer.JdbcAccessImpl
+#
+#
+#----------------------------------------------------------------------------------------
+# RowReader
+#----------------------------------------------------------------------------------------
+# Set the standard RowReader implementation. It is also possible to specify the
+# RowReader on class-descriptor level.
+RowReaderDefaultClass=org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl
+#
+#
+#----------------------------------------------------------------------------------------
+# Object cache
+#----------------------------------------------------------------------------------------
+# NOTE: ObjectCacheClass declaration in OJB.properties file was removed (since OJB 1.0.2).
+# The concrete ObjectCache implementation has to specified in the repository file using
+# the 'object-cache' element. See documentation for more detailed info.
+#
+# This property is only relevant if the per class-descriptor object-cache
+# declaration was used in conjunction with metadata runtime changes.
+# If set 'flase' the class name of the object is used
+# to find a per class ObjectCache implementation.
+# If set 'true' the ObjectCacheDescriptor instance is used as key to
+# find a per class ObjectCache, this enables to use different ObjectCache
+# instances for the same class.
+descriptorBasedCaches=false
+#
+# NOTE: CacheFilters declaration was removed (since OJB 1.0.2). To exclude
+# object of whole packages from being cache use a specific property in
+# cache declaration - see caching guide in reference docs.
+#----------------------------------------------------------------------------------------
+# Locking
+#----------------------------------------------------------------------------------------
+# The 'LockManagerClass' specify the internal used LockManager implementation.
+# If OJB is running in distributed environment it is recommended to use the remote
+# lock manager. It guarantees to provide Lockmanagement across multiple JVM's.
+#
+# The deprecated odmg locking implementation. Needs enabled 'LockMapClass' too.
+#@deprecated LockManagerClass=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
+# A servlet based lock implementation for distributed environments, needs enabled
+# property 'LockServletUrl' too.
+#LockManagerClass=org.apache.ojb.broker.locking.LockManagerRemoteImpl
+# Lock manager implementation using apache's commons-transaction locking api
+#LockManagerClass=org.apache.ojb.broker.locking.LockManagerCommonsImpl
+LockManagerClass=org.apache.ojb.broker.locking.LockManagerInMemoryImpl
+#
+# The LockServletUrl entry points to the Lockserver servlet.
+# This Servlet is addressed by all distributed JVMs if the RemoteLockMapImpl
+# is used.
+#LockServletUrl=http://127.0.0.1:8080/ojb-lockserver
+#
+# The LockTimeout entry defines the maximum time in milliseconds
+# that a lock may be hold. Defaults to 60000 = 1 minute
+LockTimeout=60000
+#
+#
+# ------ deprecated ------
+# The LockMapClass entry tells OJB which concrete LockMap
+# implementation is to be used.
+# If OJB is running on multiple concurrent clients it is recommended
+# to use the LockMapRemoteImpl. It guarantees to provide
+# Lockmanagement across multiple JVMs.
+# This Implemenation relies on a Servlet based Lockserver. To use it you have to
+# deploy the ojb-lockserver.war into a Servlet engine.
+# and you have to set the Property LockServletUrl to point to this servlet.
+# (see LockServletUrl section below).
+# If OJB is running in a single JVM (e.g. in a desktop app, or in a servlet
+# engine) it is save to use the LockMapInMemoryImpl. Using it will result
+# in a large performance gain.
+# These settings are deprecated, only needed in conjunction with the old odmg 'LockManagerClass'
+# @deprecated LockMapClass=org.apache.ojb.odmg.locking.RemoteLockMapImpl
+# @deprecated LockMapClass=org.apache.ojb.odmg.locking.InMemoryLockMapImpl
+#
+#
+#----------------------------------------------------------------------------------------
+# OQL / SQL settings
+#----------------------------------------------------------------------------------------
+# The OqlCollectionClass entry defines the collection type returned
+# from OQL queries. By default this value is set to a List.
+# This will be good for most situations. If you need the additional features of
+# DList (DList itself is persistable, support of predicate) comment in the DList
+# implementation. See also section 'ODMG settings' (DListClass entry).
+# Using DLists for large resultsets may be bad for application performance.
+# For these scenarios you can use ArrayLists or Vectors.
+# Important note: the collections class to be used MUST implement the
+# interface 'org.apache.ojb.broker.ManageableCollection'.
+#
+#OqlCollectionClass=org.apache.ojb.broker.util.collections.ManageableArrayList
+OqlCollectionClass=org.apache.ojb.odmg.collections.DListImpl
+# OqlCollectionClass=org.apache.ojb.broker.util.collections.ManageableVector
+#
+# The SqlInLimit entry limits the number of values in IN-sql statement,
+# -1 for no limits. This hint is used in Criteria.
+SqlInLimit=200
+#
+#
+#----------------------------------------------------------------------------------------
+# ODMG-api settings
+#----------------------------------------------------------------------------------------
+# Specify the used base class for ODMG API
+# - ImplementationDefaultImpl is the default class
+# - ImplementationJTAImpl is for use in managed environments like J2EE conform
+# Application Server
+#
+ImplementationClass=org.apache.ojb.odmg.ImplementationImpl
+#ImplementationClass=org.apache.ojb.odmg.ImplementationJTAImpl
+#
+# Specify the used tx handling.
+# - LocalTxManager use if you want the transaction to be associated by a thread
+# - JTATxManager use if you want the transaction to be associated via the Transaction
+# manager that is in your application server.
+#
+OJBTxManagerClass=org.apache.ojb.odmg.LocalTxManager
+#OJBTxManagerClass=org.apache.ojb.odmg.JTATxManager
+#
+#
+# The ImplicitLocking entry defines if implicit lock acquisition is
+# to be used. If set to 'true' OJB implicitly locks objects to ODMG
+# transactions after performing OQL queries.
+# Also if implicit locking is used locking objects is recursive, that is
+# associated objects are also locked.
+# If ImplicitLocking is set to 'false', no locks are obtained in OQL
+# queries, lookup objects and there is also no recursive locking.
+# This setting can be changed at runtime using OJB's ODMG extensions.
+ImplicitLocking=true
+#ImplicitLocking=false
+#
+# The LockAssociations entry defines the behaviour for the OJB
+# implicit locking feature. If set to WRITE (default) acquiring a write-
+# lock on a given object x implies write locks on all objects associated
+# to x. If set to READ implicit read-locks are acquired.
+# Acquiring a read-lock on x allways results in implicit read-locks
+# on all associated objects (if 'implicit locking' is enabled).
+# This setting can be changed at runtime using OJB's ODMG extensions.
+#LockAssociations=READ
+LockAssociations=WRITE
+#
+# Enable/Disable OJB's persistent object ordering algorithm on commit
+# of a transaction. If enabled OJB try to calculate a valid order for
+# all new/modified objects (and referenced objects).
+# If the used databases support 'deferred checks' it's recommended to use this
+# feature and to disable OJB's object ordering.
+# This setting can be changed at runtime using OJB's ODMG extensions.
+Ordering=true
+#
+#
+# Used ODMG collection implementation classes
+# (e.g. when do a Implementation#newDlist() call)
+#
+# org.odmg.DList implementation class
+DListClass=org.apache.ojb.odmg.collections.DListImpl
+#
+# org.odmg.DArray implementation class
+DArrayClass=org.apache.ojb.odmg.collections.DListImpl
+#
+# org.odmg.DMap implementation class
+DMapClass=org.apache.ojb.odmg.collections.DMapImpl
+#
+# org.odmg.DBag implementation class
+DBagClass=org.apache.ojb.odmg.collections.DBagImpl
+#
+# org.odmg.DSet implementation class
+DSetClass=org.apache.ojb.odmg.collections.DSetImpl
+#
+#
+# @deprecated property for backward compatibility.
+# If set 'true' the behavior of method
+# ImplementationImpl#setImplicitLocking(...) will be the same as
+# in OJB <=1.0.3 (set the implicit locking behavior of the current used transaction)
+# and disable the new possibility of global 'implicit locking'
+# setting at runtime with ImplementationExt#setImplicitLocking.
+# This is only for backward compatibility and will
+# be removed at a later date.
+ImplicitLockingBackward=false
+#----------------------------------------------------------------------------------------
+# Meta data / mapping settings
+#----------------------------------------------------------------------------------------
+# The PersistentFieldClass property defines the implementation class
+# for PersistentField attributes used in the OJB MetaData layer.
+# By default the best performing attribute/refection based implementation
+# is selected (PersistentFieldDirectAccessImpl).
+#
+# - PersistentFieldDirectAccessImpl
+#   is a high-speed version of the access strategies.
+#   It does not cooperate with an AccessController,
+#   but accesses the fields directly. Persistent
+#   attributes don't need getters and setters
+#   and don't have to be declared public or protected
+# - PersistentFieldPrivilegedImpl
+#   Same as above, but does cooperate with AccessController and do not
+#   suppress the java language access check (but is slow compared with direct access).
+# - PersistentFieldIntrospectorImpl
+#   uses JavaBeans compliant calls only to access persistent attributes.
+#   No Reflection is needed. But for each attribute xxx there must be
+#   public getXxx() and setXxx() methods.
+# - PersistentFieldDynaBeanAccessImpl
+#   implementation used to access a property from a
+#   org.apache.commons.beanutils.DynaBean.
+# - PersistentFieldAutoProxyImpl
+#   for each field determines upon first access how to access this particular field
+#   (directly, as a bean, as a dyna bean) and then uses that strategy
+#
+PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectImpl
+#PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldPrivilegedImpl
+#PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl
+#PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDynaBeanImpl
+#PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldAutoProxyImpl
+#(DynaBean implementation does not support nested fields)
+#
+#----------------------------------------------------------------------------------------
+# Component Intercepting for Profiling and Tracing
+#----------------------------------------------------------------------------------------
+# By enabling an InterceptorClass all OJB components will use
+# this Interceptor. Interceptors allow advanced tracing and Profiling
+# of all component method calls.
+# This is currently an experimental feature useful only for OJB kernel developers.
+#
+#InterceptorClass=org.apache.ojb.broker.util.interceptor.TracingInterceptor
+#
+#----------------------------------------------------------------------------------------
+# Transaction Management and assocation
+#----------------------------------------------------------------------------------------
+# (optional, only used when OJB runs within managed environments)
+# To praticipate in JTA transaction OJB needs access to the underlying transaction manager.
+# The TransactionManager is acquired in different ways dependent on the application server.
+# The JTATransactionManagerClass property allows you to specify the class that implements
+# the proper behaviour for finding the transaction manager. Only use when OJBTxManagerClass
+# is set to a factory that uses the application server transaction manager
+# (org.apache.ojb.odmg.JTATxManager)
+#
+# JBoss Transaction Manager Factory
+JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory
+# Weblogic Transaction Manager Factory
+#JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.WeblogicTransactionManagerFactory
+# WebSphere transaction manager factory
+#JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.WebSphereTransactionManagerFactory
+# Orion transaction manager factory
+#JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.OrionTransactionManagerFactory
+# SunOne transaction manager factory
+#JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.SunOneTransactionManagerFactory
+# JOnAs transaction manager factory
+#JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JOnASTransactionManagerFactory
+#
+#
+#----------------------------------------------------------------------------------------
+# Logging settings are now in their own file, OJB-logging.properties
+#----------------------------------------------------------------------------------------
+#----------------------------------------------------------------------------------------
+# End of OJB.properties file
+#----------------------------------------------------------------------------------------