chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r938389 - /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/
Date Tue, 27 Apr 2010 10:09:18 GMT
Author: jens
Date: Tue Apr 27 10:09:18 2010
New Revision: 938389

URL: http://svn.apache.org/viewvc?rev=938389&view=rev
Log:
Adjust InMemory Server to use new server packages and classes

Removed:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/ServiceFactory.java
Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/AtomLinkInfoProvider.java Tue Apr 27 10:09:18 2010
@@ -27,6 +27,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.ObjectList;
 import org.apache.chemistry.opencmis.commons.api.ObjectParentData;
 import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.api.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Content;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
@@ -35,7 +36,6 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.VersionedDocument;
-import org.apache.chemistry.opencmis.server.spi.ObjectInfoHolder;
 
 /**
  * For the Atom binding more information might be required than the result of a
@@ -64,12 +64,11 @@ public class AtomLinkInfoProvider {
      * @param objectInfos
      *            Holder to fill with information
      */
-    public void fillInformationForAtomLinks(String repositoryId, StoredObject so, ObjectInfoHolder objectInfos) {
-        if (null == objectInfos || null == so)
+    public void fillInformationForAtomLinks(String repositoryId, StoredObject so, ObjectData od, ObjectInfoImpl objInfo) {
+        if (null == objInfo || null == so)
             return;
         TypeDefinition typeDef = fStoreManager.getTypeById(repositoryId, so.getTypeId()).getTypeDefinition();
 
-        ObjectInfoImpl objInfo = new ObjectInfoImpl();
         // Fill all setters:
         objInfo.setId(so.getId());
         objInfo.setName(so.getName());
@@ -78,6 +77,7 @@ public class AtomLinkInfoProvider {
         objInfo.setLastModificationDate(so.getModifiedAt());
         objInfo.setTypeId(so.getTypeId());
         objInfo.setBaseType(typeDef.getBaseTypeId());
+        objInfo.setObject(od);
 
         // versioning information:
         if (so instanceof DocumentVersion) {
@@ -138,7 +138,10 @@ public class AtomLinkInfoProvider {
         objInfo.setSupportsDescendants(true);
         objInfo.setSupportsFolderTree(true);
 
-        objectInfos.addObjectInfo(objInfo);
+    }
+
+    public void fillInformationForAtomLinks(String repositoryId, StoredObject so, ObjectInfoImpl objectInfo) {
+        fillInformationForAtomLinks(repositoryId, so, null, objectInfo);        
     }
 
     /**
@@ -152,15 +155,16 @@ public class AtomLinkInfoProvider {
      * @param objectInfos
      *            Holder to fill with information
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHolder objectInfos) {
-        if (null == objectInfos || null == objectId)
+   public void fillInformationForAtomLinks(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, objectInfos);
+        fillInformationForAtomLinks(repositoryId, so, objectInfo);
     }
 
+
     /**
      * FillObjectInfoHolder object with required information needed for Atom
      * binding after a getChildren() call in navigation service
@@ -174,18 +178,23 @@ public class AtomLinkInfoProvider {
      * @param objList
      *            result of getChildren call
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHolder objectInfos,
+    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHandler objectInfos,
             ObjectInFolderList objList) {
 
         if (null == objectInfos || null == objList || null == objectId)
             return;
+        
 
         // Fill object information for requested object
-        fillInformationForAtomLinks(repositoryId, objectId, objectInfos);
+        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+        fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
+        objectInfos.addObjectInfo(objectInfo);
 
         // Fill object information for all children in result list
         for (ObjectInFolderData object : objList.getObjects()) {
-            fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfos);
+            objectInfo = new ObjectInfoImpl();
+            fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
         }
     }
 
@@ -202,12 +211,14 @@ public class AtomLinkInfoProvider {
      * @param objList
      *            result of getChildren call
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHolder objectInfos,
+    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHandler objectInfos,
             ObjectList objList) {
 
+        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
         if (null != objectId) {
             // Fill object information for requested object
-            fillInformationForAtomLinks(repositoryId, objectId, objectInfos);
+            fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
         }
 
         if (null != objList && null != objList.getObjects()) {
@@ -215,7 +226,9 @@ public class AtomLinkInfoProvider {
             List<ObjectData> listObjects = objList.getObjects();
             if (null != listObjects)
                 for (ObjectData object : listObjects) {
-                    fillInformationForAtomLinks(repositoryId, object.getId(), objectInfos);
+                    objectInfo = new ObjectInfoImpl();
+                    fillInformationForAtomLinks(repositoryId, object.getId(), objectInfo);
+                    objectInfos.addObjectInfo(objectInfo);
                 }
         }
 
@@ -234,7 +247,7 @@ public class AtomLinkInfoProvider {
      * @param objList
      *            result of getChildren call
      */
-    private void fillInformationForAtomLinks(String repositoryId, ObjectInfoHolder objectInfos,
+    private void fillInformationForAtomLinks(String repositoryId, ObjectInfoHandler objectInfos,
             ObjectInFolderContainer oifc) {
 
         if (null == objectInfos || null == oifc)
@@ -246,7 +259,9 @@ public class AtomLinkInfoProvider {
         if (null != oifc.getChildren())
             for (ObjectInFolderContainer object : oifc.getChildren()) {
                 // call recursively
+                ObjectInfoImpl objectInfo = new ObjectInfoImpl();
                 fillInformationForAtomLinks(repositoryId, objectInfos, object);
+                objectInfos.addObjectInfo(objectInfo);
             }
     }
 
@@ -263,24 +278,28 @@ public class AtomLinkInfoProvider {
      * @param oifcList
      *            result of getDescendants call
      */
-    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHolder objectInfos,
+    public void fillInformationForAtomLinks(String repositoryId, String objectId, ObjectInfoHandler objectInfos,
             List<ObjectInFolderContainer> oifcList) {
 
         if (null == objectInfos || null == oifcList || null == objectId)
             return;
 
+        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
         // Fill object information for requested object
-        fillInformationForAtomLinks(repositoryId, objectId, objectInfos);
+        fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
+        objectInfos.addObjectInfo(objectInfo);
 
         for (ObjectInFolderContainer object : oifcList) {
             fillInformationForAtomLinks(repositoryId, objectInfos, object);
         }
     }
 
-    private void fillInformationForAtomLinks(String repositoryId, ObjectInfoHolder objectInfos,
+    private void fillInformationForAtomLinks(String repositoryId, ObjectInfoHandler objectInfos,
             ObjectInFolderData object) {
 
-        fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfos);
+        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+        fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfo);
+        objectInfos.addObjectInfo(objectInfo);
     }
 
     /**
@@ -297,16 +316,19 @@ public class AtomLinkInfoProvider {
      *            result of getObjectParents call
      */
     public void fillInformationForAtomLinksGetParents(String repositoryId, String objectId,
-            ObjectInfoHolder objectInfos, List<ObjectParentData> objParents) {
+            ObjectInfoHandler objectInfos, List<ObjectParentData> objParents) {
 
         if (null == objectInfos || null == objParents || null == objectId)
             return;
 
         // Fill object information for requested object
-        fillInformationForAtomLinks(repositoryId, objectId, objectInfos);
+        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+        fillInformationForAtomLinks(repositoryId, objectId, objectInfo);
 
         for (ObjectParentData object : objParents) {
-            fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfos);
+            objectInfo = new ObjectInfoImpl();
+            fillInformationForAtomLinks(repositoryId, object.getObject().getId(), objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
         }
     }
 

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryDiscoveryServiceImpl.java Tue Apr 27 10:09:18 2010
@@ -41,6 +41,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.RepositoryInfo;
 import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+import org.apache.chemistry.opencmis.commons.api.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.commons.enums.ChangeType;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
@@ -53,14 +54,12 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.apache.chemistry.opencmis.inmemory.storedobj.impl.ObjectStoreImpl;
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
-import org.apache.chemistry.opencmis.server.spi.CmisDiscoveryService;
-import org.apache.chemistry.opencmis.server.spi.ObjectInfoHolder;
-import org.apache.chemistry.opencmis.server.support.query.CMISQLLexer;
-import org.apache.chemistry.opencmis.server.support.query.CMISQLParser;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.chemistry.opencmis.server.support.query.CMISQLLexer;
+import org.apache.chemistry.opencmis.server.support.query.CMISQLParser;
 
-public class InMemoryDiscoveryServiceImpl extends InMemoryAbstractServiceImpl implements CmisDiscoveryService {
+public class InMemoryDiscoveryServiceImpl extends InMemoryAbstractServiceImpl{
 
     private static final Log LOG = LogFactory.getLog(InMemoryDiscoveryServiceImpl.class.getName());
 
@@ -79,7 +78,7 @@ public class InMemoryDiscoveryServiceImp
 
     public ObjectList getContentChanges(CallContext context, String repositoryId, Holder<String> changeLogToken,
             Boolean includeProperties, String filter, Boolean includePolicyIds, Boolean includeAcl,
-            BigInteger maxItems, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            BigInteger maxItems, ExtensionsData extension, ObjectInfoHandler objectInfos) {
         // dummy implementation using hard coded values
 
         RepositoryInfo rep = fRepositoryService.getRepositoryInfo(context, repositoryId, null);

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryMultiFilingServiceImpl.java Tue Apr 27 10:09:18 2010
@@ -21,21 +21,21 @@ package org.apache.chemistry.opencmis.in
 import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.api.ObjectData;
 import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+import org.apache.chemistry.opencmis.commons.api.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
+import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Folder;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.MultiFiling;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
-import org.apache.chemistry.opencmis.server.spi.CmisMultiFilingService;
-import org.apache.chemistry.opencmis.server.spi.ObjectInfoHolder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class InMemoryMultiFilingServiceImpl extends InMemoryAbstractServiceImpl implements CmisMultiFilingService {
+public class InMemoryMultiFilingServiceImpl extends InMemoryAbstractServiceImpl {
 
     private static final Log LOG = LogFactory.getLog(InMemoryMultiFilingServiceImpl.class.getName());
 
@@ -47,7 +47,7 @@ public class InMemoryMultiFilingServiceI
     }
 
     public ObjectData addObjectToFolder(CallContext context, String repositoryId, String objectId, String folderId,
-            Boolean allVersions, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            Boolean allVersions, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("Begin addObjectToFolder()");
 
@@ -63,8 +63,13 @@ public class InMemoryMultiFilingServiceI
         MultiFiling obj = (MultiFiling) so;
         obj.addParent(newParent);
 
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
+
 
         String user = context.getUsername();
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, user, false,
@@ -75,7 +80,7 @@ public class InMemoryMultiFilingServiceI
     }
 
     public ObjectData removeObjectFromFolder(CallContext context, String repositoryId, String objectId,
-            String folderId, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            String folderId, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("Begin removeObjectFromFolder()");
 
@@ -90,8 +95,12 @@ public class InMemoryMultiFilingServiceI
 
         // To be able to provide all Atom links in the response we need
         // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, folder, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         String user = context.getUsername();
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, user, false,

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryNavigationServiceImpl.java Tue Apr 27 10:09:18 2010
@@ -34,6 +34,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.ObjectParentData;
 import org.apache.chemistry.opencmis.commons.api.Properties;
 import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+import org.apache.chemistry.opencmis.commons.api.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
@@ -43,9 +44,9 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectInFolderListImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectListImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectParentDataImpl;
+import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.inmemory.DataObjectCreator;
 import org.apache.chemistry.opencmis.inmemory.FilterParser;
-import org.apache.chemistry.opencmis.inmemory.storedobj.api.Children;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Folder;
@@ -56,13 +57,10 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.VersionedDocument;
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
-import org.apache.chemistry.opencmis.server.spi.CmisNavigationService;
-import org.apache.chemistry.opencmis.server.spi.CmisRepositoryService;
-import org.apache.chemistry.opencmis.server.spi.ObjectInfoHolder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class InMemoryNavigationServiceImpl extends InMemoryAbstractServiceImpl implements CmisNavigationService {
+public class InMemoryNavigationServiceImpl extends InMemoryAbstractServiceImpl {
 
     private static Log LOG = LogFactory.getLog(InMemoryNavigationServiceImpl.class);
 
@@ -76,7 +74,7 @@ public class InMemoryNavigationServiceIm
     public ObjectList getCheckedOutDocs(CallContext context, String repositoryId, String folderId, String filter,
             String orderBy, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension,
-            ObjectInfoHolder objectInfos) {
+            ObjectInfoHandler objectInfos) {
 
         ObjectListImpl res = new ObjectListImpl();
         List<ObjectData> odList = new ArrayList<ObjectData>();
@@ -94,20 +92,28 @@ public class InMemoryNavigationServiceIm
             for (VersionedDocument checkedOut : checkedOuts) {
                 ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, checkedOut, filter, user,
                         includeAllowableActions, includeRelationships, renditionFilter, false, false, extension);
-                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, checkedOut, objectInfos);
+                if (context.isObjectInfoRequired()) {
+                    ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+                    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, checkedOut, objectInfo);
+                    objectInfos.addObjectInfo(objectInfo);
+                }
                 odList.add(od);
             }
         } else {
             ObjectInFolderList children = getChildrenIntern(repositoryId, folderId, filter, orderBy,
-                    includeAllowableActions, includeRelationships, renditionFilter, false, -1, -1, false, objectInfos,
-                    user);
+                    includeAllowableActions, includeRelationships, renditionFilter, false, -1, -1, false, context
+                            .isObjectInfoRequired() ? objectInfos : null, user);
             for (ObjectInFolderData child : children.getObjects()) {
                 ObjectData obj = child.getObject();
                 StoredObject so = fStoreManager.getObjectStore(repositoryId).getObjectById(obj.getId());
                 LOG.info("Checked out: children:" + obj.getId());
                 if (so instanceof DocumentVersion && ((DocumentVersion) so).getParentDocument().isCheckedOut()) {
                     odList.add(obj);
-                    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+                    if (context.isObjectInfoRequired()) {
+                        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+                        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+                        objectInfos.addObjectInfo(objectInfo);
+                    }
                 }
             }
         }
@@ -121,7 +127,7 @@ public class InMemoryNavigationServiceIm
     public ObjectInFolderList getChildren(CallContext context, String repositoryId, String folderId, String filter,
             String orderBy, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount,
-            ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getChildren()");
 
@@ -132,7 +138,7 @@ public class InMemoryNavigationServiceIm
         String user = context.getUsername();
         ObjectInFolderList res = getChildrenIntern(repositoryId, folderId, filter, orderBy, includeAllowableActions,
                 includeRelationships, renditionFilter, includePathSegment, maxItemsInt, skipCountInt, false,
-                objectInfos, user);
+                context.isObjectInfoRequired() ? objectInfos : null, user);
         LOG.debug("stop getChildren()");
         return res;
     }
@@ -140,7 +146,7 @@ public class InMemoryNavigationServiceIm
     public List<ObjectInFolderContainer> getDescendants(CallContext context, String repositoryId, String folderId,
             BigInteger depth, String filter, Boolean includeAllowableActions,
             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePathSegment,
-            ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getDescendants()");
 
@@ -166,7 +172,7 @@ public class InMemoryNavigationServiceIm
     }
 
     public ObjectData getFolderParent(CallContext context, String repositoryId, String folderId, String filter,
-            ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getFolderParent()");
 
@@ -179,13 +185,17 @@ public class InMemoryNavigationServiceIm
             throw new CmisInvalidArgumentException("Can't get folder parent, id does not refer to a folder: "
                     + folderId);
 
-        ObjectData res = getFolderParentIntern(repositoryId, folder, filter, objectInfos);
+        ObjectData res = getFolderParentIntern(repositoryId, folder, filter, context.isObjectInfoRequired() ? objectInfos : null);
         if (res == null)
             throw new CmisInvalidArgumentException("Cannot get parent of a root folder");
 
         // To be able to provide all Atom links in the response we need
         // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         LOG.debug("stop getFolderParent()");
         return res;
@@ -194,7 +204,7 @@ public class InMemoryNavigationServiceIm
     public List<ObjectInFolderContainer> getFolderTree(CallContext context, String repositoryId, String folderId,
             BigInteger depth, String filter, Boolean includeAllowableActions,
             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePathSegment,
-            ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getFolderTree()");
 
@@ -217,7 +227,7 @@ public class InMemoryNavigationServiceIm
     public List<ObjectParentData> getObjectParents(CallContext context, String repositoryId, String objectId,
             String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includeRelativePathSegment, ExtensionsData extension,
-            ObjectInfoHolder objectInfos) {
+            ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getObjectParents()");
 
@@ -234,11 +244,15 @@ public class InMemoryNavigationServiceIm
         else
             return Collections.emptyList();
 
-        result = getObjectParentsIntern(repositoryId, spo, filter, objectInfos);
+        result = getObjectParentsIntern(repositoryId, spo, filter, context.isObjectInfoRequired() ? objectInfos : null);
 
         // To be able to provide all Atom links in the response we need
         // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         LOG.debug("stop getObjectParents()");
         return result;
@@ -248,7 +262,7 @@ public class InMemoryNavigationServiceIm
 
     private ObjectInFolderList getChildrenIntern(String repositoryId, String folderId, String filter, String orderBy,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-            Boolean includePathSegments, int maxItems, int skipCount, boolean folderOnly, ObjectInfoHolder objectInfos,
+            Boolean includePathSegments, int maxItems, int skipCount, boolean folderOnly, ObjectInfoHandler objectInfos,
             String user) {
 
         ObjectInFolderListImpl result = new ObjectInFolderListImpl();
@@ -296,17 +310,25 @@ public class InMemoryNavigationServiceIm
             oifd.setObject(objectData);
             folderList.add(oifd);
             // add additional information for Atom
-            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, spo, objectInfos);
+            if (objectInfos != null) {
+                ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+                fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, spo, objectInfo);
+                objectInfos.addObjectInfo(objectInfo);
+            }
 
         }
         result.setObjects(folderList);
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (objectInfos != null) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
         return result;
     }
 
     private List<ObjectInFolderContainer> getDescendantsIntern(String repositoryId, String folderId, String filter,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-            Boolean includePathSegments, int level, int maxLevels, boolean folderOnly, ObjectInfoHolder objectInfos,
+            Boolean includePathSegments, int level, int maxLevels, boolean folderOnly, ObjectInfoHandler objectInfos,
             String user) {
 
         // log.info("getDescendantsIntern: " + folderId + ", in level " + level
@@ -340,7 +362,7 @@ public class InMemoryNavigationServiceIm
     }
 
     private List<ObjectParentData> getObjectParentsIntern(String repositoryId, Filing sop, String filter,
-            ObjectInfoHolder objectInfos) {
+            ObjectInfoHandler objectInfos) {
 
         List<ObjectParentData> result = null;
         if (sop instanceof SingleFiling) {
@@ -373,14 +395,18 @@ public class InMemoryNavigationServiceIm
                     parentData.setObject(objData);
                     parentData.setRelativePathSegment(multiParentObj.getPathSegment());
                     result.add(parentData);
-                    fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parent, objectInfos);
+                    if (objectInfos != null) {
+                        ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+                        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parent, objectInfo);
+                        objectInfos.addObjectInfo(objectInfo);
+                    }
                 }
         }
         return result;
     }
 
     private ObjectData getFolderParentIntern(String repositoryId, SingleFiling sop, String filter,
-            ObjectInfoHolder objectInfos) {
+            ObjectInfoHandler objectInfos) {
 
         ObjectDataImpl parent = new ObjectDataImpl();
 
@@ -391,7 +417,11 @@ public class InMemoryNavigationServiceIm
         }
 
         copyFilteredProperties(repositoryId, parentFolder, filter, parent);
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parentFolder, objectInfos);
+        if (objectInfos != null) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parentFolder, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         return parent;
     }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java Tue Apr 27 10:09:18 2010
@@ -39,6 +39,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.api.TypeDefinitionContainer;
 import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+import org.apache.chemistry.opencmis.commons.api.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
@@ -51,6 +52,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.FailedToDeleteDataImpl;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl;
+import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.inmemory.DataObjectCreator;
 import org.apache.chemistry.opencmis.inmemory.FilterParser;
 import org.apache.chemistry.opencmis.inmemory.NameValidator;
@@ -69,13 +71,10 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.types.InMemoryPolicyTypeDefinition;
 import org.apache.chemistry.opencmis.inmemory.types.InMemoryRelationshipTypeDefinition;
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
-import org.apache.chemistry.opencmis.server.spi.CmisObjectService;
-import org.apache.chemistry.opencmis.server.spi.CmisRepositoryService;
-import org.apache.chemistry.opencmis.server.spi.ObjectInfoHolder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class InMemoryObjectServiceImpl extends InMemoryAbstractServiceImpl implements CmisObjectService {
+public class InMemoryObjectServiceImpl extends InMemoryAbstractServiceImpl {
     private static final Log LOG = LogFactory.getLog(InMemoryServiceFactoryImpl.class.getName());
 
     AtomLinkInfoProvider fAtomLinkProvider;
@@ -180,17 +179,17 @@ public class InMemoryObjectServiceImpl e
      * org.opencmis.client.provider.ContentStreamData,
      * org.opencmis.commons.enums.VersioningState,
      * org.opencmis.client.provider.ExtensionsData,
-     * org.opencmis.server.spi.ObjectInfoHolder)
+     * org.opencmis.server.spi.ObjectInfoHandler)
      * 
      * An additional create call compared to the ObjectService from the CMIS
      * spec. This one is needed because the Atom binding in the server
      * implementation does not know what kind of object needs to be created.
-     * Also the ObjectInfoHolder needs to be filled.
+     * Also the ObjectInfoHandler needs to be filled.
      */
     @SuppressWarnings("unchecked")
     public ObjectData create(CallContext context, String repositoryId, Properties properties, String folderId,
             ContentStream contentStream, VersioningState versioningState, List<String> policies,
-            ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         if (null == properties || null == properties.getProperties())
             throw new RuntimeException("Cannot create object, without properties.");
@@ -227,7 +226,11 @@ public class InMemoryObjectServiceImpl e
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, user, false,
                 IncludeRelationships.NONE, null, false, false, extension);
 
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, od, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
         return od;
     }
 
@@ -339,7 +342,7 @@ public class InMemoryObjectServiceImpl e
 
     public ObjectData getObject(CallContext context, String repositoryId, String objectId, String filter,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-            Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getObject()");
 
@@ -352,7 +355,11 @@ public class InMemoryObjectServiceImpl e
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, filter, user, includeAllowableActions,
                 includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension);
 
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         LOG.debug("stop getObject()");
 
@@ -361,7 +368,7 @@ public class InMemoryObjectServiceImpl e
 
     public ObjectData getObjectByPath(CallContext context, String repositoryId, String path, String filter,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-            Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start getObjectByPath()");
         checkRepositoryId(repositoryId);
@@ -379,7 +386,11 @@ public class InMemoryObjectServiceImpl e
 
         // To be able to provide all Atom links in the response we need
         // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         return od;
     }
@@ -412,7 +423,7 @@ public class InMemoryObjectServiceImpl e
     }
 
     public ObjectData moveObject(CallContext context, String repositoryId, Holder<String> objectId,
-            String targetFolderId, String sourceFolderId, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            String targetFolderId, String sourceFolderId, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         LOG.debug("start moveObject()");
         StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
@@ -464,14 +475,18 @@ public class InMemoryObjectServiceImpl e
         objectId.setValue(so.getId());
         LOG.debug("stop moveObject()");
 
-        // To be able to provide all Atom links in the response we need
-        // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-
         String user = context.getUsername();
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, 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);
+            objectInfos.addObjectInfo(objectInfo);
+        }
+
         return od;
     }
 
