org.xcmis.spi
Class Connection

java.lang.Object
  extended by org.xcmis.spi.Connection
Direct Known Subclasses:
BasicConnection

public abstract class Connection
extends Object

Connection to CMIS storage. It should be used for all operation with storage. The Connection object is associated with Storage object. When Connection is no longer needed then method close() should be used to release all associated resources. After this connection should not be in use any more.

Version:
$Id: Connection.java 332 2010-03-11 17:24:56Z andrew00x $
Author:
Andrey Parfonov

Field Summary
protected static int CREATE
           
protected  Storage storage
           
protected static int UPDATE
           
protected static int VERSION
           
 
Constructor Summary
Connection(Storage storage)
           
 
Method Summary
 void addObjectToFolder(String objectId, String folderId, boolean allVersions)
          Adds an existing fileable non-folder object to a folder.
 String addType(TypeDefinition type)
          Adds the new Object-type.
 void applyACL(String objectId, List<AccessControlEntry> addACL, List<AccessControlEntry> removeACL, AccessControlPropagation propagation)
          Adds or(and) removes the given Access Control Entries to(from) the Access Control List of object.
 void applyPolicy(String policyId, String objectId)
          Applies a specified policy to an object.
 void cancelCheckout(String documentId)
          Discard the check-out operation.
protected abstract  void checkConnection()
          Check is connection may be used at the moment, e.g.
 String checkin(String documentId, boolean major, Map<String,Property<?>> properties, ContentStream content, String checkinComment, List<AccessControlEntry> addACL, List<AccessControlEntry> removeACL, Collection<String> policies)
          Check-in Private Working Copy.
 String checkout(String documentId)
          Check-out document.
abstract  void close()
          Close the connection and release underlying resources.
 String createDocument(String parentId, Map<String,Property<?>> properties, ContentStream content, List<AccessControlEntry> addACL, List<AccessControlEntry> removeACL, Collection<String> policies, VersioningState versioningState)
          Create a document object.
 String createDocumentFromSource(String sourceId, String parentId, Map<String,Property<?>> properties, List<AccessControlEntry> addACL, List<AccessControlEntry> removeACL, Collection<String> policies, VersioningState versioningState)
          Create a document object as a copy of the given source document in the specified parent folder parentId.
 String createFolder(String parentId, Map<String,Property<?>> properties, List<AccessControlEntry> addACL, List<AccessControlEntry> removeACL, Collection<String> policies)
          Create a folder object.
 String createPolicy(String parentId, Map<String,Property<?>> properties, List<AccessControlEntry> addACL, List<AccessControlEntry> removeACL, Collection<String> policies)
          Create a policy object.
 String createRelationship(Map<String,Property<?>> properties, List<AccessControlEntry> addACL, List<AccessControlEntry> removeACL, Collection<String> policies)
          Create a relationship object.
 String deleteContentStream(String documentId, ChangeTokenHolder changeTokenHolder)
          Delete the content stream for the specified Document object.
 void deleteObject(String objectId, Boolean deleteAllVersions)
          Delete the specified object.
 Collection<String> deleteTree(String folderId, Boolean deleteAllVersions, UnfileObject unfileObject, Boolean continueOnFailure)
          Delete the specified folder object and all of its child- and descendant-objects.
 List<AccessControlEntry> getACL(String objectId, boolean onlyBasicPermissions)
          Get the ACL currently applied to the specified object.
 AllowableActions getAllowableActions(String objectId)
          Get the list of allowable actions for an Object.
 List<CmisObject> getAllVersions(String versionSeriesId, boolean includeAllowableActions, boolean includeObjectInfo, String propertyFilter)
          Get all documents in version series.
 List<CmisObject> getAppliedPolicies(String objectId, boolean includeObjectInfo, String propertyFilter)
          Gets the list of policies currently applied to the specified object.
 ItemsList<CmisObject> getCheckedOutDocs(String folderId, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includeObjectInfo, String propertyFilter, String renditionFilter, String orderBy, int maxItems, int skipCount)
          Documents that are checked out that the user has access to.
 ItemsList<CmisObject> getChildren(String folderId, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includePathSegments, boolean includeObjectInfo, String propertyFilter, String renditionFilter, String orderBy, int maxItems, int skipCount)
          Get the list of child objects contained in the specified folder.
protected  CmisObject getCmisObject(ObjectData object, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includePolicyIds, boolean includeACL, boolean includeObjectInfo, PropertyFilter parsedPropertyFilter, RenditionFilter parsedRenditionFilter)
           
 ItemsList<CmisObject> getContentChanges(ChangeLogTokenHolder changeLogToken, boolean includeProperties, String propertyFilter, boolean includePolicyIDs, boolean includeAcl, boolean includeObjectInfo, int maxItems)
          Gets content changes.
 ContentStream getContentStream(String objectId, String streamId)
          Get document's content stream.
 List<ItemsTree<CmisObject>> getDescendants(String folderId, int depth, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includePathSegments, boolean includeObjectInfo, String propertyFilter, String renditionFilter)
          Get the collection of descendant objects contained in the specified folder and any (according to depth) of its child-folders.
 CmisObject getFolderParent(String folderId, boolean includeObjectInfo, String propertyFilter)
          Get parent for specified folder.
 List<ItemsTree<CmisObject>> getFolderTree(String folderId, int depth, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includePathSegments, boolean includeObjectInfo, String propertyFilter, String renditionFilter)
          Get the collection of descendant folder objects contained in the specified folder and any (according to depth) of its child-folders.
 CmisObject getObject(String objectId, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includePolicyIDs, boolean includeAcl, boolean includeObjectInfo, String propertyFilter, String renditionFilter)
          Get object.
 CmisObject getObjectByPath(String path, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includePolicyIDs, boolean includeAcl, boolean includeObjectInfo, String propertyFilter, String renditionFilter)
          Get object by specified path.
 CmisObject getObjectOfLatestVersion(String versionSeriesId, boolean major, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includePolicyIDs, boolean includeAcl, boolean includeObjectInfo, String propertyFilter, String renditionFilter)
          Get the latest Document object in the version series.
 List<ObjectParent> getObjectParents(String objectId, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includeRelativePathSegment, boolean includeObjectInfo, String propertyFilter, String renditionFilter)
          Gets the parent folder(s) for the specified object.
 ItemsList<CmisObject> getObjectRelationships(String objectId, RelationshipDirection direction, String typeId, boolean includeSubRelationshipTypes, boolean includeAllowableActions, boolean includeObjectInfo, String propertyFilter, int maxItems, int skipCount)
          Get all or a subset of relationships associated with an independent object.
 CmisObject getProperties(String objectId, boolean includeObjectInfo, String propertyFilter)
          Get object's properties.
 CmisObject getPropertiesOfLatestVersion(String versionSeriesId, boolean major, boolean includeObjectInfo, String propertyFilter)
          Get properties of latest version in version series.
 List<Rendition> getRenditions(String objectId, String renditionFilter, int maxItems, int skipCount)
          Get the list of associated Renditions for the specified object.
 Storage getStorage()
          Gets the storage associated to this connection.
 ItemsList<TypeDefinition> getTypeChildren(String typeId, boolean includePropertyDefinition, int maxItems, int skipCount)
          Set of object types.
 TypeDefinition getTypeDefinition(String typeId)
          Get type definition for type typeId include property definition, see getTypeDefinition(String, boolean).
 TypeDefinition getTypeDefinition(String typeId, boolean includePropertyDefinition)
          Get type definition for type typeId.
 List<ItemsTree<TypeDefinition>> getTypeDescendants(String typeId, int depth, boolean includePropertyDefinition)
          Get all descendants of specified typeId in hierarchy.
 String moveObject(String objectId, String targetFolderId, String sourceFolderId)
          Moves the specified file-able object from one folder to another.
 ItemsList<CmisObject> query(String statement, boolean searchAllVersions, boolean includeAllowableActions, IncludeRelationships includeRelationships, boolean includeObjectInfo, String renditionFilter, int maxItems, int skipCount)
          Executes a CMIS-SQL query statement against the contents of the CMIS Storage.
 void removeObjectFromFolder(String objectId, String folderId)
          Remove an existing fileable non-folder object from a folder.
 void removePolicy(String policyId, String objectId)
          Removes a specified policy from an object.
 void removeType(String typeId)
          Remove type definition for type typeId .
 String setContentStream(String documentId, ContentStream content, ChangeTokenHolder changeTokenHolder, Boolean overwriteFlag)
          Sets the content stream for the specified Document object.
 String updateProperties(String objectId, ChangeTokenHolder changeTokenHolder, Map<String,Property<?>> properties)
          Update object properties.
