Author: fmui
Date: Sun Apr 25 16:27:30 2010
New Revision: 937818

URL: http://svn.apache.org/viewvc?rev=937818&view=rev
Log:
fixed service wrapper and file share repository

Modified:
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareService.java
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java?rev=937818&r1=937817&r2=937818&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
 Sun Apr 25 16:27:30 2010
@@ -52,9 +52,6 @@ import org.apache.commons.logging.LogFac
 
 /**
  * CMIS AtomPub servlet.
- * 
- * @author <a href="mailto:[email protected]";>Florian M&uuml;ller</a>
- * 
  */
 public class CmisAtomPubServlet extends HttpServlet {
 
@@ -69,79 +66,79 @@ public class CmisAtomPubServlet extends 
 
     private static final Log LOG = 
LogFactory.getLog(CmisAtomPubServlet.class.getName());
 
-    private Dispatcher fDispatcher;
-    private CallContextHandler fCallContextHandler;
+    private Dispatcher dispatcher;
+    private CallContextHandler callContextHandler;
 
     @Override
     public void init(ServletConfig config) throws ServletException {
         super.init(config);
 
         // initialize the call context handler
-        fCallContextHandler = null;
+        callContextHandler = null;
         String callContextHandlerClass = 
config.getInitParameter(PARAM_CALL_CONTEXT_HANDLER);
         if (callContextHandlerClass != null) {
             try {
-                fCallContextHandler = (CallContextHandler) 
Class.forName(callContextHandlerClass).newInstance();
+                callContextHandler = (CallContextHandler) 
Class.forName(callContextHandlerClass).newInstance();
             } catch (Exception e) {
                 throw new ServletException("Could not load call context 
handler: " + e, e);
             }
         }
 
         // initialize the dispatcher
-        fDispatcher = new Dispatcher();
+        dispatcher = new Dispatcher();
 
         try {
-            fDispatcher
+            dispatcher
                     .addResource(AtomPubUtils.RESOURCE_TYPES, METHOD_GET, 
RepositoryService.class, "getTypeChildren");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_TYPESDESC, 
METHOD_GET, RepositoryService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_TYPESDESC, 
METHOD_GET, RepositoryService.class,
                     "getTypeDescendants");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_TYPE, METHOD_GET, 
RepositoryService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_TYPE, METHOD_GET, 
RepositoryService.class,
                     "getTypeDefinition");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CHILDREN, 
METHOD_GET, NavigationService.class, "getChildren");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_DESCENDANTS, 
METHOD_GET, NavigationService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CHILDREN, METHOD_GET, 
NavigationService.class, "getChildren");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_DESCENDANTS, 
METHOD_GET, NavigationService.class,
                     "getDescendants");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_FOLDERTREE, 
METHOD_GET, NavigationService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_FOLDERTREE, 
METHOD_GET, NavigationService.class,
                     "getFolderTree");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_PARENTS, METHOD_GET, 
NavigationService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_PARENTS, METHOD_GET, 
NavigationService.class,
                     "getObjectParents");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CHECKEDOUT, 
METHOD_GET, NavigationService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CHECKEDOUT, 
METHOD_GET, NavigationService.class,
                     "getCheckedOutDocs");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_ENTRY, METHOD_GET, 
ObjectService.class, "getObject");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_OBJECTBYID, 
METHOD_GET, ObjectService.class, "getObject");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_OBJECTBYPATH, 
METHOD_GET, ObjectService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_ENTRY, METHOD_GET, 
ObjectService.class, "getObject");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_OBJECTBYID, 
METHOD_GET, ObjectService.class, "getObject");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_OBJECTBYPATH, 
METHOD_GET, ObjectService.class,
                     "getObjectByPath");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_ALLOWABLEACIONS, 
METHOD_GET, ObjectService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_ALLOWABLEACIONS, 
METHOD_GET, ObjectService.class,
                     "getAllowableActions");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CONTENT, METHOD_GET, 
