chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject 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
Date Thu, 21 Mar 2013 12:43:04 GMT
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,



Mime
View raw message