@@ -509,7 +524,7 @@ public class InMemoryObjectServiceImpl e
 
     public ObjectData updateProperties(CallContext context, String repositoryId, Holder<String> objectId,
             Holder<String> changeToken, Properties properties, Acl acl, ExtensionsData extension,
-            ObjectInfoHolder objectInfos) {
+            ObjectInfoHandler objectInfos) {
 
         LOG.debug("start updateProperties()");
         StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
@@ -616,14 +631,18 @@ public class InMemoryObjectServiceImpl e
             // extension);
         }
 
-        // To be able to provide all Atom links in the response we need
-        // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
-
         String user = context.getUsername();
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, 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);
+            objectInfos.addObjectInfo(objectInfo);
+        }
+
         LOG.debug("stop updateProperties()");
 
         return od;

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRepositoryServiceImpl.java Tue Apr 27 10:09:18 2010
@@ -36,7 +36,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.server.spi.CmisRepositoryService;
 
-public class InMemoryRepositoryServiceImpl extends InMemoryAbstractServiceImpl implements CmisRepositoryService {
+public class InMemoryRepositoryServiceImpl extends InMemoryAbstractServiceImpl {
 
     public InMemoryRepositoryServiceImpl(StoreManager storeManager) {
         super(storeManager);

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java Tue Apr 27 10:09:18 2010
@@ -30,17 +30,14 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.api.FailedToDeleteData;
 import org.apache.chemistry.opencmis.commons.api.Holder;
-import org.apache.chemistry.opencmis.commons.api.NavigationService;
 import org.apache.chemistry.opencmis.commons.api.ObjectData;
 import org.apache.chemistry.opencmis.commons.api.ObjectInFolderContainer;
 import org.apache.chemistry.opencmis.commons.api.ObjectInFolderList;
 import org.apache.chemistry.opencmis.commons.api.ObjectList;
 import org.apache.chemistry.opencmis.commons.api.ObjectParentData;
-import org.apache.chemistry.opencmis.commons.api.ObjectService;
 import org.apache.chemistry.opencmis.commons.api.Properties;
 import org.apache.chemistry.opencmis.commons.api.RenditionData;
 import org.apache.chemistry.opencmis.commons.api.RepositoryInfo;
-import org.apache.chemistry.opencmis.commons.api.RepositoryService;
 import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.api.TypeDefinitionContainer;
 import org.apache.chemistry.opencmis.commons.api.TypeDefinitionList;
@@ -54,9 +51,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.BindingsObjectFactoryImpl;
 import org.apache.chemistry.opencmis.commons.impl.server.AbstractCmisService;
 import org.apache.chemistry.opencmis.inmemory.ConfigConstants;
-import org.apache.chemistry.opencmis.inmemory.clientprovider.NavigationServiceImpl;
-import org.apache.chemistry.opencmis.inmemory.clientprovider.ObjectServiceImpl;
-import org.apache.chemistry.opencmis.inmemory.clientprovider.RepositoryServiceImpl;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
 import org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoreManagerFactory;
 import org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoreManagerImpl;
@@ -110,11 +104,6 @@ public class InMemoryService extends Abs
             }
         }
 
-        // With some special configuration settings fill the repository with
-        // some documents and folders
-        // if is empty
-        if (!allAvailableRepositories.contains(repositoryId))
-            fillRepositoryIfConfigured(parameters, repositoryId);
 
         fRepSvc = new InMemoryRepositoryServiceImpl(storeManager);
         fNavSvc = new InMemoryNavigationServiceImpl(storeManager);
@@ -123,6 +112,11 @@ public class InMemoryService extends Abs
         fDisSvc = new InMemoryDiscoveryServiceImpl(storeManager, fRepSvc, fNavSvc);
         fMultiSvc = new InMemoryMultiFilingServiceImpl(storeManager);
 
+        // With some special configuration settings fill the repository with
+        // some documents and folders
+        // if is empty
+        if (!allAvailableRepositories.contains(repositoryId))
+            fillRepositoryIfConfigured(parameters, repositoryId);
     }
 
     public CallContext getCallContext() {
@@ -166,39 +160,39 @@ public class InMemoryService extends Abs
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
         return fNavSvc.getCheckedOutDocs(getCallContext(), repositoryId, folderId, filter, orderBy,
-                includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension, null);
+                includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension, this);
     }
 
     public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
         return fNavSvc.getChildren(getCallContext(), repositoryId, folderId, filter, orderBy, includeAllowableActions,
-                includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension, null);
+                includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension, this);
     }
 
     public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
             String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
         return fNavSvc.getDescendants(getCallContext(), repositoryId, folderId, depth, filter, includeAllowableActions,
-                includeRelationships, renditionFilter, includePathSegment, extension, null);
+                includeRelationships, renditionFilter, includePathSegment, extension, this);
     }
 
     public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
