You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2010/04/18 22:15:17 UTC
svn commit: r935399 - in /incubator/chemistry/opencmis/trunk:
chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/api/server/
chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/...
Author: fmui
Date: Sun Apr 18 20:15:17 2010
New Revision: 935399
URL: http://svn.apache.org/viewvc?rev=935399&view=rev
Log:
FileShare repository: initial implementation of the new server interface
Added:
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractServiceFactory.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-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareServiceFactory.java
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java
Removed:
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractServicesFactory.java
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/refactor/
Modified:
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/api/server/CmisService.java
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.java
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareRepository.java
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/api/server/CmisService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/api/server/CmisService.java?rev=935399&r1=935398&r2=935399&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/api/server/CmisService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/api/server/CmisService.java Sun Apr 18 20:15:17 2010
@@ -9,7 +9,6 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.api.ExtensionsData;
import org.apache.chemistry.opencmis.commons.api.MultiFilingService;
import org.apache.chemistry.opencmis.commons.api.NavigationService;
-import org.apache.chemistry.opencmis.commons.api.ObjectData;
import org.apache.chemistry.opencmis.commons.api.ObjectService;
import org.apache.chemistry.opencmis.commons.api.PolicyService;
import org.apache.chemistry.opencmis.commons.api.Properties;
@@ -31,7 +30,7 @@ public interface CmisService extends Rep
* The property "cmis:objectTypeId" defines the type and implicitly the base
* type.
*/
- ObjectData create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
+ String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
VersioningState versioningState, List<String> policies, ExtensionsData extension);
/**
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java?rev=935399&r1=935398&r2=935399&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java Sun Apr 18 20:15:17 2010
@@ -235,7 +235,7 @@ public abstract class AbstractCmisServic
* <li>Object infos should contain the newly created object.</li>
* </ul>
*/
- public ObjectData create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
+ public String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
VersioningState versioningState, List<String> policies, ExtensionsData extension) {
// check properties
if (properties == null || properties.getProperties() == null) {
@@ -262,9 +262,6 @@ public abstract class AbstractCmisServic
case CMIS_FOLDER:
newId = createFolder(repositoryId, properties, folderId, policies, null, null, extension);
break;
- case CMIS_RELATIONSHIP:
- newId = createRelationship(repositoryId, properties, policies, null, null, extension);
- break;
case CMIS_POLICY:
newId = createPolicy(repositoryId, properties, folderId, policies, null, null, extension);
break;
@@ -275,9 +272,8 @@ public abstract class AbstractCmisServic
throw new CmisRuntimeException("Creation failed!");
}
- // return the new object
- return getObject(repositoryId, newId, null, Boolean.TRUE, IncludeRelationships.BOTH, null, Boolean.TRUE,
- Boolean.TRUE, null);
+ // return the new object id
+ return newId;
}
/**
@@ -614,8 +610,8 @@ public abstract class AbstractCmisServic
* <li>Object infos should contain the returned object.</li>
* </ul>
*/
- public ObjectData getObjectOfLatestVersion(String repositoryId, String versionSeriesId, Boolean major,
- String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+ 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) {
throw new CmisNotSupportedException("Not supported!");
}
@@ -630,8 +626,8 @@ public abstract class AbstractCmisServic
* <li>Implementation is optional.</li>
* </ul>
*/
- public Properties getPropertiesOfLatestVersion(String repositoryId, String versionSeriesId, Boolean major,
- String filter, ExtensionsData extension) {
+ public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+ Boolean major, String filter, ExtensionsData extension) {
throw new CmisNotSupportedException("Not supported!");
}
Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractServiceFactory.java?rev=935399&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractServiceFactory.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractServiceFactory.java Sun Apr 18 20:15:17 2010
@@ -0,0 +1,18 @@
+package org.apache.chemistry.opencmis.commons.impl.server;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.CmisServiceFactory;
+
+public abstract class AbstractServiceFactory implements CmisServiceFactory {
+
+ public void init(Map<String, String> parameters) {
+ }
+
+ public void destroy() {
+ }
+
+ public abstract CmisService getService(CallContext context);
+}
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.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/AclService.java?rev=935399&r1=935398&r2=935399&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.java Sun Apr 18 20:15:17 2010
@@ -84,6 +84,6 @@ public class AclService implements CmisA
*/
public Acl getAcl(CallContext context, String repositoryId, String objectId, Boolean onlyBasicPermissions,
ExtensionsData extension) {
- return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getAcl(context, objectId, objectId);
+ return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getAcl(context, objectId);
}
}
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=935399&r1=935398&r2=935399&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 18 20:15:17 2010
@@ -897,7 +897,7 @@ public class FileShareRepository {
/**
* CMIS getACL.
*/
- public Acl getAcl(CallContext context, String repositoryId, String objectId) {
+ public Acl getAcl(CallContext context, String objectId) {
debug("getAcl");
checkUser(context, false);
Added: 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=935399&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareService.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareService.java Sun Apr 18 20:15:17 2010
@@ -0,0 +1,302 @@
+package org.apache.chemistry.opencmis.fileshare;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.commons.api.Acl;
+import org.apache.chemistry.opencmis.commons.api.AllowableActions;
+import org.apache.chemistry.opencmis.commons.api.ContentStream;
+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.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.Properties;
+import org.apache.chemistry.opencmis.commons.api.RenditionData;
+import org.apache.chemistry.opencmis.commons.api.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinitionContainer;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinitionList;
+import org.apache.chemistry.opencmis.commons.api.server.CallContext;
+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.impl.dataobjects.ObjectListImpl;
+import org.apache.chemistry.opencmis.commons.impl.server.AbstractCmisService;
+
+/**
+ * FileShare service implementation.
+ */
+public class FileShareService extends AbstractCmisService {
+
+ private ThreadLocal<CallContext> threadLocalCallContext = new ThreadLocal<CallContext>();
+ private RepositoryMap repositoryMap;
+
+ /**
+ * Constructor.
+ */
+ public FileShareService(RepositoryMap repositoryMap) {
+ this.repositoryMap = repositoryMap;
+ }
+
+ // --- thread locals ---
+
+ public void setThreadCallContext(CallContext context) {
+ threadLocalCallContext.set(context);
+ }
+
+ public CallContext getThreadCallContext() {
+ return threadLocalCallContext.get();
+ }
+
+ public void removeThreadCallContext() {
+ threadLocalCallContext.remove();
+ }
+
+ public FileShareRepository getRepository() {
+ return repositoryMap.getRepository(getThreadCallContext().getRepositoryId());
+ }
+
+ // --- life cycle ---
+
+ @Override
+ public void close() {
+ removeThreadCallContext();
+ }
+
+ // --- repository service ---
+
+ @Override
+ public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
+ return getRepository().getRepositoryInfo(getThreadCallContext());
+ }
+
+ @Override
+ public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
+ List<RepositoryInfo> result = new ArrayList<RepositoryInfo>();
+
+ for (FileShareRepository fsr : repositoryMap.getRepositories()) {
+ result.add(fsr.getRepositoryInfo(getThreadCallContext()));
+ }
+
+ return result;
+ }
+
+ @Override
+ public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ return getRepository().getTypesChildren(getThreadCallContext(), typeId, includePropertyDefinitions, maxItems,
+ skipCount);
+ }
+
+ @Override
+ public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) {
+ return getRepository().getTypeDefinition(getThreadCallContext(), typeId);
+ }
+
+ @Override
+ public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
+ Boolean includePropertyDefinitions, ExtensionsData extension) {
+ return getRepository().getTypesDescendants(getThreadCallContext(), typeId, depth, includePropertyDefinitions);
+ }
+
+ // --- navigation service ---
+
+ @Override
+ 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 getRepository().getChildren(getThreadCallContext(), folderId, filter, includeAllowableActions,
+ includePathSegment, maxItems, skipCount, null);
+ }
+
+ @Override
+ public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
+ String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+ String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+ return getRepository().getDescendants(getThreadCallContext(), folderId, depth, filter, includeAllowableActions,
+ includePathSegment, null, false);
+ }
+
+ @Override
+ public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
+ return getRepository().getFolderParent(getThreadCallContext(), folderId, filter, null);
+ }
+
+ @Override
+ public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
+ String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+ String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+ return getRepository().getDescendants(getThreadCallContext(), folderId, depth, filter, includeAllowableActions,
+ includePathSegment, null, true);
+ }
+
+ @Override
+ public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
+ Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+ Boolean includeRelativePathSegment, ExtensionsData extension) {
+ return getRepository().getObjectParents(getThreadCallContext(), objectId, filter, includeAllowableActions,
+ includeRelativePathSegment, null);
+ }
+
+ @Override
+ public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
+ Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ ObjectListImpl result = new ObjectListImpl();
+ result.setHasMoreItems(false);
+ result.setNumItems(BigInteger.ZERO);
+ List<ObjectData> emptyList = Collections.emptyList();
+ result.setObjects(emptyList);
+
+ return result;
+ }
+
+ // --- object service ---
+
+ @Override
+ public String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
+ VersioningState versioningState, List<String> policies, ExtensionsData extension) {
+ ObjectData object = getRepository().create(getThreadCallContext(), properties, folderId, contentStream,
+ versioningState, null);
+
+ return object.getId();
+ }
+
+ @Override
+ public String createDocument(String repositoryId, Properties properties, String folderId,
+ ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
+ Acl removeAces, ExtensionsData extension) {
+ return getRepository().createDocument(getThreadCallContext(), properties, folderId, contentStream,
+ versioningState);
+ }
+
+ @Override
+ public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties,
+ String folderId, VersioningState versioningState, List<String> policies, Acl addAces, Acl removeAces,
+ ExtensionsData extension) {
+ return getRepository().createDocumentFromSource(getThreadCallContext(), sourceId, properties, folderId,
+ versioningState);
+ }
+
+ @Override
+ public String createFolder(String repositoryId, Properties properties, String folderId, List<String> policies,
+ Acl addAces, Acl removeAces, ExtensionsData extension) {
+ return getRepository().createFolder(getThreadCallContext(), properties, folderId);
+ }
+
+ @Override
+ public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+ ExtensionsData extension) {
+ getRepository().setContentStream(getThreadCallContext(), objectId, true, null);
+ }
+
+ @Override
+ public void deleteObjectOrCancelCheckOut(String repositoryId, String objectId, Boolean allVersions,
+ ExtensionsData extension) {
+ getRepository().deleteObject(getThreadCallContext(), objectId);
+ }
+
+ @Override
+ public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
+ UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+ return getRepository().deleteTree(getThreadCallContext(), folderId, continueOnFailure);
+ }
+
+ @Override
+ public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
+ return getRepository().getAllowableActions(getThreadCallContext(), objectId);
+ }
+
+ @Override
+ public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
+ BigInteger length, ExtensionsData extension) {
+ return getRepository().getContentStream(getThreadCallContext(), objectId, offset, length);
+ }
+
+ @Override
+ public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
+ IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+ Boolean includeAcl, ExtensionsData extension) {
+ return getRepository().getObject(getThreadCallContext(), objectId, filter, includeAllowableActions, includeAcl,
+ null);
+ }
+
+ @Override
+ public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
+ IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+ Boolean includeAcl, ExtensionsData extension) {
+ return getRepository().getObjectByPath(getThreadCallContext(), path, filter, includeAllowableActions,
+ includeAcl, null);
+ }
+
+ @Override
+ public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
+ ObjectData object = getRepository().getObject(getThreadCallContext(), objectId, filter, false, false, null);
+ return object.getProperties();
+ }
+
+ @Override
+ public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
+ ExtensionsData extension) {
+ getRepository().moveObject(getThreadCallContext(), objectId, targetFolderId, null);
+ }
+
+ @Override
+ public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+ Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
+ getRepository().setContentStream(getThreadCallContext(), objectId, overwriteFlag, contentStream);
+ }
+
+ @Override
+ public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+ Properties properties, ExtensionsData extension) {
+ getRepository().updateProperties(getThreadCallContext(), objectId, properties, null);
+ }
+
+ // --- versioning service ---
+
+ @Override
+ public List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,
+ Boolean includeAllowableActions, ExtensionsData extension) {
+ ObjectData theVersion = getRepository().getObject(getThreadCallContext(), versionSeriesId, filter,
+ includeAllowableActions, false, null);
+
+ return Collections.singletonList(theVersion);
+ }
+
+ @Override
+ 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(getThreadCallContext(), versionSeriesId, filter, includeAllowableActions,
+ includeAcl, null);
+ }
+
+ @Override
+ public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+ Boolean major, String filter, ExtensionsData extension) {
+ ObjectData object = getRepository().getObject(getThreadCallContext(), versionSeriesId, filter, false, false,
+ null);
+
+ return object.getProperties();
+ }
+
+ // --- ACL service ---
+
+ @Override
+ public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
+ return getRepository().getAcl(getThreadCallContext(), objectId);
+ }
+}
Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareServiceFactory.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/FileShareServiceFactory.java?rev=935399&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareServiceFactory.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareServiceFactory.java Sun Apr 18 20:15:17 2010
@@ -0,0 +1,202 @@
+package org.apache.chemistry.opencmis.fileshare;
+
+import java.io.File;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+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.CmisService;
+import org.apache.chemistry.opencmis.commons.impl.Converter;
+import org.apache.chemistry.opencmis.commons.impl.JaxBHelper;
+import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisTypeDefinitionType;
+import org.apache.chemistry.opencmis.commons.impl.server.AbstractServiceFactory;
+import org.apache.chemistry.opencmis.server.spi.AbstractServicesFactory;
+import org.apache.chemistry.opencmis.server.support.CmisServiceWrapper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class FileShareServiceFactory extends AbstractServiceFactory {
+
+ private static final String PREFIX_LOGIN = "login.";
+ private static final String PREFIX_REPOSITORY = "repository.";
+ private static final String PREFIX_TYPE = "type.";
+ private static final String SUFFIX_READWRITE = ".readwrite";
+ private static final String SUFFIX_READONLY = ".readonly";
+
+ private static final BigInteger DEFAULT_MAX_ITEMS_TYPES = BigInteger.valueOf(50);
+ private static final BigInteger DEFAULT_DEPTH_TYPES = BigInteger.valueOf(-1);
+ private static final BigInteger DEFAULT_MAX_ITEMS_OBJECTS = BigInteger.valueOf(200);
+ private static final BigInteger DEFAULT_DEPTH_OBJECTS = BigInteger.valueOf(10);
+
+ private static final Log log = LogFactory.getLog(AbstractServicesFactory.class);
+
+ private RepositoryMap repositoryMap;
+ private TypeManager typeManager;
+
+ private FileShareService fileShareService;
+ private CmisService wrapperService;
+
+ public FileShareServiceFactory() {
+ }
+
+ @Override
+ public void init(Map<String, String> parameters) {
+ repositoryMap = new RepositoryMap();
+ typeManager = new TypeManager();
+
+ readConfiguration(parameters);
+
+ // create service object and wrapper
+ fileShareService = new FileShareService(repositoryMap);
+ wrapperService = new CmisServiceWrapper(fileShareService, DEFAULT_MAX_ITEMS_TYPES, DEFAULT_DEPTH_TYPES,
+ DEFAULT_MAX_ITEMS_OBJECTS, DEFAULT_DEPTH_OBJECTS);
+ }
+
+ @Override
+ public CmisService getService(CallContext context) {
+ repositoryMap.getAuthenticatedRepository(context, context.getRepositoryId());
+ fileShareService.setThreadCallContext(context);
+
+ return wrapperService;
+ }
+
+ // ---- helpers ----
+
+ private void readConfiguration(Map<String, String> parameters) {
+ List<String> keys = new ArrayList<String>(parameters.keySet());
+ Collections.sort(keys);
+
+ for (String key : keys) {
+ if (key.startsWith(PREFIX_LOGIN)) {
+ // get logins
+ String usernameAndPassword = replaceSystemProperties(parameters.get(key));
+ if (usernameAndPassword == null) {
+ continue;
+ }
+
+ String username = usernameAndPassword;
+ String password = "";
+
+ int x = usernameAndPassword.indexOf(':');
+ if (x > -1) {
+ username = usernameAndPassword.substring(0, x);
+ password = usernameAndPassword.substring(x + 1);
+ }
+
+ repositoryMap.addLogin(username, password);
+
+ log.info("Added login '" + username + "'.");
+ } else if (key.startsWith(PREFIX_TYPE)) {
+ // load type definition
+ TypeDefinition type = loadType(replaceSystemProperties(parameters.get(key)));
+ if (type != null) {
+ typeManager.addType(type);
+ }
+ } else if (key.startsWith(PREFIX_REPOSITORY)) {
+ // configure repositories
+ String repositoryId = key.substring(PREFIX_REPOSITORY.length()).trim();
+ int x = repositoryId.lastIndexOf('.');
+ if (x > 0) {
+ repositoryId = repositoryId.substring(0, x);
+ }
+
+ if (repositoryId.length() == 0) {
+ throw new IllegalArgumentException("No repository id!");
+ }
+
+ if (key.endsWith(SUFFIX_READWRITE)) {
+ // read-write users
+ FileShareRepository fsr = repositoryMap.getRepository(repositoryId);
+ for (String user : split(parameters.get(key))) {
+ fsr.addUser(replaceSystemProperties(user), false);
+ }
+ } else if (key.endsWith(SUFFIX_READONLY)) {
+ // read-only users
+ FileShareRepository fsr = repositoryMap.getRepository(repositoryId);
+ for (String user : split(parameters.get(key))) {
+ fsr.addUser(replaceSystemProperties(user), true);
+ }
+ } else {
+ // new repository
+ String root = replaceSystemProperties(parameters.get(key));
+ FileShareRepository fsr = new FileShareRepository(repositoryId, root, typeManager);
+
+ repositoryMap.addRepository(fsr);
+
+ log.info("Added repository '" + fsr.getRepositoryId() + "': " + root);
+ }
+ }
+ }
+ }
+
+ private List<String> split(String csl) {
+ if (csl == null) {
+ return Collections.emptyList();
+ }
+
+ List<String> result = new ArrayList<String>();
+ for (String s : csl.split(",")) {
+ result.add(s.trim());
+ }
+
+ return result;
+ }
+
+ private String replaceSystemProperties(String s) {
+ if (s == null) {
+ return null;
+ }
+
+ StringBuilder result = new StringBuilder();
+ StringBuilder property = null;
+ boolean inProperty = false;
+
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+
+ if (inProperty) {
+ if (c == '}') {
+ String value = System.getProperty(property.toString());
+ if (value != null) {
+ result.append(value);
+ }
+ inProperty = false;
+ } else {
+ property.append(c);
+ }
+ } else {
+ if (c == '{') {
+ property = new StringBuilder();
+ inProperty = true;
+ } else {
+ result.append(c);
+ }
+ }
+ }
+
+ return result.toString();
+ }
+
+ @SuppressWarnings("unchecked")
+ private TypeDefinition loadType(String filename) {
+ TypeDefinition result = null;
+
+ try {
+ Unmarshaller u = JaxBHelper.createUnmarshaller();
+ JAXBElement<CmisTypeDefinitionType> type = (JAXBElement<CmisTypeDefinitionType>) u.unmarshal(new File(
+ filename));
+ result = Converter.convert(type.getValue());
+ } catch (Exception e) {
+ log.info("Could not load type: '" + filename + "'", e);
+ }
+
+ return result;
+ }
+}
Added: 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=935399&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/CmisServiceWrapper.java Sun Apr 18 20:15:17 2010
@@ -0,0 +1,1092 @@
+package org.apache.chemistry.opencmis.server.support;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.commons.api.Acl;
+import org.apache.chemistry.opencmis.commons.api.AllowableActions;
+import org.apache.chemistry.opencmis.commons.api.ContentStream;
+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.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.Properties;
+import org.apache.chemistry.opencmis.commons.api.RenditionData;
+import org.apache.chemistry.opencmis.commons.api.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinitionContainer;
+import org.apache.chemistry.opencmis.commons.api.TypeDefinitionList;
+import org.apache.chemistry.opencmis.commons.api.server.CmisService;
+import org.apache.chemistry.opencmis.commons.api.server.ObjectInfo;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
+import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Service wrapper.
+ */
+public class CmisServiceWrapper implements CmisService {
+
+ public static final BigInteger MINUS_ONE = BigInteger.valueOf(-1);
+
+ private static final Log log = LogFactory.getLog(CmisServiceWrapper.class);
+
+ private BigInteger defaultTypesMaxItems = null;
+ private BigInteger defaultTypesDepth = MINUS_ONE;
+
+ private BigInteger defaultMaxItems = null;
+ private BigInteger defaultDepth = MINUS_ONE;
+
+ private CmisService service;
+
+ /**
+ * Constructor.
+ */
+ public CmisServiceWrapper(CmisService service, BigInteger defaultTypesMaxItems, BigInteger defaultTypesDepth,
+ BigInteger defaultMaxItems, BigInteger defaultDepth) {
+ if (service == null) {
+ throw new IllegalArgumentException("Service must be set!");
+ }
+
+ this.service = service;
+
+ setDefaultTypesMaxItems(defaultTypesMaxItems);
+ setDefaultTypesDepth(defaultTypesDepth);
+ setDefaultMaxItems(defaultMaxItems);
+ setDefaultDepth(defaultDepth);
+ }
+
+ // --- wrapper operations ---
+
+ /**
+ * Set the default maxItems.
+ */
+ protected void setDefaultTypesMaxItems(BigInteger defaultTypesMaxItems) {
+ this.defaultTypesMaxItems = defaultTypesMaxItems;
+ }
+
+ /**
+ * Set the default depth.
+ */
+ protected void setDefaultTypesDepth(BigInteger defaultTypesDepth) {
+ this.defaultTypesDepth = defaultTypesDepth;
+ }
+
+ /**
+ * Set the default maxItems.
+ */
+ protected void setDefaultMaxItems(BigInteger defaultMaxItems) {
+ this.defaultMaxItems = defaultMaxItems;
+ }
+
+ /**
+ * Set the default depth.
+ */
+ protected void setDefaultDepth(BigInteger defaultDepth) {
+ this.defaultDepth = defaultDepth;
+ }
+
+ /**
+ * Converts the given exception into a CMIS exception.
+ */
+ protected CmisBaseException createCmisException(Exception e) {
+ if (e == null) {
+ // should never happen
+ // if it happens its the fault of the framework...
+
+ return new CmisRuntimeException("Unknown exception!");
+ } else if (e instanceof CmisBaseException) {
+ return (CmisBaseException) e;
+ } else {
+ // should not happen if the connector works correctly
+ // it's alarming enough to log the exception
+ log.warn(e);
+
+ return new CmisRuntimeException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Throws an exception if the given id is <code>null</code> or empty.
+ */
+ protected void checkId(String name, String id) {
+ if (id == null) {
+ throw new CmisInvalidArgumentException(name + " must be set!");
+ }
+
+ if (id.length() == 0) {
+ throw new CmisInvalidArgumentException(name + " must not be empty!");
+ }
+ }
+
+ /**
+ * Throws an exception if the given holder or id is <code>null</code> or
+ * empty.
+ */
+ protected void checkHolderId(String name, Holder<String> holder) {
+ if (holder == null) {
+ throw new CmisInvalidArgumentException(name + " must be set!");
+ }
+
+ checkId(name, holder.getValue());
+ }
+
+ /**
+ * Throws an exception if the repository id is <code>null</code> or empty.
+ */
+ protected void checkRepositoryId(String repositoryId) {
+ checkId("Repository Id", repositoryId);
+ }
+
+ /**
+ * Throws an exception if the given path is <code>null</code> or invalid.
+ */
+ protected void checkPath(String name, String path) {
+ if (path == null) {
+ throw new CmisInvalidArgumentException(name + " must be set!");
+ }
+
+ if (path.length() == 0) {
+ throw new CmisInvalidArgumentException(name + " must not be empty!");
+ }
+
+ if (path.charAt(0) != '/') {
+ throw new CmisInvalidArgumentException(name + " must start with '/'!");
+ }
+ }
+
+ /**
+ * Throws an exception if the given properties set is <code>null</code>.
+ */
+ protected void checkProperties(Properties properties) {
+ if (properties == null) {
+ throw new CmisInvalidArgumentException("Properties must be set!");
+ }
+ }
+
+ /**
+ * Throws an exception if the given content object is <code>null</code>.
+ */
+ protected void checkContentStream(ContentStream content) {
+ if (content == null) {
+ throw new CmisInvalidArgumentException("Content must be set!");
+ }
+ }
+
+ /**
+ * Throws an exception if the given query statement is <code>null</code> or
+ * empty.
+ */
+ protected void checkQueryStatement(String statement) {
+ if (statement == null) {
+ throw new CmisInvalidArgumentException("Statement must be set!");
+ }
+
+ if (statement.length() == 0) {
+ throw new CmisInvalidArgumentException("Statement must not be empty!");
+ }
+ }
+
+ /**
+ * Returns <code>true<code> if <code>value</code> is <code>null</code>.
+ */
+ protected Boolean getDefaultTrue(Boolean value) {
+ if (value == null) {
+ return Boolean.TRUE;
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns <code>false<code> if <code>value</code> is <code>null</code>.
+ */
+ protected Boolean getDefaultFalse(Boolean value) {
+ if (value == null) {
+ return Boolean.FALSE;
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns the <code>IncludeRelationships.NONE<code> if <code>value</code>
+ * is <code>null</code>.
+ */
+ protected IncludeRelationships getDefault(IncludeRelationships value) {
+ if (value == null) {
+ return IncludeRelationships.NONE;
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns the <code>VersioningState.MAJOR<code> if <code>value</code> is
+ * <code>null</code>.
+ */
+ protected VersioningState getDefault(VersioningState value) {
+ if (value == null) {
+ return VersioningState.MAJOR;
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns the <code>UnfileObjects.DELETE<code> if <code>value</code> is
+ * <code>null</code>.
+ */
+ protected UnfileObject getDefault(UnfileObject value) {
+ if (value == null) {
+ return UnfileObject.DELETE;
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns the
+ * <code>AclPropagation.REPOSITORYDETERMINED<code> if <code>value</code> is
+ * <code>null</code>.
+ */
+ protected AclPropagation getDefault(AclPropagation value) {
+ if (value == null) {
+ return AclPropagation.REPOSITORYDETERMINED;
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns the
+ * <code>RelationshipDirection.SOURCE<code> if <code>value</code> is
+ * <code>null</code> .
+ */
+ protected RelationshipDirection getDefault(RelationshipDirection value) {
+ if (value == null) {
+ return RelationshipDirection.SOURCE;
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns the <code>"cmis:none"<code> if <code>value</code> is
+ * <code>null</code>.
+ */
+ protected String getDefaultRenditionFilter(String value) {
+ if ((value == null) || (value.length() == 0)) {
+ return "cmis:none";
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns the default maxItems if <code>maxItems</code> ==
+ * <code>null</code>, throws an exception if <code>maxItems</code> < 0,
+ * returns <code>maxItems</code> otherwise.
+ */
+ protected BigInteger getTypesMaxItems(BigInteger maxItems) {
+ if (maxItems == null) {
+ return defaultTypesMaxItems;
+ }
+
+ if (maxItems.compareTo(BigInteger.ZERO) == -1) {
+ throw new CmisInvalidArgumentException("maxItems must not be negative!");
+ }
+
+ return maxItems;
+ }
+
+ /**
+ * Checks the depth parameter if it complies with CMIS specification and
+ * returns the default value if <code>depth</code> is <code>null</code>.
+ */
+ protected BigInteger getTypesDepth(BigInteger depth) {
+ if (depth == null) {
+ return defaultTypesDepth;
+ }
+
+ if (depth.compareTo(BigInteger.ZERO) == 0) {
+ throw new CmisInvalidArgumentException("depth must not be 0!");
+ }
+
+ if (depth.compareTo(MINUS_ONE) == -1) {
+ throw new CmisInvalidArgumentException("depth must not be <-1!");
+ }
+
+ return depth;
+ }
+
+ /**
+ * Returns the default maxItems if <code>maxItems</code> ==
+ * <code>null</code>, throws an exception if <code>maxItems</code> < 0,
+ * returns <code>maxItems</code> otherwise.
+ */
+ protected BigInteger getMaxItems(BigInteger maxItems) {
+ if (maxItems == null) {
+ return defaultMaxItems;
+ }
+
+ if (maxItems.compareTo(BigInteger.ZERO) == -1) {
+ throw new CmisInvalidArgumentException("maxItems must not be negative!");
+ }
+
+ return maxItems;
+ }
+
+ /**
+ * Returns 0 if <code>skipCount</code> == <code>null</code>, throws an
+ * exception if <code>skipCount</code> < 0, returns
+ * <code>skipCount</code> otherwise.
+ */
+ protected BigInteger getSkipCount(BigInteger skipCount) {
+ if (skipCount == null) {
+ return BigInteger.ZERO;
+ }
+
+ if (skipCount.compareTo(BigInteger.ZERO) == -1) {
+ throw new CmisInvalidArgumentException("skipCount must not be negative!");
+ }
+
+ return skipCount;
+ }
+
+ /**
+ * Checks the depth parameter if it complies with CMIS specification and
+ * returns the default value if <code>depth</code> is <code>null</code>.
+ */
+ protected BigInteger getDepth(BigInteger depth) {
+ if (depth == null) {
+ return defaultDepth;
+ }
+
+ if (depth.compareTo(BigInteger.ZERO) == 0) {
+ throw new CmisInvalidArgumentException("depth must not be 0!");
+ }
+
+ if (depth.compareTo(MINUS_ONE) == -1) {
+ throw new CmisInvalidArgumentException("depth must not be <-1!");
+ }
+
+ return depth;
+ }
+
+ /**
+ * Throws an exception if the given value is negative.
+ */
+ protected void checkNullOrPositive(String name, BigInteger value) {
+ if (value == null) {
+ return;
+ }
+
+ if (value.compareTo(BigInteger.ZERO) == -1) {
+ throw new CmisInvalidArgumentException(name + " must not be negative!");
+ }
+ }
+
+ // --- service operations ---
+
+ public ObjectInfo getObjectInfo(String objectId) {
+ return service.getObjectInfo(objectId);
+ }
+
+ public void close() {
+ service.close();
+ }
+
+ // --- repository service ---
+
+ public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+
+ try {
+ return service.getRepositoryInfo(repositoryId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
+ try {
+ return service.getRepositoryInfos(extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ includePropertyDefinitions = getDefaultFalse(includePropertyDefinitions);
+ maxItems = getTypesMaxItems(maxItems);
+ skipCount = getSkipCount(skipCount);
+
+ try {
+ return service.getTypeChildren(repositoryId, typeId, includePropertyDefinitions, maxItems, skipCount,
+ extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Type Id", typeId);
+
+ try {
+ return service.getTypeDefinition(repositoryId, typeId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
+ Boolean includePropertyDefinitions, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ includePropertyDefinitions = getDefaultFalse(includePropertyDefinitions);
+ depth = getTypesDepth(depth);
+
+ try {
+ return service.getTypeDescendants(repositoryId, typeId, depth, includePropertyDefinitions, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- navigation service ---
+
+ public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
+ Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ maxItems = getMaxItems(maxItems);
+ skipCount = getSkipCount(skipCount);
+
+ try {
+ return service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy, includeAllowableActions,
+ includeRelationships, renditionFilter, maxItems, skipCount, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ 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) {
+ checkRepositoryId(repositoryId);
+ checkId("Folder Id", folderId);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ includePathSegment = getDefaultFalse(includePathSegment);
+ maxItems = getMaxItems(maxItems);
+ skipCount = getSkipCount(skipCount);
+
+ try {
+ return service.getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
+ includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
+ String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+ String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Folder Id", folderId);
+ depth = getDepth(depth);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ includePathSegment = getDefaultFalse(includePathSegment);
+
+ try {
+ return service.getDescendants(repositoryId, folderId, depth, filter, includeAllowableActions,
+ includeRelationships, renditionFilter, includePathSegment, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Folder Id", folderId);
+
+ try {
+ return service.getFolderParent(repositoryId, folderId, filter, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
+ String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+ String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Folder Id", folderId);
+ depth = getDepth(depth);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ includePathSegment = getDefaultFalse(includePathSegment);
+
+ try {
+ return service.getFolderTree(repositoryId, folderId, depth, filter, includeAllowableActions,
+ includeRelationships, renditionFilter, includePathSegment, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
+ Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+ Boolean includeRelativePathSegment, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ includeRelativePathSegment = getDefaultFalse(includeRelativePathSegment);
+
+ try {
+ return service.getObjectParents(repositoryId, objectId, filter, includeAllowableActions,
+ includeRelationships, renditionFilter, includeRelativePathSegment, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- object service ---
+
+ public String create(String repositoryId, Properties properties, String folderId, ContentStream contentStream,
+ VersioningState versioningState, List<String> policies, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkProperties(properties);
+ versioningState = getDefault(versioningState);
+
+ try {
+ return service.create(repositoryId, properties, folderId, contentStream, versioningState, policies,
+ extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public String createDocument(String repositoryId, Properties properties, String folderId,
+ ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
+ Acl removeAces, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkProperties(properties);
+ versioningState = getDefault(versioningState);
+
+ try {
+ return service.createDocument(repositoryId, properties, folderId, contentStream, versioningState, policies,
+ addAces, removeAces, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties,
+ String folderId, VersioningState versioningState, List<String> policies, Acl addAces, Acl removeAces,
+ ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Source Id", sourceId);
+ versioningState = getDefault(versioningState);
+
+ try {
+ return service.createDocumentFromSource(repositoryId, sourceId, properties, folderId, versioningState,
+ policies, addAces, removeAces, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public String createFolder(String repositoryId, Properties properties, String folderId, List<String> policies,
+ Acl addAces, Acl removeAces, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkProperties(properties);
+ checkId("Folder Id", folderId);
+
+ try {
+ return service.createFolder(repositoryId, properties, folderId, policies, addAces, removeAces, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public String createPolicy(String repositoryId, Properties properties, String folderId, List<String> policies,
+ Acl addAces, Acl removeAces, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkProperties(properties);
+
+ try {
+ return service.createPolicy(repositoryId, properties, folderId, policies, addAces, removeAces, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public String createRelationship(String repositoryId, Properties properties, List<String> policies, Acl addAces,
+ Acl removeAces, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkProperties(properties);
+
+ try {
+ return service.createRelationship(repositoryId, properties, policies, addAces, removeAces, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+ ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkHolderId("Object Id", objectId);
+
+ try {
+ service.deleteContentStream(repositoryId, objectId, changeToken, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void deleteObject(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ allVersions = getDefaultTrue(allVersions);
+
+ try {
+ service.deleteObjectOrCancelCheckOut(repositoryId, objectId, allVersions, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void deleteObjectOrCancelCheckOut(String repositoryId, String objectId, Boolean allVersions,
+ ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ allVersions = getDefaultTrue(allVersions);
+
+ try {
+ service.deleteObjectOrCancelCheckOut(repositoryId, objectId, allVersions, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
+ UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Folder Id", folderId);
+ allVersions = getDefaultTrue(allVersions);
+ unfileObjects = getDefault(unfileObjects);
+ continueOnFailure = getDefaultFalse(continueOnFailure);
+
+ try {
+ return service.deleteTree(repositoryId, folderId, allVersions, unfileObjects, continueOnFailure, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+
+ try {
+ return service.getAllowableActions(repositoryId, objectId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
+ BigInteger length, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ checkNullOrPositive("Offset", offset);
+ checkNullOrPositive("Length", length);
+
+ try {
+ return service.getContentStream(repositoryId, objectId, streamId, offset, length, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
+ IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+ Boolean includeAcl, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ includePolicyIds = getDefaultFalse(includePolicyIds);
+ includeAcl = getDefaultFalse(includeAcl);
+
+ try {
+ return service.getObject(repositoryId, objectId, filter, includeAllowableActions, includeRelationships,
+ renditionFilter, includePolicyIds, includeAcl, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
+ IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+ Boolean includeAcl, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkPath("Path", path);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ includePolicyIds = getDefaultFalse(includePolicyIds);
+ includeAcl = getDefaultFalse(includeAcl);
+
+ try {
+ return service.getObjectByPath(repositoryId, path, filter, includeAllowableActions, includeRelationships,
+ renditionFilter, includePolicyIds, includeAcl, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+
+ try {
+ return service.getProperties(repositoryId, objectId, filter, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ maxItems = getMaxItems(maxItems);
+ skipCount = getSkipCount(skipCount);
+
+ try {
+ return service.getRenditions(repositoryId, objectId, renditionFilter, maxItems, skipCount, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
+ ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkHolderId("Object Id", objectId);
+ checkId("Target Folder Id", targetFolderId);
+
+ try {
+ service.moveObject(repositoryId, objectId, targetFolderId, sourceFolderId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+ Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkHolderId("Object Id", objectId);
+ overwriteFlag = getDefaultTrue(overwriteFlag);
+ checkContentStream(contentStream);
+
+ try {
+ service.setContentStream(repositoryId, objectId, overwriteFlag, changeToken, contentStream, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+ Properties properties, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkHolderId("Object Id", objectId);
+ checkProperties(properties);
+
+ try {
+ service.updateProperties(repositoryId, objectId, changeToken, properties, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- versioning service ---
+
+ public void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+
+ try {
+ service.cancelCheckOut(repositoryId, objectId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void checkIn(String repositoryId, Holder<String> objectId, Boolean major, Properties properties,
+ ContentStream contentStream, String checkinComment, List<String> policies, Acl addAces, Acl removeAces,
+ ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkHolderId("Object Id", objectId);
+ major = getDefaultTrue(major);
+
+ try {
+ service.checkIn(repositoryId, objectId, major, properties, contentStream, checkinComment, policies,
+ addAces, removeAces, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension,
+ Holder<Boolean> contentCopied) {
+ checkRepositoryId(repositoryId);
+ checkHolderId("Object Id", objectId);
+
+ try {
+ service.checkOut(repositoryId, objectId, extension, contentCopied);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ 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) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", versionSeriesId);
+ major = getDefaultFalse(major);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ includePolicyIds = getDefaultFalse(includePolicyIds);
+ includeAcl = getDefaultFalse(includeAcl);
+
+ try {
+ return service.getObjectOfLatestVersion(repositoryId, objectId, versionSeriesId, major, filter,
+ includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeAcl,
+ extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId,
+ Boolean major, String filter, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", versionSeriesId);
+ major = getDefaultFalse(major);
+
+ try {
+ return service.getPropertiesOfLatestVersion(repositoryId, objectId, versionSeriesId, major, filter,
+ extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,
+ Boolean includeAllowableActions, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Version Series Id", versionSeriesId);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+
+ try {
+ return service.getAllVersions(repositoryId, objectId, versionSeriesId, filter, includeAllowableActions,
+ extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- discovery service ---
+
+ public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
+ String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ includeProperties = getDefaultFalse(includeProperties);
+ includePolicyIds = getDefaultFalse(includePolicyIds);
+ includeAcl = getDefaultFalse(includeAcl);
+ maxItems = getMaxItems(maxItems);
+
+ try {
+ return service.getContentChanges(repositoryId, changeLogToken, includeProperties, filter, includePolicyIds,
+ includeAcl, maxItems, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
+ Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkQueryStatement(statement);
+ searchAllVersions = getDefaultFalse(searchAllVersions);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ includeRelationships = getDefault(includeRelationships);
+ renditionFilter = getDefaultRenditionFilter(renditionFilter);
+ maxItems = getMaxItems(maxItems);
+ skipCount = getSkipCount(skipCount);
+
+ try {
+ return service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+ includeRelationships, renditionFilter, maxItems, skipCount, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- multi filing service ---
+
+ public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
+ ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ checkId("Folder Id", folderId);
+ allVersions = getDefaultTrue(allVersions);
+
+ try {
+ service.addObjectToFolder(repositoryId, objectId, folderId, allVersions, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+
+ try {
+ service.removeObjectFromFolder(repositoryId, objectId, folderId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- relationship service ---
+
+ public ObjectList getObjectRelationships(String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
+ RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
+ BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ includeSubRelationshipTypes = getDefaultFalse(includeSubRelationshipTypes);
+ relationshipDirection = getDefault(relationshipDirection);
+ includeAllowableActions = getDefaultFalse(includeAllowableActions);
+ maxItems = getMaxItems(maxItems);
+ skipCount = getSkipCount(skipCount);
+
+ try {
+ return service.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
+ relationshipDirection, typeId, filter, includeAllowableActions, maxItems, skipCount, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- ACL service ---
+
+ public Acl applyAcl(String repositoryId, String objectId, Acl aces, AclPropagation aclPropagation) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ aclPropagation = getDefault(aclPropagation);
+
+ try {
+ return service.applyAcl(repositoryId, objectId, aces, aclPropagation);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public Acl applyAcl(String repositoryId, String objectId, Acl addAces, Acl removeAces,
+ AclPropagation aclPropagation, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ aclPropagation = getDefault(aclPropagation);
+
+ try {
+ return service.applyAcl(repositoryId, objectId, addAces, removeAces, aclPropagation, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+ onlyBasicPermissions = getDefaultTrue(onlyBasicPermissions);
+
+ try {
+ return service.getAcl(repositoryId, objectId, onlyBasicPermissions, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ // --- policy service ---
+
+ public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Policy Id", policyId);
+ checkId("Object Id", objectId);
+
+ try {
+ service.applyPolicy(repositoryId, policyId, objectId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public List<ObjectData> getAppliedPolicies(String repositoryId, String objectId, String filter,
+ ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Object Id", objectId);
+
+ try {
+ return service.getAppliedPolicies(repositoryId, objectId, filter, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+
+ public void removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
+ checkRepositoryId(repositoryId);
+ checkId("Policy Id", policyId);
+ checkId("Object Id", objectId);
+
+ try {
+ service.removePolicy(repositoryId, policyId, objectId, extension);
+ } catch (Exception e) {
+ throw createCmisException(e);
+ }
+ }
+}