jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792142 [33/35] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrab...
Date Wed, 08 Jul 2009 13:57:46 GMT
Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefTest.java Wed Jul  8 13:57:13 2009
@@ -23,14 +23,13 @@
 import java.io.StringWriter;
 import java.util.List;
 
-import junit.framework.TestCase;
-
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
 import org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceMapping;
 import org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff;
-import org.apache.jackrabbit.value.ValueFactoryImpl;
+
+import junit.framework.TestCase;
 
 public class CompactNodeTypeDefTest extends TestCase {
 
@@ -40,29 +39,27 @@
 
         // Read in node type def from test file
         Reader reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(TEST_FILE));
-        CompactNodeTypeDefReader cndReader = new CompactNodeTypeDefReader(reader, TEST_FILE,
-                new QNodeTypeDefinitionsBuilderImpl());
+        CompactNodeTypeDefReader cndReader = new CompactNodeTypeDefReader(reader, TEST_FILE);
 
-        List ntdList1 = cndReader.getNodeTypeDefs();
+        List<QNodeTypeDefinition> ntdList1 = cndReader.getNodeTypeDefinitions();
         NamespaceMapping nsm = cndReader.getNamespaceMapping();
         NamePathResolver resolver = new DefaultNamePathResolver(nsm);
 
         // Put imported node type def back into CND form with CND writer
         StringWriter sw = new StringWriter();
-        CompactNodeTypeDefWriter.write(ntdList1, nsm, resolver, ValueFactoryImpl.getInstance(), sw);
+        CompactNodeTypeDefWriter.write(ntdList1, nsm, resolver, sw);
 
         // Rerun the reader on the product of the writer
-        cndReader = new CompactNodeTypeDefReader(new StringReader(sw.toString()), TEST_FILE,
-                new QNodeTypeDefinitionsBuilderImpl());
+        cndReader = new CompactNodeTypeDefReader(new StringReader(sw.toString()), TEST_FILE);
 
