Class: session

.createSession~ session

CmisSession the session is the enrty point for all cmis requests before making any request, session.loadRepository() must be invoked

Constructor

new session()

Methods

(static) addObjectToFolder(objectId, folderId, allVersions, options)

Adds specified object to folder
Parameters:
Name Type Description
objectId String
folderId String
allVersions Boolean
options Object (possible options: succinct, token)

(static) appendContentStream(objectId, content, isLastChunk, options) → {CmisRequest}

Appends content to document
Parameters:
Name Type Description
objectId String
content String/Buffer
isLastChunk Boolean
options Object
Returns:
(possible options: changeToken, succinct, token)
Type
CmisRequest

(static) applyACL(objectId, addACEs, removeACEs, propagation, options)

applies ACL to object
Parameters:
Name Type Description
objectId String
addACEs Object
removeACEs Object
propagation String
options Object (possible options: token)

(static) applyPolicy(objectId, policyId, options)

applies policy to object
Parameters:
Name Type Description
objectId String
policyId String
options Object (possible options: succinct, token)

(static) bulkUpdateProperties(objectIds, properties, addSecondaryTypeIds, removeSecondaryTypeIds, options)

Updates properties of specified objects
Parameters:
Name Type Description
objectIds Array
properties Object
addSecondaryTypeIds Array
removeSecondaryTypeIds Array
options Options (possible options: token)

(static) cancelCheckOut(objectId, options)

cancels a check out
Parameters:
Name Type Description
objectId String
options Object (possible options: token)

(static) checkIn(objectId, major, input, content, comment, policies, addACEs, removeACEs, options)

checks in a document, if needed mimetype may be specified as input['cmis:contentStreamMimeType'] or as option.mimeType
Parameters:
Name Type Description
objectId String
major Boolean
input String/Object if `input` is a string used as the document name, if `input` is an object it must contain required properties: {'cmis:name': 'docName'}
content String/Buffer
comment String
policies Array
addACEs Object
removeACEs Object
options Object

(static) checkOut(objectId, options)

checks out a document
Parameters:
Name Type Description
objectId String
options Object

(static) createDocument(parentId, content, input, mimeType, versioningState, policies, addACEs, removeACEs, options)

creates a new document
Parameters:
Name Type Description
parentId String
content String/Buffer/Blob
input String/Object if `input` is a string used as the document name, if `input` is an object it must contain required properties: {'cmis:name': 'docName', 'cmis:objectTypeId': 'cmis:document'}
mimeType String
versioningState String (if set must be one of: "none", "major", "minor", "checkedout")
policies Object
addACEs Object
removeACEs Object
options Object (possible options: succinct, token)

(static) createDocumentFromSource(parentId, sourceId, content, input, mimeType, versioningState, policies, addACEs, removeACEs, options)

creates a document object as a copy of the given source document
Parameters:
Name Type Description
parentId String
sourceId String
content String/Buffer/Blob
input String/Object if `input` is a string used as the document name, if `input` is an object it must contain required properties: {'cmis:name': 'docName', 'cmis:objectTypeId': 'cmis:document'}
mimeType Stirng
versioningState String (if set must be one of: "none", "major", "minor", "checkedout")
policies Array
addACEs Object
removeACEs Object
options Object (possible options: succinct, token)

(static) createFolder(parentId, input)

creates a new folder
Parameters:
Name Type Description
parentId String
input String/Object if `input` is a string used as the folder name, if `input` is an object it must contain required properties: {'cmis:name': 'aFolder', 'cmis:objectTypeId': 'cmis:folder'}

(static) createItem(folderId, properties, policies, addACEs, removeACEs, options)

Creates an item
Parameters:
Name Type Description
folderId String
properties Object
policies Object
addACEs Object
removeACEs Object
options Object (possible options: succinct, token)

(static) createPolicy(folderId, properties, policies, addACEs, removeACEs, options)

Creates a policy
Parameters:
Name Type Description
folderId String
properties Object
policies Object
addACEs Object
removeACEs Object
options Object (possible options: succinct, token)

(static) createRelationship(properties, policies, addACEs, removeACEs, options)

