You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by md...@apache.org on 2011/10/11 15:58:55 UTC

svn commit: r1181785 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src: main/java/org/apache/chemistry/opencmis/jcr/ test/java/org/apache/chemistry/opencmis/jcr/query/

Author: mduerig
Date: Tue Oct 11 13:58:55 2011
New Revision: 1181785

URL: http://svn.apache.org/viewvc?rev=1181785&view=rev
Log:
CMIS-439: Allow customization of the default object types in JcrTypeManager and allow registration of base object types

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/DefaultJcrTypeManager.java
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrServiceFactory.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrUnversionedDocument.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/QueryTranslatorTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/XPathBuilderTest.java

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/DefaultJcrTypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/DefaultJcrTypeManager.java?rev=1181785&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/DefaultJcrTypeManager.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/DefaultJcrTypeManager.java Tue Oct 11 13:58:55 2011
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.jcr;
+
+import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.ContentStreamAllowed;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.FolderTypeDefinitionImpl;
+
+/**
+ * Default Type Manager that registers the required base types cmis:folder and cmis:document plus an unversionable
+ * document type with id cmis:unversioned-document.
+ */
+public class DefaultJcrTypeManager extends JcrTypeManager {
+
+    public static final String DOCUMENT_UNVERSIONED_TYPE_ID = "cmis:unversioned-document";
+
+    public DefaultJcrTypeManager() {
+
+        // folder type
+        FolderTypeDefinitionImpl folderType = new FolderTypeDefinitionImpl();
+        folderType.setBaseTypeId(BaseTypeId.CMIS_FOLDER);
+        folderType.setIsControllableAcl(false);
+        folderType.setIsControllablePolicy(false);
+        folderType.setIsCreatable(true);
+        folderType.setDescription("Folder");
+        folderType.setDisplayName("Folder");
+        folderType.setIsFileable(true);
+        folderType.setIsFulltextIndexed(false);
+        folderType.setIsIncludedInSupertypeQuery(true);
+        folderType.setLocalName("Folder");
+        folderType.setLocalNamespace(JcrTypeManager.NAMESPACE);
+        folderType.setIsQueryable(true);
+        folderType.setQueryName(JcrTypeManager.FOLDER_TYPE_ID);
+        folderType.setId(JcrTypeManager.FOLDER_TYPE_ID);
+
+        JcrTypeManager.addBasePropertyDefinitions(folderType);
+        JcrTypeManager.addFolderPropertyDefinitions(folderType);
+
+        addType(folderType);
+
+        // document type
+        DocumentTypeDefinitionImpl documentType = new DocumentTypeDefinitionImpl();
+        documentType.setBaseTypeId(BaseTypeId.CMIS_DOCUMENT);
+        documentType.setIsControllableAcl(false);
+        documentType.setIsControllablePolicy(false);
+        documentType.setIsCreatable(true);
+        documentType.setDescription("Document");
+        documentType.setDisplayName("Document");
+        documentType.setIsFileable(true);
+        documentType.setIsFulltextIndexed(false);
+        documentType.setIsIncludedInSupertypeQuery(true);
+        documentType.setLocalName("Document");
+        documentType.setLocalNamespace(JcrTypeManager.NAMESPACE);
+        documentType.setIsQueryable(true);
+        documentType.setQueryName(JcrTypeManager.DOCUMENT_TYPE_ID);
+        documentType.setId(JcrTypeManager.DOCUMENT_TYPE_ID);
+        documentType.setIsVersionable(true);
+        documentType.setContentStreamAllowed(ContentStreamAllowed.ALLOWED);
+
+        JcrTypeManager.addBasePropertyDefinitions(documentType);
+        JcrTypeManager.addDocumentPropertyDefinitions(documentType);
+
+        addType(documentType);
+
+        // non versionable document type
+        DocumentTypeDefinitionImpl unversionedDocument = new DocumentTypeDefinitionImpl();
+        unversionedDocument.initialize(documentType);
+
+        unversionedDocument.setDescription("Unversioned document");
+        unversionedDocument.setDisplayName("Unversioned document");
+        unversionedDocument.setLocalName("Unversioned document");
+        unversionedDocument.setIsQueryable(true);
+        unversionedDocument.setQueryName(DOCUMENT_UNVERSIONED_TYPE_ID);
+        unversionedDocument.setId(DOCUMENT_UNVERSIONED_TYPE_ID);
+        unversionedDocument.setParentTypeId(JcrTypeManager.DOCUMENT_TYPE_ID);
+
+        unversionedDocument.setIsVersionable(false);
+        unversionedDocument.setContentStreamAllowed(ContentStreamAllowed.ALLOWED);
+
+        JcrTypeManager.addBasePropertyDefinitions(unversionedDocument);
+        JcrTypeManager.addDocumentPropertyDefinitions(unversionedDocument);
+
+        addType(unversionedDocument);
+    }
+
+}

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java?rev=1181785&r1=1181784&r2=1181785&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java Tue Oct 11 13:58:55 2011
@@ -77,7 +77,7 @@ public class JcrNodeFactory {
 
     private static final Map<String, IdentifierMap> ID_MAPS = new HashMap<String, IdentifierMap>() {{
         put(JcrTypeManager.DOCUMENT_TYPE_ID, new DocumentIdentifierMap(true));
-        put(JcrTypeManager.DOCUMENT_UNVERSIONED_TYPE_ID, new DocumentIdentifierMap(false));
+        put(DefaultJcrTypeManager.DOCUMENT_UNVERSIONED_TYPE_ID, new DocumentIdentifierMap(false));
         put(JcrTypeManager.FOLDER_TYPE_ID, new FolderIdentifierMap());
     }};
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrServiceFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrServiceFactory.java?rev=1181785&r1=1181784&r2=1181785&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrServiceFactory.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrServiceFactory.java Tue Oct 11 13:58:55 2011
@@ -61,7 +61,7 @@ public class JcrServiceFactory extends A
 
     @Override
     public void init(Map<String, String> parameters) {
-        typeManager = new JcrTypeManager();
+        typeManager = createTypeManager();
         readConfiguration(parameters);
         jcrRepository = new JcrRepository(acquireJcrRepository(jcrConfig), mountPath, typeManager, new JcrNodeFactory());
     }
@@ -130,7 +130,11 @@ public class JcrServiceFactory extends A
         return new JcrService(jcrRepository);
     }
 