-        List ntdList2 = cndReader.getNodeTypeDefs();
+        List<QNodeTypeDefinition> ntdList2 = cndReader.getNodeTypeDefinitions();
 
         if (ntdList1.size() == 0 || ntdList1.size() != ntdList2.size()) {
             fail("Exported node type definition was not successfully read back in");
         } else {
             for(int k = 0; k < ntdList1.size(); k++) {
-                QNodeTypeDefinition ntd1 = (QNodeTypeDefinition) ntdList1.get(k);
-                QNodeTypeDefinition ntd2 = (QNodeTypeDefinition) ntdList2.get(k);
+                QNodeTypeDefinition ntd1 = ntdList1.get(k);
+                QNodeTypeDefinition ntd2 = ntdList2.get(k);
 
                 NodeTypeDefDiff diff = NodeTypeDefDiff.create(ntd1, ntd2);
                 if (diff.isModified() && !diff.isTrivial()){

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java Wed Jul  8 13:57:13 2009
@@ -23,6 +23,7 @@
 import javax.jcr.NamespaceException;
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFactory;
+import javax.jcr.ValueFormatException;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.qom.QueryObjectModel;
 import junit.framework.TestCase;
@@ -31,7 +32,8 @@
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelFactoryImpl;
 import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
-import org.apache.jackrabbit.value.ValueFactoryImpl;
+import org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl;
+import org.apache.jackrabbit.spi.commons.value.QValueFactoryImpl;
 
 /**
  * This class runs function tests on the JCR-SQL2 parser.
@@ -41,7 +43,7 @@
     protected Parser parser;
 
     protected Random random = new Random();
-    
+
     static class QOMF extends QueryObjectModelFactoryImpl  {
 
         public QOMF(NamePathResolver resolver, ValueFactory factory) {
@@ -52,14 +54,13 @@
                 RepositoryException {
             return null;
         }
-        
-    };
+
+    }
 
     protected void setUp() throws Exception {
         super.setUp();
-        ValueFactory vf = ValueFactoryImpl.getInstance();
-        NamePathResolver resolver = new DefaultNamePathResolver(
-                new DummyNamespaceResolver());
+        NamePathResolver resolver = new DefaultNamePathResolver(new DummyNamespaceResolver());
+        ValueFactory vf = new ValueFactoryQImpl(QValueFactoryImpl.getInstance(), resolver);
         QueryObjectModelFactoryImpl factory = new QOMF(resolver, vf);
         parser = new Parser(factory, vf);
     }
@@ -130,6 +131,8 @@
             String q = buff.toString();
             try {
                 parser.createQueryObjectModel(q);
+            } catch (ValueFormatException e) {
+                // OK
             } catch (InvalidQueryException e) {
                 // OK
             } catch (NamespaceException e) {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/QValueTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/QValueTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/QValueTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/QValueTest.java Wed Jul  8 13:57:13 2009
@@ -30,6 +30,9 @@
 import java.io.FileWriter;
 import java.util.Arrays;
 import java.util.Calendar;
+import java.math.BigDecimal;
+import java.net.URI;
+import java.net.URISyntaxException;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -51,8 +54,9 @@
  */
 public class QValueTest extends TestCase {
 
-    private final Calendar CALENDAR = Calendar.getInstance();
+    private final Calendar CALENDAR = Calendar.getInstance();            
     private static final String REFERENCE = UUID.randomUUID().toString();
+    private static final String URI_STRING = "http://jackrabbit.apache.org";
     private static final Path ROOT_PATH = PathFactoryImpl.getInstance().getRootPath();
 
     private static final QValueFactory factory = QValueFactoryImpl.getInstance();
@@ -108,6 +112,62 @@
         }
     }
 
+    //------------------------------------------------------------< DECIMAL >---
+    public void testNullDecimalValue() throws IOException, RepositoryException {
+        try {
+            factory.create(null, PropertyType.DECIMAL);
+            fail();
+        } catch (IllegalArgumentException e) {
+            // ok
+        }
+    }
+
+    public void testCreateInvalidDecimalValue() throws RepositoryException {
+        try {
+            factory.create("any", PropertyType.DECIMAL);
+            fail("'any' cannot be converted to a valid decimal value.");
+        } catch (ValueFormatException e) {
+            // ok
+        }
+    }
+
+    public void testGetDecimalOnBooleanValue() throws RepositoryException {
+        try {
+            QValue v = factory.create(true);
+            v.getDecimal();
+            fail("'true' cannot be converted to a valid decimal value.");
+        } catch (ValueFormatException e) {
+            // ok
+        }
+    }
+
+    public void testGetDecimal() throws RepositoryException {
+        BigDecimal bd1 = new BigDecimal(Long.MAX_VALUE);
+        BigDecimal bd2 = new BigDecimal(Double.MIN_VALUE);
+
+        assertEquals(bd1, factory.create(bd1).getDecimal());
+        assertEquals(bd2, factory.create(bd2).getDecimal());
+
+        assertEquals(bd1, factory.create(Long.MAX_VALUE).getDecimal());
+        assertEquals(bd2, factory.create(Double.MIN_VALUE).getDecimal());
+    }
+
+    public void testGetDoubleOnDecimal() throws RepositoryException {
+        BigDecimal bd1 = new BigDecimal(Long.MAX_VALUE);
+        BigDecimal bd2 = new BigDecimal(Double.MIN_VALUE);
+
+        assertEquals(bd1.doubleValue(), factory.create(bd1).getDouble());
+        assertEquals(bd2.doubleValue(), factory.create(bd2).getDouble());
+    }
+
+    public void testGetLongOnDecimal() throws RepositoryException {
+        BigDecimal bd1 = new BigDecimal(Long.MAX_VALUE);
+        BigDecimal bd2 = new BigDecimal(Double.MIN_VALUE);
+
+        assertEquals(bd1.longValue(), factory.create(bd1).getLong());
+        assertEquals(bd2.longValue(), factory.create(bd2).getLong());
+    }
+
     //------------------------------------------------------------< BOOLEAN >---
     /**
      * QValueImpl has a final static constant for the TRUE and the FALSE boolean
@@ -196,19 +256,19 @@
     public void testDateValueEquality() throws RepositoryException {
         QValue v = factory.create(CALENDAR);
         QValue otherV = factory.create(CALENDAR);
-        assertEquals("Equality of qualified date value must be calculated based on their String representation.", v, otherV);
+        assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV);
     }
 
     public void testDateValueEquality2() throws RepositoryException {
         QValue v = factory.create(CALENDAR);
         QValue otherV = factory.create(v.getString(), PropertyType.DATE);
-        assertEquals("Equality of qualified date value must be calculated based on their String representation.", v, otherV);
+        assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV);
     }
 
     public void testDateValueStringRepresentation() throws RepositoryException {
         QValue v = factory.create(CALENDAR);
         String s = ISO8601.format(CALENDAR);
-        assertEquals("Expected String representation of qualified date value to be ISO8601 compliant.", s, v.getString());
+        assertEquals("Expected String representation of date value to be ISO8601 compliant.", s, v.getString());
     }
 
     //----------------------------------------------------------< REFERENCE >---
@@ -230,7 +290,7 @@
     public void testReferenceValueEquality() throws RepositoryException {
         QValue v = factory.create(REFERENCE, PropertyType.REFERENCE);
         QValue otherV = factory.create(REFERENCE, PropertyType.REFERENCE);
-        assertEquals("Qualified ref values created from the same string must be equal.", v, otherV);
+        assertEquals("Reference values created from the same string must be equal.", v, otherV);
     }
 
     public void testEqualityDifferentTypes() throws RepositoryException {
@@ -239,6 +299,65 @@
         assertFalse(v.equals(v2));
     }
 
+    //------------------------------------------------------< WEAKREFERENCE >---
+
+    public void testNullWeakReferenceValue() throws IOException, RepositoryException {
+        try {
+            factory.create(null, PropertyType.WEAKREFERENCE);
+            fail();
+        } catch (IllegalArgumentException e) {
+            // ok
+        }
+    }
+
+    public void testWeakReferenceValueType() throws RepositoryException {
+        QValue v = factory.create(REFERENCE, PropertyType.WEAKREFERENCE);
+        assertTrue("Type of a date value must be PropertyType.WEAKREFERENCE.", v.getType() == PropertyType.WEAKREFERENCE);
+    }
+
+    public void testWeakReferenceValueEquality() throws RepositoryException {
+        QValue v = factory.create(REFERENCE, PropertyType.WEAKREFERENCE);
+        QValue otherV = factory.create(REFERENCE, PropertyType.WEAKREFERENCE);
+        assertEquals("Weak reference values created from the same string must be equal.", v, otherV);
+    }
+
+    public void testEqualityDifferentTypes2() throws RepositoryException {
+        QValue v = factory.create(REFERENCE, PropertyType.WEAKREFERENCE);
+        QValue v2 = factory.create(REFERENCE, PropertyType.STRING);
+        assertFalse(v.equals(v2));
+    }
+
+    //----------------------------------------------------------------< URI >---
+
+    public void testNullUriValue() throws IOException, RepositoryException {
+        try {
+            factory.create(null, PropertyType.URI);
+            fail();
+        } catch (IllegalArgumentException e) {
+            // ok
+        }
+    }
+
+    public void testUriValueType() throws RepositoryException, URISyntaxException {
+        QValue v = factory.create(URI_STRING, PropertyType.URI);
+        assertTrue("Type of a date value must be PropertyType.URI.", v.getType() == PropertyType.URI);
+    }
+
+    public void testUriValueEquality() throws RepositoryException, URISyntaxException {
+        QValue v = factory.create(URI_STRING, PropertyType.URI);
+        QValue otherV = factory.create(URI_STRING, PropertyType.URI);
+        assertEquals("Uri values created from the same string must be equal.", v, otherV);
+
+        URI uri = new URI(URI_STRING);
+        v = factory.create(uri);
+        assertEquals("Uri values created from the same string must be equal.", v, otherV);
+    }
+
+    public void testEqualityDifferentTypes3() throws RepositoryException {
+        QValue v = factory.create(URI_STRING, PropertyType.URI);
+        QValue v2 = factory.create(URI_STRING, PropertyType.STRING);
+        assertFalse(v.equals(v2));
+    }
 
     //---------------------------------------------------------------< Name >---
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/ValueFormatTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/ValueFormatTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/ValueFormatTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/value/ValueFormatTest.java Wed Jul  8 13:57:13 2009
@@ -28,6 +28,7 @@
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.QValueFactory;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.QValue;
@@ -36,8 +37,12 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.PropertyType;
 import javax.jcr.ValueFactory;
+import javax.jcr.Value;
 import java.util.List;
 import java.util.ArrayList;
+import java.math.BigDecimal;
+import java.net.URI;
+import java.net.URISyntaxException;
 
 /**
  * <code>ValueFormatTest</code>...
@@ -90,4 +95,56 @@
         }
     }
 
+    public void testDecimal() throws RepositoryException {
+        BigDecimal bd = new BigDecimal(Double.MIN_VALUE);
+
+        Value v = vFactory.createValue(bd);
+        QValue qv = qvFactory.create(bd);
+
+        assertEquals(v, ValueFormat.getJCRValue(qv, resolver, vFactory));
+        assertEquals(qv, ValueFormat.getQValue(v, resolver, qvFactory));
+    }
+
+    public void testURI() throws RepositoryException, URISyntaxException {
+        URI uri = new URI("http://jackrabbit.apache.org");
+
+        Value v = vFactory.createValue("http://jackrabbit.apache.org", PropertyType.URI);
+        QValue qv = qvFactory.create(uri);
+
+        assertEquals(v, ValueFormat.getJCRValue(qv, resolver, vFactory));
+        assertEquals(qv, ValueFormat.getQValue(v, resolver, qvFactory));
+        assertEquals(qv, ValueFormat.getQValue("http://jackrabbit.apache.org", PropertyType.URI, resolver, qvFactory));
+    }
+
+    public void testWeakReferences() throws RepositoryException {
+        String reference = UUID.randomUUID().toString();
+
+        Value v = vFactory.createValue(reference, PropertyType.WEAKREFERENCE);
+        QValue qv = qvFactory.create(reference, PropertyType.WEAKREFERENCE);
+
+        assertEquals(v, ValueFormat.getJCRValue(qv, resolver, vFactory));
+        assertEquals(qv, ValueFormat.getQValue(v, resolver, qvFactory));
+        assertEquals(qv, ValueFormat.getQValue(reference, PropertyType.WEAKREFERENCE, resolver, qvFactory));        
+    }
+
+    public void testGetJCRString() throws RepositoryException, URISyntaxException {
+        List<QValue> qvs = new ArrayList();
+
+        String reference = UUID.randomUUID().toString();
+        qvs.add(qvFactory.create(reference, PropertyType.WEAKREFERENCE));
+        qvs.add(qvFactory.create(reference, PropertyType.REFERENCE));
+        qvs.add(qvFactory.create("anyString", PropertyType.STRING));
+        qvs.add(qvFactory.create(true));
+        qvs.add(qvFactory.create(12345));
+        qvs.add(qvFactory.create(12345.7889));
+        qvs.add(qvFactory.create(new URI("http://jackrabbit.apache.org")));
+        qvs.add(qvFactory.create(new BigDecimal(Double.MIN_VALUE)));
+        qvs.add(qvFactory.create(new byte[] {'a','b','c'}));
+        qvs.add(qvFactory.create(NameConstants.JCR_ACTIVITIES));
+        qvs.add(ValueFormat.getQValue("/a/b/c", PropertyType.PATH, resolver, qvFactory));
+
+        for (QValue qv : qvs) {
+            assertEquals(ValueFormat.getJCRValue(qv, resolver, vFactory).getString(), ValueFormat.getJCRString(qv, resolver));
+        }
+    }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/cnd-reader-test-input.cnd
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/cnd-reader-test-input.cnd?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/cnd-reader-test-input.cnd (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/cnd-reader-test-input.cnd Wed Jul  8 13:57:13 2009
@@ -15,10 +15,14 @@
  * limitations under the License.
  */
 <ex = "http://example.org/jackrabbit/example">
-<rep='internal'>
 <jcr='http://www.jcp.org/jcr/1.0'>
 <nt='http://www.jcp.org/jcr/nt/1.0'>
-<mix='http://www.jcp.org/jcr/mix/1.0'>
+
+// test remapping
+<REP='internal'>
+
+// omit this namespace to test auto-registering
+// <mix='http://www.jcp.org/jcr/mix/1.0'>
 
 //------------------------------------------------------------------------------
 // E X A M P L E  T Y P E S
@@ -35,6 +39,8 @@
   
 [ex:Empty]
 
+[NoPrefix]
+
 [ex:Reference]
   - ex:ref (reference) mandatory protected < 'ex:ref'
   
@@ -44,6 +50,32 @@
 [ex:Path]
   - ex:path (path) < 'ex:a/ex:b'  
 
+[ex:Full] > ex:NodeType
+  orderable mixin abstract primaryitem ex:p1 noquery
+  - ex:p1 (STRING) mandatory protected autocreated multiple
+  - ex:p2 (BINARY) queryops '=, <>, <, <=, >, >=, LIKE'
+  - ex:p3 (LONG) nofulltext noqueryorder
+  - ex:p4 (DOUBLE)
+  - ex:p5 (BOOLEAN)
+  - ex:p6 (NAME)
+  - ex:p8 (PATH)
+  - ex:p9 (REFERENCE)
+  - ex:pa (WEAKREFERENCE)
+  - ex:pb (DECIMAL)
+  - ex:pc (URI)
+  - ex:pd (UNDEFINED)
+  - ex:pf (*)
+  + ex:n1 (ex:NodeType) COPY
+  + ex:n2 (ex:NodeType) VERSION
+  + ex:n3 (ex:NodeType) INITIALIZE
+  + ex:n4 (ex:NodeType) COMPUTE
+  + ex:n5 (ex:NodeType) IGNORE
+  + ex:n6 (ex:NodeType) ABORT
+
+[ex:Full1] > ex:NodeType
+  orderable mixin abstract primaryitem ex:p1 query
+  - ex:p1
+
 //------------------------------------------------------------------------------
 // B A S E  T Y P E S
 //------------------------------------------------------------------------------
@@ -180,19 +212,19 @@
 // J A C K R A B B I T   I N T E R N A L S
 //------------------------------------------------------------------------------
 
-[rep:nodeTypes]
+[REP:nodeTypes]
   + * (nt:nodeType) = nt:nodeType protected abort
 
-[rep:root] > nt:unstructured
+[REP:root] > nt:unstructured
   orderable
-  + jcr:system (rep:system) = rep:system mandatory ignore
+  + jcr:system (REP:system) = REP:system mandatory ignore
 
-[rep:system]
+[REP:system]
   orderable
-  + jcr:versionStorage (rep:versionStorage) = rep:versionStorage mandatory protected abort
-  + jcr:nodeTypes (rep:nodeTypes) = rep:nodeTypes mandatory protected abort
+  + jcr:versionStorage (REP:versionStorage) = REP:versionStorage mandatory protected abort
+  + jcr:nodeTypes (REP:nodeTypes) = REP:nodeTypes mandatory protected abort
   + * (nt:base) = nt:unstructured multiple ignore
 
-[rep:versionStorage]
+[REP:versionStorage]
   + * (nt:versionHistory) = nt:versionHistory protected multiple abort
-  + * (rep:versionStorage) = rep:versionStorage protected multiple abort
+  + * (REP:versionStorage) = REP:versionStorage protected multiple abort

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt Wed Jul  8 13:57:13 2009
@@ -17,8 +17,12 @@
 
 # See also jcr-spec.pdf
 
+select * from test where name=$nt:name
+
 # 6.7.1 Query (p 99)
 select * from test
+SELECT * FROM TEST
+SeLeCt * FrOm test
 select * from test where id=1
 select * from test where id=1 order by id
 select * from test order by id
@@ -155,7 +159,7 @@
 select * from test where active=""
 select * from test where a=cast('0.01' as string)
 select * from test where a=cast('abcdef' as binary)
-select * from test where a=cast('+2001-01-01T01:02:03-00:30' as date)
+select * from test where a=cast('+2001-01-01T01:02:03.000Z' as date)
 select * from test where a=cast('10' as long)
 select * from test where a=cast('100.5' as double)
 select * from test where a=cast('3.11' as decimal)
@@ -171,15 +175,11 @@
 select * from test where name=$x and id=$y
 select * from test where name=$x14
 select * from test where name=$_
-select * from test where name=$äöü
-select * from test where name=$äöü
 
 # 6.7.36 Prefix (p 124)
 select * from test where name=$nt:name
 select * from test where name=$_:name
 select * from test where name=$_1:name
-select * from test where name=$_-.0:name
-select * from test where name=$x..:name
 
 # 6.7.37 Ordering (p 125)
 # 6.7.38 Order (p 126)

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/pom.xml?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/pom.xml Wed Jul  8 13:57:13 2009
@@ -48,14 +48,18 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
+        <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
+            <phase>package</phase>
             <goals>
-              <goal>jar</goal>
-              <goal>test-jar</goal>
+              <goal>single</goal>
             </goals>
+            <configuration>
+              <descriptors>
+                <descriptor>assembly.xml</descriptor>
+              </descriptors>
+            </configuration>
           </execution>
         </executions>
       </plugin>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java Wed Jul  8 13:57:13 2009
@@ -108,7 +108,7 @@
      * 
      * @param parentId NodeId identifying the parent node.
      * @param propertyName Name of the property to be created.
-     * @param value The qualified value of the property to be created.
+     * @param value The value of the property to be created.
      * @throws ValueFormatException
      * @throws VersionException
      * @throws LockException
@@ -139,7 +139,7 @@
      *
      * @param parentId NodeId identifying the parent node.
      * @param propertyName Name of the property to be created.
-     * @param values The qualified values of the property to be created.
+     * @param values The values of the property to be created.
      * @throws javax.jcr.ValueFormatException
      * @throws javax.jcr.version.VersionException
      * @throws javax.jcr.lock.LockException
@@ -253,6 +253,16 @@
     public void setMixins(NodeId nodeId, Name[] mixinNodeTypeNames) throws RepositoryException;
 
     /**
+     * Change the primary type of the node identified by the given <code>nodeId</code>.
+     *
+     * @param nodeId NodeId identifying the node to be modified.
+     * @param primaryNodeTypeName
+     * @throws RepositoryException
+     * @see javax.jcr.Node#setPrimaryType(String)
+     */
+    public void setPrimaryType(NodeId nodeId, Name primaryNodeTypeName) throws RepositoryException;
+
+    /**
      * Move the node identified by the given <code>srcNodeId</code> to the
      * new parent identified by <code>destParentNodeId</code> and change its
      * name to <code>destName</code>.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java Wed Jul  8 13:57:13 2009
@@ -16,6 +16,9 @@
  */
 package org.apache.jackrabbit.spi;
 
+import javax.jcr.RepositoryException;
+import java.util.Map;
+
 /**
  * <code>Event</code> is similar to the regular JCR Event and adds additional
  * information about the affected item.
@@ -47,11 +50,28 @@
      */
     public static final int PROPERTY_CHANGED = javax.jcr.observation.Event.PROPERTY_CHANGED;
 
+
+    /**
+     * An event of this type is generated when a node is moved.
+     *
+     * @since JCR 2.0
+     */
+    public static final int NODE_MOVED = javax.jcr.observation.Event.NODE_MOVED;
+
+    /**
+     * If event bundling is supported, this event is used to indicate a
+     * bundle boundary within the event journal.
+     *
+     * @since JCR 2.0
+     */
+    public static final int PERSIST = javax.jcr.observation.Event.PERSIST;
+    
     /**
      * Constant for observation listener interested in all types of events.
      */
     public static final int ALL_TYPES = Event.NODE_ADDED | Event.NODE_REMOVED |
-    Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED;
+            Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED |
+            Event.NODE_MOVED | Event.PERSIST;
 
     /**
      * Returns the type of this event: a constant defined by this interface.
@@ -62,6 +82,8 @@
      * <li><code>{@link #PROPERTY_ADDED}</code></li>
      * <li><code>{@link #PROPERTY_REMOVED}</code></li>
      * <li><code>{@link #PROPERTY_CHANGED}</code></li>
+     * <li><code>{@link #NODE_MOVED}</code></li>
+     * <li><code>{@link #PERSIST}</code></li>
      * </ul>
      *
      * @return the type of this event.
@@ -105,4 +127,33 @@
      * @return a <code>String</code>.
      */
     public String getUserID();
+
+    /**
+     * Returns the information map associated with this event.
+     *
+     * @return A <code>Map</code> containing parameter information.
+     * @throws RepositoryException if an error occurs.
+     * @see javax.jcr.observation.Event#getInfo()
+     * @since JCR 2.0
+     */
+    public Map<Name, QValue> getInfo() throws RepositoryException;
+
+    /**
+     * Returns the user data.
+     *
+     * @return the user data
+     * @see javax.jcr.observation.Event#getUserData()
+     * @since JCR 2.0
+     */
+    public String getUserData();
+
+    /**
+     * Returns the date when the change was persisted that caused this event.
+     *
+     * @return the date when the change was persisted that caused this event.
+     * @throws javax.jcr.RepositoryException if an error occurs.
+     * @see javax.jcr.observation.Event#getDate()
+     * @since JCR 2.0
+     */
+    public long getDate() throws RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventBundle.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventBundle.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventBundle.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventBundle.java Wed Jul  8 13:57:13 2009
@@ -24,14 +24,14 @@
  * <code>EventIterator</code> an <code>EventBundle</code> allows to retrieve
  * the events multiple times using the {@link #getEvents} method.
  */
-public interface EventBundle {
+public interface EventBundle extends Iterable<Event> {
 
     /**
      * Returns the events of this bundle.
      *
      * @return the {@link Event events} of this bundle.
      */
-    public Iterator getEvents();
+    public Iterator<Event> getEvents();
 
     /**
      * Returns <code>true</code> if this event bundle is associated with a

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java Wed Jul  8 13:57:13 2009
@@ -30,7 +30,7 @@
 
     /**
      * Creates a new <code>PropertyId</code> from the given parent id and
-     * qualified property name.
+     * property name.
      *
      * @param parentId
      * @param propertyName

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java Wed Jul  8 13:57:13 2009
@@ -61,10 +61,14 @@
     public Name[] getMixins();
 
     /**
+     * Return the {@link PropertyId Id}s of the properties that are referencing the
+     * node based on this info object.
+     * 
      * @return {@link PropertyId Id}s of the properties that are referencing the
      * node based on this info object or an empty array if the node is not
      * referenceable or no references exist.
      * @see PropertyInfo#getId()
+     * @deprecated Use {@link RepositoryService#getReferences(SessionInfo, NodeId, Name, boolean)} instead.
      */
     public PropertyId[] getReferences();
 
@@ -72,7 +76,7 @@
      * @return {@link PropertyId Id}s of children properties
      * @see PropertyInfo#getId()
      */
-    public Iterator getPropertyIds();
+    public Iterator<PropertyId> getPropertyIds();
 
     /**
      * Return the all <code>ChildInfo</code>s of the node represent by
@@ -90,5 +94,5 @@
      * case {@link RepositoryService#getChildInfos(SessionInfo, NodeId)} will
      * be used to load the <code>ChildInfo</code>s.
      */
-    public Iterator getChildInfos();
+    public Iterator<ChildInfo> getChildInfos();
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java Wed Jul  8 13:57:13 2009
@@ -22,7 +22,7 @@
 import javax.jcr.RepositoryException;
 
 /**
- * The <code>Path</code> interface defines the qualified representation of
+ * The <code>Path</code> interface defines the SPI level representation of
  * a JCR path. It consists of an ordered list of {@link Path.Element} objects
  * and is immutable.<p/>
  *
@@ -401,9 +401,9 @@
     public interface Element extends Serializable {
 
         /**
-         * Returns the qualified name of this path element.
+         * Returns the name of this path element.
          *
-         * @return qualified name
+         * @return The name of this path element.
          */
         public Name getName();
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java Wed Jul  8 13:57:13 2009
@@ -119,7 +119,7 @@
     public Path create(String pathString) throws IllegalArgumentException;
 
     /**
-     * Creates a path element with the given qualified name.
+     * Creates a path element from the given <code>name</code>.
      * The created path element does not contain an explicit index.
      * <p/>
      * If the specified name denotes a <i>special</i> path element (either

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyInfo.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyInfo.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyInfo.java Wed Jul  8 13:57:13 2009
@@ -47,7 +47,7 @@
     public boolean isMultiValued();
 
     /**
-     * @return Qualified values present on this <code>PropertyInfo</code>.
+     * @return The values present on this <code>PropertyInfo</code>.
      */
     public QValue[] getValues();
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java Wed Jul  8 13:57:13 2009
@@ -19,7 +19,7 @@
 import javax.jcr.nodetype.ItemDefinition;
 
 /**
- * <code>QItemDefinition</code> is the qualified SPI representation of
+ * <code>QItemDefinition</code> is the SPI representation of
  * an {@link ItemDefinition item definition}. It refers to <code>Name</code>s
  * only and is thus isolated from session-specific namespace mappings.
  *

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java Wed Jul  8 13:57:13 2009
@@ -19,7 +19,7 @@
 import javax.jcr.nodetype.NodeDefinition;
 
 /**
- * <code>QNodeDefinition</code> is the qualified SPI representation of
+ * <code>QNodeDefinition</code> is the SPI representation of
  * a {@link NodeDefinition node definition}. It refers to <code>Name</code>s only
  * and is thus isolated from session-specific namespace mappings.
  *

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java Wed Jul  8 13:57:13 2009
@@ -19,8 +19,8 @@
 import java.util.Collection;
 
 /**
- * <code>QNodeTypeDefinition</code> is the qualified SPI representation of a
- * {@link javax.jcr.nodetype.NodeType node type}. It refers to qualified names
+ * <code>QNodeTypeDefinition</code> is the SPI representation of a
+ * {@link javax.jcr.nodetype.NodeType node type}. It refers to <code>Name</code>s
  * only and is therefore independant of session-specific namespace mappings.
  *
  * @see javax.jcr.nodetype.NodeType
@@ -122,5 +122,5 @@
      *
      * @return a collection of node type <code>Name</code>s
      */
-    public Collection getDependencies();
+    public Collection<Name> getDependencies();
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QPropertyDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QPropertyDefinition.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QPropertyDefinition.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QPropertyDefinition.java Wed Jul  8 13:57:13 2009
@@ -19,9 +19,9 @@
 import javax.jcr.nodetype.PropertyDefinition;
 
 /**
- * <code>QPropertyDefinition</code> is the qualified SPI representation of
- * a {@link PropertyDefinition property definition}. It refers to
- * qualified default values and value constraints only and is thus isolated
+ * <code>QPropertyDefinition</code> is the SPI representation of
+ * a {@link PropertyDefinition property definition}. It refers to <code>Name</code>s,
+ * SPI default values and value constraints only and is thus isolated
  * from session-specific namespace mappings.
  *
  * @see javax.jcr.nodetype.PropertyDefinition
@@ -45,7 +45,7 @@
      *
      * @return the array of value constraints.
      */
-    public String[] getValueConstraints();
+    public QValueConstraint[] getValueConstraints();
 
     /**
      * Returns the array of default values or <code>null</code> if no default
@@ -68,7 +68,7 @@
      * @return the availabe query operators.
      * @since JCR 2.0
      */
-    public Name[] getAvailableQueryOperators();
+    public String[] getAvailableQueryOperators();
 
     /**
      * Reports whether this property definition is full text searchable.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java Wed Jul  8 13:57:13 2009
@@ -24,9 +24,10 @@
 import javax.jcr.Property;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
+import javax.jcr.Binary;
 
 /**
- * <code>QValue</code> is the qualified SPI representation of a
+ * <code>QValue</code> is the SPI representation of a
  * {@link javax.jcr.Value jcr value}. It therefore refers to <code>Name</code>s
  * and <code>Path</code>s only and is thus isolated from session-specific
  * namespace mappings.
@@ -37,17 +38,19 @@
 
     /**
      * Returns the <code>PropertyType</code> of this <code>QValue</code> object.
-     * It may be either of the value property types defined by the JSR 170:
+     * It may be either of the value property types defined by the JSR 283:
      * <ul>
      * <li>{@link PropertyType#BINARY}</li>
      * <li>{@link PropertyType#BOOLEAN}</li>
      * <li>{@link PropertyType#DATE}</li>
+     * <li>{@link PropertyType#DECIMAL}</li>
      * <li>{@link PropertyType#DOUBLE}</li>
      * <li>{@link PropertyType#LONG}</li>
      * <li>{@link PropertyType#NAME}</li>
      * <li>{@link PropertyType#PATH}</li>
      * <li>{@link PropertyType#REFERENCE}</li>
-     * <li>{@link PropertyType#STRING}</li>
+     * <li>{@link PropertyType#URI}</li>
+     * <li>{@link PropertyType#WEAKREFERENCE}</li>
      * </ul>
      *
      * @return the <code>PropertyType</code> of this <code>QValue</code> object.
@@ -87,6 +90,15 @@
     public InputStream getStream() throws RepositoryException;
 
     /**
+     * Returns a <code>Binary</code> representation of this <code>QValue</code>
+     * object.
+     *
+     * @return A <code>Binary</code> representation of this value.
+     * @throws RepositoryException
+     */
+    public Binary getBinary() throws RepositoryException;
+
+    /**
      * Returns a <code>Calendar</code> representation of this value.
      *
      * @return A <code>Calendar</code> representation of this value.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java Wed Jul  8 13:57:13 2009
@@ -20,6 +20,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Calendar;
+import java.math.BigDecimal;
+import java.net.URI;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
@@ -97,6 +99,21 @@
      */
     public QValue create(Path value) throws RepositoryException;
 
+    /**
+     * Create a new <code>QValue</code> with type {@link javax.jcr.PropertyType#DECIMAL}.
+     *
+     * @param value A non-null <code>BigDecimal</code>.
+     * @return a new <code>QValue</code>.
+     */
+    public QValue create(BigDecimal value) throws RepositoryException;
+
+    /**
+     * Create a new <code>QValue</code> with type {@link javax.jcr.PropertyType#URI}.
+     *
+     * @param value A non-null <code>URI</code>.
+     * @return a new <code>QValue</code>.
+     */
+    public QValue create(URI value) throws RepositoryException;
 
     /**
      * Create a new <code>QValue</code> with type {@link javax.jcr.PropertyType#BINARY}.
@@ -122,7 +139,7 @@
      * Create a new <code>QValue</code> with type {@link javax.jcr.PropertyType#BINARY}.
      *
      * @param value
-     * @return a new binarly <code>QValue</code>.
+     * @return a new binary <code>QValue</code>.
      * @throws IOException
      */
     public QValue create(File value) throws RepositoryException, IOException;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java Wed Jul  8 13:57:13 2009
@@ -21,7 +21,7 @@
 
 /**
  * <code>QueryInfo</code> is the the return value of
- * {@link RepositoryService#executeQuery(SessionInfo, String, String, Map)}
+ * {@link RepositoryService#executeQuery(SessionInfo, String, String, Map, long, long, Map)} 
  * which is used to run a query on the <code>RepositoryService</code>. It
  * provides access to the rows of the query result as well as to the column
  * names.
@@ -43,5 +43,5 @@
      * the query result.
      * @see javax.jcr.query.QueryResult#getColumnNames()
      */
-    public Name[] getColumnNames();
+    public String[] getColumnNames();
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java Wed Jul  8 13:57:13 2009
@@ -19,23 +19,32 @@
 /**
  * <code>QueryResultRow</code> represents the SPI equivalent of a query result
  * row. It provides access to the id of the Node this row represents as well
- * as to the score and to the qualified values represent in this result row.
+ * as to the score and to the values represented in this result row.
  */
 public interface QueryResultRow {
 
     /**
-     * Returns {@link NodeId} of node this result row represents.
+     * Returns {@link NodeId} of node for a given <code>selectorname</code> this
+     * result row represents.
      *
-     * @return node id of the <code>Node</code> this result row represents.
+     * @param selectorName the name of a selector or <code>null</code> for the
+     *                     default selector.
+     * @return node id of the <code>Node</code> this result row represents or
+     *         <code>null</code> if there is no node present in this row for the
+     *         given selector name.
+     * @see javax.jcr.query.Row#getNode()
+     * @see javax.jcr.query.Row#getNode(String)
      */
-    public NodeId getNodeId();
+    public NodeId getNodeId(Name selectorName);
 
     /**
-     * Returns score of this result row.
+     * Returns score for the given <code>selectorName</code> of this result row.
      *
-     * @return score of this result row.
+     * @param selectorName the name of a selector or <code>null</code> for the
+     *                     default selector.
+     * @return score for the given selector in this result row.
      */
-    public double getScore();
+    public double getScore(Name selectorName);
 
     /**
      * Returns an array of <code>QValue</code>s.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java Wed Jul  8 13:57:13 2009
@@ -68,9 +68,9 @@
  * If <code>srcWorkspaceName</code> differs from the workspace name present with
  * the SessionInfo, the copy is corresponds to a copy across workspaces.
  * The source and destination of the copy operation are specified by
- * {@link NodeId}s. The <code>Name</code> holds the new name in fully qualified
- * form. Taken together, this information is sufficient to completely specify
- * and authorize the copy operations.<p/>
+ * {@link NodeId}s. The <code>Name</code> holds the new name. Taken together,
+ * this information is sufficient to completely specify and authorize the copy
+ * operations.<p/>
  *
  * The RepositoryService in addition allows to create and submit {@link Batch}
  * objects, that cover lists of operations that have to be applied to the
@@ -121,7 +121,7 @@
      * @see javax.jcr.Repository#getDescriptorKeys()
      * @see javax.jcr.Repository#getDescriptor(String)
      */
-    public Map getRepositoryDescriptors() throws RepositoryException;
+    public Map<String, String> getRepositoryDescriptors() throws RepositoryException;
 
     //-----------------------------------< SessionInfo creation and release >---
     /**
@@ -289,7 +289,7 @@
      * @see javax.jcr.Node#getVersionHistory()
      * @see javax.jcr.version.Version#getContainingHistory()
      */
-    public Iterator getItemInfos(SessionInfo sessionInfo, NodeId nodeId) throws ItemNotFoundException, RepositoryException;
+    public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, NodeId nodeId) throws ItemNotFoundException, RepositoryException;
 
     /**
      * Returns an Iterator of <code>ChildInfo</code>s present on the
@@ -302,7 +302,31 @@
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    public Iterator getChildInfos(SessionInfo sessionInfo, NodeId parentId) throws ItemNotFoundException, RepositoryException;
+    public Iterator<ChildInfo> getChildInfos(SessionInfo sessionInfo, NodeId parentId) throws ItemNotFoundException, RepositoryException;
+
+    /**
+     * Returns the {@link PropertyId Id}s of the properties that are referencing
+     * the node identified by the given <code>nodeId</code>. If
+     * <code>weakReferences</code> is <code>true</code> the ids of
+     * {@link javax.jcr.PropertyType#WEAKREFERENCE WEAKREFERENCE} properties are
+     * returned, otherwise the property must be of type {@link javax.jcr.PropertyType#REFERENCE REFERENCE}.
+     *
+     * @param sessionInfo
+     * @param nodeId
+     * @param propertyName name filter of referring properties to be returned;
+     * if <code>null</code> then all references are returned.
+     * @param weakReferences If <code>true</code> the properties must be of type
+     * {@link javax.jcr.PropertyType#WEAKREFERENCE}, otherwise of type
+     * {@link javax.jcr.PropertyType#REFERENCE}.
+     * @return An Iterator of {@link PropertyId Id}s of the properties that are
+     * referencing the node identified by the given <code>nodeId</code> or an
+     * empty iterator if the node is not eferenceable or no references exist.
+     * @throws ItemNotFoundException
+     * @throws RepositoryException
+     * @see PropertyInfo#getId()
+     * @since JCR 2.0
+     */
+    public Iterator<PropertyId> getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences) throws ItemNotFoundException, RepositoryException;
 
     /**
      * Returns the <code>PropertyInfo</code> for the <code>Property</code>
@@ -579,13 +603,13 @@
      *
      * @param sessionInfo
      * @param nodeId
+     * @return <code>NodeId</code> of newly created version
      * @throws javax.jcr.version.VersionException
      * @throws javax.jcr.UnsupportedRepositoryOperationException
      * @throws javax.jcr.InvalidItemStateException
      * @throws javax.jcr.lock.LockException
      * @throws javax.jcr.RepositoryException
      * @see javax.jcr.Node#checkin()
-     * @return <code>NodeId</code> of newly created version
      */
     public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException;
 
@@ -608,8 +632,8 @@
      *
      * @param sessionInfo
      * @param nodeId
+     * @return <code>NodeId</code> of newly created version
      * @throws javax.jcr.UnsupportedRepositoryOperationException
-     * @throws javax.jcr.lock.LockException
      * @throws javax.jcr.RepositoryException
      * @see javax.jcr.version.VersionManager#checkpoint(String)
      * @since JCR 2.0
@@ -700,7 +724,7 @@
      * @throws javax.jcr.RepositoryException
      * @see javax.jcr.Node#merge(String, boolean)
      */
-    public Iterator merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException;
+    public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException;
 
     /**
      * Merge the node identified by the given <code>NodeId</code> and its subtree
@@ -722,7 +746,7 @@
      * @see javax.jcr.version.VersionManager#merge(String, String, boolean, boolean)
      * @since JCR 2.0
      */
-    public Iterator merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException;
+    public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException;
 
     /**
      * Resolve an existing merge conflict present with the node identified by
@@ -781,6 +805,54 @@
      */
     public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws VersionException, RepositoryException;
 
+    /**
+     * Create a new activity.
+     *
+     * @param sessionInfo
+     * @param title
+     * @return the <code>NodeId</code> of the new activity node.
+     * @throws javax.jcr.UnsupportedRepositoryOperationException
+     * @throws javax.jcr.RepositoryException
+     * @see javax.jcr.version.VersionManager#createActivity(String)
+     * @since JCR 2.0
+     */
+    public NodeId createActivity(SessionInfo sessionInfo, String title) throws UnsupportedRepositoryOperationException, RepositoryException;
+
+    /**
+     * Removes the activity identified by the specified <code>activityId</code>.
+     *
+     * @param sessionInfo
+     * @param activityId
+     * @throws javax.jcr.UnsupportedRepositoryOperationException
+     * @throws javax.jcr.RepositoryException
+     * @see javax.jcr.version.VersionManager#removeActivity(Node)
+     * @since JCR 2.0
+     */
+    public void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException;
+
+    /**
+     * Merges the activity identified by the given <code>activityId</code> into
+     * the workspace the specified <code>sessionInfo</code> has been created for.
+     *
+     * @param sessionInfo
+     * @param activityId
+     * @return an <code>Iterator</code> over the {@link NodeId}s of all nodes that
+     * received a merge result of "fail" in the course of this operation.
+     * @throws UnsupportedRepositoryOperationException
+     * @throws RepositoryException
+     */
+    public Iterator mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException;
+
+    /**
+     *
+     * @param sessionInfo
+     * @param nodeId
+     * @param baselineId   @return  @throws UnsupportedRepositoryOperationException
+     * @throws RepositoryException
+     * @see javax.jcr.version.VersionManager#createConfiguration(String, Version)
+     */
+    public NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId, NodeId baselineId) throws UnsupportedRepositoryOperationException, RepositoryException;
+
     //----------------------------------------------------------< Searching >---
     /**
      * Returns a String array identifying all query languages supported by this
@@ -796,20 +868,22 @@
 
     /**
      * Checks if the query <code>statement</code> is valid according to the
-     * specified query <code>language</code>.
+     * specified query <code>language</code> and returns the bind variable
+     * names found in the query statement.
      *
      * @param sessionInfo the session info.
      * @param statement   the query statement to check.
      * @param language    the query language.
      * @param namespaces  the locally re-mapped namespace which may be used in
      *                    the query <code>statement</code>.
+     * @return the bind variable names.
      * @throws InvalidQueryException if the query statement is invalid or the
      *                               language is not supported.
      * @throws RepositoryException   if an error occurs while checking the
      *                               statement.
      * @see javax.jcr.query.QueryManager#createQuery(String, String)
      */
-    public void checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map namespaces) throws InvalidQueryException, RepositoryException;
+    public String[] checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map<String, String> namespaces) throws InvalidQueryException, RepositoryException;
 
     /**
      * Execute the given query statement with the specified query language. The
@@ -817,16 +891,31 @@
      * to namespace uri in order to be able to properly resolve prefix:localname
      * patterns present within the query statement.
      *
-     * @param sessionInfo
-     * @param statement the query statement to be execute.
-     * @param language the query language used to parse the query <code>statement</code>.
-     * @param namespaces the locally re-mapped namespace which may be used in
-     * the query <code>statement</code>.
-     * @return
-     * @throws javax.jcr.RepositoryException
+     * @param sessionInfo the session info that wants to execute the query.
+     * @param statement   the query statement to be execute.
+     * @param language    the query language used to parse the query
+     *                    <code>statement</code>.
+     * @param namespaces  the locally re-mapped namespace which may be used in
+     *                    the query <code>statement</code>.
+     * @param limit       The maximum result size or <code>-1</code> is no
+     *                    maximum is set.
+     * @param offset      The offset in the total result set or <code>-1</code>
+     *                    is no offset is set.
+     * @param values      A Map of name/value pairs collected upon calls to
+     *                    {@link javax.jcr.query.Query#bindValue(String,
+     *                    javax.jcr.Value)}.
+     * @return The query info.
+     * @throws RepositoryException if an error occurs.
      * @see javax.jcr.query.Query#execute()
      */
-    public QueryInfo executeQuery(SessionInfo sessionInfo, String statement, String language, Map namespaces) throws RepositoryException;
+    public QueryInfo executeQuery(SessionInfo sessionInfo,
+                                  String statement,
+                                  String language,
+                                  Map<String, String> namespaces,
+                                  long limit,
+                                  long offset,
+                                  Map<String, QValue> values)
+            throws RepositoryException;
 
     //--------------------------------------------------------< Observation >---
     /**
@@ -942,6 +1031,29 @@
             throws RepositoryException, InterruptedException;
 
     /**
+     * Returns events from the <code>EventJournal</code> after a given point in
+     * time. The returned event bundle may only contain events up to a given
+     * time. In order to retrieve more events a client must call this method
+     * again with the timestamp from the last event bundle. An empty bundle
+     * indicates that there are no more events.
+     *
+     * @param sessionInfo the session info.
+     * @param filter      the event filter to apply. Please note: the
+     *                    <code>noLocal</code> flag is ignored.
+     * @param after       retrieve events that occurred after the given
+     *                    timestamp.
+     * @return the event bundle.
+     * @throws RepositoryException if an error occurs.
+     * @throws UnsupportedRepositoryOperationException
+     *                             if the underlying implementation does not
+     *                             support event journaling.
+     */
+    public EventBundle getEvents(SessionInfo sessionInfo,
+                                 EventFilter filter,
+                                 long after)
+            throws RepositoryException, UnsupportedRepositoryOperationException;
+
+    /**
      * Indicates that the passed subscription is no longer needed.
      * <p/>
      * <b>Note on thread-safety:</b> it is permissible to call this methods
@@ -966,7 +1078,7 @@
      * @see javax.jcr.NamespaceRegistry#getPrefixes()
      * @see javax.jcr.NamespaceRegistry#getURIs()
      */
-    public Map getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException;
+    public Map<String, String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException;
 
     /**
      * Returns the namespace URI for the given namespace <code>prefix</code>.
@@ -1034,7 +1146,7 @@
      * @see javax.jcr.nodetype.NodeTypeManager#getPrimaryNodeTypes()
      * @see javax.jcr.nodetype.NodeTypeManager#getNodeType(String)
      */
-    public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException;
+    public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException;
 
     /**
      * Retrieve <code>QNodeTypeDefinition</code>s for the given names. The
@@ -1056,7 +1168,7 @@
      * @see javax.jcr.nodetype.NodeTypeManager#getPrimaryNodeTypes()
      * @see javax.jcr.nodetype.NodeTypeManager#getNodeType(String)
      */
-    public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException;
+    public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException;
 
     /**
      * Registers the node types with the specified <code>QNodeTypeDefinition</code>s.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java Wed Jul  8 13:57:13 2009
@@ -16,6 +16,10 @@
  */
 package org.apache.jackrabbit.spi;
 
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.RepositoryException;
+import javax.jcr.lock.LockException;
+
 /**
  * <code>SessionInfo</code> is created upon
  * {@link RepositoryService#obtain(javax.jcr.Credentials, String)} or
@@ -51,8 +55,10 @@
      * Returns the lock tokens present on this <code>SessionInfo</code>.
      *
      * @return lock tokens present on this <code>SessionInfo</code>.
+     * @throws UnsupportedRepositoryOperationException If locking is not supported.
+     * @throws RepositoryException If another error occurs.
      */
-    public String[] getLockTokens();
+    public String[] getLockTokens() throws UnsupportedRepositoryOperationException, RepositoryException;
 
     /**
      * Add the given lock token to this <code>SessionInfo</code>. The token will
@@ -60,8 +66,12 @@
      * lock identified by the given token.
      *
      * @param lockToken to be added.
+     * @param lockToken
+     * @throws UnsupportedRepositoryOperationException If locking is not supported.
+     * @throws LockException If the token cannot be added.
+     * @throws RepositoryException If another error occurs.
      */
-    public void addLockToken(String lockToken);
+    public void addLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException;
 
     /**
      * Removes the given lock token from this <code>SessionInfo</code>.
@@ -72,6 +82,18 @@
      * with LockException provided the lock hasn't been released.
      *
      * @param lockToken to be removed.
+     * @throws UnsupportedRepositoryOperationException If locking is not supported.
+     * @throws LockException If the token cannot be removed.
+     * @throws RepositoryException If another error occurs.
+     */
+    public void removeLockToken(String lockToken) throws UnsupportedRepositoryOperationException, LockException, RepositoryException;
+
+    /**
+     * Sets the user data used for {@link org.apache.jackrabbit.spi.Event#getUserData()}.
+     *
+     * @param userData
+     * @throws RepositoryException
+     * @see javax.jcr.observation.ObservationManager#setUserData(String)
      */
-    public void removeLockToken(String lockToken);
+    public void setUserData(String userData) throws RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/package.html
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/package.html?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/package.html (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/package.html Wed Jul  8 13:57:13 2009
@@ -21,7 +21,7 @@
 <ul>
 <li>Above the SPI an implementation that whishes to expose the JCR API again
 needs to implement the transient item space, the session local namespace mapping
-and various conversions from the fully qualified values present in the SPI to
+and various conversions from the value representation in the SPI to
 the resolved values in the JCR API.</li>
 <li>An implementation of the SPI interfaces has to deal with the persistent
 view of a JCR repository. This includes almost all aspects of the JSR 170

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueFactoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueFactoryTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueFactoryTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueFactoryTest.java Wed Jul  8 13:57:13 2009
@@ -203,13 +203,13 @@
     public void testDateValueEquality() throws RepositoryException {
         QValue v = factory.create(calendar);
         QValue otherV = factory.create(calendar);
-        assertEquals("Equality of qualified date value must be calculated based on their String representation.", v, otherV);
+        assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV);
     }
 
     public void testDateValueEquality2() throws RepositoryException {
         QValue v = factory.create(calendar);
         QValue otherV = factory.create(v.getString(), PropertyType.DATE);
-        assertEquals("Equality of qualified date value must be calculated based on their String representation.", v, otherV);
+        assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV);
     }
 
     //----------------------------------------------------------< REFERENCE >---