protected abstract  void validateChangeToken(ObjectData object, String changeToken)
          Validate change token provided by caller with current change token of object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE

protected static final int CREATE
See Also:
Constant Field Values

UPDATE

protected static final int UPDATE
See Also:
Constant Field Values

VERSION

protected static final int VERSION
See Also:
Constant Field Values

storage

protected Storage storage
Constructor Detail

Connection

public Connection(Storage storage)
Method Detail

addObjectToFolder

public void addObjectToFolder(String objectId,
                              String folderId,
                              boolean allVersions)
                       throws ObjectNotFoundException,
                              ConstraintException
Adds an existing fileable non-folder object to a folder. 2.2.5.1 addObjectToFolder

Parameters:
objectId - the id of the object
folderId - the target folder id into which the object is to be filed
allVersions - to add all versions of the object to the folder or only current document if the storage supports version-specific filing
Throws:
ObjectNotFoundException - if objectId or folderId were not found
ConstraintException - MUST throw this exception if the cmis:objectTypeId property value of the given object is NOT in the list of AllowedChildObjectTypeIds of the parent-folder specified by folderId or if allVersions is false but version-specific filling capability is not supported by storage
InvalidArgumentException - if objectId is id of object that is not fileable or if folderId is id of object that base type is not Folder
NotSupportedException - if multifiling feature is not supported by backend storage
See Also:
RepositoryCapabilities.isCapabilityVersionSpecificFiling()

addType

public String addType(TypeDefinition type)
               throws ConstraintException,
                      StorageException
Adds the new Object-type. It is not a standard CMIS feature (xCMIS specific) 2.1.3 Object-Type A repository MAY define additional object-types beyond the CMIS Base Object-Types

Parameters:
type - type definition
Returns:
ID of newly added type
Throws:
ConstraintException - if any of the following conditions are met:
StorageException - if type can't be added (save changes) cause to storage internal problem

applyACL

public void applyACL(String objectId,
                     List<AccessControlEntry> addACL,
                     List<AccessControlEntry> removeACL,
                     AccessControlPropagation propagation)
              throws ObjectNotFoundException,
                     ConstraintException
Adds or(and) removes the given Access Control Entries to(from) the Access Control List of object. 2.2.10.2 applyACL

Parameters:
objectId - the identifier of object for which should be applied specified ACEs
addACL - the ACEs that will be added from object's ACL. May be null or empty list
removeACL - the ACEs that will be removed from object's ACL. May be null or empty list
propagation - specifies how ACEs should be handled:
  • objectonly: ACEs must be applied without changing the ACLs of other objects
  • propagate: ACEs must be applied by propagate the changes to all inheriting objects
  • repositorydetermined: Indicates that the client leaves the behavior to the storage
Throws:
ObjectNotFoundException - if object with objectId does not exist
ConstraintException - if any of the following conditions are met:
  • The specified object's Object-Type definition's attribute for controllableACL is false
  • The value for ACLPropagation does not match the values as returned via getACLCapabilities
  • At least one of the specified values for permission in ANY of the ACEs does not match ANY of the permissionNames as returned by getACLCapability and is not a CMIS Basic permission
NotSupportedException - if managing of ACL is not supported by backend storage

applyPolicy

public void applyPolicy(String policyId,
                        String objectId)
                 throws ConstraintException,
                        ObjectNotFoundException
Applies a specified policy to an object. 2.2.9.1 applyPolicy

Parameters:
policyId - the policy Id to be applied to object
objectId - the target object Id for policy
Throws:
ObjectNotFoundException - if object with objectId or policyId does not exist
ConstraintException - if object with id objectId is not controllable by policy
InvalidArgumentException - if object with id policyId is not object which base type is Policy

cancelCheckout

public void cancelCheckout(String documentId)
                    throws ObjectNotFoundException,
                           ConstraintException,
                           UpdateConflictException,
                           VersioningException,
                           StorageException
Discard the check-out operation. As result Private Working Copy (PWC) must be removed and storage ready to next check-out operation. 2.2.7.2 cancelCheckOut

Parameters:
documentId - document id. May be PWC id or id of any other Document in Version Series
Throws:
ObjectNotFoundException - if object with documentId does not exist
ConstraintException - if the object is not versionable
UpdateConflictException - if update an object that is no longer current
VersioningException - if object is a non-current document version
StorageException - if PWC can't be removed from storage cause to storage internal problem
InvalidArgumentException - if object with documentId is not Document or if PWC in version series does not exist

checkin

public String checkin(String documentId,
                      boolean major,
                      Map<String,Property<?>> properties,
                      ContentStream content,
                      String checkinComment,
                      List<AccessControlEntry> addACL,
                      List<AccessControlEntry> removeACL,
                      Collection<String> policies)
               throws ObjectNotFoundException,
                      ConstraintException,
                      VersioningException,
                      NameConstraintViolationException,
                      UpdateConflictException,
                      StreamNotSupportedException,
                      StorageException
Check-in Private Working Copy. 2.2.7.3 checkIn