Creates a relationship
Parameters:
Name Type Description
properties Object
policies Object
addACEs Object
removeACEs Object
options Object (possible options: succinct, token)

(static) createType(type, options)

Creates a new type
Parameters:
Name Type Description
type Object
options Object (possible options: token)

(static) deleteContentStream(objectId, options)

deletes object content
Parameters:
Name Type Description
objectId String
options Object (possible options: changeToken, succinct, token)

(static) deleteObject(objectId, allVersions, options)

deletes an object
Parameters:
Name Type Description
objectId String
allVersions Boolean
options Object (possible options: token)

(static) deleteTree(objectId, allVersions, unfileObjects, continueOnFailure, options)

Deletes a folfder tree
Parameters:
Name Type Description
objectId String
allVersions Boolean
unfileObjects String (if set must be one of 'unfile', 'deletesinglefiled', 'delete')
continueOnFailure Boolean
options Object (possible options: token)

(static) deleteType(typeId, options)

Deletes specified type
Parameters:
Name Type Description
typeId String
options Object (possible options: token)

(static) getACL(objectId, onlyBasicPermissions, options)

gets object ACL
Parameters:
Name Type Description
objectId String
onlyBasicPermissions Boolean
options Object (possible options: token)

(static) getAllowableActions(objectId, options)

Gets the allowable actions of the specified object
Parameters:
Name Type Description
objectId String
options Object (possible options: filter, maxItems, skipCount, orderBy, renditionFilter, includeAllowableActions, includeRelationships, succinct, token)

(static) getAllVersions(options)

gets versions of object
Parameters:
Name Type Description
options Object (possible options: filter, includeAllowableActions, succinct, token)

(static) getAppliedPolicies(objectId, options)

gets object applied policies
Parameters:
Name Type Description
objectId String
options Object (possible options: filter, succinct, token)

(static) getCheckedOutDocs(objectId, options)

gets the documents that have been checked out in the repository
Parameters:
Name Type Description
objectId String
options Object (possible options: filter, maxItems, skipCount, orderBy, renditionFilter, includeAllowableActions, includeRelationships, succinct, token)

(static) getChildren(objectId, options)

Returns children of object specified by id
Parameters:
Name Type Description
objectId String
options Object (possible options: maxItems, skipCount, filter, orderBy, renditionFilter, includeAllowableActions, includeRelationships, includePathSegment, succinct, token)

(static) getContentChanges(changeLogToken, includeProperties, includePolicyIds, includeACL, options)

gets the changed objects, the list object should contain the next change log token.
Parameters:
Name Type Description
changeLogToken String
includeProperties Boolean
includePolicyIds Boolean
includeACL Boolean
options Object (possible options: maxItems, succinct, token)

(static) getContentStream(objectId, download, options)

Gets document content, WARNING: will not work for binary files (images, documents, ecc..)
Parameters:
Name Type Description
objectId String
download Boolean
options Object (possible options: token)

(static) getContentStreamURL(objectId, download, options)

Gets document content URL
Parameters:
Name Type Description
objectId String
download Boolean
options Object (possible options: token)
Returns:
String

(static) getCredentials()

get credentials for authentication
Returns:
username:password

(static) getDescendants(folderId, depth, options)

Gets all descendants of specified folder
Parameters:
Name Type Description
folderId String
depth Integer
options Object (possible options: filter, renditionFilter, includeAllowableActions, includeRelationships, includePathSegment, succinct, token)

(static) getFolderParent(folderId, options)

Gets the parent folder of the specified folder
Parameters:
Name Type Description
folderId String
options Object (possible options: succinct, token)

(static) getFolderTree(folderId, depth, options)

Gets the folder tree of the specified folder
Parameters:
Name Type Description
folderId String
depth Integer
options Object (possible options: filter, renditionFilter, includeAllowableActions, includeRelationships, includePathSegment, succinct, token)

(static) getLastResult(options)

gets last result
Parameters:
Name Type Description
options Object (possible options: token)

(static) getObject(objectId, returnVersion, options)

