org.opencms.cmis
Class A_CmsCmisRepository

java.lang.Object
  extended by org.opencms.cmis.A_CmsCmisRepository
All Implemented Interfaces:
I_CmsCmisRepository, I_CmsConfigurationParameterHandler, I_CmsRepository
Direct Known Subclasses:
CmsCmisRepository

public abstract class A_CmsCmisRepository
extends java.lang.Object
implements I_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
static java.lang.String CMIS_ALL
          cmis:all permission.
static java.lang.String CMIS_READ
          cmis:read permission.
static java.lang.String CMIS_WRITE
          cmis:write permission.
protected  CmsCmisTypeManager m_typeManager
          The type manager instance.
 
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
 
Constructor Summary
A_CmsCmisRepository()
           
 
Method Summary
 void addObjectToFolder(CmsCmisCallContext context, java.lang.String objectId, java.lang.String folderId, boolean allVersions)
          Adds an object to a folder (multifiling).
 org.apache.chemistry.opencmis.commons.data.Acl applyAcl(CmsCmisCallContext context, java.lang.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, java.lang.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, java.lang.String policyId, java.lang.String objectId)
          Applies a policy to an object.
 void cancelCheckOut(CmsCmisCallContext context, java.lang.String objectId)
          Cancels a checkout.
 void checkIn(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.spi.Holder<java.lang.String> objectId, boolean major, org.apache.chemistry.opencmis.commons.data.Properties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, java.lang.String checkinComment, java.util.List<java.lang.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<java.lang.String> objectId, org.apache.chemistry.opencmis.commons.spi.Holder<java.lang.Boolean> contentCopied)
          Checks out an object.
 java.lang.String createPolicy(CmsCmisCallContext context, org.apache.chemistry.opencmis.commons.data.Properties properties, java.lang.String folderId, java.util.List<java.lang.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, java.math.BigInteger offset, java.math.BigInteger length)
          Copies a range of bytes from an array into a new array.
protected  java.lang.String getAcePrincipalName(CmsObject cms, CmsUUID principalId)
          Gets a user-readable name for a principal id read from an ACE.
 java.util.List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAllVersions(CmsCmisCallContext context, java.lang.String objectId, java.lang.String versionSeriesId, java.lang.String filter, boolean includeAllowableActions)
          Gets all versions of an object.
 java.util.List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAppliedPolicies(CmsCmisCallContext context, java.lang.String objectId, java.lang.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<java.lang.String> changeLogToken, boolean includeProperties, java.lang.String filter, boolean includePolicyIds, boolean includeAcl, java.math.BigInteger maxItems)
          Gets content changes from the repository.
 org.apache.chemistry.opencmis.commons.data.ObjectData getObjectOfLatestVersion(CmsCmisCallContext context, java.lang.String objectId, java.lang.String versionSeriesId, boolean major, java.lang.String filter, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, java.lang.String renditionFilter, boolean includePolicyIds, boolean includeAcl)
          Gets the object of the latest version.
protected  java.util.List<CmsProperty> getOpenCmsProperties(java.util.Map<java.lang.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, java.lang.String objectId, java.lang.String versionSeriesId, boolean major, java.lang.String filter)
          Gets the properties of the latest version.