Parameters:
documentId - document id
major - true is new version should be marked as major false otherwise
properties - properties to be applied to new version
content - content of document
checkinComment - check-in comment
addACL - set Access Control Entry to be applied for newly created version of document. May be null or empty list
removeACL - set Access Control Entry that MUST be removed from the newly created version of document. May be null or empty list
policies - list of policy id that MUST be applied to the newly created document. May be null or empty collection
Returns:
ID of checked-in document
Throws:
ObjectNotFoundException - if object with documentId does not exist
ConstraintException - if the object is not versionable
VersioningException - if object is a not PWC
NameConstraintViolationException - if cmis:name specified in properties throws conflict
UpdateConflictException - if update an object that is no longer current
StreamNotSupportedException - if document does not supports content stream
StorageException - if changes can't be saved in storage cause to storage internal problem
InvalidArgumentException - if object with documentId is not Document

checkout

public String checkout(String documentId)
                throws ObjectNotFoundException,
                       ConstraintException,
                       UpdateConflictException,
                       VersioningException,
                       StorageException
Check-out document. 2.2.7.1 checkOut

Parameters:
documentId - document id. Storage MAY allow checked-out ONLY latest version of Document
Returns:
ID of checked-out document (PWC)
Throws:
ObjectNotFoundException - if object with documentId does not exist
ConstraintException - if the object is not versionable
UpdateConflictException - if update an object that is no longer current
VersioningException - if one of the following conditions are met:
  • object is not latest version of document version and it is not supported to checked-out other then latest version
  • version series already have one checked-out document. It is not possible to have more then one PWC at time
StorageException - if newly created PWC can't be saved in storage cause to storage internal problem
InvalidArgumentException - if object with documentId is not Document

close

public abstract void close()
Close the connection and release underlying resources. Not able to use this connection any more.


createDocument

public String createDocument(String parentId,
                             Map<String,Property<?>> properties,
                             ContentStream content,
                             List<AccessControlEntry> addACL,
                             List<AccessControlEntry> removeACL,
                             Collection<String> policies,
                             VersioningState versioningState)
                      throws ObjectNotFoundException,
                             TypeNotFoundException,
                             ConstraintException,
                             StreamNotSupportedException,
                             NameConstraintViolationException,
                             StorageException
Create a document object.

Parameters:
parentId - parent folder id for object. May be null if storage supports unfiling
properties - properties that will be applied to newly created document. If properties contains some property which updatability is other then Updatability.ONCREATE or Updatability.READWRITE this properties will be ignored
content - the document content. May be null. MUST be required if the type requires it.
addACL - Access Control Entries that MUST added for newly created document, either using the ACL from parentId if specified, or being applied if no parentId is specified. May be null or empty list
removeACL - set Access Control Entries that MUST be removed from the newly created document, either using the ACL from parentId if specified, or being ignored if no parentId is specified. May be null or empty list
policies - list of policy id that MUST be applied to the newly created document. May be null or empty collection
versioningState - enumeration specifying what the versioning state of the newly created object shall be
Returns:
ID of newly created document
Throws:
ObjectNotFoundException - if target folder with specified id parentId does not exist
TypeNotFoundException - if type specified by property cmis:objectTypeId does not exist
ConstraintException - if any of following condition are met:
  • cmis:objectTypeId property value is not an object type whose baseType is Document
  • cmis:objectTypeId property value is not in the list of AllowedChildObjectTypeIds of the parent-folder specified by parentId
  • value of any of the properties violates the min/max/required/length constraints specified in the property definition in the object type
  • contentStreamAllowed attribute of the object type definition specified by the cmis:objectTypeId property value is set to required and no content input parameter is provided
  • versionable attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and a value for the versioningState input parameter is provided that is something other than none
  • versionable attribute of the object type definition specified by the cmis:objectTypeId property value is set to true and the value for the versioningState input parameter is provided that is none
  • controllablePolicy attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one policy is provided
  • controllableACL attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one ACE is provided
  • at least one of the permissions is used in an ACE provided which is not supported by the storage
StreamNotSupportedException - if the contentStreamAllowed attribute of the object type definition specified by the cmis:objectTypeId property value is set to 'not allowed' and a contentStream input parameter is provided
NameConstraintViolationException - violation is detected with the given cmis:name property value. Storage MAY chose other name which does not conflict
StorageException - if new Document can't be saved in storage cause to storage internal problem

createDocumentFromSource

public String createDocumentFromSource(String sourceId,
                                       String parentId,
                                       Map<String,Property<?>> properties,
                                       List<AccessControlEntry> addACL,
                                       List<AccessControlEntry> removeACL,
                                       Collection<String> policies,
                                       VersioningState versioningState)
                                throws ObjectNotFoundException,
                                       ConstraintException,
                                       NameConstraintViolationException,
                                       StorageException
Create a document object as a copy of the given source document in the specified parent folder parentId.

Parameters:
sourceId - id for the source document
parentId - parent folder id for object. May be null if storage supports unfiling
properties - properties that will be applied to newly created document
addACL - Access Control Entries that MUST added for newly created document, either using the ACL from parentId if specified, or being applied if no parentId is specified. May be null or empty list
removeACL - set Access Control Entries that MUST be removed from the newly created document, either using the ACL from parentId if specified, or being ignored if no parentId is specified. May be null or empty list
policies - list of policy id that MUST be applied to the newly created document. May be null or empty collection
versioningState - enumeration specifying what the versioning state of the newly created object shall be
Returns:
ID of newly created document
Throws:
ObjectNotFoundException - if target folder with specified id parentId or source document with id sourceId does not exist
ConstraintException - if any of following condition are met:
  • sourceId is not an Object whose baseType is Document
  • source document's cmis:objectTypeId property value is NOT in the list of AllowedChildObjectTypeIds of the parent-folder specified by parentId
  • versionable attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and a value for the versioningState input parameter is provided that is something other than none
  • versionable attribute of the object type definition specified by the cmis:objectTypeId property value is set to true and the value for the versioningState input parameter is provided that is none
  • controllablePolicy attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one policy is provided
  • controllableACL attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one ACE is provided
  • At least one of the permissions is used in an ACE provided which is not supported by the storage
NameConstraintViolationException - violation is detected with the given cmis:name property value. Storage MAY chose other name which does not conflict
StorageException - if new Document can't be saved in storage cause to storage internal problem

createFolder

public String createFolder(String parentId,
                           Map<String,Property<?>> properties,
                           List<AccessControlEntry> addACL,
                           List<AccessControlEntry> removeACL,
                           Collection<String> policies)
                    throws ObjectNotFoundException,
                           TypeNotFoundException,
                           ConstraintException,
                           NameConstraintViolationException,
                           StorageException
Create a folder object.