gets an object by objectId
Parameters:
Name Type Description
objectId String
returnVersion String (if set must be one of 'this', latest' or 'latestmajor')
options Object (possible options: filter, renditionFilter, includeAllowableActions, includeRelationships, includeACL, includePolicyIds, succinct, token)

(static) getObjectByPath(path, options)

gets an object by path
Parameters:
Name Type Description
path String
options Object

(static) getObjectRelationships(objectId, includeSubRelationshipTypes, relationshipDirection, typeId, options)

gets object relationships
Parameters:
Name Type Description
objectId String
includeSubRelationshipTypes Boolean
relationshipDirection String
typeId String
options Object (possible options: maxItems, skipCount, includeAllowableActions, filter, succinct, token)

(static) getParents(folderId, options)

Gets the folders that are the parents of the specified object
Parameters:
Name Type Description
folderId String
options Object (possible options: filter, renditionFilter, includeAllowableActions, includeRelationships, includePathSegment, succinct, token)

(static) getProperties(objectId, returnVersion, options)

Gets the properties of the specified object
Parameters:
Name Type Description
objectId String
returnVersion String (if set must be one of 'this', latest' or 'latestmajor')
options Object (possible options: filter, succinct, token)

(static) getRenditions(objectId, options)

gets document renditions
Parameters:
Name Type Description
objectId String
options Object (possible options: renditionFilter, maxItems, skipCount, token)

(static) getRepositoryInfo(options)

gets repository informations
Parameters:
Name Type Description
options Object (possible options: token)

(static) getToken()

get token for authentication
Returns:
token

(static) getTypeChildren(typeId, includePropertyDefinitions, options)

gets the types that are immediate children of the specified typeId, or the base types if no typeId is provided
Parameters:
Name Type Description
typeId String
includePropertyDefinitions Boolean
options Object (possible options: maxItems, skipCount, token)

(static) getTypeDefinition(typeId, options)

gets definition of the specified type
Parameters:
Name Type Description
typeId String
options Object (possible options: token)

(static) getTypeDescendants(typeId, depth, includePropertyDefinitions, options)

gets all types descended from the specified typeId, or all the types in the repository if no typeId is provided
Parameters:
Name Type Description
typeId String
depth Integer
includePropertyDefinitions Boolean
options Object (possible options: token)

(static) loadRepositories()

Connects to a cmis server and retrieves repositories, token or credentials must already be set

(static) moveObject(objectId, targeFolderId, sourceFolderId, options)

Moves an object
Parameters:
Name Type Description
objectId String
targeFolderId String
sourceFolderId String
options Object (possible options: succinct, token)

(static) query(statement, searchAllversions, options)

performs a cmis query against the repository
Parameters:
Name Type Description
statement String
searchAllversions Boolean
options Object (possible options: maxItems, skipCount, orderBy, renditionFilter, includeAllowableActions, includeRelationships, succinct, token)

(static) removeObjectFromFolder(objectId, folderId, options)

Removes specified object from folder
Parameters:
Name Type Description
objectId String
folderId String
options Object (possible options: succinct, token)

(static) removePolicy(objectId, policyId, options)

removes policy from object
Parameters:
Name Type Description
objectId String
policyId String
options Object (possible options: succinct, token)

(static) setContentStream(objectId, content, overwriteFlag, mimeType, changeToken, options)

Updates content of document
Parameters:
Name Type Description
objectId String
content String/Buffer
overwriteFlag Boolean
mimeType String
changeToken
options Object (possible options: changeToken, succinct, token)

(static) setCredentials(username, password) → {CmisSession}

sets credentials for authentication
Parameters:
Name Type Description
username String
password String
Returns:
Type
CmisSession

(static) setToken(token) → {CmisSession}

sets token for authentication
Parameters:
Name Type Description
token String
Returns:
Type
CmisSession

(static) updateProperties(properties, options)

Updates properties of specified object
Parameters:
Name Type Description
properties Object
options Options (possible options: changeToken, succinct, token)

(static) updateType(type, options)

Updates a type definition
Parameters:
Name Type Description
type Object
options Object (possible options: token)