chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1511617 [1/5] - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/ main/java/org/apache/chemistry/opencmis/inmemory/query/ main/java/org/apache/c...
Date Thu, 08 Aug 2013 08:40:27 GMT
Author: jens
Date: Thu Aug  8 08:40:26 2013
New Revision: 1511617

URL: http://svn.apache.org/r1511617
Log:
InMemory: merge changes accidentally committed to wrong branch

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java
Removed:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/SingleFiling.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FilingMutable.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryItemTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemorySecondaryTypeDefinition.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyUtil.java
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DataObjectCreator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryPolicyServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Folder.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/MultiFiling.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/TypeManagerCreatable.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FilingImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/InMemoryServiceValidatorImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ItemImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ObjectStoreImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/PolicyImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/RelationshipImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoredObjectImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/VersionedDocumentImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DocumentTypeCreationHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/webapp/WEB-INF/classes/repository.properties
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AclServiceTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/FolderTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceMutabilityTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersioningTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/ProcessQueryTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTypesTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DataObjectCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DataObjectCreator.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DataObjectCreator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/DataObjectCreator.java Thu Aug  8 08:40:26 2013
@@ -20,7 +20,6 @@ package org.apache.chemistry.opencmis.in
 
 import java.math.BigInteger;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
@@ -29,7 +28,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
 import org.apache.chemistry.opencmis.commons.data.ChangeEventInfo;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
-import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.data.PolicyIdList;
 import org.apache.chemistry.opencmis.commons.enums.Action;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
@@ -44,6 +42,7 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Folder;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Item;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Policy;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Relationship;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
@@ -183,9 +182,9 @@ public class DataObjectCreator {
         return polIds;
     }
 