ObjectService.class, "getContentStream");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CONTENT, METHOD_PUT, 
ObjectService.class, "setContentStream");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CONTENT, 
METHOD_DELETE, ObjectService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CONTENT, METHOD_GET, 
ObjectService.class, "getContentStream");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CONTENT, METHOD_PUT, 
ObjectService.class, "setContentStream");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CONTENT, 
METHOD_DELETE, ObjectService.class,
                     "deleteContentStream");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CHILDREN, 
METHOD_POST, ObjectService.class, "create");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_RELATIONSHIPS, 
METHOD_POST, ObjectService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CHILDREN, 
METHOD_POST, ObjectService.class, "create");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_RELATIONSHIPS, 
METHOD_POST, ObjectService.class,
                     "createRelationship");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_ENTRY, METHOD_PUT, 
ObjectService.class, "updateProperties");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_ENTRY, 
METHOD_DELETE, ObjectService.class, "deleteObject");
-            fDispatcher
+            dispatcher.addResource(AtomPubUtils.RESOURCE_ENTRY, METHOD_PUT, 
ObjectService.class, "updateProperties");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_ENTRY, METHOD_DELETE, 
ObjectService.class, "deleteObject");
+            dispatcher
                     .addResource(AtomPubUtils.RESOURCE_DESCENDANTS, 
METHOD_DELETE, ObjectService.class, "deleteTree");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CHECKEDOUT, 
METHOD_POST, VersioningService.class, "checkOut");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_VERSIONS, 
METHOD_GET, VersioningService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CHECKEDOUT, 
METHOD_POST, VersioningService.class, "checkOut");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_VERSIONS, METHOD_GET, 
VersioningService.class,
                     "getAllVersions");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_VERSIONS, 
METHOD_DELETE, VersioningService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_VERSIONS, 
METHOD_DELETE, VersioningService.class,
                     "deleteAllVersions");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_QUERY, METHOD_GET, 
DiscoveryService.class, "query");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_QUERY, METHOD_POST, 
DiscoveryService.class, "query");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_CHANGES, METHOD_GET, 
DiscoveryService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_QUERY, METHOD_GET, 
DiscoveryService.class, "query");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_QUERY, METHOD_POST, 
DiscoveryService.class, "query");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_CHANGES, METHOD_GET, 
DiscoveryService.class,
                     "getContentChanges");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_RELATIONSHIPS, 
METHOD_GET, RelationshipService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_RELATIONSHIPS, 
METHOD_GET, RelationshipService.class,
                     "getObjectRelationships");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_UNFILED, 
METHOD_POST, MultiFilingService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_UNFILED, METHOD_POST, 
MultiFilingService.class,
                     "removeObjectFromFolder");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_ACL, METHOD_GET, 
AclService.class, "getAcl");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_ACL, METHOD_PUT, 
AclService.class, "applyAcl");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_POLICIES, 
METHOD_GET, PolicyService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_ACL, METHOD_GET, 
AclService.class, "getAcl");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_ACL, METHOD_PUT, 
AclService.class, "applyAcl");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_POLICIES, METHOD_GET, 
PolicyService.class,
                     "getAppliedPolicies");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_POLICIES, 
METHOD_POST, PolicyService.class, "applyPolicy");
-            fDispatcher.addResource(AtomPubUtils.RESOURCE_POLICIES, 
METHOD_DELETE, PolicyService.class, "removePolicy");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_POLICIES, 
METHOD_POST, PolicyService.class, "applyPolicy");
+            dispatcher.addResource(AtomPubUtils.RESOURCE_POLICIES, 
METHOD_DELETE, PolicyService.class, "removePolicy");
         } catch (NoSuchMethodException e) {
             LOG.error("Cannot initialize dispatcher!", e);
         }
@@ -208,7 +205,7 @@ public class CmisAtomPubServlet extends 
             String resource = pathFragments[1];
 
             // dispatch
