chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1458656 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory: TypeValidator.java storedobj/impl/StoreManagerImpl.java
Date Wed, 20 Mar 2013 07:00:16 GMT
Author: jens
Date: Wed Mar 20 07:00:15 2013
New Revision: 1458656

URL: http://svn.apache.org/r1458656
Log:
InMemory, CMIS 1.1: preserve order of properties on type creation, add type mutability flags
to RepositoryInfo

Modified:
    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/storedobj/impl/StoreManagerImpl.java

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=1458656&r1=1458655&r2=1458656&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
Wed Mar 20 07:00:15 2013
@@ -20,7 +20,7 @@ package org.apache.chemistry.opencmis.in
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
@@ -161,18 +161,16 @@ public class TypeValidator {
         td.setTypeMutability(tm);
         td.setExtensions(td.getExtensions());
         
-        if (null == td.getPropertyDefinitions()) {
-            td.setPropertyDefinitions(new HashMap<String, PropertyDefinition<?>>());
-        } else {
-            Map<String, PropertyDefinition<?>> propDefsNew = new HashMap<String,
PropertyDefinition<?>>();
+        Map<String, PropertyDefinition<?>> propDefsNew = new LinkedHashMap<String,
PropertyDefinition<?>>();
+        if (null != td.getPropertyDefinitions()) {
             Map<String, PropertyDefinition<?>> propDefs = td.getPropertyDefinitions();
             for (PropertyDefinition<?> pd : propDefs.values()) {
                 AbstractPropertyDefinition<?> pdNew = completePropertyDef(pd);
                 adjustPropertyNamesAndId(pdNew);
                 propDefsNew.put(pdNew.getId(), pd);
             }
-            td.setPropertyDefinitions(propDefsNew);
         }
+        td.setPropertyDefinitions(propDefsNew);
     }
 
     private static void checkProperties(TypeManager tm, Collection<PropertyDefinition<?>>
pds) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.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/impl/StoreManagerImpl.java?rev=1458656&r1=1458655&r2=1458656&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
Wed Mar 20 07:00:15 2013
@@ -54,6 +54,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AclCapabilitiesDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.BindingsObjectFactoryImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.CreatablePropertyTypesImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.NewTypeSettableAttributesImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionDefinitionDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.PermissionMappingDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryCapabilitiesImpl;
@@ -361,6 +362,7 @@ public class StoreManagerImpl implements
 
     @SuppressWarnings("serial")
     private RepositoryInfo createRepositoryInfo(String repositoryId) {
+        boolean cmis11 = InMemoryServiceContext.getCallContext().getCmisVersion() != CmisVersion.CMIS_1_0;
         ObjectStore objStore = getObjectStore(repositoryId);
         String rootFolderId = objStore.getRootFolder().getId();
         // repository info
@@ -374,7 +376,6 @@ public class StoreManagerImpl implements
         repoInfo.setPrincipalAnyone(InMemoryAce.getAnyoneUser());
         repoInfo.setThinClientUri("");
         repoInfo.setChangesIncomplete(Boolean.TRUE);
-        repoInfo.setChangesOnType(null);
         repoInfo.setLatestChangeLogToken(Long.valueOf(new Date(0).getTime()).toString());
         repoInfo.setVendorName("Apache Chemistry");
         repoInfo.setProductName(OPENCMIS_SERVER);
@@ -407,6 +408,23 @@ public class StoreManagerImpl implements
         permissions.add(createPermission(CMIS_READ, "Read"));
         permissions.add(createPermission(CMIS_WRITE, "Write"));
         permissions.add(createPermission(CMIS_ALL, "All"));
+        if (cmis11) {
+            NewTypeSettableAttributesImpl typeAttrs = new NewTypeSettableAttributesImpl();
+            typeAttrs.setCanSetControllableAcl(false);
+            typeAttrs.setCanSetControllablePolicy(false);
+            typeAttrs.setCanSetCreatable(true);
+            typeAttrs.setCanSetDescription(true);
+            typeAttrs.setCanSetDisplayName(true);
+            typeAttrs.setCanSetFileable(false);
+            typeAttrs.setCanSetFulltextIndexed(false);
+            typeAttrs.setCanSetId(true);
+            typeAttrs.setCanSetIncludedInSupertypeQuery(false);
+            typeAttrs.setCanSetLocalName(true);
+            typeAttrs.setCanSetLocalNamespace(true);
+            typeAttrs.setCanSetQueryable(false);
+            typeAttrs.setCanSetQueryName(true);
+            caps.setNewTypeSettableAttributes(typeAttrs);
+        }
         aclCaps.setPermissionDefinitionData(permissions);
 
         // mapping
@@ -456,7 +474,6 @@ public class StoreManagerImpl implements
         }
         
         // CMIS 1.1 extensions
-        boolean cmis11 = InMemoryServiceContext.getCallContext().getCmisVersion() != CmisVersion.CMIS_1_0;
         if (cmis11) {
             repoInfo.setCmisVersionSupported(CmisVersion.CMIS_1_1.value());
             repoInfo.setCmisVersion(CmisVersion.CMIS_1_1);
@@ -487,7 +504,7 @@ public class StoreManagerImpl implements
             repoInfo.setCmisVersionSupported(CmisVersion.CMIS_1_0.value());
             repoInfo.setCmisVersion(CmisVersion.CMIS_1_0);
         }
-        
+
         aclCaps.setPermissionMappingData(map);
 
         repoInfo.setAclCapabilities(aclCaps);



Mime
View raw message