Parameters:
parentId - parent folder id for new folder
properties - properties that will be applied to newly created folder
addACL - Access Control Entries that MUST added for newly created Folder, either using the ACL from parentId if specified, or being applied if no parentId is specified. May be null or empty list
removeACL - set Access Control Entry that MUST be removed from the newly created folder, either using the ACL from parentId if specified, or being ignored if no parentId is specified. May be null or empty list
policies - list of policy id that MUST be applied to the newly created folder. May be null or empty collection
Returns:
ID of newly created folder
Throws:
ObjectNotFoundException - if target folder with specified id parentId does not exist
TypeNotFoundException - if type specified by property cmis:objectTypeId does not exist
ConstraintException - if any of following condition are met:
  • cmis:objectTypeId property value is not an object type whose baseType is Folder
  • value of any of the properties violates the min/max/required/length constraints specified in the property definition in the object type
  • cmis:objectTypeId property value is not in the list of AllowedChildObjectTypeIds of the parent-folder specified by parentId
  • controllablePolicy attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one policy is provided
  • controllableACL attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one ACE is provided
  • at least one of the permissions is used in an ACE provided which is not supported by the storage
NameConstraintViolationException - violation is detected with the given cmis:name property value. Storage MAY chose other name which does not conflict.
StorageException - if new Folder can't be saved in storage cause to storage internal problem

createPolicy

public String createPolicy(String parentId,
                           Map<String,Property<?>> properties,
                           List<AccessControlEntry> addACL,
                           List<AccessControlEntry> removeACL,
                           Collection<String> policies)
                    throws ObjectNotFoundException,
                           TypeNotFoundException,
                           ConstraintException,
                           NameConstraintViolationException,
                           StorageException
Create a policy object. 2.2.4.5 createPolicy

Parameters:
parentId - parent folder id should be null if policy object type is not fileable
properties - properties to be applied to newly created Policy
addACL - Access Control Entries that MUST added for newly created Policy, either using the ACL from parentId if specified, or being applied if no parentId is specified. May be null or empty list
removeACL - set Access Control Entry that MUST be removed from the newly created Policy, either using the ACL from parentId if specified, or being ignored if no parentId is specified. May be null or empty list
policies - list of policy id that MUST be applied to the newly created policy. May be null or empty collection
Returns:
ID of newly created policy
Throws:
ObjectNotFoundException - if target folder with specified id parentId does not exist
TypeNotFoundException - if type specified by property cmis:objectTypeId does not exist
ConstraintException - if any of following condition are met:
  • cmis:objectTypeId property value is not an object type whose baseType is Policy
  • value of any of the properties violates the min/max/required/length constraints specified in the property definition in the object type
  • cmis:objectTypeId property value is NOT in the list of AllowedChildObjectTypeIds of the parent-folder specified by parentId
  • controllablePolicy attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one policy is provided
  • controllableACL attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one ACE is provided
  • at least one of the permissions is used in an ACE provided which is not supported by the storage
NameConstraintViolationException - violation is detected with the given cmis:name property value. Storage MAY chose other name which does not conflict
StorageException - if new Policy can't be saved in storage cause to storage internal problem

createRelationship

public String createRelationship(Map<String,Property<?>> properties,
                                 List<AccessControlEntry> addACL,
                                 List<AccessControlEntry> removeACL,
                                 Collection<String> policies)
                          throws ObjectNotFoundException,
                                 TypeNotFoundException,
                                 ConstraintException,
                                 NameConstraintViolationException,
                                 StorageException
Create a relationship object.

Parameters:
properties - properties to be applied to newly created relationship
addACL - set Access Control Entry to be applied for newly created relationship. May be null or empty list
removeACL - set Access Control Entry that MUST be removed from the newly created relationship. May be null or empty list
policies - list of policy id that MUST be applied to the newly created relationship. May be null or empty collection
Returns:
ID of newly created relationship
Throws:
ObjectNotFoundException - if cmis:sourceId or cmis:targetId property value is id of object that can't be found in storage
TypeNotFoundException - if type specified by property cmis:objectTypeId does not exist
ConstraintException - if any of following condition are met:
  • cmis:objectTypeId property value is not an object type whose baseType is Relationship
  • value of any of the properties violates the min/max/required/length constraints specified in the property definition in the object type
  • sourceObjectId ObjectType is not in the list of AllowedSourceTypes specified by the object type definition specified by cmis:objectTypeId property value
  • targetObjectId ObjectType is not in the list of AllowedTargetTypes specified by the object type definition specified by cmis:objectTypeId property value
  • controllablePolicy attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one policy is provided
  • controllableACL attribute of the object type definition specified by the cmis:objectTypeId property value is set to false and at least one ACE is provided
  • at least one of the permissions is used in an ACE provided which is not supported by the storage
NameConstraintViolationException - violation is detected with the given cmis:name property value. Storage MAY chose other name which does not conflict
StorageException - if new Relationship can't be saved in storage cause to storage internal problem

deleteContentStream

public String deleteContentStream(String documentId,
                                  ChangeTokenHolder changeTokenHolder)
                           throws ObjectNotFoundException,
                                  ConstraintException,
                                  UpdateConflictException,
                                  VersioningException,
                                  StorageException
Delete the content stream for the specified Document object.

Parameters:
documentId - document id
changeTokenHolder - is used for optimistic locking and/or concurrency checking to ensure that user updates do not conflict. This parameter must never be null but TokenHolder.getValue() may return null if caller does not provide change token. After successful deleting content stream changeTokenHolder may contains updated change token if backend support this feature
Returns:
ID of updated object
Throws:
NullPointerException - if changeTokenHolder is null
ObjectNotFoundException - if document with specified id documentId does not exist
ConstraintException - if object's type definition contentStreamAllowed attribute is set to required
UpdateConflictException - if update an object that is no longer current. Storage determine this by using change token
VersioningException - if object is a non-current (latest) document version and updatiing other then latest version is not supported
StorageException - if content of document can not be removed cause to storage internal problem

deleteObject

public void deleteObject(String objectId,
                         Boolean deleteAllVersions)
                  throws ObjectNotFoundException,
                         ConstraintException,
                         UpdateConflictException,
                         VersioningException,
                         StorageException
Delete the specified object.

Parameters:
objectId - the object id
deleteAllVersions - if true (Default if not specified) then delete all versions of the document. If false, delete only the document object specified. This parameter will be ignored if parameter when objectId non-document object or non-versionable document
Throws:
ObjectNotFoundException - if object with specified id objectId does not exist
ConstraintException - if objectId is folder that contains one or more children or is root folder
UpdateConflictException - if object that is no longer current (as determined by the storage)
VersioningException - if object can not be removed cause to versioning conflict
StorageException - if object can not be removed cause to storage internal problem

deleteTree

public Collection<String> deleteTree(String folderId,
                                     Boolean deleteAllVersions,
                                     UnfileObject unfileObject,
                                     Boolean continueOnFailure)
                              throws ObjectNotFoundException,
                                     ConstraintException,
                                     UpdateConflictException
Delete the specified folder object and all of its child- and descendant-objects.

Parameters:
folderId - folder id
deleteAllVersions - if true (Default if not specified) then delete all versions of the document. If false, delete only the document object specified. This parameter will be ignored if parameter when objectId non-document object or non-versionable document
unfileObject - an enumeration specifying how the storage MUST process file-able child objects:
  • unfile: Unfile all fileable objects
  • deletesinglefiled: Delete all fileable non-folder objects whose only parent-folders are in the current folder tree. Unfile all other fileable non-folder objects from the current folder tree
  • delete: Delete all fileable objects