protected  java.lang.RuntimeException notSupported()
          Helper method to create exceptions for unsupported features.
 org.apache.chemistry.opencmis.commons.data.ObjectList query(CmsCmisCallContext context, java.lang.String statement, boolean searchAllVersions, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, java.lang.String renditionFilter, java.math.BigInteger maxItems, java.math.BigInteger skipCount)
          Performs a query on the repository.
 void removeObjectFromFolder(CmsCmisCallContext context, java.lang.String objectId, java.lang.String folderId)
          Unfiles an object from a folder.
 void removePolicy(CmsCmisCallContext context, java.lang.String policyId, java.lang.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.repository.I_CmsRepository
initializeCms, setFilter, setName
 
Methods inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
addConfigurationParameter, initConfiguration
 

Field Detail

CMIS_ALL

public static final java.lang.String CMIS_ALL
cmis:all permission.

See Also:
Constant Field Values

CMIS_READ

public static final java.lang.String CMIS_READ
cmis:read permission.

See Also:
Constant Field Values

CMIS_WRITE

public static final java.lang.String CMIS_WRITE
cmis:write permission.

See Also:
Constant Field Values

m_typeManager

protected CmsCmisTypeManager m_typeManager
The type manager instance.

Constructor Detail

A_CmsCmisRepository

public A_CmsCmisRepository()
Method Detail

addObjectToFolder

public void addObjectToFolder(CmsCmisCallContext context,
                              java.lang.String objectId,
                              java.lang.String folderId,
                              boolean allVersions)
Description copied from interface: I_CmsCmisRepository
Adds an object to a folder (multifiling).

Specified by:
addObjectToFolder in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
folderId - the folder id
allVersions - flag to include all versions
See Also:
I_CmsCmisRepository.addObjectToFolder(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String, boolean)

applyAcl

public org.apache.chemistry.opencmis.commons.data.Acl applyAcl(CmsCmisCallContext context,
                                                               java.lang.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 interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
addAces - the ACEs to add
removeAces - the ACEs to remove
aclPropagation - the ACL propagation
Returns:
the new ACL
See Also:
I_CmsCmisRepository.applyAcl(org.opencms.cmis.CmsCmisCallContext, java.lang.String, org.apache.chemistry.opencmis.commons.data.Acl, org.apache.chemistry.opencmis.commons.data.Acl, org.apache.chemistry.opencmis.commons.enums.AclPropagation)

applyAcl

public org.apache.chemistry.opencmis.commons.data.Acl applyAcl(CmsCmisCallContext context,
                                                               java.lang.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 interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
aces - the access control entries
aclPropagation - the propagation mode
Returns:
the new ACL
See Also:
I_CmsCmisRepository.applyAcl(org.opencms.cmis.CmsCmisCallContext, java.lang.String, org.apache.chemistry.opencmis.commons.data.Acl, org.apache.chemistry.opencmis.commons.enums.AclPropagation)

applyPolicy

public void applyPolicy(CmsCmisCallContext context,
                        java.lang.String policyId,
                        java.lang.String objectId)
Description copied from interface: I_CmsCmisRepository
Applies a policy to an object.

Specified by:
applyPolicy in interface I_CmsCmisRepository
Parameters:
context - the call context
policyId - the policy id
objectId - the object id
See Also:
I_CmsCmisRepository.applyPolicy(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String)

cancelCheckOut

public void cancelCheckOut(CmsCmisCallContext context,
                           java.lang.String objectId)
Description copied from interface: I_CmsCmisRepository
Cancels a checkout.

Specified by:
cancelCheckOut in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
See Also:
I_CmsCmisRepository.cancelCheckOut(org.opencms.cmis.CmsCmisCallContext, java.lang.String)

checkIn

public void checkIn(CmsCmisCallContext context,
                    org.apache.chemistry.opencmis.commons.spi.Holder<java.lang.String> objectId,
                    boolean major,
                    org.apache.chemistry.opencmis.commons.data.Properties properties,
                    org.apache.chemistry.opencmis.commons.data.ContentStream contentStream,
                    java.lang.String checkinComment,
                    java.util.List<java.lang.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 interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
major - the major version flag
properties - the properties
contentStream - the content stream
checkinComment - the check-in comment
policies - the policies
addAces - the ACEs to add
removeAces - the ACEs to remove
See Also:
I_CmsCmisRepository.checkIn(org.opencms.cmis.CmsCmisCallContext, org.apache.chemistry.opencmis.commons.spi.Holder, boolean, org.apache.chemistry.opencmis.commons.data.Properties, org.apache.chemistry.opencmis.commons.data.ContentStream, java.lang.String, java.util.List, org.apache.chemistry.opencmis.commons.data.Acl, org.apache.chemistry.opencmis.commons.data.Acl)

checkOut

public void checkOut(CmsCmisCallContext context,
                     org.apache.chemistry.opencmis.commons.spi.Holder<java.lang.String> objectId,
                     org.apache.chemistry.opencmis.commons.spi.Holder<java.lang.Boolean> contentCopied)
Description copied from interface: I_CmsCmisRepository
Checks out an object.

Specified by:
checkOut in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
contentCopied - indicator whether the content was copied
See Also:
I_CmsCmisRepository.checkOut(org.opencms.cmis.CmsCmisCallContext, org.apache.chemistry.opencmis.commons.spi.Holder, org.apache.chemistry.opencmis.commons.spi.Holder)

createPolicy

public java.lang.String createPolicy(CmsCmisCallContext context,
                                     org.apache.chemistry.opencmis.commons.data.Properties properties,
                                     java.lang.String folderId,
                                     java.util.List<java.lang.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 interface I_CmsCmisRepository
Parameters:
context - the call context
properties - the properties
folderId - the folder id
policies - the policies
addAces - the ACEs to add
removeAces - the ACEs to remove
Returns:
the new object id
See Also:
I_CmsCmisRepository.createPolicy(org.opencms.cmis.CmsCmisCallContext, org.apache.chemistry.opencmis.commons.data.Properties, java.lang.String, java.util.List, org.apache.chemistry.opencmis.commons.data.Acl, org.apache.chemistry.opencmis.commons.data.Acl)

getAllVersions

public java.util.List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAllVersions(CmsCmisCallContext context,
                                                                                            java.lang.String objectId,
                                                                                            java.lang.String versionSeriesId,
                                                                                            java.lang.String filter,
                                                                                            boolean includeAllowableActions)
Description copied from interface: I_CmsCmisRepository
Gets all versions of an object.

Specified by:
getAllVersions in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
versionSeriesId - the version series id
filter - the property filter string
includeAllowableActions - the flag to include allowable actions
Returns:
the list of versions
See Also:
I_CmsCmisRepository.getAllVersions(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String, java.lang.String, boolean)

getAppliedPolicies

public java.util.List<org.apache.chemistry.opencmis.commons.data.ObjectData> getAppliedPolicies(CmsCmisCallContext context,
                                                                                                java.lang.String objectId,
                                                                                                java.lang.String filter)
Description copied from interface: I_CmsCmisRepository
Gets the policies for an object.

Specified by:
getAppliedPolicies in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
filter - the property filter
Returns:
the policies for the object
See Also:
I_CmsCmisRepository.getAppliedPolicies(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String)

getContentChanges

public org.apache.chemistry.opencmis.commons.data.ObjectList getContentChanges(CmsCmisCallContext context,
                                                                               org.apache.chemistry.opencmis.commons.spi.Holder<java.lang.String> changeLogToken,
                                                                               boolean includeProperties,
                                                                               java.lang.String filter,
                                                                               boolean includePolicyIds,
                                                                               boolean includeAcl,
                                                                               java.math.BigInteger maxItems)
Description copied from interface: I_CmsCmisRepository
Gets content changes from the repository.

Specified by:
getContentChanges in interface I_CmsCmisRepository
Parameters:
context - the call context
changeLogToken - the change log token
includeProperties - flag to include properties
filter - filter string for properties
includePolicyIds - flag to include policy ids
includeAcl - flag to include ACLs
maxItems - maximum number of items to return
Returns:
the list of content changes
See Also:
I_CmsCmisRepository.getContentChanges(org.opencms.cmis.CmsCmisCallContext, org.apache.chemistry.opencmis.commons.spi.Holder, boolean, java.lang.String, boolean, boolean, java.math.BigInteger)

getObjectOfLatestVersion

public org.apache.chemistry.opencmis.commons.data.ObjectData getObjectOfLatestVersion(CmsCmisCallContext context,
                                                                                      java.lang.String objectId,
                                                                                      java.lang.String versionSeriesId,
                                                                                      boolean major,
                                                                                      java.lang.String filter,
                                                                                      boolean includeAllowableActions,
                                                                                      org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships,
                                                                                      java.lang.String renditionFilter,
                                                                                      boolean includePolicyIds,
                                                                                      boolean includeAcl)
Description copied from interface: I_CmsCmisRepository
Gets the object of the latest version.

Specified by:
getObjectOfLatestVersion in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
versionSeriesId - the version series id
major - flag to get the latest major version
filter - the property filter
includeAllowableActions - flag to include allowable actions
includeRelationships - flag to include relationships
renditionFilter - filter string for renditions
includePolicyIds - flag to include policies
includeAcl - flag to include ACLs
Returns:
the data for the latest version
See Also:
I_CmsCmisRepository.getObjectOfLatestVersion(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String, boolean, java.lang.String, boolean, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships, java.lang.String, boolean, boolean)

getPropertiesOfLatestVersion

public org.apache.chemistry.opencmis.commons.data.Properties getPropertiesOfLatestVersion(CmsCmisCallContext context,
                                                                                          java.lang.String objectId,
                                                                                          java.lang.String versionSeriesId,
                                                                                          boolean major,
                                                                                          java.lang.String filter)
Description copied from interface: I_CmsCmisRepository
Gets the properties of the latest version.

Specified by:
getPropertiesOfLatestVersion in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the object id
versionSeriesId - the version series id
major - flag to access the latest major version
filter - the property filter string
Returns:
the properties from the latest version
See Also:
I_CmsCmisRepository.getPropertiesOfLatestVersion(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String, boolean, java.lang.String)

query

public org.apache.chemistry.opencmis.commons.data.ObjectList query(CmsCmisCallContext context,
                                                                   java.lang.String statement,
                                                                   boolean searchAllVersions,
                                                                   boolean includeAllowableActions,
                                                                   org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships,
                                                                   java.lang.String renditionFilter,
                                                                   java.math.BigInteger maxItems,
                                                                   java.math.BigInteger skipCount)
Description copied from interface: I_CmsCmisRepository
Performs a query on the repository.

Specified by:
query in interface I_CmsCmisRepository
Parameters:
context - the call context
statement - the query
searchAllVersions - flag to search all versions
includeAllowableActions - flag to include allowable actions
includeRelationships - flag to include relationships
renditionFilter - the filter string for renditions
maxItems - the maximum number of items to return
skipCount - the number of items to skip
Returns:
the query result objects
See Also:
I_CmsCmisRepository.query(org.opencms.cmis.CmsCmisCallContext, java.lang.String, boolean, boolean, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.math.BigInteger, java.math.BigInteger)

removeObjectFromFolder

public void removeObjectFromFolder(CmsCmisCallContext context,
                                   java.lang.String objectId,
                                   java.lang.String folderId)
Description copied from interface: I_CmsCmisRepository
Unfiles an object from a folder.

Specified by:
removeObjectFromFolder in interface I_CmsCmisRepository
Parameters:
context - the call context
objectId - the id of the object to unfile
folderId - the folder from which the object should be unfiled
See Also:
I_CmsCmisRepository.removeObjectFromFolder(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String)

removePolicy

public void removePolicy(CmsCmisCallContext context,
                         java.lang.String policyId,
                         java.lang.String objectId)
Description copied from interface: I_CmsCmisRepository
Removes a policy from an object.

Specified by:
removePolicy in interface I_CmsCmisRepository
Parameters:
context - the call context
policyId - the policy id
objectId - the object id
See Also:
I_CmsCmisRepository.removePolicy(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String)

extractRange

protected byte[] extractRange(byte[] content,
                              java.math.BigInteger offset,
                              java.math.BigInteger length)
Copies a range of bytes from an array into a new array.

Parameters:
content - the content array
offset - the start offset in the array
length - the length of the range
Returns:
the bytes from the given range of the content

getAcePrincipalName

protected java.lang.String getAcePrincipalName(CmsObject cms,
                                               CmsUUID principalId)
Gets a user-readable name for a principal id read from an ACE.

Parameters:
cms - the current CMS context
principalId - the principal id from the ACE
Returns:
the name of the principle

getOpenCmsProperties

protected java.util.List<CmsProperty> getOpenCmsProperties(java.util.Map<java.lang.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

protected java.lang.RuntimeException notSupported()
Helper method to create exceptions for unsupported features.

Returns:
the created exception