@@ -238,7 +238,7 @@
         if (reference != null) {
             QValue v = factory.create(reference, PropertyType.REFERENCE);
             QValue otherV = factory.create(reference, PropertyType.REFERENCE);
-            assertEquals("Qualified ref values created from the same string must be equal.", v, otherV);
+            assertEquals("Reference values created from the same string must be equal.", v, otherV);
         } else {
             log.warn("Configuration entry 'QValueFactoryTest.reference' is missing -> skip test 'testReferenceValueEquality'.");
         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/QValueTest.java Wed Jul  8 13:57:13 2009
@@ -194,13 +194,13 @@
     public void testDateValueEquality() throws RepositoryException {
         QValue v = factory.create(CALENDAR);
         QValue otherV = factory.create(CALENDAR);
-        assertEquals("Equality of qualified date value must be calculated based on their String representation.", v, otherV);
+        assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV);
     }
 
     public void testDateValueEquality2() throws RepositoryException {
         QValue v = factory.create(CALENDAR);
         QValue otherV = factory.create(v.getString(), PropertyType.DATE);
-        assertEquals("Equality of qualified date value must be calculated based on their String representation.", v, otherV);
+        assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV);
     }
 
     //----------------------------------------------------------< REFERENCE >---
@@ -227,7 +227,7 @@
         if (reference != null) {
             QValue v = factory.create(reference, PropertyType.REFERENCE);
             QValue otherV = factory.create(reference, PropertyType.REFERENCE);
-            assertEquals("Qualified ref values created from the same string must be equal.", v, otherV);
+            assertEquals("Reference values created from the same string must be equal.", v, otherV);
         } else {
             log.warn("Configuration entry 'QValueFactoryTest.reference' is missing -> skip test 'testReferenceValueEquality'.");
         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java Wed Jul  8 13:57:13 2009
@@ -18,12 +18,28 @@
 
 import org.apache.jackrabbit.spi.Event;
 import org.apache.jackrabbit.spi.ItemId;
-import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.NameFactory;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.webdav.xml.DomUtil;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.QValue;
+import org.apache.jackrabbit.spi.QValueFactory;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+import org.apache.jackrabbit.spi.commons.value.ValueFormat;
 import org.apache.jackrabbit.webdav.observation.ObservationConstants;
+import org.apache.jackrabbit.webdav.xml.DomUtil;
+import org.apache.jackrabbit.webdav.xml.ElementIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Element;
 
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * <code>EventImpl</code>...
  */
@@ -31,12 +47,19 @@
         extends org.apache.jackrabbit.spi.commons.EventImpl
         implements ObservationConstants {
 
+    private static Logger log = LoggerFactory.getLogger(EventImpl.class);
+
+    private static final NameFactory N_FACTORY = NameFactoryImpl.getInstance();
+
     public EventImpl(ItemId eventId, Path eventPath, NodeId parentId, int eventType,
-                     Element eventElement) {
+                     Element eventElement, NamePathResolver resolver, QValueFactory qvFactory) {
         super(getSpiEventType(eventType), eventPath, eventId, parentId,
                 null, // TODO not available from XML_EVENT element
                 null, // TODO not available from XML_EVENT element
-                DomUtil.getChildTextTrim(eventElement, XML_EVENTUSERID, NAMESPACE));
+                DomUtil.getChildTextTrim(eventElement, XML_EVENTUSERID, NAMESPACE),
+                DomUtil.getChildTextTrim(eventElement, XML_EVENTUSERDATA, NAMESPACE),
+                Long.parseLong(DomUtil.getChildTextTrim(eventElement, XML_EVENTDATE, NAMESPACE)),
+                getEventInfo(DomUtil.getChildElement(eventElement, XML_EVENTINFO, NAMESPACE), resolver, qvFactory));
     }
 
     //--------------------------------------------------------------------------
@@ -52,8 +75,40 @@
                 return Event.PROPERTY_CHANGED;
             case javax.jcr.observation.Event.PROPERTY_REMOVED:
                 return Event.PROPERTY_REMOVED;
+            case javax.jcr.observation.Event.NODE_MOVED:
+                return Event.NODE_MOVED;
+            case javax.jcr.observation.Event.PERSIST:
+                return Event.PERSIST;
             default:
                 throw new IllegalArgumentException("Invalid event type: " + jcrEventType);
         }
     }