continueOnFailure - if true, then the stprage SHOULD continue attempting to perform this operation even if deletion of a child object in the specified folder cannot be deleted. Default is false.
Returns:
list of id that were not deleted
Throws:
ObjectNotFoundException - if folder with specified id folderId does not exist
ConstraintException - if folder with specified id folderId is root folder
UpdateConflictException - if some object(s) that is no longer current (as determined by the storage)

getACL

public List<AccessControlEntry> getACL(String objectId,
                                       boolean onlyBasicPermissions)
                                throws ObjectNotFoundException
Get the ACL currently applied to the specified object. 2.2.10.1 getACL

Parameters:
objectId - identifier of object
onlyBasicPermissions - if true then return only the CMIS Basic permissions
Returns:
actual ACL or empty list if no ACL applied to object
Throws:
ObjectNotFoundException - if objectId or does not exists

getAllowableActions

public AllowableActions getAllowableActions(String objectId)
                                     throws ObjectNotFoundException
Get the list of allowable actions for an Object.

Parameters:
objectId - object id
Returns:
allowable actions for object
Throws:
ObjectNotFoundException - if object with specified id objectId does not exist

getAllVersions

public List<CmisObject> getAllVersions(String versionSeriesId,
                                       boolean includeAllowableActions,
                                       boolean includeObjectInfo,
                                       String propertyFilter)
                                throws ObjectNotFoundException,
                                       FilterNotValidException
Get all documents in version series. 2.2.7.6 getAllVersions

Parameters:
versionSeriesId - version series id
includeAllowableActions - true if allowable actions should be included in response false otherwise
includeObjectInfo - if true then in result must be included external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
Returns:
documents in the specified versionSeriesIdsorted by 'cmis:creationDate' descending. Even not versionable documents must have exactly one document in version series
Throws:
ObjectNotFoundException - if object with specified id versionSeriesId does not exist
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition

getAppliedPolicies

public List<CmisObject> getAppliedPolicies(String objectId,
                                           boolean includeObjectInfo,
                                           String propertyFilter)
                                    throws ObjectNotFoundException,
                                           FilterNotValidException
Gets the list of policies currently applied to the specified object. 2.2.9.3 getAppliedPolicies

Parameters:
objectId - the object id
includeObjectInfo - if true then in result must be included external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
Returns:
list of policy objects. If object has not applied policies that empty list will be returned
Throws:
ObjectNotFoundException - if object with objectId does not exist
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition

getCheckedOutDocs

public ItemsList<CmisObject> getCheckedOutDocs(String folderId,
                                               boolean includeAllowableActions,
                                               IncludeRelationships includeRelationships,
                                               boolean includeObjectInfo,
                                               String propertyFilter,
                                               String renditionFilter,
                                               String orderBy,
                                               int maxItems,
                                               int skipCount)
                                        throws ObjectNotFoundException,
                                               InvalidArgumentException,
                                               FilterNotValidException
Documents that are checked out that the user has access to.

Parameters:
folderId - folder from which get checked-out documents if null get all checked-out documents in storage
includeAllowableActions - if true then allowable actions should be included in response
includeRelationships - indicates what relationships of object must be returned
includeObjectInfo - if true then result must include external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
orderBy - comma-separated list of query names and the ascending modifier 'ASC' or the descending modifier 'DESC' for each query name. A storage's handling of the orderBy input is storage-specific and storage may ignore this parameter if it not able sort items
maxItems - max number of items in response. If -1 then no limit of max items in result set
skipCount - the skip items. Must be equals or greater the 0
Returns:
checked-out documents
Throws:
ObjectNotFoundException - if folderId is not null and object with folderId was not found
InvalidArgumentException - if folderId is id of object that base type is not a Folder
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getChildren

public ItemsList<CmisObject> getChildren(String folderId,
                                         boolean includeAllowableActions,
                                         IncludeRelationships includeRelationships,
                                         boolean includePathSegments,
                                         boolean includeObjectInfo,
                                         String propertyFilter,
                                         String renditionFilter,
                                         String orderBy,
                                         int maxItems,
                                         int skipCount)
                                  throws ObjectNotFoundException,
                                         InvalidArgumentException,
                                         FilterNotValidException
Get the list of child objects contained in the specified folder.

Parameters:
folderId - folder id
includeAllowableActions - if true then allowable actions for each child object should be included in response
includeRelationships - indicates what relationships of object must be returned
includePathSegments - if true then returns a PathSegment for each child object
includeObjectInfo - if true then result must include external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
orderBy - comma-separated list of query names and the ascending modifier 'ASC' or the descending modifier 'DESC' for each query name. A storage's handling of the orderBy input is storage-specific and storage may ignore this parameter if it not able sort items. May be null if sorting is not required
maxItems - max number of items in response. If -1 then no limit of max items in result set
skipCount - the skip items. Must be equals or greater the 0
Returns:
folder's children
Throws:
ObjectNotFoundException - if object with folderId was not found
InvalidArgumentException - if object with id folderId is not a Folder
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getContentChanges

public ItemsList<CmisObject> getContentChanges(ChangeLogTokenHolder changeLogToken,
                                               boolean includeProperties,
                                               String propertyFilter,
                                               boolean includePolicyIDs,
                                               boolean includeAcl,
                                               boolean includeObjectInfo,
                                               int maxItems)
                                        throws ConstraintException,
                                               FilterNotValidException
Gets content changes. This service is intended to be used by search crawlers or other applications that need to efficiently understand what has changed in the storage.

Parameters:
changeLogToken - if ChangeLogTokenHolder#getToken() return value other than null, then change event corresponded to the value of the specified change log token will be returned as the first result in the output. If not specified, then will be returned the first change event recorded in the change log. When set of changes passed is returned then changeLogToken must contains log token corresponded to the last change event. Then it may be used by client for getting next set on change events.
includeProperties - if true, then the result includes the updated property values for 'updated' change events. If false, then the result will not include the updated property values for 'updated' change events. The single exception to this is that the objectId MUST always be included
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties. This parameter will be ignored includeProperties is false
includePolicyIDs - if true, then the include the IDs of Policies applied to the object referenced in each change event, if the change event modified the set of policies applied to the object
includeAcl - if true, then include ACL applied to the object referenced in each change event
includeObjectInfo - if true then result must include external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
maxItems - max number of items in response. If -1 then no limit of max items in result set
Returns:
content changes
Throws:
ConstraintException - if the event corresponding to the change log token provided as an input parameter is no longer available in the change log. (E.g. because the change log was truncated)
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition

getContentStream

public ContentStream getContentStream(String objectId,
                                      String streamId)
                               throws ObjectNotFoundException,
                                      ConstraintException
Get document's content stream.