-            boolean methodFound = fDispatcher.dispatch(resource, method, 
context, service, repositoryId, request,
+            boolean methodFound = dispatcher.dispatch(resource, method, 
context, service, repositoryId, request,
                     response);
 
             // if the dispatcher couldn't find a matching method, return an
@@ -237,8 +234,8 @@ public class CmisAtomPubServlet extends 
         CallContextImpl context = new 
CallContextImpl(CallContext.BINDING_ATOMPUB, repositoryId, true);
 
         // call call context handler
-        if (fCallContextHandler != null) {
-            Map<String, String> callContextMap = 
fCallContextHandler.getCallContextMap(request);
+        if (callContextHandler != null) {
+            Map<String, String> callContextMap = 
callContextHandler.getCallContextMap(request);
             if (callContextMap != null) {
                 for (Map.Entry<String, String> e : callContextMap.entrySet()) {
                     context.put(e.getKey(), e.getValue());

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java?rev=937818&r1=937817&r2=937818&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
 Sun Apr 25 16:27:30 2010
@@ -59,6 +59,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.CapabilityQuery;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
 import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
+import org.apache.chemistry.opencmis.server.impl.CallContextImpl;
 
 /**
  * Repository Service operations.
@@ -86,6 +87,9 @@ public final class RepositoryService {
             infoDataList = service.getRepositoryInfos(null);
         } else {
             infoDataList = 
Collections.singletonList(service.getRepositoryInfo(repositoryId, null));
+            if (context instanceof CallContextImpl) {
+                ((CallContextImpl) context).put(CallContext.REPOSITORY_ID, 
repositoryId);
+            }
         }
 
         // set headers

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java?rev=937818&r1=937817&r2=937818&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java
 Sun Apr 25 16:27:30 2010
@@ -852,16 +852,22 @@ public class FileShareRepository {
     /**
      * CMIS getObject.
      */
-    public ObjectData getObject(CallContext context, String objectId, String 
filter, Boolean includeAllowableActions,
-            Boolean includeAcl, ObjectInfoHandler objectInfos) {
+    public ObjectData getObject(CallContext context, String objectId, String 
versionServicesId, String filter,
+            Boolean includeAllowableActions, Boolean includeAcl, 
ObjectInfoHandler objectInfos) {
         debug("getObject");
         boolean userReadOnly = checkUser(context, false);
 
         // check id
-        if (objectId == null) {
+        if ((objectId == null) && (versionServicesId == null)) {
             throw new CmisInvalidArgumentException("Object Id must be set.");
         }
 
+        if (objectId == null) {
+            // this works only because there are no versions in a file system
+            // and the object id and version series id are the same
+            objectId = versionServicesId;
+        }
+
         // get the file or folder
         File file = getFile(objectId);
 

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareService.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareService.java?rev=937818&r1=937817&r2=937818&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareService.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareService.java
 Sun Apr 25 16:27:30 2010
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
 import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+import 
org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectListImpl;
 import org.apache.chemistry.opencmis.commons.impl.server.AbstractCmisService;
 
@@ -62,7 +63,13 @@ public class FileShareService extends Ab
 
     @Override
     public RepositoryInfo getRepositoryInfo(String repositoryId, 
ExtensionsData extension) {
-        return getRepository().getRepositoryInfo(getCallContext());
+        for (FileShareRepository fsr : repositoryMap.getRepositories()) {
+            if (fsr.getRepositoryId().equals(repositoryId)) {
+                return fsr.getRepositoryInfo(getCallContext());
+            }
+        }
+
+        throw new CmisObjectNotFoundException("Unknown repository '" + 
repositoryId + "'!");
     }
 
     @Override
@@ -101,7 +108,7 @@ public class FileShareService extends Ab
             Boolean includeAllowableActions, IncludeRelationships 
includeRelationships, String renditionFilter,
             Boolean includePathSegment, BigInteger maxItems, BigInteger 
skipCount, ExtensionsData extension) {
         return getRepository().getChildren(getCallContext(), folderId, filter, 
includeAllowableActions,
-                includePathSegment, maxItems, skipCount, null);
+                includePathSegment, maxItems, skipCount, this);
     }
 
     @Override
@@ -109,12 +116,12 @@ public class FileShareService extends Ab
             String filter, Boolean includeAllowableActions, 
IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePathSegment, ExtensionsData 
extension) {
         return getRepository().getDescendants(getCallContext(), folderId, 
depth, filter, includeAllowableActions,
-                includePathSegment, null, false);
+                includePathSegment, this, false);
     }
 
     @Override
     public ObjectData getFolderParent(String repositoryId, String folderId, 
String filter, ExtensionsData extension) {
-        return getRepository().getFolderParent(getCallContext(), folderId, 
filter, null);
+        return getRepository().getFolderParent(getCallContext(), folderId, 
filter, this);
     }
 
     @Override
@@ -122,7 +129,7 @@ public class FileShareService extends Ab
             String filter, Boolean includeAllowableActions, 
IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePathSegment, ExtensionsData 
extension) {
         return getRepository().getDescendants(getCallContext(), folderId, 
depth, filter, includeAllowableActions,
-                includePathSegment, null, true);
+                includePathSegment, this, true);
     }
 
     @Override
@@ -130,7 +137,7 @@ public class FileShareService extends Ab
             Boolean includeAllowableActions, IncludeRelationships 
includeRelationships, String renditionFilter,
             Boolean includeRelativePathSegment, ExtensionsData extension) {
         return getRepository().getObjectParents(getCallContext(), objectId, 
filter, includeAllowableActions,
-                includeRelativePathSegment, null);
+                includeRelativePathSegment, this);
     }
 
     @Override