-        return fNavSvc.getFolderParent(getCallContext(), repositoryId, folderId, filter, extension, null);
+        return fNavSvc.getFolderParent(getCallContext(), repositoryId, folderId, filter, extension, this);
     }
 
     public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
             String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
         return fNavSvc.getFolderTree(getCallContext(), repositoryId, folderId, depth, filter, includeAllowableActions,
-                includeRelationships, renditionFilter, includePathSegment, extension, null);
+                includeRelationships, renditionFilter, includePathSegment, extension, this);
     }
 
     public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includeRelativePathSegment, ExtensionsData extension) {
         return fNavSvc.getObjectParents(getCallContext(), repositoryId, objectId, filter, includeAllowableActions,
-                includeRelationships, renditionFilter, includeRelativePathSegment, extension, null);
+                includeRelationships, renditionFilter, includeRelativePathSegment, extension, this);
     }
 
     // --- object service ---
@@ -206,7 +200,7 @@ public class InMemoryService extends Abs
     public String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
             VersioningState versioningState, List<String> policies, ExtensionsData extension) {
         ObjectData od = fObjSvc.create(getCallContext(), repositoryId, properties, folderId, contentStream,
-                versioningState, policies, extension, null);
+                versioningState, policies, extension, this);
         return od.getId();
 
     }