-    //------------------------------------------< private >--- 
+    protected JcrTypeManager createTypeManager() {
+        return new DefaultJcrTypeManager();
+    }
+
+    //------------------------------------------< private >---
 
     private void readConfiguration(Map<String, String> parameters) {
         Map<String, String> map = new HashMap<String, String>();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java?rev=1181785&r1=1181784&r2=1181785&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java Tue Oct 11 13:58:55 2011
@@ -26,7 +26,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionList;
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.enums.Cardinality;
-import org.apache.chemistry.opencmis.commons.enums.ContentStreamAllowed;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
 import org.apache.chemistry.opencmis.commons.enums.Updatability;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
@@ -63,82 +62,15 @@ public class JcrTypeManager implements T
     private static final Log log = LogFactory.getLog(JcrTypeManager.class);
 
     public static final String DOCUMENT_TYPE_ID = "cmis:document";
-    public static final String DOCUMENT_UNVERSIONED_TYPE_ID = "cmis:unversioned-document";
     public static final String FOLDER_TYPE_ID = "cmis:folder";
     public static final String RELATIONSHIP_TYPE_ID = "cmis:relationship";
     public static final String POLICY_TYPE_ID = "cmis:policy";
-    private static final String NAMESPACE = "http://opencmis.org/jcr";
+    public static final String NAMESPACE = "http://opencmis.org/jcr";
 
     private final Map<String, TypeDefinitionContainerImpl> fTypes;
 
     public JcrTypeManager() {
         fTypes = new HashMap<String, TypeDefinitionContainerImpl>();
-
-        // folder type
-        FolderTypeDefinitionImpl folderType = new FolderTypeDefinitionImpl();
-        folderType.setBaseTypeId(BaseTypeId.CMIS_FOLDER);
-        folderType.setIsControllableAcl(false);
-        folderType.setIsControllablePolicy(false);
-        folderType.setIsCreatable(true);
-        folderType.setDescription("Folder");
-        folderType.setDisplayName("Folder");
-        folderType.setIsFileable(true);
-        folderType.setIsFulltextIndexed(false);
-        folderType.setIsIncludedInSupertypeQuery(true);
-        folderType.setLocalName("Folder");
-        folderType.setLocalNamespace(NAMESPACE);
-        folderType.setIsQueryable(true);  
-        folderType.setQueryName(FOLDER_TYPE_ID);
-        folderType.setId(FOLDER_TYPE_ID);
-
-        addBasePropertyDefinitions(folderType);
-        addFolderPropertyDefinitions(folderType);
-
-        addTypeInternal(folderType);
-
-        // document type
-        DocumentTypeDefinitionImpl documentType = new DocumentTypeDefinitionImpl();
-        documentType.setBaseTypeId(BaseTypeId.CMIS_DOCUMENT);
-        documentType.setIsControllableAcl(false);
-        documentType.setIsControllablePolicy(false);
-        documentType.setIsCreatable(true);
-        documentType.setDescription("Document");
-        documentType.setDisplayName("Document");
-        documentType.setIsFileable(true);
-        documentType.setIsFulltextIndexed(false);
-        documentType.setIsIncludedInSupertypeQuery(true);
-        documentType.setLocalName("Document");
-        documentType.setLocalNamespace(NAMESPACE);
-        documentType.setIsQueryable(true);
-        documentType.setQueryName(DOCUMENT_TYPE_ID);
-        documentType.setId(DOCUMENT_TYPE_ID);
-        documentType.setIsVersionable(true);
-        documentType.setContentStreamAllowed(ContentStreamAllowed.ALLOWED);
-
-        addBasePropertyDefinitions(documentType);
-        addDocumentPropertyDefinitions(documentType);
-
-        addTypeInternal(documentType);
-
-        // non versionable document type
-        DocumentTypeDefinitionImpl unversionedDocument = new DocumentTypeDefinitionImpl();
-        unversionedDocument.initialize(documentType);
-
-        unversionedDocument.setDescription("Unversioned document");
-        unversionedDocument.setDisplayName("Unversioned document");
-        unversionedDocument.setLocalName("Unversioned document");
-        unversionedDocument.setIsQueryable(true);
-        unversionedDocument.setQueryName(DOCUMENT_UNVERSIONED_TYPE_ID);
-        unversionedDocument.setId(DOCUMENT_UNVERSIONED_TYPE_ID);
-        unversionedDocument.setParentTypeId(DOCUMENT_TYPE_ID);
-
-        unversionedDocument.setIsVersionable(false);
-        unversionedDocument.setContentStreamAllowed(ContentStreamAllowed.ALLOWED);
-
-        addBasePropertyDefinitions(unversionedDocument);
-        addDocumentPropertyDefinitions(unversionedDocument);
-
-        addTypeInternal(unversionedDocument);
     }
 
     /**
@@ -151,34 +83,39 @@ public class JcrTypeManager implements T
             return false;
         }
 
-        if (type.getBaseTypeId() == null) {
-            return false;
-        }
-
-        // find base type
-        TypeDefinition baseType;
-        if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) {
-            baseType = copyTypeDefinition(fTypes.get(DOCUMENT_TYPE_ID).getTypeDefinition());
-        }
-        else if (type.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) {
-            baseType = copyTypeDefinition(fTypes.get(FOLDER_TYPE_ID).getTypeDefinition());
-        }
-        else if (type.getBaseTypeId() == BaseTypeId.CMIS_RELATIONSHIP) {
-            baseType = copyTypeDefinition(fTypes.get(RELATIONSHIP_TYPE_ID).getTypeDefinition());
-        }
-        else if (type.getBaseTypeId() == BaseTypeId.CMIS_POLICY) {
-            baseType = copyTypeDefinition(fTypes.get(POLICY_TYPE_ID).getTypeDefinition());
-        }
-        else {
+        if (fTypes.containsKey(type.getId())) {
+            // can't overwrite a type
             return false;
         }
 
         AbstractTypeDefinition newType = (AbstractTypeDefinition) copyTypeDefinition(type);
 
-        // copy property definition
-        for (PropertyDefinition<?> propDef : baseType.getPropertyDefinitions().values()) {
-            ((AbstractPropertyDefinition<?>) propDef).setIsInherited(true);
-            newType.addPropertyDefinition(propDef);
+        if (!newType.getBaseTypeId().value().equals(newType.getId())) {
+
+            // find base type
+            TypeDefinition baseType;
+            if (newType.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) {
+                baseType = copyTypeDefinition(fTypes.get(DOCUMENT_TYPE_ID).getTypeDefinition());
+            }
+            else if (newType.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) {
+                baseType = copyTypeDefinition(fTypes.get(FOLDER_TYPE_ID).getTypeDefinition());
+            }
+            else if (newType.getBaseTypeId() == BaseTypeId.CMIS_RELATIONSHIP) {
+                baseType = copyTypeDefinition(fTypes.get(RELATIONSHIP_TYPE_ID).getTypeDefinition());
+            }
+            else if (newType.getBaseTypeId() == BaseTypeId.CMIS_POLICY) {
+                baseType = copyTypeDefinition(fTypes.get(POLICY_TYPE_ID).getTypeDefinition());
+            }
+            else {
+                return false;
+            }
+
+            // copy property definition
+            for (PropertyDefinition<?> propDef : baseType.getPropertyDefinitions().values()) {
+                ((AbstractPropertyDefinition<?>) propDef).setIsInherited(true);
+                newType.addPropertyDefinition(propDef);
+            }
+
         }
 
         // add it
@@ -307,8 +244,9 @@ public class JcrTypeManager implements T
     public TypeDefinition getTypeByQueryName(String typeQueryName) {
         for (TypeDefinitionContainerImpl type : fTypes.values()) {
             TypeDefinition typeDef = type.getTypeDefinition();
-            if (typeDef.getQueryName().equals(typeQueryName))
+            if (typeDef.getQueryName().equals(typeQueryName)) {
                 return typeDef;
+            }
         }
         
         return null;
@@ -329,16 +267,15 @@ public class JcrTypeManager implements T
 
     public String getPropertyIdForQueryName(TypeDefinition typeDefinition, String propQueryName) {
         for (PropertyDefinition<?> pd : typeDefinition.getPropertyDefinitions().values()) {
-            if (pd.getQueryName().equals(propQueryName))
+            if (pd.getQueryName().equals(propQueryName)) {
                 return pd.getId();
+            }
         }
 
         return null;
     }
 
-    //------------------------------------------< private >---
-
-    private static void addBasePropertyDefinitions(AbstractTypeDefinition type) {
+    public static void addBasePropertyDefinitions(AbstractTypeDefinition type) {
         type.addPropertyDefinition(createPropDef(PropertyIds.BASE_TYPE_ID, "Base Type Id", "Base Type Id",
                 PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, true));
 
@@ -367,7 +304,7 @@ public class JcrTypeManager implements T
                 PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
     }
 
-    private static void addFolderPropertyDefinitions(FolderTypeDefinitionImpl type) {
+    public static void addFolderPropertyDefinitions(FolderTypeDefinitionImpl type) {
         type.addPropertyDefinition(createPropDef(PropertyIds.PARENT_ID, "Parent Id", "Parent Id", PropertyType.ID,
                 Cardinality.SINGLE, Updatability.READONLY, false, false));
 
@@ -379,7 +316,7 @@ public class JcrTypeManager implements T
                 Cardinality.SINGLE, Updatability.READONLY, false, false));
     }
 
-    private static void addDocumentPropertyDefinitions(DocumentTypeDefinitionImpl type) {
+    public static void addDocumentPropertyDefinitions(DocumentTypeDefinitionImpl type) {
         type.addPropertyDefinition(createPropDef(PropertyIds.IS_IMMUTABLE, "Is Immutable", "Is Immutable",
                 PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false));
 
@@ -430,7 +367,7 @@ public class JcrTypeManager implements T
     /**
      * Creates a property definition object.
      */
-    private static PropertyDefinition<?> createPropDef(String id, String displayName, String description,
+    public static PropertyDefinition<?> createPropDef(String id, String displayName, String description,
             PropertyType datatype, Cardinality cardinality, Updatability updateability, boolean inherited,
             boolean required) {
 
@@ -480,6 +417,8 @@ public class JcrTypeManager implements T
         return result;
     }
 
+    //------------------------------------------< private >---
+
     /**
      * Adds a type to collection.
      */
@@ -488,11 +427,6 @@ public class JcrTypeManager implements T
             return;
         }
 
-        if (fTypes.containsKey(type.getId())) {
-            // can't overwrite a type
-            return;
-        }
-
         TypeDefinitionContainerImpl tc = new TypeDefinitionContainerImpl();
         tc.setTypeDefinition(type);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrUnversionedDocument.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrUnversionedDocument.java?rev=1181785&r1=1181784&r2=1181785&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrUnversionedDocument.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrUnversionedDocument.java Tue Oct 11 13:58:55 2011
@@ -53,7 +53,7 @@ public class JcrUnversionedDocument exte
 
     @Override
     protected String getTypeIdInternal() {
-        return JcrTypeManager.DOCUMENT_UNVERSIONED_TYPE_ID;
+        return DefaultJcrTypeManager.DOCUMENT_UNVERSIONED_TYPE_ID;
     }
 
     @Override

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/QueryTranslatorTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/QueryTranslatorTest.java?rev=1181785&r1=1181784&r2=1181785&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/QueryTranslatorTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/QueryTranslatorTest.java Tue Oct 11 13:58:55 2011
@@ -22,7 +22,7 @@ package org.apache.chemistry.opencmis.jc
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
-import org.apache.chemistry.opencmis.jcr.JcrTypeManager;
+import org.apache.chemistry.opencmis.jcr.DefaultJcrTypeManager;
 import org.apache.chemistry.opencmis.jcr.util.ISO8601;
 import org.apache.chemistry.opencmis.server.support.query.CalendarHelper;
 import org.junit.Test;
@@ -34,7 +34,7 @@ import static org.junit.Assert.*;
 public class QueryTranslatorTest {
     private String jcrTypeCondition;
 
-    final QueryTranslator queryTranslator = new QueryTranslator(new JcrTypeManager()) {
+    final QueryTranslator queryTranslator = new QueryTranslator(new DefaultJcrTypeManager()) {
         @Override
         protected String jcrPathFromId(String id) {
             assertNotNull(id);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/XPathBuilderTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/XPathBuilderTest.java?rev=1181785&r1=1181784&r2=1181785&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/XPathBuilderTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/test/java/org/apache/chemistry/opencmis/jcr/query/XPathBuilderTest.java Tue Oct 11 13:58:55 2011
@@ -21,7 +21,7 @@ package org.apache.chemistry.opencmis.jc
 
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
-import org.apache.chemistry.opencmis.jcr.JcrTypeManager;
+import org.apache.chemistry.opencmis.jcr.DefaultJcrTypeManager;
 import org.apache.chemistry.opencmis.jcr.util.ISO8601;
 import org.apache.chemistry.opencmis.server.support.query.CalendarHelper;
 import org.apache.chemistry.opencmis.server.support.query.QueryObject;
@@ -221,7 +221,7 @@ public class XPathBuilderTest {
 
     private static XPathBuilder execute(String statement) {
         QueryUtil queryUtil = new QueryUtil();
-        QueryObject queryObject = new QueryObject(new JcrTypeManager());
+        QueryObject queryObject = new QueryObject(new DefaultJcrTypeManager());
         ParseTreeWalker<XPathBuilder> parseTreeWalker = new ParseTreeWalker<XPathBuilder>(new EvaluatorXPath());
         queryUtil.traverseStatementAndCatchExc(statement, queryObject, parseTreeWalker);
         return parseTreeWalker.getResult();