You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by je...@apache.org on 2013/03/21 13:43:04 UTC

svn commit: r1459272 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java

Author: jens
Date: Thu Mar 21 12:43:03 2013
New Revision: 1459272

URL: http://svn.apache.org/r1459272
Log:
InMemory: don't return items or sec. types in getTypeById() for CMIS 1.0

Modified:
    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/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=1459272&r1=1459271&r2=1459272&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 Thu Mar 21 12:43:03 2013
@@ -167,7 +167,17 @@ public class StoreManagerImpl implements
             throw new RuntimeException("Unknown repository " + repositoryId);
         }
 
-        return typeManager.getTypeById(typeId);
+        boolean cmis11 = InMemoryServiceContext.getCallContext().getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinitionContainer tdc = typeManager.getTypeById(typeId);
+        if (null != tdc && !cmis11) {
+            TypeDefinition td = tdc.getTypeDefinition();
+            if (td.getBaseTypeId() == BaseTypeId.CMIS_ITEM || td.getBaseTypeId() == BaseTypeId.CMIS_SECONDARY
+                    || td.getId().equals(BaseTypeId.CMIS_ITEM.value())
+                    || td.getId().equals(BaseTypeId.CMIS_SECONDARY.value())) {
+                tdc = null; // filter new types for CMIS 1.0
+            }
+        }
+        return tdc;
     }
 
     public TypeDefinitionContainer getTypeById(String repositoryId, String typeId, boolean includePropertyDefinitions,