@@ -276,14 +270,14 @@ public class InMemoryService extends Abs
             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
             Boolean includeAcl, ExtensionsData extension) {
         return fObjSvc.getObject(getCallContext(), repositoryId, objectId, filter, includeAllowableActions,
-                includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
+                includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, this);
     }
 
     public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
             IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
             Boolean includeAcl, ExtensionsData extension) {
         return fObjSvc.getObjectByPath(getCallContext(), repositoryId, path, filter, includeAllowableActions,
-                includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
+                includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, this);
     }
 
     public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
@@ -298,7 +292,7 @@ public class InMemoryService extends Abs
 
     public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
             ExtensionsData extension) {
-        fObjSvc.moveObject(getCallContext(), repositoryId, objectId, targetFolderId, sourceFolderId, extension, null);
+        fObjSvc.moveObject(getCallContext(), repositoryId, objectId, targetFolderId, sourceFolderId, extension, this);
     }
 
     public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
@@ -310,7 +304,7 @@ public class InMemoryService extends Abs
     public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
             Properties properties, ExtensionsData extension) {
         fObjSvc.updateProperties(getCallContext(), repositoryId, objectId, changeToken, properties, null, extension,
-                null);
+                this);
     }
 
     // --- versioning service ---
@@ -323,12 +317,12 @@ public class InMemoryService extends Abs
             ContentStream contentStream, String checkinComment, List<String> policies, Acl addAces, Acl removeAces,
             ExtensionsData extension) {
         fVerSvc.checkIn(getCallContext(), repositoryId, objectId, major, properties, contentStream, checkinComment,
-                policies, addAces, removeAces, extension, null);
+                policies, addAces, removeAces, extension, this);
     }
 
     public void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension,
             Holder<Boolean> contentCopied) {
-        fVerSvc.checkOut(getCallContext(), repositoryId, objectId, extension, contentCopied, null);
+        fVerSvc.checkOut(getCallContext(), repositoryId, objectId, extension, contentCopied, this);
     }
 
     public ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
