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/06/27 16:39:40 UTC
svn commit: r201998 - in
/incubator/jackrabbit/trunk/contrib/orm-persistence: ./ applications/test/
applications/test/repository/nodetypes/
src/java/org/apache/jackrabbit/core/state/orm/
src/java/org/apache/jackrabbit/core/state/orm/hibernate/ src/java...
Author: stefan
Date: Mon Jun 27 07:39:39 2005
New Revision: 201998
URL: http://svn.apache.org/viewcvs?rev=201998&view=rev
Log:
JCR-129: applied patch supplied by serge as-is
(http://issues.apache.org/jira/browse/JCR-129)
Modified:
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/project.xml
incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMPropertyState.java
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/OJBPersistenceManager.java
incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/ValuesToStringFieldConversion.java
incubator/jackrabbit/trunk/contrib/orm-persistence/src/test/org/apache/jackrabbit/test/orm/BlobTest.java
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?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository.xml (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repository.xml Mon Jun 27 07:39:39 2005
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Repository//EN" "file://config.dtd"> -->
<!DOCTYPE Repository [
<!--
the Repository element configures a repository instance;
@@ -46,7 +45,7 @@
it also specifies the access manager to be used (AccessManager element).
-->
- <!ELEMENT Security (AccessManager)>
+ <!ELEMENT Security (AccessManager, LoginModule?)>
<!ATTLIST Security
appName CDATA #REQUIRED>
@@ -67,7 +66,16 @@
name CDATA #REQUIRED
value CDATA #REQUIRED>
- <!--
+ <!--
+ the LoginModule element optionally specifies a JAAS login module to
+ authenticate users. This feature allows the use of Jackrabbit in a
+ non-JAAS environment.
+ -->
+ <!ELEMENT LoginModule (param*)>
+ <!ATTLIST LoginModule
+ class CDATA #REQUIRED>
+
+ <!--
the Workspaces element specifies the workspaces root directory
(rootPath attribute) and the name of the default workspace
(defaultWorkspace attribute).
@@ -137,6 +145,11 @@
<AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
<!-- <param name="config" value="${rep.home}/access.xml"/> -->
</AccessManager>
+
+ <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
+ <!-- anonymous user name ('anonymous' is the default value) -->
+ <param name="anonymousId" value="anonymous"/>
+ </LoginModule>
</Security>
<!--
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?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- 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 Mon Jun 27 07:39:39 2005
@@ -76,7 +76,7 @@
<propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
</nodeType>
- <!-- Defines a nodetype for testing NodeType.canSetProperty() -->
+ <!-- Defines a nodetype for tests of NodeType.canSetProperty(), Property.setValue() and Node.setProperty() -->
<nodeType name="test:canSetProperty" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
@@ -181,6 +181,16 @@
<valueConstraint>/abc</valueConstraint>
</valueConstraints>
</propertyDefinition>
+ <propertyDefinition name="ReferenceConstraints" requiredType="Reference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints>
+ <valueConstraint>test:canSetProperty</valueConstraint>
+ </valueConstraints>
+ </propertyDefinition>
+ <propertyDefinition name="ReferenceMultipleConstraints" requiredType="Reference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints>
+ <valueConstraint>test:canSetProperty</valueConstraint>
+ </valueConstraints>
+ </propertyDefinition>
</nodeType>
<!-- Defines a nodetype for testing NodeType.canAddChildNode() -->
@@ -211,6 +221,16 @@
<childNodeDefinition name="*" defaultPrimaryType="test:setProperty" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false" />
</nodeType>
+ <!-- Defines a nodetype to test assuming the PropertyType at Node.setProperty(). -->
+ <nodeType name="test:setPropertyAssumingType" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ </supertypes>
+ <propertyDefinition name="test:singleProperty" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" />
+ <propertyDefinition name="test:multiProperty" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true" />
+ <childNodeDefinition name="*" defaultPrimaryType="test:setPropertyAssumingType" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false" />
+ </nodeType>
+
<!-- Defines a nodetype with a childNodeDefinition that does not allow same name siblings -->
<nodeType name="test:sameNameSibsFalseChildNodeDefinition" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
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?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repositoryStubImpl.properties (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/applications/test/repositoryStubImpl.properties Mon Jun 27 07:39:39 2005
@@ -250,6 +250,9 @@
# a tree at a different location.
javax.jcr.tck.SerializationTest.propertyValueMayChange= jcr:created jcr:uuid jcr:versionHistory jcr:baseVersion jcr:predecessors P_Reference
+# List all properties which are skipped during xml import according specification chapter 7.3.3
+javax.jcr.tck.SerializationTest.propertySkipped=
+
# 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
@@ -273,6 +276,9 @@
javax.jcr.tck.SerializationTest.referenceTestProperty=P_Reference
javax.jcr.tck.SerializationTest.multiValueTestProperty=P_MultiValue
+# node type not allowing same name sibs
+javax.jcr.tck.SerializationTest.sameNameSibsFalseChildNodeDefinition=test:sameNameSibsFalseChildNodeDefinition
+
# Test method: testVersioningExceptionSessionFileChild
# specified nodetype must be versionable and allow child nodes of the same type.
javax.jcr.tck.SerializationTest.testVersioningExceptionSessionFileChild.nodetype=test:versionable
@@ -280,6 +286,10 @@
# 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 method: testSessionImportXmlOverwriteException
+# requires a node type that does not allow same name siblings
+javax.jcr.tck.SerializationTest.testSessionImportXmlOverwriteException.nodetype=nt:folder
# Test class: ExportSysViewTest
javax.jcr.tck.ExportSysViewTest.testroot=/testdata
Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/project.xml?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/project.xml (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/project.xml Mon Jun 27 07:39:39 2005
@@ -52,7 +52,7 @@
<dependency>
<groupId>jackrabbit</groupId>
<artifactId>jackrabbit</artifactId>
- <version>0.16.4-dev</version>
+ <version>0.16.4.1-dev</version>
</dependency>
<dependency>
<id>concurrent</id>
@@ -74,8 +74,8 @@
<dependency>
<groupId>jsr170</groupId>
<artifactId>jcr</artifactId>
- <version>0.16.4</version>
- <url>http://www.day.com/maven/jsr170/jars/jcr-0.16.4.jar</url>
+ <version>0.16.4.1</version>
+ <url>http://www.day.com/maven/jsr170/jars/jcr-0.16.4.1.jar</url>
</dependency>
<dependency>
<id>log4j</id>
Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMPropertyState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMPropertyState.java?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMPropertyState.java (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ORMPropertyState.java Mon Jun 27 07:39:39 2005
@@ -18,7 +18,7 @@
import java.io.Serializable;
-import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.value.InternalValue;
import org.apache.jackrabbit.core.ItemId;
import org.apache.jackrabbit.core.PropertyId;
import org.apache.jackrabbit.core.nodetype.PropDefId;
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?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- 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 Mon Jun 27 07:39:39 2005
@@ -23,8 +23,8 @@
import java.util.List;
import javax.jcr.PropertyType;
-import org.apache.jackrabbit.core.BLOBFileValue;
-import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.value.BLOBFileValue;
+import org.apache.jackrabbit.core.value.InternalValue;
import org.apache.jackrabbit.core.NodeId;
import org.apache.jackrabbit.core.PropertyId;
import org.apache.jackrabbit.core.QName;
Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/OJBPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/OJBPersistenceManager.java?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/OJBPersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/src/java/org/apache/jackrabbit/core/state/orm/ojb/OJBPersistenceManager.java Mon Jun 27 07:39:39 2005
@@ -23,8 +23,8 @@
import javax.jcr.PropertyType;
-import org.apache.jackrabbit.core.BLOBFileValue;
-import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.value.BLOBFileValue;
+import org.apache.jackrabbit.core.value.InternalValue;
import org.apache.jackrabbit.core.NodeId;
import org.apache.jackrabbit.core.PropertyId;
import org.apache.jackrabbit.core.QName;
@@ -401,7 +401,7 @@
{
// destroy all the references before saving
destroy(refs, broker);
-
+
Iterator nodeRefPropIdIter = refs.getReferences().iterator();
while (nodeRefPropIdIter.hasNext())
{
@@ -420,7 +420,7 @@
throws ItemStateException
{
log.debug("Deleting node " + state.getId());
-
+
// Destroy node
OJBNodeState nodeState = new OJBNodeState(state.getId());
QueryByIdentity query = new QueryByIdentity(nodeState);
@@ -489,7 +489,7 @@
/**
* @see PersistenceManager#store(ChangeLog)
- *
+ *
* This method ensures that changes are either written completely to the
* underlying persistence layer, or not at all.
*/
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?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- 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 Mon Jun 27 07:39:39 2005
@@ -19,7 +19,7 @@
import java.util.ArrayList;
import java.util.StringTokenizer;
-import org.apache.jackrabbit.core.InternalValue;
+import org.apache.jackrabbit.core.value.InternalValue;
import org.apache.ojb.broker.accesslayer.conversions.ConversionException;
import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;
Modified: incubator/jackrabbit/trunk/contrib/orm-persistence/src/test/org/apache/jackrabbit/test/orm/BlobTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/orm-persistence/src/test/org/apache/jackrabbit/test/orm/BlobTest.java?rev=201998&r1=201997&r2=201998&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/orm-persistence/src/test/org/apache/jackrabbit/test/orm/BlobTest.java (original)
+++ incubator/jackrabbit/trunk/contrib/orm-persistence/src/test/org/apache/jackrabbit/test/orm/BlobTest.java Mon Jun 27 07:39:39 2005
@@ -16,12 +16,12 @@
*/
package org.apache.jackrabbit.test.orm;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
-import java.io.InputStream;
-import javax.jcr.StringValue;
-import java.io.ByteArrayInputStream;
-import java.io.BufferedInputStream;
+import javax.jcr.ValueFactory;
import org.apache.jackrabbit.test.AbstractJCRTest;
@@ -52,7 +52,8 @@
if (!rn.hasNode("blobnode")) {
ByteArrayInputStream inputStream = new ByteArrayInputStream(blobContent);
Node n = rn.addNode("blobnode", "nt:unstructured");
- n.setProperty("testprop", new StringValue("Hello, World."));
+ ValueFactory valueFactory = superuser.getValueFactory();
+ n.setProperty("testprop", valueFactory.createValue("Hello, World."));
n.setProperty("blobTest", inputStream);
superuser.save();
}