+
+    private static Map<Name, QValue> getEventInfo(Element infoElement,
+                                                  NamePathResolver resolver,
+                                                  QValueFactory qvFactory) {
+        if (infoElement == null) {
+            return Collections.EMPTY_MAP;
+        }
+
+        Map<Name, QValue> info = new HashMap();
+        ElementIterator it = DomUtil.getChildren(infoElement);
+        while (it.hasNext()) {
+            Element el = it.nextElement();
+            String uri = el.getNamespaceURI();
+            String localName = el.getLocalName();
+            String value = DomUtil.getTextTrim(el);
+            try {
+                Name n = N_FACTORY.create(uri, localName);
+                QValue qv = null;
+                if (value != null) {
+                    qv = ValueFormat.getQValue(value, PropertyType.PATH, resolver, qvFactory);
+                }
+                info.put(n, qv);
+            } catch (RepositoryException e) {
+                log.error("Internal Error: ", e.getMessage());
+            }
+        }
+        return info;
+    }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java Wed Jul  8 13:57:13 2009
@@ -68,7 +68,7 @@
         String typeName = propSet.get(ItemResourceConstants.JCR_TYPE).getValue().toString();
         type = PropertyType.valueFromName(typeName);
 
-        // values from jcr-server must be converted to qualified values.
+        // values from jcr-server must be converted to SPI values.
         if (propSet.contains(ItemResourceConstants.JCR_VALUE)) {
             ValuesProperty vp = new ValuesProperty(propSet.get(ItemResourceConstants.JCR_VALUE), type, valueFactory);
             Value jcrValue = vp.getJcrValue(type, valueFactory);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java Wed Jul  8 13:57:13 2009
@@ -29,6 +29,7 @@
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QValueFactory;
 import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.QValueConstraint;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -240,13 +241,14 @@
             }
             // property definitions
             for (int i = 0; i < propDefs.length; i++) {
-                // REFERENCE value constraints
-                if (propDefs[i].getRequiredType() == PropertyType.REFERENCE) {
-                    String[] ca = propDefs[i].getValueConstraints();
+                // [WEAK]REFERENCE value constraints
+                if (propDefs[i].getRequiredType() == PropertyType.REFERENCE
+                        || propDefs[i].getRequiredType() == PropertyType.WEAKREFERENCE) {
+                    QValueConstraint[] ca = propDefs[i].getValueConstraints();
                     if (ca != null) {
                         for (int j = 0; j < ca.length; j++) {
                             // TODO: don't rely on a specific factory
-                            Name ntName = NameFactoryImpl.getInstance().create(ca[j]);
+                            Name ntName = NameFactoryImpl.getInstance().create(ca[j].getString());
                             if (!name.equals(ntName)) {
                                 dependencies.add(ntName);
                             }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java Wed Jul  8 13:57:13 2009
@@ -21,8 +21,10 @@
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QValueFactory;
+import org.apache.jackrabbit.spi.QValueConstraint;
 import org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl;
 import org.apache.jackrabbit.spi.commons.value.ValueFormat;
+import org.apache.jackrabbit.spi.commons.nodetype.constraint.ValueConstraint;
 import org.apache.jackrabbit.webdav.xml.DomUtil;
 import org.apache.jackrabbit.webdav.xml.ElementIterator;
 import org.w3c.dom.Element;
@@ -50,7 +52,7 @@
     /**
      * The value constraints.
      */
-    private final String[] valueConstraints;
+    private final QValueConstraint[] valueConstraints;
 
     /**
      * The default values.
@@ -62,7 +64,7 @@
      */
     private final boolean multiple;
 
-    private final Name[] availableQueryOperators;
+    private final String[] availableQueryOperators;
     private final boolean fullTextSearcheable;
     private final boolean queryOrderable;
 
@@ -126,35 +128,31 @@
 
         child = DomUtil.getChildElement(pdefElement, VALUECONSTRAINTS_ELEMENT, null);
         if (child == null) {
-            valueConstraints = new String[0];
+            valueConstraints = QValueConstraint.EMPTY_ARRAY;
         } else {
-            List vc = new ArrayList();
+            List<QValueConstraint> vc = new ArrayList<QValueConstraint>();
             ElementIterator it = DomUtil.getChildren(child, VALUECONSTRAINT_ELEMENT, null);
             while (it.hasNext()) {
-                int constType = (requiredType == PropertyType.REFERENCE) ?  PropertyType.NAME : requiredType;
                 String qValue = DomUtil.getText(it.nextElement());
                 // in case of name and path constraint, the value must be
-                // converted to be in qualified format
-                if (constType == PropertyType.NAME || constType == PropertyType.PATH) {
-                   qValue = ValueFormat.getQValue(qValue, constType, resolver, qValueFactory).getString();
-                }
-                vc.add(qValue);
+                // converted to SPI values
+                // TODO: tobefixed. path-constraint may contain trailing *
+                vc.add(ValueConstraint.create(requiredType, qValue, resolver));
             }
-            valueConstraints = (String[]) vc.toArray(new String[vc.size()]);
+            valueConstraints = vc.toArray(new QValueConstraint[vc.size()]);
         }
 
         child = DomUtil.getChildElement(pdefElement, AVAILABLE_QUERY_OPERATORS_ELEMENT, null);
         if (child == null) {
-            availableQueryOperators = new Name[0];
+            availableQueryOperators = new String[0];
         } else {
-            List names = new ArrayList();
+            List<String> names = new ArrayList<String>();
             ElementIterator it = DomUtil.getChildren(child, AVAILABLE_QUERY_OPERATOR_ELEMENT, null);
             while (it.hasNext()) {
                 String str = DomUtil.getText(it.nextElement());
-                Name n = resolver.getQName(str);
-                names.add(n);
+                names.add(str);
             }
-            availableQueryOperators = (Name[]) names.toArray(new Name[names.size()]);
+            availableQueryOperators = names.toArray(new String[names.size()]);
         }
     }
     
@@ -169,7 +167,7 @@
     /**
      * {@inheritDoc}
      */
-    public String[] getValueConstraints() {
+    public QValueConstraint[] getValueConstraints() {
         return valueConstraints;
     }
 
@@ -190,7 +188,7 @@
     /**
      * {@inheritDoc}
      */
-    public Name[] getAvailableQueryOperators() {
+    public String[] getAvailableQueryOperators() {
         return availableQueryOperators;
     }
 



Mime
View raw message