@@ -336,7 +330,7 @@ public class InMemoryService extends Abs
             String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension) {
         return fVerSvc.getObjectOfLatestVersion(getCallContext(), repositoryId, versionSeriesId, major, filter,
                 includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl,
-                extension, null);
+                extension, this);
     }
 
     public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
@@ -348,15 +342,15 @@ public class InMemoryService extends Abs
     public List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,
             Boolean includeAllowableActions, ExtensionsData extension) {
         return fVerSvc.getAllVersions(getCallContext(), repositoryId, versionSeriesId, filter, includeAllowableActions,
-                extension, null);
+                extension, this);
     }
 
     // --- discovery service ---
 
     public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
             String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
-        return super.getContentChanges(repositoryId, changeLogToken, includeProperties, filter, includePolicyIds,
-                includeAcl, maxItems, extension);
+        return fDisSvc.getContentChanges(getCallContext(), repositoryId, changeLogToken, includeProperties, filter, includePolicyIds,
+                includeAcl, maxItems, extension, this);
     }
 
     public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
@@ -370,11 +364,11 @@ public class InMemoryService extends Abs
 
     public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
             ExtensionsData extension) {
-        fMultiSvc.addObjectToFolder(getCallContext(), repositoryId, objectId, folderId, allVersions, extension, null);
+        fMultiSvc.addObjectToFolder(getCallContext(), repositoryId, objectId, folderId, allVersions, extension, this);
     }
 
     public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