-    public static List<ObjectData> fillRelationships(TypeManager tm, IncludeRelationships includeRelationships,
-            StoredObject so, String user) {
-        return getRelationships(tm, includeRelationships, so, user);
+    public static List<ObjectData> fillRelationships(TypeManager tm, ObjectStore objStore,
+            IncludeRelationships includeRelationships, StoredObject so, String user) {
+        return getRelationships(tm, objStore, includeRelationships, so, user);
     }
 
     public static ChangeEventInfo fillChangeEventInfo(StoredObject so) {
@@ -194,7 +193,7 @@ public class DataObjectCreator {
         return changeEventInfo;
     }
 
-    public static List<ObjectData> getRelationships(TypeManager tm, IncludeRelationships includeRelationships,
+    public static List<ObjectData> getRelationships(TypeManager tm, ObjectStore objStore, IncludeRelationships includeRelationships,
             StoredObject spo, String user) {
         if (includeRelationships != IncludeRelationships.NONE) {
             RelationshipDirection relationshipDirection = RelationshipDirection.SOURCE;
@@ -204,10 +203,10 @@ public class DataObjectCreator {
             else if (includeRelationships == IncludeRelationships.BOTH)
                 relationshipDirection = RelationshipDirection.EITHER;
             
-            List<StoredObject>  relationships = spo.getObjectRelationships(relationshipDirection, user);
+            List<StoredObject> relationships = objStore.getRelationships(spo.getId(), null, relationshipDirection); 
             List<ObjectData> res = new ArrayList<ObjectData>(relationships.size());
             for (StoredObject so : relationships) {
-                ObjectData od = PropertyCreationHelper.getObjectData(tm, so, null, user, false,
+                ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, null, user, false,
                         IncludeRelationships.NONE, null, false, false, null);
                 res.add(od);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeManagerImpl.java Thu Aug  8 08:40:26 2013
@@ -34,12 +34,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.TypeDefinitionContainerImpl;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.TypeManagerCreatable;
 import org.apache.chemistry.opencmis.inmemory.types.DocumentTypeCreationHelper;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryDocumentTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryFolderTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryItemTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryPolicyTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryRelationshipTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemorySecondaryTypeDefinition;
 import org.apache.chemistry.opencmis.inmemory.types.TypeUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -114,16 +108,17 @@ public class TypeManagerImpl implements 
      *            list of types to add to the repository
      *
      */
-    public void initTypeSystem(List<TypeDefinition> typesList) {
+    public void initTypeSystem(List<TypeDefinition> typesList, boolean createCmisDefaultTypes) {
 
-        createCmisDefaultTypes();
+        if (createCmisDefaultTypes)
+            createCmisDefaultTypes();
 
         // merge all types from the list and build the correct hierachy with
         // children
         // and property lists
         if (null != typesList) {
             for (TypeDefinition typeDef : typesList) {
-                addTypeDefinition(typeDef);
+                addTypeDefinition(typeDef, false);
             }
         }
 
@@ -139,20 +134,23 @@ public class TypeManagerImpl implements 
      *            new type to add
      */
     @Override
-	public void addTypeDefinition(TypeDefinition cmisType) {
+	public void addTypeDefinition(TypeDefinition cmisType, boolean addInheritedProperties) {
         
-        TypeDefinitionContainerImpl typeContainer = new TypeDefinitionContainerImpl(cmisType);
-
-        // add new type to children of parent types
-        TypeDefinitionContainer parentTypeContainer = fTypesMap.get(cmisType.getParentTypeId());
-        parentTypeContainer.getChildren().add(typeContainer);
-
-        // recursively add inherited properties
-        Map<String, PropertyDefinition<?>> propDefs = typeContainer.getTypeDefinition().getPropertyDefinitions();
-        addInheritedProperties(propDefs, parentTypeContainer.getTypeDefinition());
-
         LOG.info("Adding type definition with name " + cmisType.getLocalName() + " and id " 
                 + cmisType.getId() + " to repository.");
+        TypeDefinitionContainerImpl typeContainer = new TypeDefinitionContainerImpl(cmisType);
+
+        if (null != cmisType.getParentTypeId()) {
+            // add new type to children of parent types
+            TypeDefinitionContainer parentTypeContainer = fTypesMap.get(cmisType.getParentTypeId());
+            parentTypeContainer.getChildren().add(typeContainer);
+
+            if (addInheritedProperties) {
+            // recursively add inherited properties
+                Map<String, PropertyDefinition<?>> propDefs = typeContainer.getTypeDefinition().getPropertyDefinitions();
+                addInheritedProperties(propDefs, parentTypeContainer.getTypeDefinition());
+            }
+        }
         // add type to type map
         fTypesMap.put(cmisType.getId(), typeContainer);
     }
@@ -238,17 +236,18 @@ public class TypeManagerImpl implements 
     }
 
     private static boolean isRootType(TypeDefinitionContainer c) {
-        if (c.getTypeDefinition().equals(InMemoryFolderTypeDefinition.getRootFolderType())
-                || c.getTypeDefinition().equals(InMemoryDocumentTypeDefinition.getRootDocumentType())
-                || c.getTypeDefinition().equals(InMemoryRelationshipTypeDefinition.getRootRelationshipType())
-                || c.getTypeDefinition().equals(InMemoryPolicyTypeDefinition.getRootPolicyType())
-                || c.getTypeDefinition().equals(InMemoryItemTypeDefinition.getRootItemType()) // CMIS 1.1
-                || c.getTypeDefinition().equals(InMemorySecondaryTypeDefinition.getRootSecondaryType()) // CMIS 1.1
-                ) {
-            return true;
-        } else {
-            return false;
-        }
+        return (c.getTypeDefinition().getId().equals(c.getTypeDefinition().getBaseTypeId().value()));
+//        if (c.getTypeDefinition().equals(InMemoryFolderTypeDefinition.getRootFolderType())
+//                || c.getTypeDefinition().equals(InMemoryDocumentTypeDefinition.getRootDocumentType())
+//                || c.getTypeDefinition().equals(InMemoryRelationshipTypeDefinition.getRootRelationshipType())
+//                || c.getTypeDefinition().equals(InMemoryPolicyTypeDefinition.getRootPolicyType())
+//                || c.getTypeDefinition().equals(InMemoryItemTypeDefinition.getRootItemType()) // CMIS 1.1
+//                || c.getTypeDefinition().equals(InMemorySecondaryTypeDefinition.getRootSecondaryType()) // CMIS 1.1
+//                ) {
+//            return true;
+//        } else {
+//            return false;
+//        }
     }
 
     private static PropertyDefinition<?> clonePropertyDefinition(PropertyDefinition<?> src) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java Thu Aug  8 08:40:26 2013
@@ -199,19 +199,21 @@ public class TypeValidator {
             
             for (TypeDefinitionContainer tdc : tdl) {
                 TypeDefinition td = tdc.getTypeDefinition();
-                for (PropertyDefinition<?> pd1 : td.getPropertyDefinitions().values()) {
-                    // check if id is used
-                    if (pd1.getId().equals(pd2.getId()))
-                        throw new CmisConstraintException("Property id " + pd2.getId() + " already in use in type "
-                                + td.getId());
-                    // check if query name is used
-                    if (pd1.getQueryName().equals(pd2.getQueryName()))
-                        throw new CmisConstraintException("Property query name " + pd2.getQueryName() + " already in use in type "
-                                + td.getQueryName());
-                    // check if local name is used
-                    if (pd1.getLocalName().equals(pd2.getLocalName()))
-                        throw new CmisConstraintException("Property local name " + pd2.getLocalName() + " already in use in type "
-                                + td.getId());
+                if (null != td.getPropertyDefinitions()) {
+                    for (PropertyDefinition<?> pd1 : td.getPropertyDefinitions().values()) {
+                        // check if id is used
+                        if (pd1.getId().equals(pd2.getId()))
+                            throw new CmisConstraintException("Property id " + pd2.getId() + " already in use in type "
+                                    + td.getId());
+                        // check if query name is used
+                        if (pd1.getQueryName().equals(pd2.getQueryName()))
+                            throw new CmisConstraintException("Property query name " + pd2.getQueryName() + " already in use in type "
+                                    + td.getQueryName());
+                        // check if local name is used
+                        if (pd1.getLocalName().equals(pd2.getLocalName()))
+                            throw new CmisConstraintException("Property local name " + pd2.getLocalName() + " already in use in type "
+                                    + td.getId());
+                    }
                 }
             }
         }        
@@ -405,9 +407,9 @@ public class TypeValidator {
 
     private static void checkBaseAndParentType(TypeManager tm, TypeDefinition td) {
         if (null == td.getBaseTypeId()) 
-            throw new CmisInvalidArgumentException("You canno create a type without a base type id: " + td.getId());
+            throw new CmisInvalidArgumentException("You cannot create a type without a base type id: " + td.getId());
         if (null == td.getParentTypeId()) 
-            throw new CmisInvalidArgumentException("You canno create a type without a parent type id: " + td.getId());
+            throw new CmisInvalidArgumentException("You cannot create a type without a parent type id: " + td.getId());
         
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java Thu Aug  8 08:40:26 2013
@@ -54,7 +54,6 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.impl.ContentStreamDataImpl;
 import org.apache.chemistry.opencmis.inmemory.storedobj.impl.ObjectStoreImpl;
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
-import org.apache.chemistry.opencmis.inmemory.types.PropertyUtil;
 import org.apache.chemistry.opencmis.server.support.TypeManager;
 import org.apache.chemistry.opencmis.server.support.query.AbstractPredicateWalker;
 import org.apache.chemistry.opencmis.server.support.query.CmisQueryWalker;
@@ -158,7 +157,7 @@ public class InMemoryQueryProcessor {
             String queryName = queryObj.getTypes().values().iterator().next();
             TypeDefinition td = queryObj.getTypeDefinitionFromQueryName(queryName);
 
-            ObjectData od = PropertyCreationHelper.getObjectDataQueryResult(tm, td, so, user, props, funcs,
+            ObjectData od = PropertyCreationHelper.getObjectDataQueryResult(tm, objStore, td, so, user, props, funcs,
                     secondaryTypeIds, includeAllowableActions, includeRelationships, renditionFilter);
             objDataList.add(od);
         }
@@ -207,8 +206,8 @@ public class InMemoryQueryProcessor {
                     String propId = ((ColumnReference) sel).getPropertyId();
                     PropertyDefinition<?> pd = ((ColumnReference) sel).getPropertyDefinition();
                     
-                    Object propVal1 = PropertyUtil.getProperty(so1, propId, pd);
-                    Object propVal2 = PropertyUtil.getProperty(so2, propId, pd);
+                    Object propVal1 = PropertyQueryUtil.getProperty(so1, propId, pd);
+                    Object propVal2 = PropertyQueryUtil.getProperty(so2, propId, pd);
 
                     if (propVal1 == null && propVal2 == null) {
                         result = 0;
@@ -363,7 +362,7 @@ public class InMemoryQueryProcessor {
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
             List<Object> literals = onLiteralList(listNode);
-            Object prop = PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);
+            Object prop = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
 
             if (pd.getCardinality() != Cardinality.SINGLE) {
                 throw new IllegalStateException("Operator IN only is allowed on single-value properties ");
@@ -381,7 +380,7 @@ public class InMemoryQueryProcessor {
             // then it evaluates to true for null values (not set properties).
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object prop = PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);
+            Object prop = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
             List<Object> literals = onLiteralList(listNode);
             if (pd.getCardinality() != Cardinality.SINGLE) {
                 throw new IllegalStateException("Operator IN only is allowed on single-value properties ");
@@ -459,7 +458,7 @@ public class InMemoryQueryProcessor {
         public Boolean walkIsNull(Tree opNode, Tree colNode) {
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object propVal = PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);
+            Object propVal = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
             return propVal == null;
         }
 
@@ -467,7 +466,7 @@ public class InMemoryQueryProcessor {
         public Boolean walkIsNotNull(Tree opNode, Tree colNode) {
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object propVal = PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);
+            Object propVal = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
             return propVal != null;
         }
 
@@ -489,7 +488,7 @@ public class InMemoryQueryProcessor {
                 throw new IllegalStateException("LIKE is not allowed for multi-value properties ");
             }
 
-            String propVal = (String) PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);
+            String propVal = (String) PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
             
             if (null == propVal) {
             	return false;
@@ -556,7 +555,7 @@ public class InMemoryQueryProcessor {
             // System.identityHashCode(leftChild) + " is " + leftChild);
             ColumnReference colRef = getColumnReference(leftChild);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object val = PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);
+            Object val = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
             if (val==null) {
                 return null;
             } else if (val instanceof List<?>) {

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java?rev=1511617&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java Thu Aug  8 08:40:26 2013
@@ -0,0 +1,188 @@
+/*
+ * 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.inmemory.query;
+
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.data.PropertyData;
+import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
+import org.apache.chemistry.opencmis.commons.enums.Cardinality;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
+import org.apache.chemistry.opencmis.inmemory.server.InMemoryServiceContext;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.Content;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.Document;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.Folder;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.Policy;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.Relationship;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.VersionedDocument;
+
+public class PropertyQueryUtil {
+    
+    public static Object getProperty(StoredObject so, String propertyId, PropertyDefinition<?> pd) {
+        ContentStream content = null;
+        DocumentVersion ver = null;
+        VersionedDocument verDoc = null;
+        Folder folder = null;
+        Document doc = null;
+        Relationship rel = null;
+        Policy pol = null;
+        
+        boolean cmis11 = InMemoryServiceContext.getCallContext().getCmisVersion() != CmisVersion.CMIS_1_0;
+
+        if (so instanceof Content)
+            content = ((Content) so).getContent(0, 0);
+        if (so instanceof DocumentVersion)
+            ver = (DocumentVersion) so;
+        if (so instanceof VersionedDocument)
+            verDoc = (VersionedDocument) so;
+        if (so instanceof Folder)
+            folder = (Folder) so;
+        if (so instanceof Document)
+            doc = (Document) so;
+        if (so instanceof Relationship)
+            rel = (Relationship) so;
+        if (so instanceof Policy)
+            pol = (Policy) so;
+
+        // generic properties:
+        if (propertyId.equals(PropertyIds.NAME)) {
+            return so.getName();
+        }
+        if (propertyId.equals(PropertyIds.OBJECT_ID)) {
+            return so.getId();
+        }
+        if (propertyId.equals(PropertyIds.OBJECT_TYPE_ID)) {
+            return so.getTypeId();
+        }
+        if (propertyId.equals(PropertyIds.BASE_TYPE_ID)) {
+            return null; // TOODO: return so.getBaseTypeId());
+        }
+        if (propertyId.equals(PropertyIds.CREATED_BY)) {
+            return so.getCreatedBy();
+        }
+        if (propertyId.equals(PropertyIds.CREATION_DATE)) {
+            return so.getCreatedAt();
+        }
+        if (propertyId.equals(PropertyIds.LAST_MODIFIED_BY)) {
+            return so.getModifiedBy();
+        }
+        if (propertyId.equals(PropertyIds.LAST_MODIFICATION_DATE)) {
+            return so.getModifiedAt();
+        }
+        if (propertyId.equals(PropertyIds.CHANGE_TOKEN)) {
+            return so.getChangeToken();
+        }
+        if (cmis11 && propertyId.equals(PropertyIds.DESCRIPTION)) {
+            return so.getDescription();
+        }
+
+        if (ver != null) {
+            // get version related properties
+            // not support on a version, only on a versioned document:
+            // VERSION_SERIES_ID, IS_VERSION_SERIES_CHECKED_OUT,
+            // VERSION_SERIES_CHECKED_OUT_BY,
+            // VERSION_SERIES_CHECKED_OUT_ID, IS_LATEST_MAJOR_VERSION,
+            // IS_LATEST_VERSION
+            if (propertyId.equals(PropertyIds.IS_MAJOR_VERSION)) {
+                return ver.isMajor();
+            }
+
+            if (propertyId.equals(PropertyIds.CHECKIN_COMMENT)) {
+                return ver.getCheckinComment();
+            }
+            if (propertyId.equals(PropertyIds.VERSION_LABEL)) {
+                return ver.getVersionLabel();
+            }
+            if (propertyId.equals(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID)) {
+                return ver.isPwc() ? ver.getId() : null;
+            }
+        }
+
+        // get versioned document related properties
+        if (verDoc != null) {
+            if (propertyId.equals(PropertyIds.VERSION_SERIES_ID)) {
+                return verDoc.getId();
+            }
+            if (propertyId.equals(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT)) {
+                return verDoc.isCheckedOut();
+            }
+            if (propertyId.equals(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY)) {
+                return verDoc.getCheckedOutBy();
+            }
+        }
+
+        // Set the content related properties
+        if (null != content) {
+            // omit: PropertyIds.CMIS_CONTENT_STREAM_ID
+            if (propertyId.equals(PropertyIds.CONTENT_STREAM_FILE_NAME)) {
+                return content.getFileName();
+            }
+
+            if (propertyId.equals(PropertyIds.CONTENT_STREAM_LENGTH)) {
+                return content.getBigLength();
+            }
+            if (propertyId.equals(PropertyIds.CONTENT_STREAM_MIME_TYPE)) {
+                return content.getMimeType();
+            }
+        }
+
+        if (folder != null) {
+            // not supported: ALLOWED_CHILD_OBJECT_TYPE_IDS
+            // not supported: PATH
+            if (propertyId.equals(PropertyIds.PARENT_ID)) {
+                return folder.getParentId();
+            }
+        }
+
+        if (doc != null) {
+            if (propertyId.equals(PropertyIds.IS_IMMUTABLE)) {
+                return false;
+            }
+        }
+
+        if (rel != null) {
+            if (propertyId.equals(PropertyIds.SOURCE_ID)) {
+                return rel.getSourceObjectId();
+            }
+            if (propertyId.equals(PropertyIds.TARGET_ID)) {
+                return rel.getTargetObjectId();
+            }
+        }
+        
+        if (pol != null) {
+            if (propertyId.equals(PropertyIds.POLICY_TEXT)) {
+                return pol.getPolicyText();
+            }
+        }
+        
+       // try custom property:
+       PropertyData<?> lVal = so.getProperties().get(propertyId);
+       if (null == lVal)
+           return null;
+       else if (pd.getCardinality() == Cardinality.SINGLE) {
+           return lVal.getFirstValue();
+       } else {
+           return lVal.getValues();
+       }
+    }
+
+}

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java Thu Aug  8 08:40:26 2013
@@ -77,6 +77,7 @@ public class AtomLinkInfoProvider {
             return;
         }
         TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         // Fill all setters:
         objInfo.setId(so.getId());
@@ -95,7 +96,8 @@ public class AtomLinkInfoProvider {
             objInfo.setIsCurrentVersion(ver == ver.getParentDocument().getLatestVersion(false));
             objInfo.setVersionSeriesId(ver.getParentDocument().getId());
             objInfo.setWorkingCopyId(pwc == null ? null : pwc.getId());
-            objInfo.setWorkingCopyOriginalId(pwc == ver ? ver.getParentDocument().getPwc().getId()
+            objInfo.setWorkingCopyOriginalId(pwc == ver && ver.getParentDocument().getLatestVersion(false) != null ?
+                    ver.getParentDocument().getLatestVersion(false).getId()
                     : null);
         } else if (so instanceof VersionedDocument) {
             VersionedDocument doc = (VersionedDocument) so;
@@ -149,12 +151,12 @@ public class AtomLinkInfoProvider {
 
         // Relationships
         objInfo.setSupportsRelationships(true);
-        List<StoredObject> rels = so.getObjectRelationships(RelationshipDirection.SOURCE, null);
+        List<StoredObject> rels = objStore.getRelationships(so.getId(), null, RelationshipDirection.SOURCE);
         List<String> srcIds = new ArrayList<String>(rels.size());
         for (StoredObject rel : rels)
             srcIds.add(rel.getId());
         
-        rels = so.getObjectRelationships(RelationshipDirection.TARGET, null);
+        rels = objStore.getRelationships(so.getId(), null, RelationshipDirection.TARGET);
         List<String> targetIds = new ArrayList<String>(rels.size());
         for (StoredObject rel : rels)
             targetIds.add(rel.getId());
@@ -172,8 +174,8 @@ public class AtomLinkInfoProvider {
 
     public void fillInformationForAtomLinks(String repositoryId, StoredObject so, ObjectInfoImpl objectInfo) {
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, so, null, null, false,
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
+        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, null, null, false,
                 IncludeRelationships.NONE, null, false, false, null);
         fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/BaseServiceValidatorImpl.java Thu Aug  8 08:40:26 2013
@@ -161,6 +161,7 @@ public class BaseServiceValidatorImpl im
 
     protected StoredObject[] checkParams(String repositoryId, String objectId1, String objectId2) {
         StoredObject[] so = new StoredObject[2];
+        checkRepositoryId(repositoryId);
         ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         so[0] = checkExistingObjectId(objectStore, objectId1);
         so[1] = checkExistingObjectId(objectStore, objectId2);
@@ -450,7 +451,18 @@ public class BaseServiceValidatorImpl im
 	public StoredObject[] removeObjectFromFolder(CallContext context, String repositoryId, String objectId,
             String folderId, ExtensionsData extension) {
 
-        return checkParams(repositoryId, objectId, folderId);
+        if (folderId != null)
+        {
+            return checkParams(repositoryId, objectId, folderId);
+        }
+        else
+        {
+            StoredObject[] so = new StoredObject[1];
+            checkRepositoryId(repositoryId);
+            ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
+            so[0] = checkExistingObjectId(objectStore, objectId);
+            return so;
+        }        
     }
 
     @Override

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAclService.java Thu Aug  8 08:40:26 2013
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.inmemory.TypeValidator;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.slf4j.Logger;
@@ -42,12 +43,15 @@ public class InMemoryAclService extends 
     public Acl getAcl(CallContext context, String repositoryId, String objectId, Boolean onlyBasicPermissions,
             ExtensionsData extension, ObjectInfoHandler objectInfos) {
         LOG.debug("start getAcl()");
-        Acl acl = null;
+        int aclId;
         StoredObject so = validator.getAcl(context, repositoryId, objectId, extension);
+        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         if (so instanceof DocumentVersion)
-            acl = ((DocumentVersion) so).getParentDocument().getAcl();
+            aclId = ((DocumentVersion) so).getParentDocument().getAclId();
         else
-            acl = so.getAcl();
+            aclId = so.getAclId();
+        
+        Acl acl = objectStore.getAcl(aclId);
 
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java Thu Aug  8 08:40:26 2013
@@ -18,6 +18,8 @@
  */
 package org.apache.chemistry.opencmis.inmemory.server;
 
+import java.util.List;
+
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
@@ -25,6 +27,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Folder;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStoreMultiFiling;
@@ -75,23 +78,38 @@ public class InMemoryMultiFilingServiceI
 
         StoredObject[] sos = validator.removeObjectFromFolder(context, repositoryId, objectId, folderId, extension);
         StoredObject so = sos[0];
-
-        StoredObject folder = sos[1];
-
-        ObjectStoreMultiFiling osmf = checkObjects(repositoryId, so, folder);
-        Folder parent = (Folder) folder;
-        
-        osmf.removeParent(so, parent);
-
-        // To be able to provide all Atom links in the response we need
-        // additional information:
-        if (context.isObjectInfoRequired()) {
-            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfo);
-            objectInfos.addObjectInfo(objectInfo);
+        if (null != folderId) {
+            StoredObject folder = sos[1];
+            ObjectStoreMultiFiling osmf = checkObjects(repositoryId, so, folder);
+            Folder parent = (Folder) folder;
+
+            osmf.removeParent(so, parent);
+
+            // To be able to provide all Atom links in the response we need
+            // additional information:
+            if (context.isObjectInfoRequired()) {
+                ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfo);
+                objectInfos.addObjectInfo(objectInfo);
+            }
+        } else {
+            ObjectStoreMultiFiling osmf = checkObjects(repositoryId, so, null);
+            List<String> parentIds = osmf.getParentIds((Filing) so,  context.getUsername());
+            for (String parentId: parentIds) {
+                Folder parent = (Folder) ((ObjectStore)osmf).getObjectById(parentId);
+                osmf.removeParent(so, parent);
+            }
+
+            // To be able to provide all Atom links in the response we need
+            // additional information:
+            if (context.isObjectInfoRequired()) {
+                ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+                objectInfos.addObjectInfo(objectInfo);
+            }
         }
-
+        
         LOG.debug("End removeObjectFromFolder()");
     }
 
@@ -106,7 +124,7 @@ public class InMemoryMultiFilingServiceI
                     + " is a folder and folders are not multi-filed.");
         }
 
-        if (!(folder instanceof Folder)) {
+        if (folder != null && !(folder instanceof Folder)) {
             throw new CmisConstraintException("Cannot add object to folder, folder id " + folder.getId()
                     + " does not refer to a folder.");
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java Thu Aug  8 08:40:26 2013
@@ -82,12 +82,13 @@ public class InMemoryNavigationServiceIm
         LOG.debug("start getCheckedOutDocs()");
 
         String user = context.getUsername();
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
         if (null == folderId) {
             List<StoredObject> checkedOuts = fStoreManager.getObjectStore(repositoryId).getCheckedOutDocuments(
                     orderBy, context.getUsername(), includeRelationships);
             for (StoredObject checkedOut : checkedOuts) {
                 TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-                ObjectData od = PropertyCreationHelper.getObjectData(tm, checkedOut, filter, user,
+                ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, checkedOut, filter, user,
                         includeAllowableActions, includeRelationships, renditionFilter, false, false, extension);
                 if (context.isObjectInfoRequired()) {
                     ObjectInfoImpl objectInfo = new ObjectInfoImpl();
@@ -99,8 +100,8 @@ public class InMemoryNavigationServiceIm
         } else {
             LOG.debug("getting checked-out documents for folder: " + folderId);
             ObjectInFolderList children = getChildrenIntern(repositoryId, folderId, filter, orderBy,
-                    includeAllowableActions, includeRelationships, renditionFilter, false, -1, -1, false, true,
-                    context.isObjectInfoRequired() ? objectInfos : null, user);
+                   includeAllowableActions, includeRelationships, renditionFilter, false, -1, -1, false, true,
+                   context.isObjectInfoRequired() ? objectInfos : null, user);
             for (ObjectInFolderData child : children.getObjects()) {
                 ObjectData obj = child.getObject();
                 StoredObject so = fStoreManager.getObjectStore(repositoryId).getObjectById(obj.getId());
@@ -288,11 +289,11 @@ public class InMemoryNavigationServiceIm
 
         ObjectStoreFiling.ChildrenResult children = folderOnly ? objStoreFiling.getFolderChildren((Folder)so, maxItems, skipCount, user) : objStoreFiling
                 .getChildren((Folder)so, maxItems, skipCount, user, includePwc);
-
+        
         for (Fileable child : children.getChildren()) {
 
             if (!cmis11 && child instanceof Item)
-                continue; // ignore items for CMIS 1.0
+                continue; // ignore items for CMIS 1.0 
             
             ObjectInFolderDataImpl oifd = new ObjectInFolderDataImpl();
             if (includePathSegments != null && includePathSegments) {
@@ -300,7 +301,7 @@ public class InMemoryNavigationServiceIm
             }
 
             TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-            ObjectData objectData = PropertyCreationHelper.getObjectData(tm, child, filter, user, includeAllowableActions, 
+            ObjectData objectData = PropertyCreationHelper.getObjectData(tm, objStore, child, filter, user, includeAllowableActions, 
                     includeRelationships, renditionFilter, false, false, null);
 
             oifd.setObject(objectData);
@@ -338,7 +339,6 @@ public class InMemoryNavigationServiceIm
             ObjectInFolderList children = getChildrenIntern(repositoryId, folderId, filter, orderBy,
                     includeAllowableActions, includeRelationships, renditionFilter, includePathSegments, 1000, 0,
                     folderOnly, false, objectInfos, user);
-
             childrenOfFolderId = new ArrayList<ObjectInFolderContainer>();
             if (null != children) {
 
@@ -373,7 +373,7 @@ public class InMemoryNavigationServiceIm
                 ObjectParentDataImpl parentData = new ObjectParentDataImpl();
                 TypeManager tm = fStoreManager.getTypeManager(repositoryId);
                 Folder parent = (Folder) objStore.getObjectById(parentId);
-                ObjectData objData = PropertyCreationHelper.getObjectData(tm, parent, filter, user, includeAllowableActions, 
+                ObjectData objData = PropertyCreationHelper.getObjectData(tm, objStore, parent, filter, user, includeAllowableActions, 
                         includeRelationships, renditionFilter, false, true, null);
                 parentData.setObject(objData);
                 if (null != includeRelativePathSegment && includeRelativePathSegment)
@@ -408,7 +408,7 @@ public class InMemoryNavigationServiceIm
         copyFilteredProperties(repositoryId, parentFolder, filter, parent);
         
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        parent.setRelationships(DataObjectCreator.getRelationships(tm, includeRelationships, parentFolder, user));
+        parent.setRelationships(DataObjectCreator.getRelationships(tm, objStore, includeRelationships, parentFolder, user));
         
         if (includeAllowableActions != null && includeAllowableActions) {
             //  AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(spo, user);
@@ -426,9 +426,10 @@ public class InMemoryNavigationServiceIm
     }
 
     void copyFilteredProperties(String repositoryId, StoredObject so, String filter, ObjectDataImpl objData) {
+        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        Properties props = PropertyCreationHelper.getPropertiesFromObject(so, tm, requestedIds, true);
+        Properties props = PropertyCreationHelper.getPropertiesFromObject(so, objectStore, tm, requestedIds, true);
         objData.setProperties(props);
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java Thu Aug  8 08:40:26 2013
@@ -80,11 +80,7 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.VersionedDocument;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryDocumentTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryFolderTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryItemTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryPolicyTypeDefinition;
-import org.apache.chemistry.opencmis.inmemory.types.InMemoryRelationshipTypeDefinition;
+import org.apache.chemistry.opencmis.inmemory.types.DocumentTypeCreationHelper;
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
 import org.apache.chemistry.opencmis.server.support.TypeManager;
 import org.apache.chemistry.opencmis.server.support.TypeValidator;
@@ -119,6 +115,7 @@ public class InMemoryObjectServiceImpl e
         LOG.debug("start createDocumentFromSource()");
         StoredObject so = validator.createDocumentFromSource(context, repositoryId, sourceId, folderId, policies,
                 extension);
+        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
 
         ContentStream content = getContentStream(context, repositoryId, sourceId, null, BigInteger.valueOf(-1),
                 BigInteger.valueOf(-1), null);
@@ -130,7 +127,7 @@ public class InMemoryObjectServiceImpl e
         // build properties collection
         List<String> requestedIds = FilterParser.getRequestedIdsFromFilter("*");
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        Properties existingProps = PropertyCreationHelper.getPropertiesFromObject(so, tm, requestedIds, true);
+        Properties existingProps = PropertyCreationHelper.getPropertiesFromObject(so, objectStore, tm, requestedIds, true);
 
         PropertiesImpl newPD = new PropertiesImpl();
         // copy all existing properties
@@ -213,16 +210,18 @@ public class InMemoryObjectServiceImpl e
         // check if the given type is a document type
         BaseTypeId typeBaseId = typeDefC.getTypeDefinition().getBaseTypeId();
         StoredObject so = null;
-        if (typeBaseId.equals(InMemoryDocumentTypeDefinition.getRootDocumentType().getBaseTypeId())) {
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
+
+        if (typeBaseId.equals(DocumentTypeCreationHelper.getCmisDocumentType().getBaseTypeId())) {
             so = createDocumentIntern(context, repositoryId, properties, folderId, contentStream, versioningState,
                     null, null, null, null);
-        } else if (typeBaseId.equals(InMemoryFolderTypeDefinition.getRootFolderType().getBaseTypeId())) {
+        } else if (typeBaseId.equals(DocumentTypeCreationHelper.getCmisFolderType().getBaseTypeId())) {
             so = createFolderIntern(context, repositoryId, properties, folderId, null, null, null, null);
-        } else if (typeBaseId.equals(InMemoryPolicyTypeDefinition.getRootPolicyType().getBaseTypeId())) {
+        } else if (typeBaseId.equals(DocumentTypeCreationHelper.getCmisPolicyType().getBaseTypeId())) {
             so = createPolicyIntern(context, repositoryId, properties, folderId, null, null, null, null);
-        } else if (typeBaseId.equals(InMemoryRelationshipTypeDefinition.getRootRelationshipType().getBaseTypeId())) {
+        } else if (typeBaseId.equals(DocumentTypeCreationHelper.getCmisRelationshipType().getBaseTypeId())) {
             so = createRelationshipIntern(context, repositoryId, properties, null, null, null, null);
-        } else if (typeBaseId.equals(InMemoryItemTypeDefinition.getRootItemType().getBaseTypeId())) {
+        } else if (typeBaseId.equals(DocumentTypeCreationHelper.getCmisItemType().getBaseTypeId())) {
             so = createItemIntern(context, repositoryId, properties, folderId, null, null, null, null);
         } else {
             LOG.error("The type contains an unknown base object id, object can't be created");
@@ -231,7 +230,7 @@ public class InMemoryObjectServiceImpl e
         // Make a call to getObject to convert the resulting id into an
         // ObjectData
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, so, null, context.getUsername(), false,
+        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, null, context.getUsername(), false,
                 IncludeRelationships.NONE, null, false, false, extension);
 
         if (context.isObjectInfoRequired()) {
@@ -381,6 +380,7 @@ public class InMemoryObjectServiceImpl e
         LOG.debug("start getObject()");
 
         StoredObject so = validator.getObject(context, repositoryId, objectId, extension);
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         if (so == null) {
             throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
@@ -388,7 +388,7 @@ public class InMemoryObjectServiceImpl e
 
         String user = context.getUsername();
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, so, filter, user, includeAllowableActions,
+        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, filter, user, includeAllowableActions,
                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
 
         if (context.isObjectInfoRequired()) {
@@ -426,9 +426,10 @@ public class InMemoryObjectServiceImpl e
         }
 
         String user = context.getUsername();
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, so, filter, user, includeAllowableActions,
+        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, filter, user, includeAllowableActions,
                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
 
         LOG.debug("stop getObjectByPath()");
@@ -449,6 +450,7 @@ public class InMemoryObjectServiceImpl e
 
         LOG.debug("start getProperties()");
         StoredObject so = validator.getProperties(context, repositoryId, objectId, extension);
+        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
 
         if (so == null) {
             throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
@@ -457,7 +459,7 @@ public class InMemoryObjectServiceImpl e
         // build properties collection
         List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        Properties props = PropertyCreationHelper.getPropertiesFromObject(so, tm, requestedIds, true);
+        Properties props = PropertyCreationHelper.getPropertiesFromObject(so, objectStore, tm, requestedIds, true);
         LOG.debug("stop getProperties()");
         return props;
     }
@@ -544,7 +546,7 @@ public class InMemoryObjectServiceImpl e
         LOG.debug("stop moveObject()");
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, so, null, user, false, IncludeRelationships.NONE,
+        ObjectData od = PropertyCreationHelper.getObjectData(tm, objectStore, so, null, user, false, IncludeRelationships.NONE,
                 null, false, false, extension);
 
         // To be able to provide all Atom links in the response we need
@@ -571,7 +573,7 @@ public class InMemoryObjectServiceImpl e
 
         if (changeToken != null && changeToken.getValue() != null
                 && Long.valueOf(so.getChangeToken()) > Long.valueOf(changeToken.getValue())) {
-            throw new CmisUpdateConflictException("updateProperties failed: changeToken does not match");
+            throw new CmisUpdateConflictException("setContentStream failed: changeToken does not match");
         }
 
         if (!(so instanceof Document || so instanceof VersionedDocument || so instanceof DocumentVersion)) {
@@ -604,7 +606,6 @@ public class InMemoryObjectServiceImpl e
 
         content.setContent(contentStream, true);
         so.updateSystemBasePropertiesWhenModified(null, context.getUsername());
-
         LOG.debug("stop setContentStream()");
     }
 
@@ -615,6 +616,7 @@ public class InMemoryObjectServiceImpl e
         LOG.debug("start updateProperties()");
         StoredObject so = validator.updateProperties(context, repositoryId, objectId, extension);
         String user = context.getUsername();
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         // Validation
         TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
@@ -667,13 +669,18 @@ public class InMemoryObjectServiceImpl e
 
                 PropertyData<?> value = properties.getProperties().get(key);
                 PropertyDefinition<?> propDef = typeDef.getPropertyDefinitions().get(key);
-                if (null == propDef && cmis11) {
+                if (cmis11 && null == propDef) {
                     TypeDefinition typeDefSecondary = getSecondaryTypeDefinition(repositoryId, secondaryTypeIds, key);
                     if (null == typeDefSecondary)
                         throw new CmisInvalidArgumentException("Cannot update property " + key
                                 + ": not contained in type");
                     propDef = typeDefSecondary.getPropertyDefinitions().get(key);
                 }
+                
+                if (null == propDef) {
+                    throw new CmisInvalidArgumentException("Unknown property " + key
+                            + ": not contained in type (or any secondary type)");                        
+                }
 
                 if (value.getValues() == null || value.getFirstValue() == null) {
                     // delete property
@@ -686,12 +693,12 @@ public class InMemoryObjectServiceImpl e
                     oldProperties.remove(key);
                     hasUpdatedProp = true;
                 } else {
-                    if (propDef.getUpdatability().equals(Updatability.WHENCHECKEDOUT)) {
+                    if (propDef.getUpdatability() == Updatability.WHENCHECKEDOUT) {
                         if (!isCheckedOut)
                             throw new CmisUpdateConflictException(
                                     "updateProperties failed, following property can't be updated, because it is not checked-out: "
                                             + key);
-                    } else if (!propDef.getUpdatability().equals(Updatability.READWRITE)) {
+                    } else if (propDef.getUpdatability() != Updatability.READWRITE) {
                         throw new CmisConstraintException(
                                 "updateProperties failed, following property can't be updated, because it is not writable: "
                                         + key);
@@ -717,8 +724,8 @@ public class InMemoryObjectServiceImpl e
                     throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
                 }
                 // Note: the test for duplicated name in folder is left to the object store
-                ObjectStoreFiling objStore = (ObjectStoreFiling) fStoreManager.getObjectStore(repositoryId);
-                objStore.rename((Fileable)so, (String) pd.getFirstValue()); 
+                ObjectStoreFiling objStoreFiling = (ObjectStoreFiling) objStore;
+                objStoreFiling.rename((Fileable)so, (String) pd.getFirstValue()); 
                 hasUpdatedProp = true;
             }
         }
@@ -730,7 +737,6 @@ public class InMemoryObjectServiceImpl e
             }
             so.updateSystemBasePropertiesWhenModified(properties.getProperties(), user);
             // set changeToken
-            so.persist();
         }
 
         if (hasUpdatedProp) {
@@ -752,7 +758,7 @@ public class InMemoryObjectServiceImpl e
         }
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, so, null, user, false, IncludeRelationships.NONE,
+        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, null, user, false, IncludeRelationships.NONE,
                 null, false, false, extension);
 
         // To be able to provide all Atom links in the response we need
@@ -804,8 +810,7 @@ public class InMemoryObjectServiceImpl e
         }
 
         content.appendContent(contentStream);
-        so.updateSystemBasePropertiesWhenModified(null, context.getUsername());
-    }
+        so.updateSystemBasePropertiesWhenModified(null, context.getUsername());    }
 
     public List<BulkUpdateObjectIdAndChangeToken> bulkUpdateProperties(CallContext context, String repositoryId,
             List<BulkUpdateObjectIdAndChangeToken> objectIdAndChangeToken, Properties properties,
@@ -931,13 +936,11 @@ public class InMemoryObjectServiceImpl e
         if (((DocumentTypeDefinition) typeDef).isVersionable()) {
             DocumentVersion version = objectStore.createVersionedDocument(name, propMap, user, folder, policies,
                     addACEs, removeACEs, contentStream, versioningState);
-            version.persist();
             so = version; // return the version and not the version series to
                           // caller
         } else {
             Document doc = objectStore.createDocument(name, propMap, user, folder, policies, addACEs, removeACEs);
             doc.setContent(contentStream, false);
-            doc.persist();
             so = doc;
         }
 
@@ -1013,7 +1016,6 @@ public class InMemoryObjectServiceImpl e
         Folder newFolder = objStore.createFolder(folderName, properties.getProperties(), user, parent, policies,
                 addACEs, removeACEs);
         LOG.debug("stop createFolder()");
-        newFolder.persist();
         return newFolder;
     }
 
@@ -1180,10 +1182,7 @@ public class InMemoryObjectServiceImpl e
 
         // Now we are sure to have document type definition:
         so = objectStore.createItem(name, propMap, user, folder, policies, addACEs, removeACEs);
-        so.persist();
-
         return so;
-
     }
 
     private boolean hasDescendant(String user, ObjectStore objStore, Folder sourceFolder, Folder targetFolder) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryPolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryPolicyServiceImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryPolicyServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryPolicyServiceImpl.java Thu Aug  8 08:40:26 2013
@@ -43,6 +43,7 @@ public class InMemoryPolicyServiceImpl e
             String filter, ExtensionsData extension) {
 
         StoredObject so = validator.getAppliedPolicies(context, repositoryId, objectId, extension);
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         if (so == null) {
             throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
@@ -57,7 +58,7 @@ public class InMemoryPolicyServiceImpl e
             ObjectStore os = super.fStoreManager.getObjectStore(repositoryId);
             for (String polId : polIds) {
                 StoredObject pol = os.getObjectById(polId);
-                ObjectData od = PropertyCreationHelper.getObjectData(tm, pol, filter, user, false,
+                ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, pol, filter, user, false,
                         IncludeRelationships.NONE, null, false, false, null);
                 res.add(od);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java Thu Aug  8 08:40:26 2013
@@ -81,7 +81,7 @@ public class InMemoryRelationshipService
         List<ObjectData> odList = new ArrayList<ObjectData>();
 
         for (StoredObject rel : rels) {
-            ObjectData od = PropertyCreationHelper.getObjectData(tm, rel, filter, user, includeAllowableActions,
+            ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, rel, filter, user, includeAllowableActions,
                     IncludeRelationships.NONE, null, false, false, extension);
             odList.add(od);
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java Thu Aug  8 08:40:26 2013
@@ -156,7 +156,7 @@ public class InMemoryRepositoryServiceIm
         AbstractTypeDefinition newType = TypeValidator.completeType(type);
         TypeValidator.adjustTypeNamesAndId(newType);
         TypeValidator.checkType(typeManager, newType);
-        typeManager.addTypeDefinition(newType);
+        typeManager.addTypeDefinition(newType, true);
         return newType;
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java Thu Aug  8 08:40:26 2013
@@ -279,7 +279,7 @@ public class InMemoryServiceFactoryImpl 
                             ((AbstractTypeDefinition) typeDef)
                                     .setPropertyDefinitions(new LinkedHashMap<String, PropertyDefinition<?>>());
                         }
-                        tmc.addTypeDefinition(typeDef);
+                        tmc.addTypeDefinition(typeDef, false);
                     } 
                     XMLUtils.next(parser);
                 } else if (event == XMLStreamReader.END_ELEMENT) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java Thu Aug  8 08:40:26 2013
@@ -40,6 +40,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.inmemory.FilterParser;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Document;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.VersionedDocument;
@@ -66,11 +67,12 @@ public class InMemoryVersioningServiceIm
     public void cancelCheckOut(CallContext context, String repositoryId, String objectId, ExtensionsData extension) {
 
         StoredObject so = validator.cancelCheckOut(context, repositoryId, objectId, extension);
-
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
         String user = context.getUsername();
         VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
-
+        DocumentVersion pwc = verDoc.getPwc();
         verDoc.cancelCheckOut(user);
+        objStore.deleteVersion(pwc);
 
         // if this is the last version delete the document itself
         if (verDoc.getAllVersions().size() == 0)
@@ -95,9 +97,11 @@ public class InMemoryVersioningServiceIm
         if (contentStream != null && contentStream.getStream() == null)
             contentStream = null;
 
+        if (null == major) 
+            major = true;
+        
         verDoc.checkIn(major, properties, contentStream, checkinComment, policies, user);
         verDoc.updateSystemBasePropertiesWhenModified(null, context.getUsername());
-
         // To be able to provide all Atom links in the response we need
         // additional information:
         if (context.isObjectInfoRequired()) {
@@ -121,6 +125,7 @@ public class InMemoryVersioningServiceIm
 
         checkIsVersionableObject(so);
 
+        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);
 
         ContentStream content = null;
@@ -140,6 +145,7 @@ public class InMemoryVersioningServiceIm
         checkHasUser(user);
 
         DocumentVersion pwc = verDoc.checkOut(content, user);
+        objectStore.storeVersion(pwc);
         objectId.setValue(pwc.getId()); // return the id of the created pwc
         if (null != contentCopied) // Note: always null in AtomPub binding
             contentCopied.setValue(true);
@@ -248,7 +254,7 @@ public class InMemoryVersioningServiceIm
 
         StoredObject so = validator.getPropertiesOfLatestVersion(context, repositoryId, objectId, versionSeriesId,
                 extension);
-
+        ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         StoredObject latestVersionObject = null;
 
         // In AtomPu8b you do not get the version series id, only the object id
@@ -269,7 +275,8 @@ public class InMemoryVersioningServiceIm
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
 
-        Properties props = PropertyCreationHelper.getPropertiesFromObject(latestVersionObject, tm, requestedIds, true);
+        Properties props = PropertyCreationHelper.getPropertiesFromObject(latestVersionObject, objectStore, tm,
+                requestedIds, true);
 
         return props;
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Children.java Thu Aug  8 08:40:26 2013
@@ -55,14 +55,14 @@ public interface Children {
      * @param skipCount
      *            initial offset where to start fetching
      * @param user 
-     * 			user to determine visible children
+     *             user to determine visible children
      * @param usePwc 
-     * 			if true return private working copy otherwise return latest version; 
+     *             if true return private working copy otherwise return latest version; 
      * 
      * @return list of children objects
      */
     ChildrenResult getChildren(int maxItems, int skipCount, String user, boolean usePwc);
-
+    
     /**
      * get all the children of this folder which are folders. To support paging
      * an initial offset and a maximum number of children to retrieve can be

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java?rev=1511617&r1=1511616&r2=1511617&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Filing.java Thu Aug  8 08:40:26 2013
@@ -45,7 +45,7 @@ public interface Filing {
      * 		user id
      * @return list of parent folders
      */
-    List<String> getParents();
+    List<String> getParentIds();
     
     /**
      * usually true except for the root folder, optimized call that just tests



Mime
View raw message