Parameters:
objectId - object id
streamId - identifier for the rendition stream, when used to get a rendition stream. For Documents, if not provided then this method returns the content stream. For Folders (if Folders supports renditions) this parameter must be provided
Returns:
object's content stream or throws ConstraintException if object has not content stream. Never return null
Throws:
ObjectNotFoundException - if object with specified id objectId does not exist
ConstraintException - if the object specified by objectId does NOT have a content stream or rendition stream

getDescendants

public List<ItemsTree<CmisObject>> getDescendants(String folderId,
                                                  int depth,
                                                  boolean includeAllowableActions,
                                                  IncludeRelationships includeRelationships,
                                                  boolean includePathSegments,
                                                  boolean includeObjectInfo,
                                                  String propertyFilter,
                                                  String renditionFilter)
                                           throws ObjectNotFoundException,
                                                  FilterNotValidException
Get the collection of descendant objects contained in the specified folder and any (according to depth) of its child-folders. 2.2.3.2 getDescendants

Parameters:
folderId - folder id
depth - depth for discover descendants if -1 then discovery descendants at all levels
includeAllowableActions - if true then allowable actions for each object should be included in response
includeRelationships - indicates what relationships of object must be returned
includePathSegments - if true then returns a PathSegment for each child object
includeObjectInfo - if true then result must include external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
Returns:
folder's tree
Throws:
ObjectNotFoundException - if object with folderId was not found
InvalidArgumentException - if object with id folderId is not a Folder or if depth != -1 && !(depth >= 1)
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getFolderParent

public CmisObject getFolderParent(String folderId,
                                  boolean includeObjectInfo,
                                  String propertyFilter)
                           throws ObjectNotFoundException,
                                  FilterNotValidException
Get parent for specified folder. This method MUST NOT be used for getting parents of other fileable objects.

Parameters:
folderId - folder id
includeObjectInfo - if true then result must include external information about object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
Returns:
folder's parent
Throws:
ObjectNotFoundException - if object with folderId was not found
InvalidArgumentException - if the folderId is id of the root folder
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition

getFolderTree

public List<ItemsTree<CmisObject>> getFolderTree(String folderId,
                                                 int depth,
                                                 boolean includeAllowableActions,
                                                 IncludeRelationships includeRelationships,
                                                 boolean includePathSegments,
                                                 boolean includeObjectInfo,
                                                 String propertyFilter,
                                                 String renditionFilter)
                                          throws ObjectNotFoundException,
                                                 FilterNotValidException
Get the collection of descendant folder objects contained in the specified folder and any (according to depth) of its child-folders. 2.2.3.3 getFolderTree

Parameters:
folderId - folder id
depth - depth for discover descendants if -1 then discovery descendants at all levels
includeAllowableActions - if true then allowable actions for each object should be included in response
includeRelationships - indicates what relationships of object must be returned
includePathSegments - if true then returns a PathSegment for each child object
includeObjectInfo - if true then result must include external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
Returns:
folder's tree
Throws:
ObjectNotFoundException - if object with folderId was not found
InvalidArgumentException - if object with id folderId is not a Folder or if depth != -1 && !(depth >= 1)
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getObject

public CmisObject getObject(String objectId,
                            boolean includeAllowableActions,
                            IncludeRelationships includeRelationships,
                            boolean includePolicyIDs,
                            boolean includeAcl,
                            boolean includeObjectInfo,
                            String propertyFilter,
                            String renditionFilter)
                     throws ObjectNotFoundException,
                            FilterNotValidException
Get object.

Parameters:
objectId - object id
includeAllowableActions - if true then include object allowable actions for object
includeRelationships - include object relationships
includePolicyIDs - include policies applied to object
includeAcl - include object's ACL
includeObjectInfo - if true then in result must be included external information about object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document.
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
Returns:
retrieval object
Throws:
ObjectNotFoundException - if object with specified id objectId does not exist
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getObjectByPath

public CmisObject getObjectByPath(String path,
                                  boolean includeAllowableActions,
                                  IncludeRelationships includeRelationships,
                                  boolean includePolicyIDs,
                                  boolean includeAcl,
                                  boolean includeObjectInfo,
                                  String propertyFilter,
                                  String renditionFilter)
                           throws ObjectNotFoundException,
                                  FilterNotValidException
Get object by specified path.

Parameters:
path - object's path
includeAllowableActions - true if allowable actions should be included in response false otherwise
includeRelationships - include object's relationship
includePolicyIDs - include policies IDs applied to object
includeAcl - include ACL
includeObjectInfo - if true then in result must be included external information about object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
Returns:
retrieval object
Throws:
ObjectNotFoundException - if object with specified path does not exist
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getObjectOfLatestVersion

public CmisObject getObjectOfLatestVersion(String versionSeriesId,
                                           boolean major,
                                           boolean includeAllowableActions,
                                           IncludeRelationships includeRelationships,
                                           boolean includePolicyIDs,
                                           boolean includeAcl,
                                           boolean includeObjectInfo,
                                           String propertyFilter,
                                           String renditionFilter)
                                    throws ObjectNotFoundException,
                                           FilterNotValidException
Get the latest Document object in the version series. 2.2.7.4 getObjectOfLatestVersion

Parameters:
versionSeriesId - version series id
major - if true then return the properties for the latest major version object in the Version Series, otherwise return the properties for the latest (major or non-major) version. If the input parameter major is true and the Version Series contains no major versions, then the ObjectNotFoundException will be thrown.
includeAllowableActions - true if allowable actions should be included in response false otherwise
includeRelationships - include object's relationship
includePolicyIDs - include policies IDs applied to object
includeAcl - include ACL
includeObjectInfo - if true then in result must be included external information about object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
Returns:
object of latest version in version series
Throws:
ObjectNotFoundException - if Version Series with id versionSeriesId does not exist or the input parameter major is true and the Version Series contains no major versions.
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getObjectParents

public List<ObjectParent> getObjectParents(String objectId,
                                           boolean includeAllowableActions,
                                           IncludeRelationships includeRelationships,
                                           boolean includeRelativePathSegment,
                                           boolean includeObjectInfo,
                                           String propertyFilter,
                                           String renditionFilter)
                                    throws ObjectNotFoundException,
                                           ConstraintException,
                                           FilterNotValidException
Gets the parent folder(s) for the specified object.

Parameters:
objectId - object id
includeAllowableActions - if true then allowable actions should be included in response
includeRelationships - indicates what relationships of object must be returned
includeRelativePathSegment - if true, returns a PathSegment for each child object
includeObjectInfo - if true then result must include external information about object. See ObjectInfo and ObjectParent.getObject(). Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
Returns:
object's parents. Empty list for unfiled objects or for the root folder
Throws:
ObjectNotFoundException - if object with objectId was not found
ConstraintException - if this method is invoked on an not fileable object
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition or renditionFilter has invalid syntax or contains at least one unknown rendition

getObjectRelationships