-        fMultiSvc.removeObjectFromFolder(getCallContext(), repositoryId, objectId, folderId, extension, null);
+        fMultiSvc.removeObjectFromFolder(getCallContext(), repositoryId, objectId, folderId, extension, this);
     }
 
     // --- relationship service ---
@@ -457,9 +451,9 @@ public class InMemoryService extends Abs
             return;
 
         BindingsObjectFactory objectFactory = new BindingsObjectFactoryImpl();
-        NavigationService navSvc = new NavigationServiceImpl(fNavSvc);
-        ObjectService objSvc = new ObjectServiceImpl(fObjSvc);
-        RepositoryService repSvc = new RepositoryServiceImpl(fRepSvc);
+//        NavigationService navSvc = new NavigationServiceImpl(fNavSvc);
+//        ObjectService objSvc = new ObjectServiceImpl(fObjSvc);
+//        RepositoryService repSvc = new RepositoryServiceImpl(fRepSvc);
 
         String levelsStr = parameters.get(ConfigConstants.FILLER_DEPTH);
         int levels = 1;
@@ -490,7 +484,7 @@ public class InMemoryService extends Abs
             contentSizeKB = Integer.parseInt(contentSizeKBStr);
 
         // Create a hierarchy of folders and fill it with some documents
-        ObjectGenerator gen = new ObjectGenerator(objectFactory, navSvc, objSvc, repositoryId);
+        ObjectGenerator gen = new ObjectGenerator(objectFactory, this, this, repositoryId);
 
         gen.setNumberOfDocumentsToCreatePerFolder(docsPerLevel);
 
