chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1719450 [1/2] - in /chemistry/opencmis/trunk: chemistry-opencmis-server/chemistry-opencmis-server-inmemory/ chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/ chemistry-opencm...
Date Fri, 11 Dec 2015 15:21:32 GMT
Author: jens
Date: Fri Dec 11 15:21:31 2015
New Revision: 1719450

URL: http://svn.apache.org/viewvc?rev=1719450&view=rev
Log:
InMemoryServer: get rid of thread local storage

Removed:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceContext.java
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/pom.xml
    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/query/InMemoryQueryProcessor.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AbstractServiceImpl.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/InMemoryAbstractServiceImpl.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/InMemoryDiscoveryServiceImpl.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/InMemoryService.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/StoreManager.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/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/types/PropertyCreationHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/tools/specexamples/SpecExamples.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/pom.xml?rev=1719450&r1=1719449&r2=1719450&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/pom.xml (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/pom.xml Fri Dec 11 15:21:31 2015
@@ -68,6 +68,7 @@
                     </overlays>
                     <archiveClasses>true</archiveClasses>
                     <attachClasses>true</attachClasses>
+                    <failOnMissingWebXml>false</failOnMissingWebXml>
                 </configuration>
             </plugin>
             <plugin>

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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -36,7 +36,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.AllowableActionsImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ChangeEventInfoDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.PolicyIdListImpl;
-import org.apache.chemistry.opencmis.inmemory.server.InMemoryServiceContext;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Content;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Folder;
@@ -60,7 +60,7 @@ public final class DataObjectCreator {
     private DataObjectCreator() {
     }
 
-    public static AllowableActions fillAllowableActions(StoredObject so, String user) {
+    public static AllowableActions fillAllowableActions(CallContext callContext, StoredObject so, String user) {
 
         boolean isFolder = so instanceof Folder;
         boolean isDocument = so instanceof Content;
@@ -77,7 +77,7 @@ public final class DataObjectCreator {
         boolean hasRendition = so.hasRendition(user);
         boolean canGetAcl = user != null && (isDocument || isFolder || isItem);
         boolean canSetAcl = canGetAcl;
-        boolean cmis11 = InMemoryServiceContext.getCallContext().getCmisVersion() != CmisVersion.CMIS_1_0;
+        boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
 
         if (so instanceof Version) {
             isCheckedOut = ((Version) so).isPwc();
@@ -184,9 +184,9 @@ public final class DataObjectCreator {
         return polIds;
     }
 
-    public static List<ObjectData> fillRelationships(TypeManager tm, ObjectStore objStore,
+    public static List<ObjectData> fillRelationships(CallContext context, TypeManager tm, ObjectStore objStore,
             IncludeRelationships includeRelationships, StoredObject so, String user) {
-        return getRelationships(tm, objStore, includeRelationships, so, user);
+        return getRelationships(context, tm, objStore, includeRelationships, so, user);
     }
 
     public static ChangeEventInfo fillChangeEventInfo(StoredObject so) {
@@ -195,7 +195,7 @@ public final class DataObjectCreator {
         return changeEventInfo;
     }
 
-    public static List<ObjectData> getRelationships(TypeManager tm, ObjectStore objStore,
+    public static List<ObjectData> getRelationships(CallContext context, TypeManager tm, ObjectStore objStore,
             IncludeRelationships includeRelationships, StoredObject spo, String user) {
         if (includeRelationships != IncludeRelationships.NONE) {
             RelationshipDirection relationshipDirection = RelationshipDirection.SOURCE;
@@ -209,7 +209,7 @@ public final class DataObjectCreator {
             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, objStore, so, null, user, false,
+                ObjectData od = PropertyCreationHelper.getObjectData(context, 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/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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -40,11 +40,13 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.enums.Cardinality;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectListImpl;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Content;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing;
@@ -84,9 +86,11 @@ public class InMemoryQueryProcessor {
     private Tree whereTree;
     private ObjectStoreImpl objStore;
     private List<TypeDefinition> secondaryTypeIds;
+    private CallContext callContext;
 
-    public InMemoryQueryProcessor(ObjectStoreImpl objStore) {
+    public InMemoryQueryProcessor(ObjectStoreImpl objStore, CallContext ctx) {
         this.objStore = objStore;
+        this.callContext = ctx;
     }
 
     /**
@@ -208,7 +212,7 @@ public class InMemoryQueryProcessor {
             String queryName = queryObj.getTypes().values().iterator().next();
             TypeDefinition td = queryObj.getTypeDefinitionFromQueryName(queryName);
 
-            ObjectData od = PropertyCreationHelper.getObjectDataQueryResult(tm, objStore, td, so, user, props, funcs,
+            ObjectData od = PropertyCreationHelper.getObjectDataQueryResult(callContext,tm, objStore, td, so, user, props, funcs,
                     secondaryTypeIds, includeAllowableActions, includeRelationships, renditionFilter);
             objDataList.add(od);
         }
@@ -257,8 +261,9 @@ public class InMemoryQueryProcessor {
                     String propId = ((ColumnReference) sel).getPropertyId();
                     PropertyDefinition<?> pd = ((ColumnReference) sel).getPropertyDefinition();
 
-                    Object propVal1 = PropertyQueryUtil.getProperty(so1, propId, pd);
-                    Object propVal2 = PropertyQueryUtil.getProperty(so2, propId, pd);
+                    boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+                    Object propVal1 = PropertyQueryUtil.getProperty(so1, propId, pd, cmis11);
+                    Object propVal2 = PropertyQueryUtil.getProperty(so2, propId, pd, cmis11);
 
                     if (propVal1 == null && propVal2 == null) {
                         result = 0;
@@ -402,7 +407,9 @@ public class InMemoryQueryProcessor {
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
             List<Object> literals = onLiteralList(listNode);
-            Object prop = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
+            boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+
+            Object prop = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd, cmis11);
 
             if (pd.getCardinality() != Cardinality.SINGLE) {
                 throw new IllegalStateException("Operator IN only is allowed on single-value properties ");
@@ -420,7 +427,8 @@ public class InMemoryQueryProcessor {
             // then it evaluates to true for null values (not set properties).
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object prop = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
+            boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+            Object prop = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd, cmis11);
             List<Object> literals = onLiteralList(listNode);
             if (pd.getCardinality() != Cardinality.SINGLE) {
                 throw new IllegalStateException("Operator IN only is allowed on single-value properties ");
@@ -498,7 +506,8 @@ public class InMemoryQueryProcessor {
         public Boolean walkIsNull(Tree opNode, Tree colNode) {
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object propVal = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
+            boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+            Object propVal = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd, cmis11);
             return propVal == null;
         }
 
@@ -506,7 +515,8 @@ public class InMemoryQueryProcessor {
         public Boolean walkIsNotNull(Tree opNode, Tree colNode) {
             ColumnReference colRef = getColumnReference(colNode);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object propVal = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
+            boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+            Object propVal = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd, cmis11);
             return propVal != null;
         }
 
@@ -528,7 +538,8 @@ public class InMemoryQueryProcessor {
                 throw new IllegalStateException("LIKE is not allowed for multi-value properties ");
             }
 
-            String propVal = (String) PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
+            boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+            String propVal = (String) PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd, cmis11);
 
             if (null == propVal) {
                 return false;
@@ -593,7 +604,8 @@ public class InMemoryQueryProcessor {
 
             ColumnReference colRef = getColumnReference(leftChild);
             PropertyDefinition<?> pd = colRef.getPropertyDefinition();
-            Object val = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd);
+            boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+            Object val = PropertyQueryUtil.getProperty(so, colRef.getPropertyId(), pd, cmis11);
             if (val == null) {
                 return null;
             } else if (val instanceof List<?>) {

Modified: 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=1719450&r1=1719449&r2=1719450&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/PropertyQueryUtil.java Fri Dec 11 15:21:31 2015
@@ -23,8 +23,6 @@ import org.apache.chemistry.opencmis.com
 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;
@@ -39,7 +37,7 @@ public final class PropertyQueryUtil {
     private PropertyQueryUtil() {
     }
 
-    public static Object getProperty(StoredObject so, String propertyId, PropertyDefinition<?> pd) {
+    public static Object getProperty(StoredObject so, String propertyId, PropertyDefinition<?> pd, boolean cmis11) {
         ContentStream content = null;
         DocumentVersion ver = null;
         VersionedDocument verDoc = null;
@@ -48,8 +46,6 @@ public final class PropertyQueryUtil {
         Relationship rel = null;
         Policy pol = null;
 
-        boolean cmis11 = InMemoryServiceContext.getCallContext().getCmisVersion() != CmisVersion.CMIS_1_0;
-
         if (so instanceof Content) {
             content = ((Content) so).getContent();
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AbstractServiceImpl.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/AbstractServiceImpl.java?rev=1719450&r1=1719449&r2=1719450&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AbstractServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AbstractServiceImpl.java Fri Dec 11 15:21:31 2015
@@ -88,9 +88,9 @@ public class AbstractServiceImpl {
         }
     }
 
-    protected TypeDefinition getTypeDefinition(String repositoryId, Properties properties) {
+    protected TypeDefinition getTypeDefinition(String repositoryId, Properties properties, boolean cmis11) {
         String typeId = (String) properties.getProperties().get(PropertyIds.OBJECT_TYPE_ID).getFirstValue();
-        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId);
+        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId, cmis11);
         if (typeDefC == null) {
             throw new CmisInvalidArgumentException("Cannot create object, a type with id " + typeId + " is unknown");
         }
@@ -98,9 +98,9 @@ public class AbstractServiceImpl {
         return typeDefC.getTypeDefinition();
     }
 
-    protected TypeDefinition getTypeDefinition(String repositoryId, StoredObject obj) {
+    protected TypeDefinition getTypeDefinition(String repositoryId, StoredObject obj, boolean cmis11) {
 
-        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, obj.getTypeId());
+        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, obj.getTypeId(), cmis11);
         return typeDefC.getTypeDefinition();
     }
 

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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -30,10 +30,12 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
 import org.apache.chemistry.opencmis.commons.data.RenditionData;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
 import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.commons.impl.server.RenditionInfoImpl;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.commons.server.RenditionInfo;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Content;
@@ -64,6 +66,8 @@ public class AtomLinkInfoProvider {
      * FillObjectInfoHolder object with required information needed for Atom
      * binding for a single object.
      * 
+     * @param callContext
+     *            call context of associated request
      * @param repositoryId
      *            id of repository
      * @param so
@@ -73,12 +77,13 @@ public class AtomLinkInfoProvider {
      * @param objInfo
      *            Holder to fill with information
      */
-    public void fillInformationForAtomLinks(String repositoryId, StoredObject so, ObjectData od, 
+    public void fillInformationForAtomLinks(CallContext callContext, String repositoryId, StoredObject so, ObjectData od, 
             ObjectInfoImpl objInfo) {
         if (null == objInfo || null == so) {
             return;
         }
-        TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
+        boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, so.getTypeId(), cmis11).getTypeDefinition();
         ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         // Fill all setters:
@@ -187,18 +192,20 @@ public class AtomLinkInfoProvider {
      * @param objectInfo
      *            Holder to fill with information
      */
-    public void fillInformationForAtomLinks(String repositoryId, StoredObject so, ObjectInfoImpl objectInfo) {
+    public void fillInformationForAtomLinks(CallContext callContext, String repositoryId, StoredObject so, ObjectInfoImpl objectInfo) {
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
         ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, null, null, false,
+        ObjectData od = PropertyCreationHelper.getObjectData(callContext, tm, objStore, so, null, null, false,
                 IncludeRelationships.NONE, null, false, false, null);
-        fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
+        fillInformationForAtomLinks(callContext, repositoryId, so, od, objectInfo);
     }
 
     /**
      * FillObjectInfoHolder object with required information needed for Atom
      * binding for a single object.
      * 
+     * @param callContext
+     *            call context of associated request
      * @param repositoryId
      *            id of repository
      * @param objectId
@@ -206,20 +213,22 @@ public class AtomLinkInfoProvider {
      * @param objectInfo
      *            Holder to fill with information
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoImpl objectInfo) {
+    public void fillInformationForAtomLinks(CallContext callContext, String repositoryId, String objectId, ObjectInfoImpl objectInfo) {
         if (null == objectInfo || null == objectId) {
             return;
         }
 
         ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         StoredObject so = objectStore.getObjectById(objectId);
-        fillInformationForAtomLinks(repositoryId, so, objectInfo);
+        fillInformationForAtomLinks(callContext, repositoryId, so, objectInfo);
     }
 
     /**
      * FillObjectInfoHolder object with required information needed for Atom
      * binding after a getChildren() call in navigation service.
      * 
+     * @param callContext
+     *            call context of associated request
      * @param repositoryId
      *            id of repository
      * @param objectId
@@ -229,7 +238,7 @@ public class AtomLinkInfoProvider {
      * @param objList
      *            result of getChildren call
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHandler objectInfos,
+    public void fillInformationForAtomLinks(CallContext callContext, String repositoryId, String objectId, ObjectInfoHandler objectInfos,
             ObjectInFolderList objList) {
 
         if (null == objectInfos || null == objList || null == objectId) {
@@ -238,13 +247,13 @@ public class AtomLinkInfoProvider {
 
         // Fill object information for requested object
         ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-        fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
+        fillInformationForAtomLinks(callContext, repositoryId, objectId, objectInfo);
         objectInfos.addObjectInfo(objectInfo);
 
         // Fill object information for all children in result list
         for (ObjectInFolderData object : objList.getObjects()) {
             objectInfo = new ObjectInfoImpl();
-            fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfo);
+            fillInformationForAtomLinks(callContext, repositoryId, object.getObject().getId(), objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
     }
@@ -253,6 +262,8 @@ public class AtomLinkInfoProvider {
      * FillObjectInfoHolder object with required information needed for Atom
      * binding for an object list.
      * 
+     * @param callContext
+     *            call context of associated request
      * @param repositoryId
      *            id of repository
      * @param objectId
@@ -262,13 +273,13 @@ public class AtomLinkInfoProvider {
      * @param objList
      *            result of getChildren call
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHandler objectInfos,
+    public void fillInformationForAtomLinks(CallContext callContext, String repositoryId, String objectId, ObjectInfoHandler objectInfos,
             ObjectList objList) {
 
         ObjectInfoImpl objectInfo = new ObjectInfoImpl();
         if (null != objectId) {
             // Fill object information for requested object
-            fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
+            fillInformationForAtomLinks(callContext, repositoryId, objectId, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -301,7 +312,7 @@ public class AtomLinkInfoProvider {
      * @param oifc
      *            result of previous call
      */
-    private void fillInformationForAtomLinks(String repositoryId, ObjectInfoHandler objectInfos,
+    private void fillInformationForAtomLinks(CallContext callContext, String repositoryId, ObjectInfoHandler objectInfos,
             ObjectInFolderContainer oifc) {
 
         if (null == objectInfos || null == oifc) {
@@ -309,13 +320,13 @@ public class AtomLinkInfoProvider {
         }
 
         // Fill object information for all elements in result list
-        fillInformationForAtomLinks(repositoryId, objectInfos, oifc.getObject());
+        fillInformationForAtomLinks(callContext, repositoryId, objectInfos, oifc.getObject());
 
         if (null != oifc.getChildren()) {
             for (ObjectInFolderContainer object : oifc.getChildren()) {
                 // call recursively
                 ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-                fillInformationForAtomLinks(repositoryId, objectInfos, object);
+                fillInformationForAtomLinks(callContext, repositoryId, objectInfos, object);
                 objectInfos.addObjectInfo(objectInfo);
             }
         }
@@ -334,7 +345,7 @@ public class AtomLinkInfoProvider {
      * @param oifcList
      *            result of getDescendants call
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHandler objectInfos,
+    public void fillInformationForAtomLinks(CallContext callContext, String repositoryId, String objectId, ObjectInfoHandler objectInfos,
             List<ObjectInFolderContainer> oifcList) {
 
         if (null == objectInfos || null == oifcList || null == objectId) {
@@ -343,19 +354,19 @@ public class AtomLinkInfoProvider {
 
         ObjectInfoImpl objectInfo = new ObjectInfoImpl();
         // Fill object information for requested object
-        fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
+        fillInformationForAtomLinks(callContext, repositoryId, objectId, objectInfo);
         objectInfos.addObjectInfo(objectInfo);
 
         for (ObjectInFolderContainer object : oifcList) {
-            fillInformationForAtomLinks(repositoryId, objectInfos, object);
+            fillInformationForAtomLinks(callContext, repositoryId, objectInfos, object);
         }
     }
 
-    private void fillInformationForAtomLinks(String repositoryId, ObjectInfoHandler objectInfos,
+    private void fillInformationForAtomLinks(CallContext callContext, String repositoryId, ObjectInfoHandler objectInfos,
             ObjectInFolderData object) {
 
         ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-        fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfo);
+        fillInformationForAtomLinks(callContext, repositoryId, object.getObject().getId(), objectInfo);
         objectInfos.addObjectInfo(objectInfo);
     }
 
@@ -372,7 +383,7 @@ public class AtomLinkInfoProvider {
      * @param objParents
      *            result of getObjectParents call
      */
-    public void fillInformationForAtomLinksGetParents(String repositoryId, String objectId,
+    public void fillInformationForAtomLinksGetParents(CallContext callContext, String repositoryId, String objectId,
             ObjectInfoHandler objectInfos, List<ObjectParentData> objParents) {
 
         if (null == objectInfos || null == objParents || null == objectId) {
@@ -381,11 +392,11 @@ public class AtomLinkInfoProvider {
 
         // Fill object information for requested object
         ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-        fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
+        fillInformationForAtomLinks(callContext, repositoryId, objectId, objectInfo);
 
         for (ObjectParentData object : objParents) {
             objectInfo = new ObjectInfoImpl();
-            fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfo);
+            fillInformationForAtomLinks(callContext, repositoryId, object.getObject().getId(), objectInfo);
             objectInfos.addObjectInfo(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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -42,6 +42,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
 import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
 import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
 import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
@@ -191,10 +192,11 @@ public class BaseServiceValidatorImpl im
         return so;
     }
 
-    protected void checkPolicies(String repositoryId, List<String> policyIds) {
+    protected void checkPolicies(CallContext context, String repositoryId, List<String> policyIds) {
         if (policyIds != null && policyIds.size() > 0) {
+        	boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
             for (String policyId : policyIds) {
-                TypeDefinitionContainer tdc = fStoreManager.getTypeById(repositoryId, policyId);
+                TypeDefinitionContainer tdc = fStoreManager.getTypeById(repositoryId, policyId, cmis11);
                 if (tdc == null) {
                     throw new CmisInvalidArgumentException("Unknown policy type: " + policyId);
                 }
@@ -205,9 +207,9 @@ public class BaseServiceValidatorImpl im
         }
     }
 
-    protected void checkCreatablePropertyTypes(String repositoryId,
+    protected void checkCreatablePropertyTypes(CallContext context, String repositoryId,
             Collection<PropertyDefinition<?>> propertyDefinitions) {
-        RepositoryInfo repositoryInfo = fStoreManager.getRepositoryInfo(repositoryId);
+        RepositoryInfo repositoryInfo = fStoreManager.getRepositoryInfo(context, repositoryId);
         RepositoryCapabilities repositoryCapabilities = repositoryInfo.getCapabilities();
         if (null == repositoryCapabilities) {
         	return;
@@ -235,9 +237,9 @@ public class BaseServiceValidatorImpl im
         }
     }
 
-    protected void checkSettableAttributes(String repositoryId, TypeDefinition oldTypeDefinition,
+    protected void checkSettableAttributes(CallContext context, String repositoryId, TypeDefinition oldTypeDefinition,
             TypeDefinition newTypeDefinition) {
-        RepositoryInfo repositoryInfo = fStoreManager.getRepositoryInfo(repositoryId);
+        RepositoryInfo repositoryInfo = fStoreManager.getRepositoryInfo(context, repositoryId);
         RepositoryCapabilities repositoryCapabilities = repositoryInfo.getCapabilities();
         NewTypeSettableAttributes newTypeSettableAttributes = repositoryCapabilities.getNewTypeSettableAttributes();
 
@@ -452,13 +454,13 @@ public class BaseServiceValidatorImpl im
         // anything else should be ignored
     }
 
-    protected TypeDefinition checkExistingTypeId(String repositoryId, String typeId) {
+    protected TypeDefinition checkExistingTypeId(String repositoryId, String typeId, boolean cmis11) {
 
         if (null == typeId) {
             throw new CmisInvalidArgumentException(TYPE_ID_CANNOT_BE_NULL);
         }
 
-        TypeDefinitionContainer tdc = fStoreManager.getTypeById(repositoryId, typeId);
+        TypeDefinitionContainer tdc = fStoreManager.getTypeById(repositoryId, typeId, cmis11);
         if (tdc == null) {
             throw new CmisObjectNotFoundException(UNKNOWN_TYPE_ID + typeId);
         }
@@ -769,7 +771,8 @@ public class BaseServiceValidatorImpl im
         }
 
         if (typeId != null) {
-            TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, typeId).getTypeDefinition();
+        	boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+            TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, typeId, cmis11).getTypeDefinition();
             if (typeDef == null) {
                 throw new CmisInvalidArgumentException("Type Id " + typeId + " is not known in repository "
                         + repositoryId);
@@ -847,7 +850,8 @@ public class BaseServiceValidatorImpl im
             throw new CmisInvalidArgumentException("Type cannot be null.");
         }
         String parentTypeId = type.getParentTypeId();
-        TypeDefinitionContainer parentTypeContainer = fStoreManager.getTypeById(repositoryId, parentTypeId);
+        boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinitionContainer parentTypeContainer = fStoreManager.getTypeById(repositoryId, parentTypeId, cmis11);
         if (null == parentTypeContainer) {
             throw new CmisInvalidArgumentException(UNKNOWN_TYPE_ID + parentTypeId);
         }
@@ -856,7 +860,7 @@ public class BaseServiceValidatorImpl im
         if (!(parentType.getTypeMutability().canCreate())) {
             throw new CmisConstraintException("parent type: " + parentTypeId + " does not allow mutability create");
         }
-        checkCreatablePropertyTypes(repositoryId, type.getPropertyDefinitions().values());
+        checkCreatablePropertyTypes(callContext, repositoryId, type.getPropertyDefinitions().values());
     }
 
     @Override
@@ -864,15 +868,16 @@ public class BaseServiceValidatorImpl im
             ExtensionsData extension) {
         checkRepositoryId(repositoryId);
 
-        TypeDefinition updateType = checkExistingTypeId(repositoryId, type.getId());
+        boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition updateType = checkExistingTypeId(repositoryId, type.getId(), cmis11);
         checkUpdateType(updateType, type);
         checkBasicType(type);
         // check if type can be updated
         if (!(updateType.getTypeMutability().canUpdate())) {
             throw new CmisConstraintException("type: " + type.getId() + " does not allow mutability update");
         }
-        checkCreatablePropertyTypes(repositoryId, type.getPropertyDefinitions().values());
-        checkSettableAttributes(repositoryId, updateType, type);
+        checkCreatablePropertyTypes(callContext, repositoryId, type.getPropertyDefinitions().values());
+        checkSettableAttributes(callContext, repositoryId, updateType, type);
         checkUpdatePropertyDefinitions(updateType.getPropertyDefinitions(), type.getPropertyDefinitions());
         return updateType;
     }
@@ -882,7 +887,8 @@ public class BaseServiceValidatorImpl im
             ExtensionsData extension) {
         checkRepositoryId(repositoryId);
 
-        TypeDefinition deleteType = checkExistingTypeId(repositoryId, typeId);
+        boolean cmis11 = callContext.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition deleteType = checkExistingTypeId(repositoryId, typeId, cmis11);
         checkBasicType(deleteType);
         // check if type can be deleted
         if (!(deleteType.getTypeMutability().canDelete())) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAbstractServiceImpl.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/InMemoryAbstractServiceImpl.java?rev=1719450&r1=1719449&r2=1719450&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAbstractServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryAbstractServiceImpl.java Fri Dec 11 15:21:31 2015
@@ -44,6 +44,7 @@ public class InMemoryAbstractServiceImpl
     protected final CmisServiceValidator validator;
     protected final AtomLinkInfoProvider fAtomLinkProvider;
 
+
     protected InMemoryAbstractServiceImpl(StoreManager storeManager, CmisServiceValidator validator) {
         this.fStoreManager = storeManager;
         this.validator = validator;
@@ -56,13 +57,14 @@ public class InMemoryAbstractServiceImpl
         this.fAtomLinkProvider = new AtomLinkInfoProvider(fStoreManager);
     }
 
-    protected TypeDefinition getTypeDefinition(String repositoryId, Properties properties) {
+    protected TypeDefinition getTypeDefinition(String repositoryId, Properties properties, boolean cmis11) {
         if (null == properties) {
             return null;
         }
 
         String typeId = (String) properties.getProperties().get(PropertyIds.OBJECT_TYPE_ID).getFirstValue();
-        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId);
+        
+        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId, cmis11);
         if (typeDefC == null) {
             throw new CmisInvalidArgumentException("Cannot create object, a type with id " + typeId + " is unknown");
         }
@@ -70,14 +72,14 @@ public class InMemoryAbstractServiceImpl
         return typeDefC.getTypeDefinition();
     }
 
-    protected List<TypeDefinition> getTypeDefinition(String repositoryId, List<String> typeIds) {
+    protected List<TypeDefinition> getTypeDefinition(String repositoryId, List<String> typeIds, boolean cmis11) {
         if (null == typeIds || typeIds.isEmpty()) {
             return null;
         }
 
         List<TypeDefinition> result = new ArrayList<TypeDefinition>(typeIds.size());
         for (String typeId : typeIds) {
-            TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId);
+            TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId, cmis11);
             if (typeDefC == null) {
                 throw new CmisInvalidArgumentException("Cannot create object, a type with id " + typeId
                         + " is unknown");
@@ -88,9 +90,9 @@ public class InMemoryAbstractServiceImpl
         return result;
     }
 
-    protected TypeDefinition getTypeDefinition(String repositoryId, StoredObject obj) {
+    protected TypeDefinition getTypeDefinition(String repositoryId, StoredObject obj, boolean cmis11) {
 
-        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, obj.getTypeId());
+        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, obj.getTypeId(), cmis11);
         return typeDefC == null ? null : typeDefC.getTypeDefinition();
     }
 

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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -56,7 +56,7 @@ public class InMemoryAclService extends
 
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -75,7 +75,7 @@ public class InMemoryAclService extends
 
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
         return acl;

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.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/InMemoryDiscoveryServiceImpl.java?rev=1719450&r1=1719449&r2=1719450&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java Fri Dec 11 15:21:31 2015
@@ -119,7 +119,7 @@ public class InMemoryDiscoveryServiceImp
         // To be able to provide all Atom links in the response we need
         // additional information:
         if (objectInfos != null) {
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, null, objectInfos, objList);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, null, objectInfos, objList);
         }
         return objList;
     }
@@ -150,7 +150,7 @@ public class InMemoryDiscoveryServiceImp
         String user = context.getUsername();
         ObjectList res;
 
-        res = fStoreManager.query(user, repositoryId, statement, searchAllVersions, includeAllowableActions,
+        res = fStoreManager.query(context, user, repositoryId, statement, searchAllVersions, includeAllowableActions,
                 includeRelationships, renditionFilter, maxItems, skipCount);
         LOG.debug("stop query()");
         return res;

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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -62,8 +62,8 @@ public class InMemoryMultiFilingServiceI
         objStore.addParent(so, newParent);
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, folder, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -89,8 +89,8 @@ public class InMemoryMultiFilingServiceI
             // additional information:
             if (context.isObjectInfoRequired()) {
                 ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
-                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfo);
+                fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
+                fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, folder, objectInfo);
                 objectInfos.addObjectInfo(objectInfo);
             }
         } else {
@@ -105,7 +105,7 @@ public class InMemoryMultiFilingServiceI
             // additional information:
             if (context.isObjectInfoRequired()) {
                 ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+                fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
                 objectInfos.addObjectInfo(objectInfo);
             }
         }

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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -88,19 +88,19 @@ public class InMemoryNavigationServiceIm
                     context.getUsername(), includeRelationships);
             for (StoredObject checkedOut : checkedOuts) {
                 TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-                ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, checkedOut, filter, user,
+                ObjectData od = PropertyCreationHelper.getObjectData(context, tm, objStore, checkedOut, filter, user,
                         includeAllowableActions, includeRelationships, renditionFilter, false, false, extension);
                 if (context.isObjectInfoRequired()) {
                     ObjectInfoImpl objectInfo = new ObjectInfoImpl();
                     fAtomLinkProvider
-                            .fillInformationForAtomLinks(repositoryId, /* workingCopy */checkedOut, objectInfo);
+                            .fillInformationForAtomLinks(context, repositoryId, /* workingCopy */checkedOut, objectInfo);
                     objectInfos.addObjectInfo(objectInfo);
                 }
                 odList.add(od);
             }
         } else {
             LOG.debug("getting checked-out documents for folder: " + folderId);
-            ObjectInFolderList children = getChildrenIntern(repositoryId, folderId, filter, orderBy,
+            ObjectInFolderList children = getChildrenIntern(context, repositoryId, folderId, filter, orderBy,
                     includeAllowableActions, includeRelationships, renditionFilter, false, -1, -1, false, true,
                     context.isObjectInfoRequired() ? objectInfos : null, user);
             for (ObjectInFolderData child : children.getObjects()) {
@@ -111,7 +111,7 @@ public class InMemoryNavigationServiceIm
                     odList.add(obj);
                     if (context.isObjectInfoRequired()) {
                         ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-                        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+                        fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
                         objectInfos.addObjectInfo(objectInfo);
                     }
                 }
@@ -137,7 +137,7 @@ public class InMemoryNavigationServiceIm
         int maxItemsInt = maxItems == null ? -1 : maxItems.intValue();
         int skipCountInt = skipCount == null ? 0 : skipCount.intValue();
         String user = context.getUsername();
-        ObjectInFolderList res = getChildrenIntern(repositoryId, folderId, filter, orderBy, includeAllowableActions,
+        ObjectInFolderList res = getChildrenIntern(context, repositoryId, folderId, filter, orderBy, includeAllowableActions,
                 includeRelationships, renditionFilter, includePathSegment, maxItemsInt, skipCountInt, false, false,
                 context.isObjectInfoRequired() ? objectInfos : null, user);
         LOG.debug("stop getChildren()");
@@ -164,7 +164,7 @@ public class InMemoryNavigationServiceIm
 
         int level = 0;
         String user = context.getUsername();
-        List<ObjectInFolderContainer> result = getDescendantsIntern(repositoryId, folderId, filter,
+        List<ObjectInFolderContainer> result = getDescendantsIntern(context, repositoryId, folderId, filter,
                 includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, level, levels,
                 false, objectInfos, user);
 
@@ -187,7 +187,7 @@ public class InMemoryNavigationServiceIm
                     + folderId);
         }
 
-        ObjectData res = getFolderParentIntern(repositoryId, folder, filter, false, IncludeRelationships.NONE,
+        ObjectData res = getFolderParentIntern(context, repositoryId, folder, filter, false, IncludeRelationships.NONE,
                 context.getUsername(), context.isObjectInfoRequired() ? objectInfos : null);
         if (res == null) {
             throw new CmisInvalidArgumentException("Cannot get parent of a root folder");
@@ -197,7 +197,7 @@ public class InMemoryNavigationServiceIm
         // additional information:
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -221,7 +221,7 @@ public class InMemoryNavigationServiceIm
         int levels = depth == null ? 2 : depth.intValue();
         int level = 0;
         String user = context.getUsername();
-        List<ObjectInFolderContainer> result = getDescendantsIntern(repositoryId, folderId, filter,
+        List<ObjectInFolderContainer> result = getDescendantsIntern(context, repositoryId, folderId, filter,
                 includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, level, levels,
                 true, objectInfos, user);
 
@@ -243,12 +243,11 @@ public class InMemoryNavigationServiceIm
         // parent for each object (no multi-filing)
         List<ObjectParentData> result = null;
 
-        Filing spo = null;
         if (!(so instanceof Filing)) {
             return Collections.emptyList();
         }
 
-        result = getObjectParentsIntern(repositoryId, so, filter, context.isObjectInfoRequired() ? objectInfos : null,
+        result = getObjectParentsIntern(context, repositoryId, so, filter, context.isObjectInfoRequired() ? objectInfos : null,
                 includeAllowableActions, includeRelationships, renditionFilter, includeRelativePathSegment,
                 context.getUsername());
 
@@ -256,7 +255,7 @@ public class InMemoryNavigationServiceIm
         // additional information:
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -266,7 +265,7 @@ public class InMemoryNavigationServiceIm
 
     // private helpers
 
-    private ObjectInFolderList getChildrenIntern(String repositoryId, String folderId, String filter, String orderBy,
+    private ObjectInFolderList getChildrenIntern(CallContext context, String repositoryId, String folderId, String filter, String orderBy,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includePathSegments, int maxItems, int skipCount, boolean folderOnly, boolean includePwc,
             ObjectInfoHandler objectInfos, String user) {
@@ -275,7 +274,7 @@ public class InMemoryNavigationServiceIm
         List<ObjectInFolderData> folderList = new ArrayList<ObjectInFolderData>();
         ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
         StoredObject so = objStore.getObjectById(folderId);
-        boolean cmis11 = InMemoryServiceContext.getCallContext().getCmisVersion() != CmisVersion.CMIS_1_0;
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
 
         if (so == null) {
             throw new CmisObjectNotFoundException("Unknown object id: " + folderId);
@@ -300,7 +299,7 @@ public class InMemoryNavigationServiceIm
             }
 
             TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-            ObjectData objectData = PropertyCreationHelper.getObjectData(tm, objStore, child, filter, user,
+            ObjectData objectData = PropertyCreationHelper.getObjectData(context, tm, objStore, child, filter, user,
                     includeAllowableActions, includeRelationships, renditionFilter, false, false, null);
 
             oifd.setObject(objectData);
@@ -308,7 +307,7 @@ public class InMemoryNavigationServiceIm
             // add additional information for Atom
             if (objectInfos != null) {
                 ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, child, objectInfo);
+                fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, child, objectInfo);
                 objectInfos.addObjectInfo(objectInfo);
             }
         }
@@ -318,13 +317,13 @@ public class InMemoryNavigationServiceIm
 
         if (objectInfos != null) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
         return result;
     }
 
-    private List<ObjectInFolderContainer> getDescendantsIntern(String repositoryId, String folderId, String filter,
+    private List<ObjectInFolderContainer> getDescendantsIntern(CallContext context, String repositoryId, String folderId, String filter,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includePathSegments, int level, int maxLevels, boolean folderOnly, ObjectInfoHandler objectInfos,
             String user) {
@@ -332,7 +331,7 @@ public class InMemoryNavigationServiceIm
         List<ObjectInFolderContainer> childrenOfFolderId = null;
         if (maxLevels == -1 || level < maxLevels) {
             String orderBy = PropertyIds.NAME;
-            ObjectInFolderList children = getChildrenIntern(repositoryId, folderId, filter, orderBy,
+            ObjectInFolderList children = getChildrenIntern(context, repositoryId, folderId, filter, orderBy,
                     includeAllowableActions, includeRelationships, renditionFilter, includePathSegments,
                     MAX_FOLDERS_IN_GET_DESC, 0, folderOnly, false, objectInfos, user);
             childrenOfFolderId = new ArrayList<ObjectInFolderContainer>();
@@ -341,7 +340,7 @@ public class InMemoryNavigationServiceIm
                 for (ObjectInFolderData child : children.getObjects()) {
                     ObjectInFolderContainerImpl oifc = new ObjectInFolderContainerImpl();
                     String childId = child.getObject().getId();
-                    List<ObjectInFolderContainer> subChildren = getDescendantsIntern(repositoryId, childId, filter,
+                    List<ObjectInFolderContainer> subChildren = getDescendantsIntern(context, repositoryId, childId, filter,
                             includeAllowableActions, includeRelationships, renditionFilter, includePathSegments,
                             level + 1, maxLevels, folderOnly, objectInfos, user);
 
@@ -356,7 +355,7 @@ public class InMemoryNavigationServiceIm
         return childrenOfFolderId;
     }
 
-    private List<ObjectParentData> getObjectParentsIntern(String repositoryId, StoredObject so, String filter,
+    private List<ObjectParentData> getObjectParentsIntern(CallContext context, String repositoryId, StoredObject so, String filter,
             ObjectInfoHandler objectInfos, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includeRelativePathSegment, String user) {
 
@@ -369,7 +368,7 @@ public class InMemoryNavigationServiceIm
                 ObjectParentDataImpl parentData = new ObjectParentDataImpl();
                 TypeManager tm = fStoreManager.getTypeManager(repositoryId);
                 Folder parent = (Folder) objStore.getObjectById(parentId);
-                ObjectData objData = PropertyCreationHelper.getObjectData(tm, objStore, parent, filter, user,
+                ObjectData objData = PropertyCreationHelper.getObjectData(context, tm, objStore, parent, filter, user,
                         includeAllowableActions, includeRelationships, renditionFilter, false, true, null);
                 parentData.setObject(objData);
                 if (null != includeRelativePathSegment && includeRelativePathSegment && so instanceof Fileable) {
@@ -378,7 +377,7 @@ public class InMemoryNavigationServiceIm
                 result.add(parentData);
                 if (objectInfos != null) {
                     ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-                    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parent, objectInfo);
+                    fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, parent, objectInfo);
                     objectInfos.addObjectInfo(objectInfo);
                 }
             }
@@ -387,7 +386,7 @@ public class InMemoryNavigationServiceIm
         return result;
     }
 
-    private ObjectData getFolderParentIntern(String repositoryId, StoredObject so, String filter,
+    private ObjectData getFolderParentIntern(CallContext context, String repositoryId, StoredObject so, String filter,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String user,
             ObjectInfoHandler objectInfos) {
 
@@ -405,17 +404,17 @@ public class InMemoryNavigationServiceIm
         copyFilteredProperties(repositoryId, parentFolder, filter, parent);
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        parent.setRelationships(DataObjectCreator.getRelationships(tm, objStore, includeRelationships, parentFolder,
+        parent.setRelationships(DataObjectCreator.getRelationships(context, tm, objStore, includeRelationships, parentFolder,
                 user));
 
         if (includeAllowableActions != null && includeAllowableActions) {
-            AllowableActions allowableActions = parentFolder.getAllowableActions(user);
+            AllowableActions allowableActions = parentFolder.getAllowableActions(context, user);
             parent.setAllowableActions(allowableActions);
         }
 
         if (objectInfos != null) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parentFolder, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, parentFolder, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 

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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -206,7 +206,8 @@ public class InMemoryObjectServiceImpl e
                     "Cannot create object, without a type (no property with id CMIS_OBJECT_TYPE_ID).");
         }
 
-        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId, cmis11);
         if (typeDefC == null) {
             throw new CmisInvalidArgumentException("Cannot create object, a type with id " + typeId + " is unknown");
         }
@@ -234,12 +235,12 @@ 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, objStore, so, null, context.getUsername(), false,
+        ObjectData od = PropertyCreationHelper.getObjectData(context, tm, objStore, so, null, context.getUsername(), false,
                 IncludeRelationships.NONE, null, false, false, extension);
 
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, od, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
         return so != null ? so.getId() : null;
@@ -341,7 +342,7 @@ public class InMemoryObjectServiceImpl e
         }
 
         String user = context.getUsername();
-        AllowableActions allowableActions = so.getAllowableActions(user);
+        AllowableActions allowableActions = so.getAllowableActions(context, user);
         LOG.debug("stop getAllowableActions()");
         return allowableActions;
     }
@@ -387,12 +388,12 @@ public class InMemoryObjectServiceImpl e
 
         String user = context.getUsername();
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, filter, user, includeAllowableActions,
+        ObjectData od = PropertyCreationHelper.getObjectData(context, tm, objStore, so, filter, user, includeAllowableActions,
                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
 
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -428,7 +429,7 @@ public class InMemoryObjectServiceImpl e
         ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, filter, user, includeAllowableActions,
+        ObjectData od = PropertyCreationHelper.getObjectData(context, tm, objStore, so, filter, user, includeAllowableActions,
                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
 
         LOG.debug("stop getObjectByPath()");
@@ -437,7 +438,7 @@ public class InMemoryObjectServiceImpl e
         // additional information:
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -539,14 +540,14 @@ public class InMemoryObjectServiceImpl e
         LOG.debug("stop moveObject()");
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, objectStore, so, null, user, false,
+        ObjectData od = PropertyCreationHelper.getObjectData(context, 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
         // additional information:
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, od, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -573,7 +574,8 @@ public class InMemoryObjectServiceImpl e
         }
 
         // validate content allowed
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = getTypeDefinition(repositoryId, so, cmis11);
         if (!(typeDef instanceof DocumentTypeDefinition)) {
             throw new CmisInvalidArgumentException("Object does not refer to a document, can't set content");
         }
@@ -616,7 +618,8 @@ public class InMemoryObjectServiceImpl e
         ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         // Validation
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = getTypeDefinition(repositoryId, so, cmis11);
         boolean isCheckedOut = false;
 
         isCheckedOut = isCheckedOut(so, user);
@@ -624,7 +627,6 @@ public class InMemoryObjectServiceImpl e
         Map<String, PropertyData<?>> oldProperties = new HashMap<String, PropertyData<?>>();
 
         // check properties for validity
-        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
         validateProperties(repositoryId, so, properties, false, cmis11);
 
         if (changeToken != null && changeToken.getValue() != null
@@ -652,7 +654,7 @@ public class InMemoryObjectServiceImpl e
         // Find secondary type definitions to delete (null means not set --> do
         // not change, empty --> remove all secondary types)
         if (null != newSecondaryTypeIds) {
-            List<String> propertiesIdToDelete = getListOfPropertiesToDeleteFromRemovedSecondaryTypes(repositoryId, so,
+            List<String> propertiesIdToDelete = getListOfPropertiesToDeleteFromRemovedSecondaryTypes(context, repositoryId, so,
                     newSecondaryTypeIds);
             for (String propIdToRemove : propertiesIdToDelete) {
                 oldProperties.put(propIdToRemove, null);
@@ -668,7 +670,7 @@ public class InMemoryObjectServiceImpl e
             PropertyData<?> value = properties.getProperties().get(key);
             PropertyDefinition<?> propDef = typeDef.getPropertyDefinitions().get(key);
             if (cmis11 && null == propDef) {
-                TypeDefinition typeDefSecondary = getSecondaryTypeDefinition(repositoryId, secondaryTypeIds, key);
+                TypeDefinition typeDefSecondary = getSecondaryTypeDefinition(context, repositoryId, secondaryTypeIds, key);
                 if (null == typeDefSecondary) {
                     throw new CmisInvalidArgumentException("Cannot update property " + key + ": not contained in type");
                 }
@@ -744,14 +746,14 @@ public class InMemoryObjectServiceImpl e
         }
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
-        ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, so, null, user, false,
+        ObjectData od = PropertyCreationHelper.getObjectData(context, 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
         // additional information:
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, od, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 
@@ -762,8 +764,6 @@ public class InMemoryObjectServiceImpl e
     public void appendContentStream(CallContext context, String repositoryId, Holder<String> objectId,
             Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
 
-        Content content;
-
         LOG.debug("start appendContentStream()");
         StoredObject so = validator.appendContentStream(context, repositoryId, objectId, extension);
 
@@ -778,21 +778,19 @@ public class InMemoryObjectServiceImpl e
         }
 
         // validate content allowed
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = getTypeDefinition(repositoryId, so, cmis11);
         if (!(typeDef instanceof DocumentTypeDefinition)) {
             throw new CmisInvalidArgumentException("Object does not refer to a document, can't set content");
         }
         TypeValidator.validateContentAllowed((DocumentTypeDefinition) typeDef, null != contentStream);
 
-        if (so instanceof Document) {
-            content = ((Document) so);
-        } else if (so instanceof DocumentVersion) {
+        if (so instanceof DocumentVersion) {
             // something that is versionable check the proper status of the
             // object
             String user = context.getUsername();
             testHasProperCheckedOutStatus(so, user);
-            content = (DocumentVersion) so;
-        } else {
+        } else if (!(so instanceof Document)){
             throw new IllegalArgumentException("Content cannot be set on this object (must be document or version)");
         }
 
@@ -838,7 +836,8 @@ public class InMemoryObjectServiceImpl e
         TypeValidator.validateRequiredSystemProperties(properties);
 
         String user = context.getUsername();
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties, cmis11);
 
         ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         Map<String, PropertyData<?>> propMap = properties.getProperties();
@@ -889,7 +888,6 @@ public class InMemoryObjectServiceImpl e
             propMap = propMapNew;
         }
 
-        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
         validateProperties(repositoryId, null, properties, false, cmis11);
 
         // set user, creation date, etc.
@@ -963,7 +961,8 @@ public class InMemoryObjectServiceImpl e
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME + " Name is: " + folderName);
         }
 
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties, cmis11);
 
         // check if the given type is a folder type
         if (!typeDef.getBaseTypeId().equals(BaseTypeId.CMIS_FOLDER)) {
@@ -977,7 +976,6 @@ public class InMemoryObjectServiceImpl e
             propertiesNew = new PropertiesImpl(propMapNew.values());
         }
 
-        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
         validateProperties(repositoryId, null, propertiesNew, false, cmis11);
 
         // validate ACL
@@ -1061,7 +1059,8 @@ public class InMemoryObjectServiceImpl e
             throw new CmisInvalidArgumentException("Cannot create a relationship without a targetId.");
         }
 
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties, cmis11);
 
         // check if the given type is a relationship type
         if (!typeDef.getBaseTypeId().equals(BaseTypeId.CMIS_RELATIONSHIP)) {
@@ -1082,7 +1081,6 @@ public class InMemoryObjectServiceImpl e
             propertiesNew = properties;
         }
 
-        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
         validateProperties(repositoryId, null, propertiesNew, false, cmis11);
 
         // validate ACL
@@ -1092,9 +1090,9 @@ public class InMemoryObjectServiceImpl e
         ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
 
         TypeDefinition sourceTypeDef = fStoreManager.getTypeById(repositoryId,
-                objStore.getObjectById(sourceId).getTypeId()).getTypeDefinition();
+                objStore.getObjectById(sourceId).getTypeId(), cmis11).getTypeDefinition();
         TypeDefinition targetTypeDef = fStoreManager.getTypeById(repositoryId,
-                objStore.getObjectById(targetId).getTypeId()).getTypeDefinition();
+                objStore.getObjectById(targetId).getTypeId(), cmis11).getTypeDefinition();
         TypeValidator.validateAllowedRelationshipTypes((RelationshipTypeDefinition) typeDef, sourceTypeDef,
                 targetTypeDef);
 
@@ -1123,7 +1121,8 @@ public class InMemoryObjectServiceImpl e
         TypeValidator.validateRequiredSystemProperties(properties);
 
         String user = context.getUsername();
-        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+        TypeDefinition typeDef = getTypeDefinition(repositoryId, properties, cmis11);
 
         ObjectStore objectStore = fStoreManager.getObjectStore(repositoryId);
         Map<String, PropertyData<?>> propMap = properties.getProperties();
@@ -1167,7 +1166,6 @@ public class InMemoryObjectServiceImpl e
             propertiesNew = new PropertiesImpl(propMapNew.values());
         }
 
-        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
         validateProperties(repositoryId, null, propertiesNew, false, cmis11);
 
         // set user, creation date, etc.
@@ -1280,9 +1278,9 @@ public class InMemoryObjectServiceImpl e
         TypeDefinition typeDef;
 
         if (null != so) {
-            typeDef = getTypeDefinition(repositoryId, so);
+            typeDef = getTypeDefinition(repositoryId, so, cmis11);
         } else {
-            typeDef = getTypeDefinition(repositoryId, properties);
+            typeDef = getTypeDefinition(repositoryId, properties, cmis11);
         }
 
         // check properties for validity
@@ -1304,21 +1302,22 @@ public class InMemoryObjectServiceImpl e
         if (null != secondaryTypeIds && secondaryTypeIds.size() != 0) {
             List<String> allTypeIds = new ArrayList<String>(secondaryTypeIds);
             allTypeIds.add(typeDef.getId());
-            List<TypeDefinition> typeDefs = getTypeDefinition(repositoryId, allTypeIds);
+            List<TypeDefinition> typeDefs = getTypeDefinition(repositoryId, allTypeIds, cmis11);
             TypeValidator.validateProperties(typeDefs, properties, checkMandatory);
         } else {
             TypeValidator.validateProperties(typeDef, properties, checkMandatory, true);
         }
     }
 
-    private TypeDefinition getSecondaryTypeDefinition(String repositoryId, Set<String> secondaryTypeIds,
+    private TypeDefinition getSecondaryTypeDefinition(CallContext context, String repositoryId, Set<String> secondaryTypeIds,
             String propertyId) {
         if (null == secondaryTypeIds || secondaryTypeIds.isEmpty()) {
             return null;
         }
 
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
         for (String typeId : secondaryTypeIds) {
-            TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId);
+            TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeId, cmis11);
             TypeDefinition typeDef = typeDefC.getTypeDefinition();
 
             if (TypeValidator.typeContainsProperty(typeDef, propertyId)) {
@@ -1329,7 +1328,7 @@ public class InMemoryObjectServiceImpl e
         return null;
     }
 
-    private List<String> getListOfPropertiesToDeleteFromRemovedSecondaryTypes(String repositoryId, StoredObject so,
+    private List<String> getListOfPropertiesToDeleteFromRemovedSecondaryTypes(CallContext context, String repositoryId, StoredObject so,
             List<String> newSecondaryTypeIds) {
 
         List<String> propertiesToDelete = new ArrayList<String>(); // properties
@@ -1340,8 +1339,10 @@ public class InMemoryObjectServiceImpl e
         List<String> existingSecondaryTypeIds = so.getSecondaryTypeIds();
         List<String> delta = new ArrayList<String>(existingSecondaryTypeIds);
         delta.removeAll(newSecondaryTypeIds);
+        boolean cmis11 = context.getCmisVersion() != CmisVersion.CMIS_1_0;
+
         for (String typeDefId : delta) {
-            TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeDefId);
+            TypeDefinitionContainer typeDefC = fStoreManager.getTypeById(repositoryId, typeDefId, cmis11);
             TypeDefinition typeDef = typeDefC.getTypeDefinition();
             propertiesToDelete.addAll(typeDef.getPropertyDefinitions().keySet());
         }

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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -58,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, objStore, pol, filter, user, false,
+                ObjectData od = PropertyCreationHelper.getObjectData(context, 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=1719450&r1=1719449&r2=1719450&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 Fri Dec 11 15:21:31 2015
@@ -84,13 +84,13 @@ public class InMemoryRelationshipService
         List<ObjectData> odList = new ArrayList<ObjectData>();
 
         for (StoredObject rel : rels) {
-            ObjectData od = PropertyCreationHelper.getObjectData(tm, objStore, rel, filter, user,
+            ObjectData od = PropertyCreationHelper.getObjectData(context, tm, objStore, rel, filter, user,
                     includeAllowableActions, IncludeRelationships.NONE, null, false, false, extension);
             odList.add(od);
         }
         if (context.isObjectInfoRequired()) {
             ObjectInfoImpl objectInfo = new ObjectInfoImpl();
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(context, repositoryId, so, objectInfo);
             objectInfos.addObjectInfo(objectInfo);
         }
 




Mime
View raw message