public ItemsList<CmisObject> getObjectRelationships(String objectId,
                                                    RelationshipDirection direction,
                                                    String typeId,
                                                    boolean includeSubRelationshipTypes,
                                                    boolean includeAllowableActions,
                                                    boolean includeObjectInfo,
                                                    String propertyFilter,
                                                    int maxItems,
                                                    int skipCount)
                                             throws FilterNotValidException,
                                                    ObjectNotFoundException,
                                                    TypeNotFoundException
Get all or a subset of relationships associated with an independent object.

Parameters:
objectId - object id
direction - relationship direction
typeId - relationship type id. If null then return relationships of all types
includeSubRelationshipTypes - if true, then the return all relationships whose object types are descendant types of typeId.
includeAllowableActions - if true then allowable actions should be included in response
includeObjectInfo - if true then in result must be included external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - property filter as string
maxItems - max number of items in response. If -1 then no limit of max items in result set
skipCount - the skip items. Must be equals or greater the 0
Returns:
object's relationships
Throws:
ObjectNotFoundException - if object with objectId does not exist
TypeNotFoundException - if typeId != null and type typeId does not exist
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition

getProperties

public CmisObject getProperties(String objectId,
                                boolean includeObjectInfo,
                                String propertyFilter)
                         throws ObjectNotFoundException,
                                FilterNotValidException
Get object's properties.

Parameters:
objectId - object id
includeObjectInfo - if true then in result must be included external information about object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
Returns:
CMIS object that contains properties
Throws:
ObjectNotFoundException - if object with specified id objectId does not exist
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition

getPropertiesOfLatestVersion

public CmisObject getPropertiesOfLatestVersion(String versionSeriesId,
                                               boolean major,
                                               boolean includeObjectInfo,
                                               String propertyFilter)
                                        throws FilterNotValidException,
                                               ObjectNotFoundException
Get properties of latest version in version series. 2.2.7.5 getPropertiesOfLatestVersion

Parameters:
versionSeriesId - version series id
major - if true then return the properties for the latest major version object in the Version Series, otherwise return the properties for the latest (major or non-major) version. If the input parameter major is true and the Version Series contains no major versions, then the ObjectNotFoundException will be thrown.
includeObjectInfo - if true then in result must be included external information about object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
propertyFilter - comma-delimited list of property definition Query Names. A wildcard '*' is supported and minds return all properties. If empty string or null provided than storage MAY return storage specific set of properties
Returns:
CMIS object that contains properties of latest version of object in version series
Throws:
ObjectNotFoundException - if Version Series with id versionSeriesId does not exist or the input parameter major is true and the Version Series contains no major versions.
FilterNotValidException - if propertyFilter has invalid syntax or contains at least one property name that is not in object's property definition

getRenditions

public List<Rendition> getRenditions(String objectId,
                                     String renditionFilter,
                                     int maxItems,
                                     int skipCount)
                              throws ObjectNotFoundException,
                                     FilterNotValidException
Get the list of associated Renditions for the specified object. Only rendition attributes are returned, not rendition stream.

Parameters:
objectId - object id
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
maxItems - max number of items in response. If -1 then no limit of max items in result set
skipCount - the skip items. Must be equals or greater then 0
Returns:
object's renditions
Throws:
ObjectNotFoundException - if object with specified objectId does not exist
FilterNotValidException - if renditionFilter has invalid syntax or contains at least one unknown rendition

getStorage

public Storage getStorage()
Gets the storage associated to this connection.

Returns:
storage

getTypeChildren

public ItemsList<TypeDefinition> getTypeChildren(String typeId,
                                                 boolean includePropertyDefinition,
                                                 int maxItems,
                                                 int skipCount)
                                          throws TypeNotFoundException
Set of object types.

Parameters:
typeId - the type id, if not null then return only specified Object Type and its direct descendant. If null then return base types.
includePropertyDefinition - true if property definition should be included false otherwise
maxItems - max number of items in response. If -1 then no limit of max items in result set
skipCount - the skip items. Must be equals or greater then 0
Returns:
list of all base types or specified object type and its direct children
Throws:
TypeNotFoundException - if type typeId does not exist

getTypeDefinition

public TypeDefinition getTypeDefinition(String typeId)
                                 throws TypeNotFoundException
Get type definition for type typeId include property definition, see getTypeDefinition(String, boolean).

Parameters:
typeId - type Id
Returns:
type definition
Throws:
TypeNotFoundException - if type typeId does not exist

getTypeDefinition

public TypeDefinition getTypeDefinition(String typeId,
                                        boolean includePropertyDefinition)
                                 throws TypeNotFoundException
Get type definition for type typeId.

Parameters:
typeId - type Id
includePropertyDefinition - if true property definition should be included
Returns:
type definition
Throws:
TypeNotFoundException - if type typeId does not exist

getTypeDescendants

public List<ItemsTree<TypeDefinition>> getTypeDescendants(String typeId,
                                                          int depth,
                                                          boolean includePropertyDefinition)
                                                   throws TypeNotFoundException
Get all descendants of specified typeId in hierarchy. If typeId is null then return all types and ignore the value of the depth parameter.

Parameters:
typeId - the type id
depth - the depth of level in hierarchy
includePropertyDefinition - true if property definition should be included false otherwise
Returns:
list of descendant types
Throws:
TypeNotFoundException - if type typeId does not exist
InvalidArgumentException - if depth != -1 && !(depth >= 1)

moveObject

public String moveObject(String objectId,
                         String targetFolderId,
                         String sourceFolderId)
                  throws ObjectNotFoundException,
                         NameConstraintViolationException,
                         ConstraintException,
                         UpdateConflictException,
                         VersioningException,
                         StorageException
Moves the specified file-able object from one folder to another.

Parameters:
objectId - object id
targetFolderId - target folder for moving object
sourceFolderId - move object from which object to be moved
Returns:
moved object ID
Throws:
ObjectNotFoundException - if object with objectId or sourceFolderId or targetFolderId were not found
ConstraintException - if type of the given object is NOT in the list of AllowedChildObjectTypeIds of the parent-folder specified by targetFolderId
NameConstraintViolationException - violation is detected with the given cmis:name property value in destination folder
InvalidArgumentException - if the service is invoked with a missing sourceFolderId or the sourceFolderId doesn't match the specified object's parent folder (or one of the parent folders if the storage supports multifiling.).
UpdateConflictException - if object that is no longer current (as determined by the storage)
VersioningException - if object is a non-current (latest) document version
StorageException - if object can not be moved (save changes) cause to storage internal problem

query

public ItemsList<CmisObject> query(String statement,
                                   boolean searchAllVersions,
                                   boolean includeAllowableActions,
                                   IncludeRelationships includeRelationships,
                                   boolean includeObjectInfo,
                                   String renditionFilter,
                                   int maxItems,
                                   int skipCount)
                            throws FilterNotValidException
Executes a CMIS-SQL query statement against the contents of the CMIS Storage.