@@ -152,7 +159,7 @@ public class FileShareService extends Ab
     public String create(String repositoryId, Properties properties, String 
folderId, ContentStream contentStream,
             VersioningState versioningState, List<String> policies, 
ExtensionsData extension) {
         ObjectData object = getRepository().create(getCallContext(), 
properties, folderId, contentStream,
-                versioningState, null);
+                versioningState, this);
 
         return object.getId();
     }
@@ -211,7 +218,8 @@ public class FileShareService extends Ab
     public ObjectData getObject(String repositoryId, String objectId, String 
filter, Boolean includeAllowableActions,
             IncludeRelationships includeRelationships, String renditionFilter, 
Boolean includePolicyIds,
             Boolean includeAcl, ExtensionsData extension) {
-        return getRepository().getObject(getCallContext(), objectId, filter, 
includeAllowableActions, includeAcl, null);
+        return getRepository().getObject(getCallContext(), objectId, null, 
filter, includeAllowableActions, includeAcl,
+                this);
     }
 
     @Override
@@ -219,12 +227,12 @@ public class FileShareService extends Ab
             IncludeRelationships includeRelationships, String renditionFilter, 
Boolean includePolicyIds,
             Boolean includeAcl, ExtensionsData extension) {
         return getRepository().getObjectByPath(getCallContext(), path, filter, 
includeAllowableActions, includeAcl,
-                null);
+                this);
     }
 
     @Override
     public Properties getProperties(String repositoryId, String objectId, 
String filter, ExtensionsData extension) {
-        ObjectData object = getRepository().getObject(getCallContext(), 
objectId, filter, false, false, null);
+        ObjectData object = getRepository().getObject(getCallContext(), 
objectId, null, filter, false, false, this);
         return object.getProperties();
     }
 
@@ -237,7 +245,7 @@ public class FileShareService extends Ab
     @Override
     public void moveObject(String repositoryId, Holder<String> objectId, 
String targetFolderId, String sourceFolderId,
             ExtensionsData extension) {
-        getRepository().moveObject(getCallContext(), objectId, targetFolderId, 
null);
+        getRepository().moveObject(getCallContext(), objectId, targetFolderId, 
this);
     }
 
     @Override
@@ -249,7 +257,7 @@ public class FileShareService extends Ab
     @Override
     public void updateProperties(String repositoryId, Holder<String> objectId, 
Holder<String> changeToken,
             Properties properties, ExtensionsData extension) {
-        getRepository().updateProperties(getCallContext(), objectId, 
properties, null);
+        getRepository().updateProperties(getCallContext(), objectId, 
properties, this);
     }
 
     // --- versioning service ---
