You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2005/04/06 17:44:43 UTC

svn commit: r160306 - in incubator/jackrabbit/trunk/contrib/orm-persistence: ./ applications/test/ applications/test/repository/nodetypes/ applications/test/workspaces/default/ src/java/org/apache/jackrabbit/core/state/orm/hibernate/ src/java/org/apache/jackrabbit/core/state/orm/ojb/

Author: stefan
Date: Wed Apr  6 08:44:42 2005
New Revision: 160306

URL: http://svn.apache.org/viewcvs?view=rev&rev=160306
Log:
committing as-is Patch for ORM-Persistence posted by serge

Added:
    incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/jaas.config
Modified:
    incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/log4j.xml
    incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository.xml
    incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository/nodetypes/custom_nodetypes.xml
    incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repositoryStubImpl.properties
    incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/workspaces/default/workspace.xml
    incubator/jackrabbit/trunk/contrib/orm-persistence/maven.xml
    incubator/jackrabbit/trunk/contrib/orm-persistence/project.properties
    incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/hibernate/HibernatePersistenceManager.java
    incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/ValuesToStringFieldConversion.java

Added: incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/jaas.config
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/jaas.config?view=auto&rev=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/jaas.config (added)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/jaas.config Wed Apr  6 08:44:42 2005
@@ -0,0 +1,3 @@
+Jackrabbit {
+  org.apache.jackrabbit.core.security.SimpleLoginModule required anonymousId="anonymous";
+};

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/log4j.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/log4j.xml?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/log4j.xml (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/log4j.xml Wed Apr  6 08:44:42 2005
@@ -24,19 +24,14 @@
              <param name="ConversionPattern"
                             value="%6r [%t] %5p %c.%M:%L - %m%n"/>
         </layout>
-        <!--
-
-        Uncomment the following if you need to filter on message
-        strings.
+    </appender>
 
-        -->
-        <!--
-        <filter class="org.apache.log4j.varia.StringMatchFilter">
-            <param name="StringToMatch" value="field"/>
-                <param name="AcceptOnMatch" value="false"/>
-        </filter>
-        <filter class="org.apache.log4j.varia.DenyAllFilter" />
-        -->
+    <appender name="FILE" class="org.apache.log4j.FileAppender">
+        <param name="File" value="jcr.log" />	
+        <layout class="org.apache.log4j.PatternLayout">
+             <param name="ConversionPattern"
+                            value="%6r [%t] %5p %c.%M:%L - %m%n"/>
+        </layout>
     </appender>
 
     <category name="org.apache.jackrabbit">
@@ -53,7 +48,7 @@
     </category>
 
     <root>
-        <priority value="debug"/>
-        <appender-ref ref="STDOUT"/>
+        <priority value="info"/>
+        <appender-ref ref="FILE"/>
     </root>
 </log4j:configuration>

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository.xml?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository.xml (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository.xml Wed Apr  6 08:44:42 2005
@@ -1,20 +1,4 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-   Copyright 2004-2005 The Apache Software Foundation or its licensors,
-                       as applicable.
-
-   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.
-  -->
 <!-- <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Repository//EN" "file://config.dtd"> -->
 <!DOCTYPE Repository [
     <!--
@@ -30,6 +14,9 @@
             used by the repository to persist global state such as
             registered namespaces, custom node types, etc..
 
+            a Security element that specifies the name of the app-entry
+            in the JAAS config and the access manager
+
             a Workspaces element that specifies to the location of
             workspaces root directory and the name of default workspace
 
@@ -41,10 +28,10 @@
             a SearchIndex element that is used for configuring per workspace
             Indexing-related settings
 
-            a Versioning element that is used for configuring 
+            a Versioning element that is used for configuring
             versioning-related settings
     -->
-    <!ELEMENT Repository (FileSystem,Workspaces,Workspace,Versioning)>
+    <!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning)>
 
     <!--
         a virtual file system
@@ -54,6 +41,25 @@
       class CDATA #REQUIRED>
 
     <!--
+        the Security element specifies the name (appName attribute)
+        of the JAAS configuration app-entry for this repository. 
+
+        it also specifies the access manager to be used (AccessManager element).
+    -->
+    <!ELEMENT Security (AccessManager)>
+    <!ATTLIST Security
+      appName CDATA #REQUIRED>
+
+    <!--
+        the AccessManager element configures the access manager to be used by
+        this repository instance; the class attribute specifies the FQN of the
+        class implementing the AccessManager interface
+    -->
+    <!ELEMENT AccessManager (param*)>
+    <!ATTLIST AccessManager
+      class CDATA #REQUIRED>
+
+    <!--
         generic parameter (name/value pair)
     -->
     <!ELEMENT param EMPTY>
@@ -86,7 +92,7 @@
     <!--
         the PersistenceManager element configures the persistence manager
         to be used for the workspace; the class attribute specifies the
-        FQN of the class implementing PersistenceManager interface
+        FQN of the class implementing the PersistenceManager interface
     -->
     <!ELEMENT PersistenceManager (param*)>
     <!ATTLIST PersistenceManager
@@ -110,6 +116,7 @@
       rootPath CDATA #REQUIRED
     >
 ]>
+<!-- Example Repository Configuration File -->
 <Repository>
     <!--
         virtual file system where the repository stores global state
@@ -118,6 +125,20 @@
     <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
         <param name="path" value="${rep.home}/repository"/>
     </FileSystem>
+
+    <!--
+        security configuration
+    -->
+    <Security appName="Jackrabbit">
+        <!--
+            access manager:
+            class: FQN of class implementing the AccessManager interface
+        -->
+        <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
+            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+        </AccessManager>
+    </Security>
+
     <!--
         location of workspaces root directory and name of default workspace
     -->
@@ -129,7 +150,7 @@
     <Workspace name="${wsp.name}">
         <!--
             virtual file system of the workspace:
-            class: FQN of class implementing FileSystem interface
+            class: FQN of class implementing the FileSystem interface
         -->
         <FileSystem class="com.day.jackrabbit.fs.cq.CQFileSystem">
             <param name="path" value="${wsp.home}/wspStore.dat"/>
@@ -138,20 +159,46 @@
             <param name="autoSync" value="false"/>
         </FileSystem>
         <!--
-            persistence of the workspace:
-            class: FQN of class implementing PersistenceManager interface
+        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+            <param name="path" value="${wsp.home}"/>
+        </FileSystem>
+        -->
+        <!--
+            persistence manager of the workspace:
+            class: FQN of class implementing the PersistenceManager interface
+        -->
+        <!--
+        <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager"/>
+        -->
+        <!--
+        <PersistenceManager class="org.apache.jackrabbit.core.state.mem.InMemPersistenceManager">
+            <param name="initialCapacity" value="100000"/>
+            <param name="loadFactor" value="0.3"/>
+            <param name="persistent" value="true"/>
+        </PersistenceManager>
         -->
-        <!-- <PersistenceManager class="org.apache.jackrabbit.core.state.orm.ojb.OJBPersistenceManager" /> -->
-        <PersistenceManager class="org.apache.jackrabbit.core.state.orm.hibernate.HibernatePersistenceManager" />
+        <!-- <PersistenceManager class="org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager"/> -->
+        <PersistenceManager class="org.apache.jackrabbit.core.state.orm.ojb.OJBPersistenceManager" />
+        <!--PersistenceManager class="org.apache.jackrabbit.core.state.orm.hibernate.HibernatePersistenceManager" /-->
 
         <!--
             Search index and the file system it uses.
+            class: FQN of class implementing the QueryHandler interface
+            Supported Parameters:
+            - useCompoundFile: advises lucene to use compound files for the index files
+            - minMergeDocs: minimum number of nodes in an index until segments are merged
+            - maxMergeDocs: maximum number of nodes in segments that will be merged
+            - mergeFactor: determines how often segment indices are merged
+            - redoSize: maximum number of entries in the redo log until the in-memory index is merged
+            - bufferSize: maximum number of documents that are held in a pending queue until added to the index
         -->
         <SearchIndex class="org.apache.jackrabbit.core.search.lucene.SearchIndex">
             <param name="useCompoundFile" value="true"/>
             <param name="minMergeDocs" value="1000"/>
             <param name="maxMergeDocs" value="10000"/>
             <param name="mergeFactor" value="10"/>
+            <param name="redoSize" value="1000"/>
+            <param name="bufferSize" value="10"/>
 
             <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
                 <param name="path" value="${wsp.home}/index"/>
@@ -173,9 +220,15 @@
             <param name="blockSize" value="128"/>
             <param name="autoSync" value="false"/>
         </FileSystem>
-
+    
         <!--
-            Configures the persistence manager to be used for persisting version state.
+            <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+                <param name="path" value="${rep.home}/version"/>
+            </FileSystem>
+        -->
+        
+        <!--
+            Configures the perisistence manager to be used for persisting version state.
             Please note that the current versioning implementation is based on
             a 'normal' persistence manager, but this could change in future
             implementations.
@@ -183,5 +236,4 @@
         <PersistenceManager class="org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager"/>
 
     </Versioning>
-
 </Repository>

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository/nodetypes/custom_nodetypes.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository/nodetypes/custom_nodetypes.xml?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository/nodetypes/custom_nodetypes.xml (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository/nodetypes/custom_nodetypes.xml Wed Apr  6 08:44:42 2005
@@ -18,19 +18,19 @@
  */
  -->
 <nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:test="http://www.apache.org/jackrabbit/test" xmlns:mix="http://www.jcp.org/jcr/mix/1.0">
-  <nodeType name="test:versionable" mixin="false" orderableChildNodes="false" primaryItemName="">
+  <nodeType name="test:versionable" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
     <supertypes>
       <supertype>mix:versionable</supertype>
       <supertype>nt:base</supertype>
     </supertypes>
-    <propertyDef name="*" type="String" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
-    <propertyDef name="test:copyOnParentVersionProp" type="String" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
-    <propertyDef name="test:versionOnParentVersionProp" type="String" autoCreate="false" mandatory="false" onParentVersion="VERSION" protected="false" multiple="false" />
-    <propertyDef name="test:initializeOnParentVersionProp" type="String" autoCreate="false" mandatory="false" onParentVersion="INITIALIZE" protected="false" multiple="false" />
-    <propertyDef name="test:computeOnParentVersionProp" type="String" autoCreate="false" mandatory="false" onParentVersion="COMPUTE" protected="false" multiple="false" />
-    <propertyDef name="test:ignoreOnParentVersionProp" type="String" autoCreate="false" mandatory="false" onParentVersion="IGNORE" protected="false" multiple="false" />
-    <propertyDef name="test:abortOnParentVersionProp" type="String" autoCreate="false" mandatory="false" onParentVersion="ABORT" protected="false" multiple="false" />
-    <childNodeDef name="*" defaultPrimaryType="" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSibs="false">
+    <propertyDef name="*" requiredType="undefined" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+    <propertyDef name="test:copyOnParentVersionProp" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+    <propertyDef name="test:versionOnParentVersionProp" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="VERSION" protected="false" multiple="false" />
+    <propertyDef name="test:initializeOnParentVersionProp" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="INITIALIZE" protected="false" multiple="false" />
+    <propertyDef name="test:computeOnParentVersionProp" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="COMPUTE" protected="false" multiple="false" />
+    <propertyDef name="test:ignoreOnParentVersionProp" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="IGNORE" protected="false" multiple="false" />
+    <propertyDef name="test:abortOnParentVersionProp" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="ABORT" protected="false" multiple="false" />
+    <childNodeDef name="*" defaultPrimaryType="test:versionable" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSibs="false">
       <requiredPrimaryTypes>
         <requiredPrimaryType>nt:base</requiredPrimaryType>
       </requiredPrimaryTypes>
@@ -66,5 +66,163 @@
       </requiredPrimaryTypes>
     </childNodeDef>
   </nodeType>
+  
+  <!-- Defines a referenceable nodetype for testing purposes -->
+  <nodeType name="test:refTargetNode" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>mix:versionable</supertype>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDef name="*" requiredType="undefined" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+  </nodeType>
+
+  <!-- Defines a nodetype for testing NodeType.canSetProperty() -->
+  <nodeType name="test:canSetProperty" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDef name="String" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="StringMultiple" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="StringConstraints" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+        <valueConstraint>def</valueConstraint>
+        <valueConstraint>ghi</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="StringMultipleConstraints" requiredType="String" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+        <valueConstraint>def</valueConstraint>
+        <valueConstraint>ghi</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="Binary" requiredType="Binary" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="BinaryMultiple" requiredType="Binary" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="BinaryConstraints" requiredType="Binary" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="BinaryMultipleConstraints" requiredType="Binary" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="Date" requiredType="Date" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="DateMultiple" requiredType="Date" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="DateConstraints" requiredType="Date" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(1974-02-15T00:00:00.000Z,)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="DateMultipleConstraints" requiredType="Date" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,1974-02-15T00:00:00.000Z)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="Double" requiredType="Double" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="DoubleMultiple" requiredType="Double" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="DoubleConstraints" requiredType="Double" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(100,)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="DoubleMultipleConstraints" requiredType="Double" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="Long" requiredType="Long" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="LongMultiple" requiredType="Long" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="LongConstraints" requiredType="Long" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(100,)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="LongMultipleConstraints" requiredType="Long" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>(,100)</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="Boolean" requiredType="Boolean" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="BooleanMultiple" requiredType="Boolean" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="BooleanConstraints" requiredType="Boolean" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>true</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="BooleanMultipleConstraints" requiredType="Boolean" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>true</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="Name" requiredType="Name" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="NameMultiple" requiredType="Name" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="NameConstraints" requiredType="Name" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="NameMultipleConstraints" requiredType="Name" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>abc</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="Path" requiredType="Path" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDef name="PathMultiple" requiredType="Path" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
+    <propertyDef name="PathConstraints" requiredType="Path" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>/abc</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+    <propertyDef name="PathMultipleConstraints" requiredType="Path" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>/abc</valueConstraint>
+      </valueConstraints>
+    </propertyDef>
+  </nodeType>
+
+  <!-- Defines a nodetype for testing NodeType.canAddChildNode() -->
+  <nodeType name="test:canAddChildNode" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <childNodeDef name="testChildWithDefaultType" defaultPrimaryType="nt:base" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSibs="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDef>
+    <childNodeDef name="testChildWithoutDefaultType" defaultPrimaryType="" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSibs="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDef>
+  </nodeType>
+
+  <!-- Defines a nodetype for testing Node.setProperty(). -->
+  <nodeType name="test:setProperty" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+      <supertype>mix:referenceable</supertype>
+    </supertypes>
+    <propertyDef name="*" requiredType="undefined" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+    <propertyDef name="test:multiProperty" requiredType="undefined" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true" />
+    <childNodeDef name="*" defaultPrimaryType="test:setProperty" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSibs="false" />
+  </nodeType>
+  
+  <!-- Defines a nodetype with a ChildNodeDef that does not allow same name siblings -->
+  <nodeType name="test:sameNameSibsFalseChildNodeDef" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDef name="*" requiredType="undefined" autoCreate="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
+    <childNodeDef name="*" defaultPrimaryType="test:sameNameSibsFalseChildNodeDef" autoCreate="false" mandatory="false" onParentVersion="COMPUTE" protected="false" sameNameSibs="false">
+      <requiredPrimaryTypes>
+        <requiredPrimaryType>nt:base</requiredPrimaryType>
+      </requiredPrimaryTypes>
+    </childNodeDef>
+  </nodeType>  
+
 </nodeTypes>
 

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repositoryStubImpl.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repositoryStubImpl.properties?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repositoryStubImpl.properties (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repositoryStubImpl.properties Wed Apr  6 08:44:42 2005
@@ -1,23 +1,15 @@
-#  Copyright 2003-2005 The Apache Software Foundation or its licensors,
-#                      as applicable
-#
-#  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.
 #
 # This is the configuration file for the jackrabbit repository test stub.
 #
 
 # Stub implementation class
-javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.test.JackrabbitRepositoryStub
+javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.core.JackrabbitRepositoryStub
+
+# repository specific configuration
+org.apache.jackrabbit.repository.config=applications/test/repository.xml
+org.apache.jackrabbit.repository.name=repo
+org.apache.jackrabbit.repository.home=applications/test
+org.apache.jackrabbit.repository.jaas.config=applications/test/jaas.config
 
 # credential configuration
 javax.jcr.tck.superuser.name=superuser
@@ -30,10 +22,10 @@
 # global test configuration
 javax.jcr.tck.testroot=/testroot
 javax.jcr.tck.nodetype=nt:unstructured
-javax.jcr.tck.nodename1=foo
-javax.jcr.tck.nodename2=bar
-javax.jcr.tck.nodename3=foobar
-javax.jcr.tck.nodename4=myname
+javax.jcr.tck.nodename1=node1
+javax.jcr.tck.nodename2=node2
+javax.jcr.tck.nodename3=node3
+javax.jcr.tck.nodename4=node4
 javax.jcr.tck.propertyname1=prop1
 javax.jcr.tck.propertyname2=prop2
 javax.jcr.tck.workspacename=test
@@ -47,14 +39,308 @@
 # Test method: testName
 javax.jcr.tck.AddNodeTest.testName.nodename1=myname
 
-# QUERY CONFIGURATION
+# ==============================================================================
+# JAVAX.JCR CONFIGURATION
+# ==============================================================================
+
+# Test class: ItemDefTest
+javax.jcr.tck.ItemDefTest.testroot=/testdata
+
+# Test class: ItemReadMethodsTest
+javax.jcr.tck.ItemReadMethodsTest.testroot=/testdata
+
+# Test class: NodeReadMethodsTest
+javax.jcr.tck.NodeReadMethodsTest.testroot=/testdata
+
+# Test class: PropertyTypeTest
+javax.jcr.tck.PropertyTypeTest.testroot=/testdata
+
+# Test class: BinaryPropertyTest
+javax.jcr.tck.BinaryPropertyTest.testroot=/testdata
+
+# Test class: BooleanPropertyTest
+javax.jcr.tck.BooleanPropertyTest.testroot=/testdata
+
+# Test class: DatePropertyTest
+javax.jcr.tck.DatePropertyTest.testroot=/testdata
+
+# Test class: DoublePropertyTest
+javax.jcr.tck.DoublePropertyTest.testroot=/testdata
+
+# Test class: LongPropertyTest
+javax.jcr.tck.LongPropertyTest.testroot=/testdata
+
+# Test class: NamePropertyTest
+javax.jcr.tck.NamePropertyTest.testroot=/testdata
+
+# Test class: PathPropertyTest
+javax.jcr.tck.PathPropertyTest.testroot=/testdata
+
+# Test class: ReferencePropertyTest
+javax.jcr.tck.ReferencePropertyTest.testroot=/testdata
+
+# Test class: StringPropertyTest
+javax.jcr.tck.StringPropertyTest.testroot=/testdata
+
+# Test class: UndefinedPropertyTest
+javax.jcr.tck.UndefinedPropertyTest.testroot=/testdata
+
+# Test class: PropertyReadMethodsTest
+javax.jcr.tck.PropertyReadMethodsTest.testroot=/testdata
+
+# Test class: NodeIteratorTest
+javax.jcr.tck.NodeIteratorTest.testroot=/testdata
+
+# Test class: NodeDiscoveringNodeTypesTest
+javax.jcr.tck.NodeDiscoveringNodeTypesTest.testroot=/testdata
+
+# Test class: RepositoryDescriptorTest
+javax.jcr.tck.RepositoryDescriptorTest.testroot=/testdata
+
+# Test class: WorkspaceReadMethodsTest
+javax.jcr.tck.WorkspaceReadMethodsTest.testroot=/testdata
+
+# Test class: SessionReadMethodsTest
+javax.jcr.tck.SessionReadMethodsTest.testroot=/testdata
+
+# Test class: NamespaceRegistryReadMethodsTest
+javax.jcr.tck.NamespaceRegistryReadMethodsTest.testroot=/testdata
+
+# Test class: NamespaceRemappingTest
+javax.jcr.tck.NamespaceRemappingTest.testroot=/testdata
+
+# Test class: SessionTest
+# Test method: testMoveItemExistsException
+# nodetype that does not allow same name siblings
+javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype2=nt:folder
+# valid node type that can be added as child of nodetype2
+javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype3=nt:hierarchyNode
+
+# Test class: SessionTest
+# Test method: testSaveContstraintViolationException
+# nodetype that has a property that is mandatory but not autocreated
+javax.jcr.tck.SessionTest.testSaveContstraintViolationException.nodetype2=nt:file
+
+# Test class: SessionUUIDTest
+# node type that has a property of type PropertyType.REFERENCE
+javax.jcr.tck.SessionUUIDTest.nodetype=nt:unstructured
+# name of the property that is of type PropertyType.REFERENCE
+javax.jcr.tck.SessionUUIDTest.propertyname1=foobar
+# nodetype that has nodetype mix:referenceable assigned
+javax.jcr.tck.SessionUUIDTest.nodetype2=test:refTargetNode
+
+# Test class: SessionUUIDTest
+# Test method: testSaveMovedRefNode
+# name of the property that can be modified
+javax.jcr.tck.SessionUUIDTest.testSaveMovedRefNode.propertyname1=foobar
+
+# Test class: NodeTest
+# Test method: testAddNodeItemExistsException
+# nodetype that does not allow same name siblings and allows child nodes of
+# the same type
+javax.jcr.tck.NodeTest.testAddNodeItemExistsException.nodetype=nt:folder
+
+# Test class: NodeTest
+# Test method: testRemoveMandatoryNode
+# nodetype that has a mandatory child node definition
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodetype2=nt:file
+# nodetype of the  mandatory child
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodetype3=nt:base
+# name of the mandatory node
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodename3=jcr:content
+
+# Test class: NodeTest
+# Test method: testSaveContstraintViolationException
+# nodetype that has a property that is mandatory but not autocreated
+javax.jcr.tck.NodeTest.testSaveContstraintViolationException.nodetype2=nt:file
+
+# Test class: NodeUUIDTest
+# node type that has a property of type PropertyType.REFERENCE
+javax.jcr.tck.NodeUUIDTest.nodetype=nt:unstructured
+# name of the property that is of type PropertyType.REFERENCE
+javax.jcr.tck.NodeUUIDTest.propertyname1=ref
+# nodetype that has nodetype mix:referenceable assigned
+javax.jcr.tck.NodeUUIDTest.nodetype2=test:refTargetNode
+
+# Test class: NodeUUIDTest
+# Test method: testSaveMovedRefNode
+# name of the property that can be modified
+javax.jcr.tck.NodeUUIDTest.testSaveMovedRefNode.propertyname1=foobar
+# nodetype that has nodetype mix:referenceable assigned
+
+# Test class: NodeOrderableChildNodesTest
+# nodetype that supports orderable child nodes
+javax.jcr.tck.NodeOrderableChildNodesTest.nodetype2=nt:unstructured
+# valid node type that can be added as child of nodetype 2
+javax.jcr.tck.NodeOrderableChildNodesTest.nodetype3=nt:unstructured
+
+# Test class: NodeOrderableChildNodesTest
+# Test method: testOrderBeforeUnsupportedRepositoryOperationException
+# nodetype that does not allow ordering of child nodes
+javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype2=nt:folder
+# valid node type that can be added as child of nodetype 2
+javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype3=nt:hierarchyNode
+
+# Test class: SetPropertyNodeTest
+# nodetype which is referenceable
+javax.jcr.tck.SetPropertyNodeTest.nodetype=test:setProperty
+
+# Test class: SetPropertyValueTest
+# property that allows multiple values
+javax.jcr.tck.SetPropertyValueTest.propertyname2=test:multiProperty
+javax.jcr.tck.SetPropertyValueTest.nodetype=test:setProperty
+
+# Test class: SetPropertyStringTest
+# property that allows multiple values
+javax.jcr.tck.SetPropertyStringTest.propertyname2=test:multiProperty
+javax.jcr.tck.SetPropertyStringTest.nodetype=test:setProperty
+
+# Test class: WorkspaceCloneSameNameSibsTest
+javax.jcr.tck.WorkspaceCloneSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDef
+javax.jcr.tck.WorkspaceCloneSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceCopyBetweenWorkspacesSameNameSibsTest
+javax.jcr.tck.WorkspaceCopyBetweenWorkspacesSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDef
+javax.jcr.tck.WorkspaceCopyBetweenWorkspacesSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceCopySameNameSibsTest
+javax.jcr.tck.WorkspaceCopySameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDef
+javax.jcr.tck.WorkspaceCopySameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceMoveSameNameSibsTest
+javax.jcr.tck.WorkspaceMoveSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDef
+javax.jcr.tck.WorkspaceMoveSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: RepositoryLoginTest
+javax.jcr.tck.RepositoryLoginTest.testroot=/testdata
+
+# Test class: ReferenceableRootNodesTest
+javax.jcr.tck.ReferenceableRootNodesTest.testroot=/testdata
+
+# Test class: ExportDocViewTest
+javax.jcr.tck.ExportDocViewTest.testroot=/testdata
+
+# ------------------------------------------------------------------------------
+# observation configuration
+# ------------------------------------------------------------------------------
+
+# Test class: AddEventListenerTest
+# Test method: testNodeType
+javax.jcr.tck.AddEventListenerTest.testNodeType.nodetype2=nt:folder
+
+# Configuration settings for the serialization.
+# Note that the serialization test tries to use as many features of the repository
+# as possible, but fails silently if a feature is not available. You have to
+# specify all of the following configuration entries, even if your repository does
+# not support the feature that is associated with them.
+
+# Root node for the example tree
+javax.jcr.tck.SerializationTest.testroot=/testdata/serialization
+
+# Node type to use for the example tree. Specify a node type that allows complex trees and all property types if possible
+javax.jcr.tck.SerializationTest.nodetype=nt:unstructured
+
+# Name of the nodes for source and target tree
+javax.jcr.tck.SerializationTest.sourceFolderName=source
+javax.jcr.tck.SerializationTest.targetFolderName=target
+javax.jcr.tck.SerializationTest.rootNodeName=test
+
+# List the properties whose values may change during serialization/deserialization. For example,
+# the UUID of a node is unique in the repository, so it will have to change when you re-import
+# a tree at a different location.
+javax.jcr.tck.SerializationTest.propertyValueMayChange= jcr:created jcr:uuid jcr:versionHistory jcr:baseVersion jcr:predecessors P_Reference
+
+# The name of the test node types. For easier diagnostics, the node types have names
+# that tell you the kind of information they store
+javax.jcr.tck.SerializationTest.nodeTypesTestNode=NodeTypes
+javax.jcr.tck.SerializationTest.mixinTypeTestNode=MixinTypes
+javax.jcr.tck.SerializationTest.propertyTypesTestNode=PropertyTypes
+javax.jcr.tck.SerializationTest.sameNameChildrenTestNode=SameNameChildren
+javax.jcr.tck.SerializationTest.multiValuePropertiesTestNode=MultiValueProperties
+javax.jcr.tck.SerializationTest.referenceableNodeTestNode=ReferenceableNode
+javax.jcr.tck.SerializationTest.orderChildrenTestNode=OrderChildren
+javax.jcr.tck.SerializationTest.namespaceTestNode=Namespace
+
+# The name of the test property types.
+javax.jcr.tck.SerializationTest.stringTestProperty=P_String
+javax.jcr.tck.SerializationTest.binaryTestProperty=P_Binary
+javax.jcr.tck.SerializationTest.dateTestProperty=P_Date
+javax.jcr.tck.SerializationTest.longTestProperty=P_Long
+javax.jcr.tck.SerializationTest.doubleTestProperty=P_Double
+javax.jcr.tck.SerializationTest.booleanTestProperty=P_Boolean
+javax.jcr.tck.SerializationTest.nameTestProperty=P_Name
+javax.jcr.tck.SerializationTest.pathTestProperty=P_Path
+javax.jcr.tck.SerializationTest.referenceTestProperty=P_Reference
+javax.jcr.tck.SerializationTest.multiValueTestProperty=P_MultiValue
+
+# Test method: testVersioningExceptionSessionFileChild
+# specified nodetype must be versionable and allow child nodes of the same type.
+javax.jcr.tck.SerializationTest.testVersioningExceptionSessionFileChild.nodetype=test:versionable
+
+# Test method: testVersioningExceptionSessionFileParent
+# specified nodetype must be versionable and allow child nodes of the same type.
+javax.jcr.tck.SerializationTest.testVersioningExceptionSessionFileParent.nodetype=test:versionable
+
+# Test class: ExportSysViewTest
+javax.jcr.tck.ExportSysViewTest.testroot=/testdata
+
+# ==============================================================================
+# JAVAX.JCR.QUERY CONFIGURATION
+# ==============================================================================
 
 # Test class: SaveTest
 # Test method: testConstraintViolationException
 # Specified node type must not allow child nodes.
 javax.jcr.tck.SaveTest.testConstraintViolationException.nodetype=nt:query
 
-# VERSIONING CONFIGURATION
+# Test class: XPathQueryLevel1Test
+javax.jcr.tck.XPathQueryLevel1Test.testroot=/testdata/query
+
+# Test class: XPathDocOrderTest
+javax.jcr.tck.XPathDocOrderTest.testroot=/testdata/query
+
+# Test class: XPathPosIndexTest
+javax.jcr.tck.XPathPosIndexTest.testroot=/testdata/query
+
+# Test class: XPathOrderByTest
+javax.jcr.tck.XPathOrderByTest.testroot=/testdata/query
+
+# Test class: XPathSyntaxTest
+javax.jcr.tck.XPathSyntaxTest.testroot=/testdata/query
+
+# Test class: XPathJcrPathTest
+javax.jcr.tck.XPathJcrPathTest.testroot=/testdata
+
+# Test class: SQLQueryLevel1Test
+javax.jcr.tck.SQLQueryLevel1Test.testroot=/testdata/query
+
+# Test class: SQLSyntaxTest
+javax.jcr.tck.SQLSyntaxTest.testroot=/testdata/query
+
+# Test class: SQLOrderByTest
+javax.jcr.tck.SQLOrderByTest.testroot=/testdata/query
+
+# Test class: DerefQueryLevel1Test
+javax.jcr.tck.DerefQueryLevel1Test.testroot=/testdata
+
+# Test class: GetPropertyNamesTest
+javax.jcr.tck.GetPropertyNamesTest.testroot=/testdata
+
+# Test class: SQLJcrPathTest
+javax.jcr.tck.SQLJcrPathTest.testroot=/testdata
+
+# Test class: SQLPathTest
+javax.jcr.tck.SQLPathTest.testroot=/testdata
+
+# Test class: PredicatesTest
+javax.jcr.tck.PredicatesTest.testroot=/testdata
+
+# Test class: SimpleSelectionTest
+javax.jcr.tck.SimpleSelectionTest.testroot=/testdata
+
+# ==============================================================================
+# JAVAX.JCR.VERSIONING CONFIGURATION
+# ==============================================================================
 
 # nodetye that is versionable. if it is not, an attempt is made to create versionable nodes
 # by adding a mix:versionable mixin-type.
@@ -90,6 +376,11 @@
 javax.jcr.tck.OnParentVersionIgnoreTest.propertyname1=test:ignoreOnParentVersionProp
 javax.jcr.tck.OnParentVersionInitializeTest.propertyname1=test:initializeOnParentVersionProp
 
+# Test class: RestoreTest
+# Test method: testRestoreWithUUIDConflict
+# nodename4 must be the name of a child node with a OPV definition COPY or VERSION
+javax.jcr.tck.RestoreTest.testRestoreWithUUIDConflict.nodename4=test:versionOnParentVersion
+
 # config for nodes that show the indicated OPV behaviour:
 # nodes are added in order to test the versioning behaviour indicated by the test-class name.
 # NOTE:
@@ -102,8 +393,3 @@
 javax.jcr.tck.OnParentVersionCopyTest.nodetype=nt:unstructured
 javax.jcr.tck.OnParentVersionAbortTest.nodename4=test:abortOnParentVersion
 javax.jcr.tck.OnParentVersionAbortTest.nodetype=nt:unstructured
-
-# repository name
-org.apache.jackrabbit.repository.config=applications/test/repository.xml
-org.apache.jackrabbit.repository.name=repo
-org.apache.jackrabbit.repository.home=applications/test

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/workspaces/default/workspace.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/workspaces/default/workspace.xml?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/workspaces/default/workspace.xml (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/workspaces/default/workspace.xml Wed Apr  6 08:44:42 2005
@@ -14,8 +14,8 @@
       persistence of the workspace:
       class: FQN of class implementing PersistenceManager interface
   -->
-  <!-- <PersistenceManager class="org.apache.jackrabbit.core.state.orm.ojb.OJBPersistenceManager" /> -->
-  <PersistenceManager class="org.apache.jackrabbit.core.state.orm.hibernate.HibernatePersistenceManager" />
+        <PersistenceManager class="org.apache.jackrabbit.core.state.orm.ojb.OJBPersistenceManager" />
+        <!--PersistenceManager class="org.apache.jackrabbit.core.state.orm.hibernate.HibernatePersistenceManager" /-->
   <!--
       Search index and the file system it uses.
   -->
@@ -24,8 +24,11 @@
     <param name="minMergeDocs" value="1000" />
     <param name="maxMergeDocs" value="10000" />
     <param name="mergeFactor" value="10" />
+    <param name="redoSize" value="1000"/>
+    <param name="bufferSize" value="10"/>
     <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
       <param name="path" value="${wsp.home}/index" />
     </FileSystem>
   </SearchIndex>
 </Workspace>
+

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/maven.xml?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/maven.xml (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/maven.xml Wed Apr  6 08:44:42 2005
@@ -29,6 +29,14 @@
        id="maven.test.compile.src.set"
        refid="parent.test.src.dir"/>
   </preGoal>
+  
+  <postGoal name="test:compile">
+    <copy todir="${maven.test.dest}">
+      <fileset dir="${basedir}/../../src/test">
+        <exclude name="**/*.java"/>
+      </fileset>
+    </copy>  
+  </postGoal>
 
    <!-- Additionally cleans the test data created -->
    <postGoal name="clean">
@@ -46,7 +54,7 @@
         <ant:delete includeEmptyDirs="true">
             <ant:fileset dir="applications/test/workspaces">
                 <ant:include name="**/*"/>
-                <!--ant:exclude name="**/workspace.xml"/-->
+                <ant:exclude name="**/workspace.xml"/>
             </ant:fileset>
         </ant:delete>
         <ant:delete dir="applications/test/tx"/>

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/project.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/project.properties?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/project.properties (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/project.properties Wed Apr  6 08:44:42 2005
@@ -13,17 +13,34 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
+######################################################################
+# Apache Central Repository
+######################################################################
+maven.repo.central=www.apache.org
+maven.repo.central.directory=/www/www.apache.org/dist/java-repository
+maven.remote.group=apcvs
+maven.changelog.factory = org.apache.maven.svnlib.SvnChangeLogFactory
 
 ######################################################################
 # JUnit Testing
 ######################################################################
-
 maven.test.failure = false
 maven.junit.fork=true
 maven.test.search.classdir=true
-maven.junit.sysproperties=org.xml.sax.driver
 maven.junit.jvmargs=-Xmx1024M
+maven.junit.sysproperties=org.xml.sax.driver java.security.auth.login.config
 org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
+java.security.auth.login.config=applications/test/jaas.config
+
+
+#If you wish to skip tests when doing builds, uncomment
+#maven.test.skip = true
+
+######################################################################
+# Checkstyle
+######################################################################
+maven.checkstyle.properties= checkstyle.xml
+maven.linkcheck.enable=false 
 
 ######################################################################
 # JavaDoc
@@ -40,7 +57,40 @@
 maven.javadoc.version=false
 
 ######################################################################
-# Checkstyle
+# Other opts
 ######################################################################
-maven.checkstyle.properties= checkstyle.xml
-maven.linkcheck.enable=false 
+# uncomment the next line to work in offline mode (no jar download & no linkcheck)
+#maven.mode.online=
+
+maven.compile.debug=on
+maven.compile.deprecation=off
+maven.compile.optimize=off
+
+maven.jarResources.basedir=src/java
+maven.jar.excludes=**/package.html
+
+# specifying additional remote repository for downloading dependencies 
+# not available at www.ibiblio.org/maven/
+maven.repo.remote = http://www.ibiblio.org/maven/,http://www.day.com/maven/
+
+######################################################################
+# Site L&F
+######################################################################
+# maven.xdoc.jsl=
+maven.xdoc.date=
+maven.xdoc.poweredby.image=maven-feather.png
+maven.xdoc.version=${pom.currentVersion}
+maven.xdoc.developmentProcessUrl=http://incubator.apache.org/projects/jackrabbit.html
+maven.changelog.range=60
+maven.changelog.factory=org.apache.maven.svnlib.SvnChangeLogFactory
+
+# ------------------------------------------------------------------------
+# M A V E N  J A R  O V E R R I D E
+# ------------------------------------------------------------------------
+#maven.jar.override = on
+#maven.jar.jcr = ${basedir}/lib/jcr.jar
+
+######################################################################
+# Site Deploy (into ../jackrabbit-site for checkout on incubator.apache.org)
+######################################################################
+maven.site.deploy.method=fs

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/hibernate/HibernatePersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/hibernate/HibernatePersistenceManager.java?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/hibernate/HibernatePersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/hibernate/HibernatePersistenceManager.java Wed Apr  6 08:44:42 2005
@@ -49,11 +49,16 @@
 import net.sf.hibernate.Transaction;
 import net.sf.hibernate.cfg.Configuration;
 import net.sf.hibernate.type.Type;
+import org.apache.jackrabbit.core.state.PersistenceManager;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.jackrabbit.core.state.ChangeLog;
+import org.apache.ojb.broker.PersistenceBrokerFactory;
+import org.apache.ojb.broker.PersistenceBrokerException;
 
 /**
  * Hibernate implementation of a Jackrabbit persistence manager.
  */
-public class HibernatePersistenceManager extends AbstractPersistenceManager {
+public class HibernatePersistenceManager implements PersistenceManager {
 
     private static Logger log = Logger.getLogger(HibernatePersistenceManager.class);
 
@@ -180,8 +185,7 @@
                         ByteArrayInputStream in = new ByteArrayInputStream(
                             ormBlobValue.getBlobValue());
                         try {
-                            BLOBFileValue blobValue = new BLOBFileValue(in);
-                            internalValueList.add(blobValue);
+                            internalValueList.add(InternalValue.create(in));
                         } catch (Throwable t) {
                             throw new ItemStateException(
                                 "Error while trying to load blob value", t);
@@ -400,52 +404,23 @@
     /**
      * @see org.apache.jackrabbit.core.state.AbstractPersistenceManager#store(NodeState)
      */
-    public void store(NodeState state) throws ItemStateException {
+    public void store(NodeState state, Session session) throws ItemStateException, HibernateException {
         log.debug("Request to store " + state.getId());
         boolean isUpdate = true;
-        Session session = null;
-        Transaction tx = null;
-        try {
-            session = sessionFactory.openSession();
-            tx = session.beginTransaction();
             HibernateNodeState nodeState = new HibernateNodeState(state);
             if (state.getStatus() == ItemState.STATUS_NEW) {
                 session.save(nodeState);
             } else {
                 session.update(nodeState);
             }
-            tx.commit();
-        } catch (HibernateException he) {
-            try {
-                if (tx != null)
-                    tx.rollback();
-            } catch (HibernateException he2) {
-                log.error("Error while rolling back transaction", he2);
-            }
-            throw new ItemStateException("Error saving " + state.getId(), he);
-        } finally {
-            if (session != null) {
-                try {
-                    session.close();
-                } catch (HibernateException he) {
-                    throw new ItemStateException(
-                        "Error while closing hibernate session", he);
-                }
-            }
-        }
     }
 
     /**
      * @see org.apache.jackrabbit.core.state.AbstractPersistenceManager#store(PropertyState)
      */
-    public void store(PropertyState state) throws ItemStateException {
+    public void store(PropertyState state, Session session) throws ItemStateException, HibernateException {
         log.debug("Request to store " + state.getId());
         boolean isUpdate = true;
-        Session session = null;
-        Transaction tx = null;
-        try {
-            session = sessionFactory.openSession();
-            tx = session.beginTransaction();
             ORMPropertyState propState = new ORMPropertyState(state);
 
             InternalValue[] values = state.getValues();
@@ -477,8 +452,6 @@
                             try {
                                 blobVal.spool(out);
                             } catch (Throwable t) {
-                                tx.rollback();
-                                session.close();
                                 throw new ItemStateException(t.getMessage(), t);
                             }
                             ormBlobValue.setSize(new Long(blobVal.getLength()));
@@ -494,39 +467,18 @@
             } else {
                 session.update(propState);
             }
-            tx.commit();
-        } catch (HibernateException he) {
-            try {
-                if (tx != null)
-                    tx.rollback();
-            } catch (HibernateException he2) {
-                log.error("Error while rolling back transaction", he2);
-            }
-            throw new ItemStateException("Error saving " + state.getId(), he);
-        } finally {
-            if (session != null) {
-                try {
-                    session.close();
-                } catch (HibernateException he) {
-                    throw new ItemStateException(
-                        "Error while closing hibernate session", he);
-                }
-            }
-        }
     }
 
     /**
      * @see org.apache.jackrabbit.core.state.AbstractPersistenceManager#store(NodeReferences)
      */
-    public void store(NodeReferences refs) throws ItemStateException {
+    public void store(NodeReferences refs, Session session) throws ItemStateException, HibernateException {
         Iterator nodeRefPropIdIter = refs.getReferences().iterator();
         log.debug("Request to store node references for targetId=" +
                   refs.getTargetId());
-        Session session = null;
-        Transaction tx = null;
-        try {
-            session = sessionFactory.openSession();
-            tx = session.beginTransaction();
+        // destroy all the references before saving
+        destroy(refs, session);
+
             int i = 0;
             while (nodeRefPropIdIter.hasNext()) {
                 PropertyId curPropertyId = (PropertyId) nodeRefPropIdIter.next();
@@ -540,39 +492,13 @@
                     session.clear();
                 }
             }
-            tx.commit();
-        } catch (HibernateException he) {
-            try {
-                if (tx != null)
-                    tx.rollback();
-            } catch (HibernateException he2) {
-                log.error("Error while rolling back transaction", he2);
-            }
-            throw new ItemStateException(
-                "Error storing node references for targetId=" +
-                refs.getTargetId(), he);
-        } finally {
-            if (session != null) {
-                try {
-                    session.close();
-                } catch (HibernateException he) {
-                    throw new ItemStateException(
-                        "Error while closing hibernate session", he);
-                }
-            }
-        }
     }
 
     /**
      * @see org.apache.jackrabbit.core.state.AbstractPersistenceManager#destroy(NodeState)
      */
-    public void destroy(NodeState state) throws ItemStateException {
+    public void destroy(NodeState state, Session session) throws ItemStateException, HibernateException {
         log.debug("Deleting node " + state.getUUID());
-        Session session = null;
-        Transaction tx = null;
-        try {
-            session = sessionFactory.openSession();
-            tx = session.beginTransaction();
             HibernateNodeState nodeState = null;
             try {
                 List nodeList = session.find(
@@ -588,37 +514,13 @@
                 }
             } catch (ObjectNotFoundException onfe) {
             }
-            tx.commit();
-        } catch (HibernateException he) {
-            try {
-                if (tx != null)
-                    tx.rollback();
-            } catch (HibernateException he2) {
-                log.error("Error while rolling back transaction", he2);
-            }
-            throw new ItemStateException("Error deleting " + state.getId(), he);
-        } finally {
-            if (session != null) {
-                try {
-                    session.close();
-                } catch (HibernateException he) {
-                    throw new ItemStateException(
-                        "Error while closing hibernate session", he);
-                }
-            }
-        }
     }
 
     /**
      * @see org.apache.jackrabbit.core.state.AbstractPersistenceManager#destroy(PropertyState)
      */
-    public void destroy(PropertyState state) throws ItemStateException {
+    public void destroy(PropertyState state, Session session) throws ItemStateException, HibernateException {
         log.debug("Deleting property " + state.getId());
-        Session session = null;
-        Transaction tx = null;
-        try {
-            session = sessionFactory.openSession();
-            tx = session.beginTransaction();
             ORMPropertyState propState = null;
             try {
                 List propertyList = session.find(
@@ -641,63 +543,132 @@
                 }
             } catch (ObjectNotFoundException onfe) {
             }
-            tx.commit();
-        } catch (HibernateException he) {
-            try {
-                if (tx != null)
-                    tx.rollback();
-            } catch (HibernateException he2) {
-                log.error("Error while rolling back transaction", he2);
-            }
-            throw new ItemStateException("Error deleting " + state.getId(), he);
-        } finally {
-            if (session != null) {
-                try {
-                    session.close();
-                } catch (HibernateException he) {
-                    throw new ItemStateException(
-                        "Error while closing hibernate session", he);
-                }
-            }
-        }
     }
 
     /**
      * @see org.apache.jackrabbit.core.state.AbstractPersistenceManager#destroy(NodeReferences)
      */
-    public void destroy(NodeReferences refs) throws ItemStateException {
+    public void destroy(NodeReferences refs, Session session) throws ItemStateException, HibernateException {
         log.debug("Deleting node refences for targetId=" +
                   refs.getTargetId().toString());
-        Session session = null;
-        Transaction tx = null;
-        try {
-            session = sessionFactory.openSession();
-            tx = session.beginTransaction();
             session.delete("from org.apache.jackrabbit.core.state.orm.ORMNodeReference as nf where nf.targetId='" +
                            refs.getTargetId().toString() +
                            "'");
             refs.clearAllReferences();
-            tx.commit();
-        } catch (HibernateException he) {
-            try {
-                if (tx != null)
+    }
+
+    /**
+     * @see PersistenceManager#createNew
+     */
+    public NodeState createNew(NodeId id)
+    {
+        return new NodeState(id.getUUID(), null, null, NodeState.STATUS_NEW,
+                false);
+    }
+
+    /**
+     * @see PersistenceManager#createNew
+     */
+    public PropertyState createNew(PropertyId id)
+    {
+        return new PropertyState(id.getName(), id.getParentUUID(),
+                PropertyState.STATUS_NEW, false);
+    }
+
+    /**
+     * @see PersistenceManager#store(ChangeLog)
+     *
+     * This method ensures that changes are either written completely to the
+     * underlying persistence layer, or not at all.
+     */
+    public void store(ChangeLog changeLog) throws ItemStateException
+    {
+        Session session = null;
+        Transaction tx = null;
+        try
+        {
+            session = sessionFactory.openSession();
+            tx = session.beginTransaction();
+            Iterator iter = changeLog.deletedStates();
+            while (iter.hasNext())
+            {
+                ItemState state = (ItemState) iter.next();
+                if (state.isNode())
+                {
+                    destroy((NodeState) state, session);
+                } else
+                {
+                    destroy((PropertyState) state, session);
+                }
+            }
+            iter = changeLog.addedStates();
+            while (iter.hasNext())
+            {
+                ItemState state = (ItemState) iter.next();
+                if (state.isNode())
+                {
+                    store((NodeState) state, session);
+                } else
+                {
+                    store((PropertyState) state, session);
+                }
+            }
+            iter = changeLog.modifiedStates();
+            while (iter.hasNext())
+            {
+                ItemState state = (ItemState) iter.next();
+                if (state.isNode())
+                {
+                    store((NodeState) state, session);
+                } else
+                {
+                    store((PropertyState) state, session);
+                }
+            }
+            iter = changeLog.modifiedRefs();
+            while (iter.hasNext())
+            {
+                NodeReferences refs = (NodeReferences) iter.next();
+                if (refs.hasReferences())
+                {
+                    store(refs, session);
+                } else
+                {
+                    destroy(refs, session);
+                }
+            }
+            tx.commit() ;
+        } catch (ItemStateException e)
+        {
+            if (tx != null) {
+                try {
                     tx.rollback();
-            } catch (HibernateException he2) {
-                log.error("Error while rolling back transaction", he2);
+                } catch (HibernateException ex) {
+                    throw new ItemStateException("Error while rolling back", ex);
+                }
             }
-            throw new ItemStateException(
-                "Error deleting node references for targetId=" +
-                refs.getTargetId().toString(), he);
-        } finally {
+            throw e;
+        } catch (HibernateException e)
+        {
+            if (tx != null) {
+                try {
+                    tx.rollback();
+                } catch (HibernateException ex) {
+                    throw new ItemStateException("Error while rolling back", ex);
+                }
+            }
+            throw new ItemStateException("Unable to store", e);
+        } finally
+        {
             if (session != null) {
                 try {
                     session.close();
-                } catch (HibernateException he) {
-                    throw new ItemStateException(
-                        "Error while closing hibernate session", he);
+                } catch (HibernateException ex) {
+                    throw new ItemStateException("Error while closing session", ex);
                 }
             }
         }
+
     }
 
 }

Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/ValuesToStringFieldConversion.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/ValuesToStringFieldConversion.java?view=diff&r1=160305&r2=160306
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/ValuesToStringFieldConversion.java (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/ValuesToStringFieldConversion.java Wed Apr  6 08:44:42 2005
@@ -30,6 +30,8 @@
 public class ValuesToStringFieldConversion
     implements FieldConversion {
 
+    public static final String SEPARATOR = "#$#";
+
     private int type;
 
     public ValuesToStringFieldConversion() {
@@ -45,7 +47,7 @@
         for (int i=0; i < values.length; i++) {
             buffer.append(values[i].toString());
             if (i < values.length - 1) {
-                buffer.append(",");
+                buffer.append(SEPARATOR);
             }
         }
         return buffer.toString();
@@ -53,7 +55,7 @@
 
     public Object sqlToJava(Object object) throws ConversionException {
         ArrayList valueList = new ArrayList();
-        StringTokenizer tokenizer = new StringTokenizer((String) object, ",");
+        StringTokenizer tokenizer = new StringTokenizer((String) object, SEPARATOR);
         while (tokenizer.hasMoreTokens()) {
             InternalValue curValue = InternalValue.valueOf(tokenizer.nextToken(), type);
             valueList.add(curValue);