public class

CMISCloudConnector

extends Object
implements CMISFacade
java.lang.Object
   ↳ org.mule.module.cmis.CMISCloudConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

CMIS (Content Management Interoperability Services) is a standard for improving interoperability between ECM systems.

Summary

Fields
private String baseUrl URL base for the SOAP connector.
private String endpoint The type of endpoint
private CMISFacade facade Reference to a CMISFacade implementation in case you want to use another implementation or initialize the default in a diferent way.
private String password Password
private String repositoryId The identifier for the Repository that this connector instance works with
private String username Username
Public Constructors
CMISCloudConnector()
Public Methods
Acl applyAcl(CmisObject cmisObject, String objectId, List<Ace> addAces, List<Ace> removeAces, AclPropagation aclPropagation)
Set the permissions associated with an object.
void applyPolicy(CmisObject cmisObject, String objectId, List<ObjectId> policyIds)
Applies policies to this object.
void cancelCheckOut(CmisObject document, String documentId)
If applied to a PWC (private working copy) of the document, the check out will be reversed.
ChangeEvents changelog(String changeLogToken, boolean includeProperties)
Gets repository changes.
ObjectId checkIn(CmisObject document, String documentId, Object content, String filename, String mimeType, boolean major, String checkinComment, Map<String, String> properties)
If applied to a PWC (private working copy) it performs a check in.
ObjectId checkOut(CmisObject document, String documentId)
Checks out the document and returns the object id of the PWC (private working copy).
ObjectId createDocumentById(String folderId, String filename, Object content, String mimeType, VersioningState versioningState, String objectType, Map<String, String> properties)
Creates a new document in the repository.
ObjectId createDocumentByPath(String folderPath, String filename, Object content, String mimeType, VersioningState versioningState, String objectType, Map<String, String> properties, boolean force)
Creates a new document in the repository.
ObjectId createFolder(String folderName, String parentObjectId)
Creates a folder.
void delete(CmisObject cmisObject, String objectId, boolean allVersions)
Remove an object

List<String> deleteTree(CmisObject folder, String folderId, boolean allversions, UnfileObject unfile, boolean continueOnFailure)
Deletes a folder and all subfolders.
Object folder(Folder folder, String folderId, NavigationOptions get, Integer depth, String filter, String orderBy)
Navigates the folder structure.
Acl getAcl(CmisObject cmisObject, String objectId)
Returns the ACL if it has been fetched for an object.
List<Document> getAllVersions(CmisObject document, String documentId, String filter, String orderBy)
Retrieve an object's version history

List<Policy> getAppliedPolicies(CmisObject cmisObject, String objectId)
Get the policies that are applied to an object.
String getBaseUrl()
ItemIterable<Document> getCheckoutDocs(String filter, String orderBy)
Retrieve list of checked out documents.
ContentStream getContentStream(CmisObject cmisObject, String objectId)
Retrieves the content stream of a Document.
String getEndpoint()
CMISFacade getFacade()
CmisObject getObjectById(String objectId)
Returns a CMIS object from the repository and puts it into the cache.
CmisObject getObjectByPath(String path)
Returns a CMIS object from the repository and puts it into the cache.
List<Relationship> getObjectRelationships(CmisObject cmisObject, String objectId)
Returns the relationships if they have been fetched for an object.
List<Folder> getParentFolders(CmisObject cmisObject, String objectId)
Retrieves the parent folders of a fileable cmis object

String getPassword()
String getRepositoryId()
ObjectType getTypeDefinition(String typeId)
Returns the type definition of the given type id.
String getUsername()
void initialise()
FileableCmisObject moveObject(FileableCmisObject cmisObject, String objectId, String sourceFolderId, String targetFolderId)
Moves a fileable cmis object from one location to another.
ItemIterable<QueryResult> query(String statement, Boolean searchAllVersions, String filter, String orderBy)
Sends a query to the repository

List<Repository> repositories()
Returns all repositories that are available at the endpoint.
RepositoryInfo repositoryInfo()
Returns information about the CMIS repository, the optional capabilities it supports and its Access Control information if applicable.
void setBaseUrl(String baseUrl)
void setEndpoint(String endpoint)
void setFacade(CMISFacade facade)
void setPassword(String password)
void setRepositoryId(String repositoryId)
void setUsername(String username)
CmisObject updateObjectProperties(CmisObject cmisObject, String objectId, Map<String, String> properties)
Update an object's properties