@@ -257,8 +265,8 @@ public class FileShareService extends Ab
     @Override
     public List<ObjectData> getAllVersions(String repositoryId, String 
objectId, String versionSeriesId, String filter,
             Boolean includeAllowableActions, ExtensionsData extension) {
-        ObjectData theVersion = getRepository().getObject(getCallContext(), 
versionSeriesId, filter,
-                includeAllowableActions, false, null);
+        ObjectData theVersion = getRepository().getObject(getCallContext(), 
objectId, versionSeriesId, filter,
+                includeAllowableActions, false, this);
 
         return Collections.singletonList(theVersion);
     }
@@ -267,14 +275,15 @@ public class FileShareService extends Ab
     public ObjectData getObjectOfLatestVersion(String repositoryId, String 
objectId, String versionSeriesId,
             Boolean major, String filter, Boolean includeAllowableActions, 
IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePolicyIds, Boolean 
includeAcl, ExtensionsData extension) {
-        return getRepository().getObject(getCallContext(), versionSeriesId, 
filter, includeAllowableActions,
-                includeAcl, null);
+        return getRepository().getObject(getCallContext(), objectId, 
versionSeriesId, filter, includeAllowableActions,
+                includeAcl, this);
     }
 
     @Override
     public Properties getPropertiesOfLatestVersion(String repositoryId, String 
objectId, String versionSeriesId,
             Boolean major, String filter, ExtensionsData extension) {
-        ObjectData object = getRepository().getObject(getCallContext(), 
versionSeriesId, filter, false, false, null);
+        ObjectData object = getRepository().getObject(getCallContext(), 
objectId, versionSeriesId, filter, false,
+                false, null);
 
         return object.getProperties();
     }

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java?rev=937818&r1=937817&r2=937818&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java
 Sun Apr 25 16:27:30 2010
@@ -131,6 +131,19 @@ public class CmisServiceWrapper<T extend
     }
 
     /**
+     * Throws an exception if the given ids are all <code>null</code> or empty.
+     */
+    protected void checkIds(String name, String... ids) {
+        for (String id : ids) {
+            if (id != null && id.length() > 0) {
+                return;
+            }
+        }
+
+        throw new CmisInvalidArgumentException(name + " must be set!");
+    }
+
+    /**
      * Throws an exception if the given holder or id is <code>null</code> or
      * empty.
      */
@@ -886,7 +899,7 @@ public class CmisServiceWrapper<T extend
             Boolean major, String filter, Boolean includeAllowableActions, 
IncludeRelationships includeRelationships,
             String renditionFilter, Boolean includePolicyIds, Boolean 
includeAcl, ExtensionsData extension) {
         checkRepositoryId(repositoryId);
-        checkId("Object Id", versionSeriesId);
+        checkIds("Version Series Id", objectId, versionSeriesId);
         major = getDefaultFalse(major);
         includeAllowableActions = getDefaultFalse(includeAllowableActions);
         includeRelationships = getDefault(includeRelationships);
@@ -906,7 +919,7 @@ public class CmisServiceWrapper<T extend
     public Properties getPropertiesOfLatestVersion(String repositoryId, String 
objectId, String versionSeriesId,
             Boolean major, String filter, ExtensionsData extension) {
         checkRepositoryId(repositoryId);
-        checkId("Object Id", versionSeriesId);
+        checkIds("Version Series Id", objectId, versionSeriesId);
         major = getDefaultFalse(major);
 
         try {
@@ -920,7 +933,7 @@ public class CmisServiceWrapper<T extend
     public List<ObjectData> getAllVersions(String repositoryId, String 
objectId, String versionSeriesId, String filter,
             Boolean includeAllowableActions, ExtensionsData extension) {
         checkRepositoryId(repositoryId);
-        checkId("Version Series Id", versionSeriesId);
+        checkIds("Version Series Id", objectId, versionSeriesId);
         includeAllowableActions = getDefaultFalse(includeAllowableActions);
 
         try {


Reply via email to