@@ -519,10 +513,10 @@ public class InMemoryService extends Abs
         // Simulate a runtime context with configuration parameters
         // Attach the CallContext to a thread local context that can be accessed
         // from everywhere
-        // RuntimeContext.attachCfg(new DummyCallContext());
-
+        DummyCallContext ctx = new DummyCallContext();
+        setCallContext(ctx);
         // Build the tree
-        RepositoryInfo rep = repSvc.getRepositoryInfo(repositoryId, null);
+        RepositoryInfo rep = fRepSvc.getRepositoryInfo(ctx, repositoryId, null);
         String rootFolderId = rep.getRootFolderId();
 
         try {

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java?rev=938389&r1=938388&r2=938389&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java Tue Apr 27 10:09:18 2010
@@ -30,10 +30,12 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.api.Properties;
 import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+import org.apache.chemistry.opencmis.commons.api.server.ObjectInfoHandler;
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
+import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
 import org.apache.chemistry.opencmis.inmemory.FilterParser;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.Document;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.DocumentVersion;
@@ -41,12 +43,10 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
 import org.apache.chemistry.opencmis.inmemory.storedobj.api.VersionedDocument;
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
-import org.apache.chemistry.opencmis.server.spi.CmisVersioningService;
-import org.apache.chemistry.opencmis.server.spi.ObjectInfoHolder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class InMemoryVersioningServiceImpl extends InMemoryAbstractServiceImpl implements CmisVersioningService {
+public class InMemoryVersioningServiceImpl extends InMemoryAbstractServiceImpl {
 
     private static final Log LOG = LogFactory.getLog(InMemoryVersioningServiceImpl.class.getName());
 
@@ -71,7 +71,7 @@ public class InMemoryVersioningServiceIm
 
     public ObjectData checkIn(CallContext context, String repositoryId, Holder<String> objectId, Boolean major,
             Properties properties, ContentStream contentStream, String checkinComment, List<String> policies,
-            Acl addAces, Acl removeAces, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            Acl addAces, Acl removeAces, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
         String user = context.getUsername();
@@ -89,7 +89,11 @@ public class InMemoryVersioningServiceIm
 
         // To be able to provide all Atom links in the response we need
         // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, user, false,
                 IncludeRelationships.NONE, null, false, false, extension);
@@ -98,7 +102,7 @@ public class InMemoryVersioningServiceIm
     }
 
     public ObjectData checkOut(CallContext context, String repositoryId, Holder<String> objectId,
-            ExtensionsData extension, Holder<Boolean> contentCopied, ObjectInfoHolder objectInfos) {
+            ExtensionsData extension, Holder<Boolean> contentCopied, ObjectInfoHandler objectInfos) {
 
         StoredObject so = checkStandardParameters(repositoryId, objectId.getValue());
         TypeDefinition typeDef = getTypeDefinition(repositoryId, so);
@@ -131,7 +135,11 @@ public class InMemoryVersioningServiceIm
 
         // To be able to provide all Atom links in the response we need
         // additional information:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         ObjectData od = PropertyCreationHelper.getObjectData(fStoreManager, so, null, user, false,
                 IncludeRelationships.NONE, null, false, false, extension);
@@ -140,7 +148,7 @@ public class InMemoryVersioningServiceIm
     }
 
     public List<ObjectData> getAllVersions(CallContext context, String repositoryId, String versionSeriesId,
-            String filter, Boolean includeAllowableActions, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            String filter, Boolean includeAllowableActions, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
 
@@ -157,7 +165,11 @@ public class InMemoryVersioningServiceIm
         }
 
         // provide information for Atom links for version series:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         return res;
     }
@@ -165,7 +177,7 @@ public class InMemoryVersioningServiceIm
     public ObjectData getObjectOfLatestVersion(CallContext context, String repositoryId, String versionSeriesId,
             Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension,
-            ObjectInfoHolder objectInfos) {
+            ObjectInfoHandler objectInfos) {
 
         StoredObject so = checkStandardParameters(repositoryId, versionSeriesId);
         ObjectData objData = null;
@@ -182,7 +194,11 @@ public class InMemoryVersioningServiceIm
             throw new RuntimeException("Object is not instance of a document (version series)");
 
         // provide information for Atom links for version series:
-        fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfos);
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
 
         return objData;
     }
@@ -209,7 +225,7 @@ public class InMemoryVersioningServiceIm
     }
 
     private ObjectData getObject(CallContext context, String repositoryId, String objectId, String filter,
-            Boolean includeAllowableActions, ExtensionsData extension, ObjectInfoHolder objectInfos) {
+            Boolean includeAllowableActions, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         return fObjectService.getObject(context, repositoryId, objectId, filter, includeAllowableActions,
                 IncludeRelationships.NONE, null, false, includeAllowableActions, extension, objectInfos);



Mime
View raw message