Parameters:
statement - SQL statement
searchAllVersions - if false, then include latest versions of documents in the query search scope otherwise all versions. If the Storage does not support the optional capabilityAllVersionsSearchable capability, then this parameter value MUST be set to false
includeAllowableActions - if true return allowable actions in request
includeRelationships - indicates what relationships of object must be returned
includeObjectInfo - if true then result must include external information about each object. See ObjectInfo. Particular this info may be used by REST Atom binding for building correct Atom document
renditionFilter - renditions kinds or mimetypes that must be included in result. If null or empty string provided then no renditions will be returned. The Rendition Filter grammar is defined as follows:
        <renditionInclusion> ::= <none> | <wildcard> | <termlist>
        <termlist> ::= <term> | <term> ',' <termlist>
        <term> ::= <kind> | <mimetype>
        <kind> ::= <text>
        <mimetype> ::= <type> '/' <subtype>
        <type> ::= <text>
        <subtype> ::= <text> | <wildcard>
        <text> ::= any char except whitespace
        <wildcard> ::= '*
        <none> ::= 'cmis:none'
 
An inclusion pattern allows:
  • Wildcard : include all associated Renditions
  • Comma-separated list of Rendition kinds or mimetypes : include only those Renditions that match one of the specified kinds or mimetypes
  • cmis:none: exclude all associated Renditions
maxItems - max number of items in response. If -1 then no limit of max items in result set
skipCount - the skip items. Must be equals or greater then 0
Returns:
query results
Throws:
FilterNotValidException - if renditionFilter has invalid syntax or contains unknown rendition kinds or mimetypes

removeObjectFromFolder

public void removeObjectFromFolder(String objectId,
                                   String folderId)
                            throws ObjectNotFoundException
Remove an existing fileable non-folder object from a folder. 2.2.5.2 removeObjectFromFolder

Parameters:
objectId - the id of object to be removed
folderId - the folder from which the object is to be removed. If null, then remove the object from all folders in which it is currently filed. In this case unfiling capability must be supported otherwise NotSupportedException will be thrown
Throws:
ObjectNotFoundException - if objectId or folderId were not found
InvalidArgumentException - if object objectId is not fileable or is folder or if object folderId is not a folder
NotSupportedException - if unfiling capability is not supported by backend storage

removePolicy

public void removePolicy(String policyId,
                         String objectId)
                  throws ConstraintException,
                         ObjectNotFoundException
Removes a specified policy from an object.

Parameters:
policyId - id of policy to be removed from object
objectId - id of object
Throws:
ObjectNotFoundException - if object with objectId does not exist
ConstraintException - if object with id objectId is not controllable by policy
InvalidArgumentException - if object with policyId is not object whose base type is Policy

removeType

public void removeType(String typeId)
                throws TypeNotFoundException,
                       ConstraintException,
                       StorageException
Remove type definition for type typeId .

Parameters:
typeId - type Id
Throws:
TypeNotFoundException - if type typeId does not exist
ConstraintException - if removing type violates a storage constraint. For example, if storage already contains object of this type
StorageException - if type can't be removed (save changes) cause to storage internal problem

setContentStream

public String setContentStream(String documentId,
                               ContentStream content,
                               ChangeTokenHolder changeTokenHolder,
                               Boolean overwriteFlag)
                        throws ObjectNotFoundException,
                               ContentAlreadyExistsException,
                               ConstraintException,
                               StreamNotSupportedException,
                               UpdateConflictException,
                               VersioningException,
                               StorageException
Sets the content stream for the specified Document object.

Parameters:
documentId - document id
content - content stream to be applied to object
changeTokenHolder - is used for optimistic locking and/or concurrency checking to ensure that user updates do not conflict. This parameter must never be null but TokenHolder.getValue() may return null if caller does not provide change token. After successful updating content stream changeTokenHolder may contains updated change token if backend support this feature
overwriteFlag - if true on object's content stream exists it will be overridden. If false and context stream already exists then ContentAlreadyExistsException will be thrown
Returns:
ID of updated object
Throws:
ObjectNotFoundException - if document with specified id documentId does not exist
NullPointerException - if changeTokenHolder is null
ContentAlreadyExistsException - if the input parameter overwriteFlag is false and the Object already has a content-stream
ConstraintException - if document type definition attribute TypeDefinition.getContentStreamAllowed() is 'notallowed' and specified contentStream is other then null or if TypeDefinition.getContentStreamAllowed() attribute is 'required' and contentStream is null
StreamNotSupportedException - will be thrown if the contentStreamAllowed attribute of the object type definition specified by the cmis:objectTypeId property value of the given document is set to not allowed
UpdateConflictException - if update an object that is no longer current. Storage determine this by using change token
VersioningException - if object is a non-current (latest) document version and updatiing other then latest version is not supported
StorageException - if object's content stream can not be updated (save changes) cause to storage internal problem

updateProperties

public String updateProperties(String objectId,
                               ChangeTokenHolder changeTokenHolder,
                               Map<String,Property<?>> properties)
                        throws ObjectNotFoundException,
                               ConstraintException,
                               NameConstraintViolationException,
                               UpdateConflictException,
                               VersioningException,
                               StorageException
Update object properties.

Parameters:
objectId - object id
changeTokenHolder - is used for optimistic locking and/or concurrency checking to ensure that user updates do not conflict. This parameter must never be null but TokenHolder.getValue() may return null if caller does not provide change token. After successful updating properties changeTokenHolder may contains updated change token if backend support this feature
properties - the properties to be applied for object
Returns:
ID of updated object
Throws:
ObjectNotFoundException - if document with specified id objectId does not exist
ConstraintException - if value of any of the properties violates the min/max/required/length constraints specified in the property definition in the object type
NameConstraintViolationException - if cmis:name specified in properties throws conflict
UpdateConflictException - if update an object that is no longer current. Storage determine this by using change token
VersioningException - if any of following conditions are met:
  • The object is not checked out and any of the properties being updated are defined in their object type definition have an attribute value of Updatability 'when checked-out'
  • if object is a non-current (latest) document version and updatiing other then latest version is not supported
StorageException - if object's properties can not be updated (save changes) cause to storage internal problem

checkConnection

protected abstract void checkConnection()
                                 throws IllegalStateException
Check is connection may be used at the moment, e.g. it may be already closed.

Throws:
IllegalStateException - if connection may not be used any more

getCmisObject

protected CmisObject getCmisObject(ObjectData object,
                                   boolean includeAllowableActions,
                                   IncludeRelationships includeRelationships,
                                   boolean includePolicyIds,
                                   boolean includeACL,
                                   boolean includeObjectInfo,
                                   PropertyFilter parsedPropertyFilter,
                                   RenditionFilter parsedRenditionFilter)

validateChangeToken

protected abstract void validateChangeToken(ObjectData object,
                                            String changeToken)
                                     throws UpdateConflictException
Validate change token provided by caller with current change token of object.

Parameters:
object - object
changeToken - change token from 'client'
Throws:
UpdateConflictException - if specified change token does not match to object change token


Copyright © 2011 eXo Platform SAS. All Rights Reserved.