[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.module.cmis.CMISFacade

Fields

private String baseUrl

URL base for the SOAP connector.

private String endpoint

The type of endpoint

private CMISFacade facade

Reference to a CMISFacade implementation in case you want to use another implementation or initialize the default in a diferent way. Using this option make useless the other attributes.

private String password

Password

private String repositoryId

The identifier for the Repository that this connector instance works with

private String username

Username

Public Constructors

public CMISCloudConnector ()

Public Methods

public Acl applyAcl (CmisObject cmisObject, String objectId, List<Ace> addAces, List<Ace> removeAces, AclPropagation aclPropagation)

Set the permissions associated with an object.

Parameters
cmisObject The object whose Acl is intended to change.
objectId The id of the object
addAces Added access control entities
removeAces Removed access control entities
aclPropagation Wheter to propagate changes or not. can be REPOSITORYDETERMINED | OBJECTONLY | PROPAGATE
Returns
  • the new access control list

public void applyPolicy (CmisObject cmisObject, String objectId, List<ObjectId> policyIds)

Applies policies to this object.

Parameters
cmisObject The document from which to get the stream. Can be null if "objectId" is set.
objectId Id of the document from which to get the stream. Can be null if "object" is set.
policyIds Policy ID's to apply

public void cancelCheckOut (CmisObject document, String documentId)

If applied to a PWC (private working copy) of the document, the check out will be reversed. Otherwise, an exception will be thrown.

Parameters
document The checked out document. Can be null if "documentId" is set.
documentId Id of the checked out document. Can be null if "document" is set.

public ChangeEvents changelog (String changeLogToken, boolean includeProperties)

Gets repository changes.

Parameters
changeLogToken The change log token to start from or null
includeProperties Indicates if changed properties should be included in the result
Returns
  • a ChangeEvents instance

public ObjectId checkIn (CmisObject document, String documentId, Object content, String filename, String mimeType, boolean major, String checkinComment, Map<String, String> properties)

If applied to a PWC (private working copy) it performs a check in. Otherwise, an exception will be thrown.

Parameters
document The document to check-in. Can be null if "documentId" is set.
documentId Id of the document to check-in. Can be null if "document" is set.
content File content (no byte array or input stream for now)
filename Name of the file
mimeType Stream content-type
major Whether it is major
checkinComment Check-in comment
properties Custom properties
Returns
  • the ObjectId of the checkedin document

public ObjectId checkOut (CmisObject document, String documentId)

Checks out the document and returns the object id of the PWC (private working copy).

Parameters
document The document to be checked out. Can be null if "documentId" is set.
documentId Id of the document to be checked out. Can be null if "document" is set.
Returns
  • PWC ObjectId

public ObjectId createDocumentById (String folderId, String filename, Object content, String mimeType, VersioningState versioningState, String objectType, Map<String, String> properties)

Creates a new document in the repository.

Parameters
folderId Folder Object Id
filename Name of the file
content File content (no byte array or input stream for now)
mimeType Stream content-type
versioningState An enumeration specifying what the versioing state of the newly-created object MUST be. If the repository does not support versioning, the repository MUST ignore the versioningState parameter.
objectType The type of the object.
properties The properties optional document properties to set
Returns
  • the ObjectId of the created

public ObjectId createDocumentByPath (String folderPath, String filename, Object content, String mimeType, VersioningState versioningState, String objectType, Map<String, String> properties, boolean force)

Creates a new document in the repository.

Parameters
folderPath Folder in the repository that will hold the document
filename Name of the file
content File content (no byte array or input stream for now)
mimeType Stream content-type
versioningState An enumeration specifying what the versioing state of the newly-created object MUST be. If the repository does not support versioning, the repository MUST ignore the versioningState parameter.
objectType The type of the object.
properties The properties optional document properties to set
force If should folder structure must be created when there are missing intermediate folders
Returns
  • the ObjectId of the created

public ObjectId createFolder (String folderName, String parentObjectId)

Creates a folder. Note that this is not recusive creation. You just create one folder

Parameters
folderName Folder name (eg: "my documents")
parentObjectId Parent folder for the folder being created (eg: repository.rootFolder)
Returns
  • the ObjectId of the created

public void delete (CmisObject cmisObject, String objectId, boolean allVersions)

Remove an object

Parameters
cmisObject The object to be deleted. Can be null if "objectId" is set.
objectId The object's id. Can be null if "cmisObject" is set.
allVersions If true, deletes all version history of the object. Defaults to "false".

public List<String> deleteTree (CmisObject folder, String folderId, boolean allversions, UnfileObject unfile, boolean continueOnFailure)

Deletes a folder and all subfolders.

Parameters
folder Folder Object. Can be null if "folderId" is set.
folderId Folder Object id. Can be null if "folder" is set.
allversions If true, then delete all versions of the document. If false, delete only the document object specified.
unfile Specifies how the repository must process file-able child- or descendant-objects.
continueOnFailure Specified whether to continue attempting to perform this operation even if deletion of a child- or descendant-object in the specified folder cannot be deleted or not.
Returns
  • a list of object ids which failed to be deleted.

public Object folder (Folder folder, String folderId, NavigationOptions get, Integer depth, String filter, String orderBy)

Navigates the folder structure.

Parameters
folder Folder Object. Can be null if "folderId" is set.
folderId Folder Object id. Can be null if "folder" is set.
get NavigationOptions that specifies whether to get the parent folder, the list of immediate children or the whole descendants tree
depth If "get" value is DESCENDANTS, represents the depth of the descendants tree
filter Comma-separated list of properties to filter (only for CHILDREN or DESCENDANTS navigation)
orderBy Comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC" for each query name (only for CHILDREN or DESCENDANTS navigation)
Returns
  • the following, depending on the value of "get" parameter:
    • PARENT: returns the parent Folder
    • CHILDREN: returns a CmisObject ItemIterable with objects contained in the current folder
    • DESCENDANTS: List> representing the whole descentants tree of the current folder
    • TREE: List> representing the directory structure under the current folder.

public Acl getAcl (CmisObject cmisObject, String objectId)

Returns the ACL if it has been fetched for an object.

Parameters
cmisObject The object whose Acl is needed
objectId The id of the object
Returns
  • the object's Acl

public List<Document> getAllVersions (CmisObject document, String documentId, String filter, String orderBy)

Retrieve an object's version history

Parameters
document The document whose versions are to be retrieved
documentId Id of the document whose versions are to be retrieved
filter Comma-separated list of properties to filter (only for CHILDREN or DESCENDANTS navigation)
orderBy Comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC" for each query name (only for CHILDREN or DESCENDANTS navigation)
Returns
  • versions of the document.

public List<Policy> getAppliedPolicies (CmisObject cmisObject, String objectId)

Get the policies that are applied to an object.

Parameters
cmisObject The document from which to get the stream. Can be null if "objectId" is set.
objectId Id of the document from which to get the stream. Can be null if "object" is set.
Returns
  • List of applied policies

public String getBaseUrl ()

public ItemIterable<Document> getCheckoutDocs (String filter, String orderBy)

Retrieve list of checked out documents.

Parameters
filter Comma-separated list of properties to filter
orderBy Comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC" for each query name
Returns
  • list of Document.

public ContentStream getContentStream (CmisObject cmisObject, String objectId)

Retrieves the content stream of a Document.

Parameters
cmisObject The document from which to get the stream. Can be null if "objectId" is set.
objectId Id of the document from which to get the stream. Can be null if "object" is set.
Returns
  • The content stream of the document.

public String getEndpoint ()

public CMISFacade getFacade ()

public CmisObject getObjectById (String objectId)

Returns a CMIS object from the repository and puts it into the cache.

Parameters
objectId The object id
Returns
  • a CmisObject instance

public CmisObject getObjectByPath (String path)

Returns a CMIS object from the repository and puts it into the cache.

Parameters
path Path of the object to retrieve
Returns
  • a CmisObject instance

public List<Relationship> getObjectRelationships (CmisObject cmisObject, String objectId)

Returns the relationships if they have been fetched for an object.

Parameters
cmisObject The object whose relationships are needed
objectId The id of the object
Returns
  • list of the object's relationships

public List<Folder> getParentFolders (CmisObject cmisObject, String objectId)

Retrieves the parent folders of a fileable cmis object

Parameters
cmisObject The object whose parent folders are needed. can be null if "objectId" is set.
objectId Id of the object whose parent folders are needed. can be null if "object" is set.
Returns
  • a list of the object's parent folders.

public String getPassword ()

public String getRepositoryId ()

public ObjectType getTypeDefinition (String typeId)

Returns the type definition of the given type id.

Parameters
typeId Object type Id
Returns
  • type of object ObjectType

public String getUsername ()

public void initialise ()

public FileableCmisObject moveObject (FileableCmisObject cmisObject, String objectId, String sourceFolderId, String targetFolderId)

Moves a fileable cmis object from one location to another. Take into account that a fileable object may be filled in several locations. Thats why you must specify a source folder.

Parameters
cmisObject The object to move. Can be null if "objectId" is set.
objectId The object's id. Can be null if "cmisObject" is set.
sourceFolderId Id of the source folder
targetFolderId Id of the target folder
Returns
  • The object moved (FileableCmisObject)

public ItemIterable<QueryResult> query (String statement, Boolean searchAllVersions, String filter, String orderBy)

Sends a query to the repository

Parameters
statement The query statement (CMIS query language)
searchAllVersions Specifies if the latest and non-latest versions of document objects should be included
filter Comma-separated list of properties to filter
orderBy Comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC" for each query name
Returns
  • an iterable of QueryResult

public List<Repository> repositories ()

Returns all repositories that are available at the endpoint.

Returns
  • a list of Repository.

public RepositoryInfo repositoryInfo ()

Returns information about the CMIS repository, the optional capabilities it supports and its Access Control information if applicable.

Returns
  • a RepositoryInfo instance

public void setBaseUrl (String baseUrl)

Parameters
baseUrl

public void setEndpoint (String endpoint)

Parameters
endpoint

public void setFacade (CMISFacade facade)

Parameters
facade

public void setPassword (String password)

Parameters
password

public void setRepositoryId (String repositoryId)

Parameters
repositoryId

public void setUsername (String username)

Parameters
username

public CmisObject updateObjectProperties (CmisObject cmisObject, String objectId, Map<String, String> properties)

Update an object's properties

Parameters
cmisObject Object to be updated. Can be null if "objectId" is set.
objectId The object's id. Can be null if "cmisObject" is set.
properties The properties to update
Returns
  • The updated object (a repository might have created a new object)