Package org.opencms.cmis
Class A_CmsCmisRepository
java.lang.Object
org.opencms.cmis.A_CmsCmisRepository
- All Implemented Interfaces:
I_CmsCmisRepository
,I_CmsConfigurationParameterHandler
,I_CmsRepository
- Direct Known Subclasses:
CmsCmisRepository
Abstract repository superclass.
This class was introduced to separate the CMIS methods which are not supported from those which are, so only unsupported operations and utility should go into this class.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
cmis:all permission.static final String
cmis:read permission.static final String
cmis:write permission.protected CmsCmisTypeManager
The type manager instance.Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObjectToFolder
(CmsCmisCallContext context, String objectId, String folderId, boolean allVersions) Adds an object to a folder (multifiling).org.apache.chemistry.opencmis.commons.data.Acl
applyAcl
(CmsCmisCallContext context, String objectId, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Applies ACL to an object.org.apache.chemistry.opencmis.commons.data.Acl
applyAcl
(CmsCmisCallContext context, String objectId, org.apache.chemistry.opencmis.commons.data.Acl aces, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Changes the ACL for an object.void
applyPolicy
(CmsCmisCallContext context, String policyId, String objectId) Applies a policy to an object.void
cancelCheckOut
(CmsCmisCallContext context, String objectId) Cancels a checkout.void
checkIn
(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, boolean major, org.apache.chemistry.opencmis.commons.data.Properties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String checkinComment, List<String> policies, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces) Checks in a document.void
checkOut
(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, org.apache.chemistry.opencmis.commons.spi.Holder<Boolean> contentCopied) Checks out an object.createPolicy
(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId, List<String> policies, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces) Creates a policy.protected byte[]
extractRange
(byte[] content, BigInteger offset, BigInteger length) Copies a range of bytes from an array into a new array.protected String
getAcePrincipalName
(CmsObject cms, CmsUUID principalId) Gets a user-readable name for a principal id read from an ACE.List<org.apache.chemistry.opencmis.commons.data.ObjectData>
getAllVersions
(CmsCmisCallContext context, String objectId, String versionSeriesId, String filter, boolean includeAllowableActions) Gets all versions of an object.List<org.apache.chemistry.opencmis.commons.data.ObjectData>
getAppliedPolicies
(CmsCmisCallContext context, String objectId, String filter) Gets the policies for an object.org.apache.chemistry.opencmis.commons.data.ObjectList
getContentChanges
(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogToken, boolean includeProperties, String filter, boolean includePolicyIds, boolean includeAcl, BigInteger maxItems) Gets content changes from the repository.org.apache.chemistry.opencmis.commons.data.ObjectData
getObjectOfLatestVersion
(CmsCmisCallContext context, String objectId, String versionSeriesId, boolean major, String filter, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, boolean includePolicyIds, boolean includeAcl) Gets the object of the latest version.protected List<CmsProperty>
getOpenCmsProperties
(Map<String, org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties) Helper method to create OpenCms property objects from a map of CMIS properties.org.apache.chemistry.opencmis.commons.data.Properties
getPropertiesOfLatestVersion
(CmsCmisCallContext context, String objectId, String versionSeriesId, boolean major, String filter) Gets the properties of the latest version.protected RuntimeException
Helper method to create exceptions for unsupported features.org.apache.chemistry.opencmis.commons.data.ObjectList
query
(CmsCmisCallContext context, String statement, boolean searchAllVersions, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, BigInteger maxItems, BigInteger skipCount) Performs a query on the repository.void
removeObjectFromFolder
(CmsCmisCallContext context, String objectId, String folderId) Unfiles an object from a folder.void
removePolicy
(CmsCmisCallContext context, String policyId, String objectId) Removes a policy from an object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.cmis.I_CmsCmisRepository
createDocument, createDocumentFromSource, createFolder, createRelationship, deleteContentStream, deleteObject, deleteTree, getAcl, getAllowableActions, getCheckedOutDocs, getChildren, getConfiguration, getContentStream, getDescendants, getDescription, getFilter, getFolderParent, getId, getName, getObject, getObjectByPath, getObjectParents, getObjectRelationships, getProperties, getRenditions, getRepositoryInfo, getTypeChildren, getTypeDefinition, getTypeDescendants, moveObject, setContentStream, updateProperties
Methods inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
addConfigurationParameter, initConfiguration
Methods inherited from interface org.opencms.repository.I_CmsRepository
getTranslation, initializeCms, isTranslationEnabled, setFilter, setName, setTranslation
-
Field Details
-
CMIS_ALL
cmis:all permission.- See Also:
-
CMIS_READ
cmis:read permission.- See Also:
-
CMIS_WRITE
cmis:write permission.- See Also:
-
m_typeManager
The type manager instance.
-
-
Constructor Details
-
A_CmsCmisRepository
public A_CmsCmisRepository()
-
-
Method Details
-
addObjectToFolder
public void addObjectToFolder(CmsCmisCallContext context, String objectId, String folderId, boolean allVersions) Description copied from interface:I_CmsCmisRepository
Adds an object to a folder (multifiling).- Specified by:
addObjectToFolder
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idfolderId
- the folder idallVersions
- flag to include all versions- See Also:
-
applyAcl
public org.apache.chemistry.opencmis.commons.data.Acl applyAcl(CmsCmisCallContext context, String objectId, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Description copied from interface:I_CmsCmisRepository
Applies ACL to an object.- Specified by:
applyAcl
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idaddAces
- the ACEs to addremoveAces
- the ACEs to removeaclPropagation
- the ACL propagation- Returns:
- the new ACL
- See Also:
-
applyAcl
public org.apache.chemistry.opencmis.commons.data.Acl applyAcl(CmsCmisCallContext context, String objectId, org.apache.chemistry.opencmis.commons.data.Acl aces, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation) Description copied from interface:I_CmsCmisRepository
Changes the ACL for an object.- Specified by:
applyAcl
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idaces
- the access control entriesaclPropagation
- the propagation mode- Returns:
- the new ACL
- See Also:
-
applyPolicy
Description copied from interface:I_CmsCmisRepository
Applies a policy to an object.- Specified by:
applyPolicy
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextpolicyId
- the policy idobjectId
- the object id- See Also:
-
cancelCheckOut
Description copied from interface:I_CmsCmisRepository
Cancels a checkout.- Specified by:
cancelCheckOut
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object id- See Also:
-
checkIn
public void checkIn(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, boolean major, org.apache.chemistry.opencmis.commons.data.Properties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String checkinComment, List<String> policies, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces) Description copied from interface:I_CmsCmisRepository
Checks in a document.- Specified by:
checkIn
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idmajor
- the major version flagproperties
- the propertiescontentStream
- the content streamcheckinComment
- the check-in commentpolicies
- the policiesaddAces
- the ACEs to addremoveAces
- the ACEs to remove- See Also:
-
checkOut
public void checkOut(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> objectId, org.apache.chemistry.opencmis.commons.spi.Holder<Boolean> contentCopied) Description copied from interface:I_CmsCmisRepository
Checks out an object.- Specified by:
checkOut
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idcontentCopied
- indicator whether the content was copied- See Also:
-
createPolicy
public String createPolicy(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, String folderId, List<String> policies, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces) Description copied from interface:I_CmsCmisRepository
Creates a policy.- Specified by:
createPolicy
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextproperties
- the propertiesfolderId
- the folder idpolicies
- the policiesaddAces
- the ACEs to addremoveAces
- the ACEs to remove- Returns:
- the new object id
- See Also:
-
getAllVersions
public List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAllVersions(CmsCmisCallContext context, String objectId, String versionSeriesId, String filter, boolean includeAllowableActions) Description copied from interface:I_CmsCmisRepository
Gets all versions of an object.- Specified by:
getAllVersions
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idversionSeriesId
- the version series idfilter
- the property filter stringincludeAllowableActions
- the flag to include allowable actions- Returns:
- the list of versions
- See Also:
-
getAppliedPolicies
public List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAppliedPolicies(CmsCmisCallContext context, String objectId, String filter) Description copied from interface:I_CmsCmisRepository
Gets the policies for an object.- Specified by:
getAppliedPolicies
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idfilter
- the property filter- Returns:
- the policies for the object
- See Also:
-
getContentChanges
public org.apache.chemistry.opencmis.commons.data.ObjectList getContentChanges(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogToken, boolean includeProperties, String filter, boolean includePolicyIds, boolean includeAcl, BigInteger maxItems) Description copied from interface:I_CmsCmisRepository
Gets content changes from the repository.- Specified by:
getContentChanges
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextchangeLogToken
- the change log tokenincludeProperties
- flag to include propertiesfilter
- filter string for propertiesincludePolicyIds
- flag to include policy idsincludeAcl
- flag to include ACLsmaxItems
- maximum number of items to return- Returns:
- the list of content changes
- See Also:
-
getObjectOfLatestVersion
public org.apache.chemistry.opencmis.commons.data.ObjectData getObjectOfLatestVersion(CmsCmisCallContext context, String objectId, String versionSeriesId, boolean major, String filter, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, boolean includePolicyIds, boolean includeAcl) Description copied from interface:I_CmsCmisRepository
Gets the object of the latest version.- Specified by:
getObjectOfLatestVersion
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idversionSeriesId
- the version series idmajor
- flag to get the latest major versionfilter
- the property filterincludeAllowableActions
- flag to include allowable actionsincludeRelationships
- flag to include relationshipsrenditionFilter
- filter string for renditionsincludePolicyIds
- flag to include policiesincludeAcl
- flag to include ACLs- Returns:
- the data for the latest version
- See Also:
-
getPropertiesOfLatestVersion
public org.apache.chemistry.opencmis.commons.data.Properties getPropertiesOfLatestVersion(CmsCmisCallContext context, String objectId, String versionSeriesId, boolean major, String filter) Description copied from interface:I_CmsCmisRepository
Gets the properties of the latest version.- Specified by:
getPropertiesOfLatestVersion
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the object idversionSeriesId
- the version series idmajor
- flag to access the latest major versionfilter
- the property filter string- Returns:
- the properties from the latest version
- See Also:
-
query
public org.apache.chemistry.opencmis.commons.data.ObjectList query(CmsCmisCallContext context, String statement, boolean searchAllVersions, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, BigInteger maxItems, BigInteger skipCount) Description copied from interface:I_CmsCmisRepository
Performs a query on the repository.- Specified by:
query
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextstatement
- the querysearchAllVersions
- flag to search all versionsincludeAllowableActions
- flag to include allowable actionsincludeRelationships
- flag to include relationshipsrenditionFilter
- the filter string for renditionsmaxItems
- the maximum number of items to returnskipCount
- the number of items to skip- Returns:
- the query result objects
- See Also:
-
removeObjectFromFolder
Description copied from interface:I_CmsCmisRepository
Unfiles an object from a folder.- Specified by:
removeObjectFromFolder
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextobjectId
- the id of the object to unfilefolderId
- the folder from which the object should be unfiled- See Also:
-
removePolicy
Description copied from interface:I_CmsCmisRepository
Removes a policy from an object.- Specified by:
removePolicy
in interfaceI_CmsCmisRepository
- Parameters:
context
- the call contextpolicyId
- the policy idobjectId
- the object id- See Also:
-
extractRange
Copies a range of bytes from an array into a new array.- Parameters:
content
- the content arrayoffset
- the start offset in the arraylength
- the length of the range- Returns:
- the bytes from the given range of the content
-
getAcePrincipalName
Gets a user-readable name for a principal id read from an ACE.- Parameters:
cms
- the current CMS contextprincipalId
- the principal id from the ACE- Returns:
- the name of the principle
-
getOpenCmsProperties
protected List<CmsProperty> getOpenCmsProperties(Map<String, org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties) Helper method to create OpenCms property objects from a map of CMIS properties.- Parameters:
properties
- the CMIS properties- Returns:
- the OpenCms properties
-
notSupported
Helper method to create exceptions for unsupported features.- Returns:
- the created exception
-