public class CMISScript
extends org.alfresco.repo.jscript.BaseScopableProcessorExtension
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARG_CHANGE_LOG_TOKEN |
static java.lang.String |
ARG_CHECKIN |
static java.lang.String |
ARG_CHECKIN_COMMENT |
static java.lang.String |
ARG_CHILD_TYPES |
static java.lang.String |
ARG_CONTINUE_ON_FAILURE |
static java.lang.String |
ARG_DEPTH |
static java.lang.String |
ARG_DIRECTION |
static java.lang.String |
ARG_FILTER |
static java.lang.String |
ARG_FOLDER_BY_PATH |
static java.lang.String |
ARG_FOLDER_ID |
static java.lang.String |
ARG_INCLUDE_ACL |
static java.lang.String |
ARG_INCLUDE_ALLOWABLE_ACTIONS |
static java.lang.String |
ARG_INCLUDE_PROPERTY_DEFINITIONS |
static java.lang.String |
ARG_INCLUDE_RELATIONSHIPS |
static java.lang.String |
ARG_INCLUDE_SUB_RELATIONSHIP_TYPES |
static java.lang.String |
ARG_LENGTH |
static java.lang.String |
ARG_MAJOR |
static java.lang.String |
ARG_MAJOR_VERSION |
static java.lang.String |
ARG_MAX_ITEMS |
static java.lang.String |
ARG_OFFSET |
static java.lang.String |
ARG_ORDER_BY |
static java.lang.String |
ARG_QUERY_STATEMENT |
static java.lang.String |
ARG_RELATIONSHIP_TYPE |
static java.lang.String |
ARG_REMOVE_FROM |
static java.lang.String |
ARG_RENDITION_FILTER |
static java.lang.String |
ARG_REPOSITORY_ID |
static java.lang.String |
ARG_RETURN_VERSION |
static java.lang.String |
ARG_SKIP_COUNT |
static java.lang.String |
ARG_SOURCE_FOLDER_ID |
static java.lang.String |
ARG_THIS_VERSION |
static java.lang.String |
ARG_TYPE_ID |
static java.lang.String |
ARG_TYPES |
static java.lang.String |
ARG_UNFILE_OBJECTS |
static java.lang.String |
ARG_VERSIONING_STATE |
Constructor and Description |
---|
CMISScript() |
Modifier and Type | Method and Description |
---|---|
void |
addObjectToFolder(org.alfresco.repo.jscript.ScriptNode child,
org.alfresco.repo.jscript.ScriptNode parent)
Adds an object to a folder.
|
void |
applyACL(org.alfresco.repo.jscript.ScriptNode node,
java.io.Serializable principalIds,
java.io.Serializable permissions)
Applies an ACL to a node.
|
void |
applyPolicy(java.lang.String policyId,
org.alfresco.repo.jscript.ScriptNode target)
Applies a policy object to a target object.
|
org.alfresco.repo.jscript.ScriptNode |
applyVersioningState(org.alfresco.repo.jscript.ScriptNode source,
java.lang.String versioningState)
Applies a versioning state to a new node, potentially resulting in a new node.
|
void |
cancelCheckOut(org.alfresco.repo.jscript.ScriptNode source)
Cancels a check out.
|
org.alfresco.repo.jscript.ScriptNode |
checkIn(org.alfresco.repo.jscript.ScriptNode source,
java.lang.String checkinComment,
boolean isMajor)
Checks in a given private working copy node.
|
org.alfresco.repo.jscript.ScriptNode |
checkOut(java.lang.String objectId)
Checks out an object by ID.
|
org.alfresco.cmis.CMISObjectReference |
createObjectIdReference(java.lang.String objectId)
Create Object Reference
|
org.alfresco.cmis.CMISObjectReference |
createObjectReferenceFromUrl(java.util.Map args,
java.util.Map templateArgs)
Create CMIS Object Reference from URL segments
|
org.alfresco.repo.jscript.ScriptNode |
createPolicy(java.lang.String typeId,
org.alfresco.repo.jscript.ScriptNode parent)
Creates a policy object of the specified type, and optionally adds the policy to a folder.
|
org.alfresco.cmis.CMISRelationshipReference |
createRelationshipReferenceFromUrl(java.util.Map args,
java.util.Map templateArgs)
Create CMIS Relationship Reference from URL segments
|
org.alfresco.cmis.CMISRepositoryReference |
createRepoReferenceFromUrl(java.util.Map args,
java.util.Map templateArgs)
Create CMIS Repository Reference from URL segments
|
void |
deleteContentStream(org.alfresco.repo.jscript.ScriptNode source)
Deletes a node's content stream.
|
void |
deleteObject(org.alfresco.repo.jscript.Association assoc)
Deletes an association.
|
void |
deleteObject(org.alfresco.repo.jscript.ScriptNode source,
boolean allVersions)
Deletes a node.
|
void |
deleteTree(org.alfresco.repo.jscript.ScriptNode source,
org.springframework.extensions.webscripts.Status status,
boolean continueOnFailure,
boolean unfile,
boolean deleteAllVersions)
Attempts to delete a folder and all of its children, recording the status in the given status object.
|
org.alfresco.cmis.CMISAclCapabilityEnum |
getAclCapability()
Gets the ACL capability.
|
org.alfresco.cmis.CMISAclPropagationEnum |
getAclPropagation()
Gets the ACL propagation.
|
org.alfresco.cmis.CMISAclSupportedPermissionEnum |
getAclSupportedPermissions()
Gets the supported permission types.
|
org.mozilla.javascript.Scriptable |
getAllVersions(org.alfresco.repo.jscript.ScriptNode source)
Gets all the versions of a node.
|
boolean |
getAllVersionsSearchable()
Can you query non-latest versions of a document.
|
PagedResults |
getAppliedPolicies(org.alfresco.repo.jscript.ScriptNode source,
java.lang.String filter,
Page page)
Gets the list of policy objects currently applied to a target object.
|
org.alfresco.repo.jscript.Association |
getAssociation(org.alfresco.cmis.CMISRelationshipReference ref)
Get Association from Relationship Reference
|
org.mozilla.javascript.Scriptable |
getChangeLog(java.lang.String changeLogToken,
java.lang.Integer maxItems)
Gets the change log attributes.
|
org.alfresco.cmis.CMISCapabilityChanges |
getChangeLogCapability()
Gets the change log capability.
|
boolean |
getChangesIncomplete()
Determines whether the repository's change log can return all changes ever made to any object in the repository
or only changes made after a particular point in time.
|
java.lang.String[] |
getChangesOnType()
Gets the list of base types for which changes are available.
|
org.alfresco.repo.jscript.ScriptNode |
getDefaultRootFolder()
Gets the default root folder
|
java.lang.String |
getDefaultRootFolderPath()
Gets the default root folder path
|
java.lang.String |
getDefaultTypesFilter()
Gets the default Types filter
|
org.alfresco.cmis.CMISJoinEnum |
getJoinSupport()
Get the join support level in queries.
|
java.lang.String |
getLastChangeLogToken()
Gets the last change log token.
|
org.alfresco.repo.jscript.ScriptNode |
getNode(org.alfresco.cmis.CMISObjectReference ref)
Get Node from Object Reference
|
java.util.List |
getPermissionMappings()
Get the list of permission mappings.
|
java.lang.String |
getPrincipalAnonymous()
Gets the name of the principal who is used for anonymous access.
|
java.lang.String |
getPrincipalAnyone()
Gets the name of the principal who is used to indicate any authenticated user.
|
boolean |
getPwcSearchable()
Can you query the private working copy of a document.
|
org.alfresco.cmis.CMISQueryEnum |
getQuerySupport()
Get the query support level.
|
java.util.List |
getRepositoryPermissions()
Get all the permissions defined by the repository.
|
org.alfresco.repo.jscript.ScriptNode |
getReturnVersion(org.alfresco.repo.jscript.ScriptNode source,
java.lang.String returnVersion)
Gets the required version of a node
|
java.lang.String |
getSpecTitle()
Gets the supported CMIS Specification Title
|
java.lang.String |
getVersion()
Gets the supported CMIS Version
|
boolean |
isValidTypesFilter(java.lang.String typesFilter)
Is specified Types filter valid?
|
void |
moveObject(org.alfresco.repo.jscript.ScriptNode child,
org.alfresco.repo.jscript.ScriptNode targetFolder,
java.lang.String sourceFolderId)
Moves an object from a source folder to a target folder.
|
PagedResults |
query(java.lang.String statement,
Page page)
Issue query.
|
PagedResults |
queryCheckedOut(java.lang.String username,
org.alfresco.repo.jscript.ScriptNode folder,
boolean includeDescendants,
Page page)
Query for items checked-out to user within folder (and possibly descendants)
|
PagedResults |
queryChildren(org.alfresco.repo.jscript.ScriptNode parent,
java.lang.String typesFilter,
java.lang.String orderBy,
Page page)
Query for node children
|
org.alfresco.cmis.CMISPropertyDefinition |
queryProperty(java.lang.String propertyName)
Query the Property Definition for the given Property.
|
PagedResults |
queryRelationships(org.alfresco.repo.jscript.ScriptNode node,
org.alfresco.cmis.CMISTypeDefinition relDef,
boolean includeSubTypes,
org.alfresco.cmis.CMISRelationshipDirectionEnum direction,
Page page)
Query for node relationships
|
org.alfresco.cmis.CMISTypeDefinition |
queryType(org.alfresco.repo.jscript.ScriptNode node)
Query the Type Definition for the given Node.
|
org.alfresco.cmis.CMISTypeDefinition |
queryType(java.lang.String typeId)
Query for a Type Definition given a CMIS Type Id.
|
PagedResults |
queryTypeChildren(org.alfresco.cmis.CMISTypeDefinition typeDef,
Page page)
Query for child types (of a given type), or the base types (if no type given).
|
void |
removePolicy(java.lang.String policyId,
java.lang.String objectId)
Removes a previously applied policy from a target object.
|
void |
setAspects(org.alfresco.repo.jscript.ScriptNode node,
java.lang.Iterable aspectsToRemove,
java.lang.Iterable aspectsToAdd)
Sets the aspects on a node (Alfresco extension).
|
void |
setCMISAccessControlService(org.alfresco.cmis.CMISAccessControlService cmisAccessControlService)
Sets the CMIS access control service.
|
void |
setCMISChangeLogService(org.alfresco.cmis.CMISChangeLogService cmisChangeLogService)
Sets the CMIS change log service.
|
void |
setCMISDictionaryService(org.alfresco.cmis.CMISDictionaryService cmisDictionaryService)
Set the CMIS Dictionary Service.
|
void |
setCMISQueryService(org.alfresco.cmis.CMISQueryService cmisQueryService)
Set the CMIS Query Service.
|
void |
setCMISReferenceFactory(ReferenceFactory referenceFactory)
Set the CMIS Reference Factory.
|
void |
setCMISService(org.alfresco.cmis.CMISServices cmisService)
Set the CMIS Service.
|
void |
setPaging(Paging paging)
Set the paging helper.
|
void |
setServiceRegistry(org.alfresco.service.ServiceRegistry services)
Set the service registry
|
getScope, setScope
public static final java.lang.String ARG_CHILD_TYPES
public static final java.lang.String ARG_CONTINUE_ON_FAILURE
public static final java.lang.String ARG_CHECKIN
public static final java.lang.String ARG_CHECKIN_COMMENT
public static final java.lang.String ARG_DEPTH
public static final java.lang.String ARG_DIRECTION
public static final java.lang.String ARG_FILTER
public static final java.lang.String ARG_FOLDER_BY_PATH
public static final java.lang.String ARG_FOLDER_ID
public static final java.lang.String ARG_INCLUDE_ALLOWABLE_ACTIONS
public static final java.lang.String ARG_INCLUDE_PROPERTY_DEFINITIONS
public static final java.lang.String ARG_INCLUDE_RELATIONSHIPS
public static final java.lang.String ARG_INCLUDE_SUB_RELATIONSHIP_TYPES
public static final java.lang.String ARG_LENGTH
public static final java.lang.String ARG_MAJOR
public static final java.lang.String ARG_MAJOR_VERSION
public static final java.lang.String ARG_MAX_ITEMS
public static final java.lang.String ARG_OFFSET
public static final java.lang.String ARG_QUERY_STATEMENT
public static final java.lang.String ARG_REMOVE_FROM
public static final java.lang.String ARG_RELATIONSHIP_TYPE
public static final java.lang.String ARG_REPOSITORY_ID
public static final java.lang.String ARG_RETURN_VERSION
public static final java.lang.String ARG_SKIP_COUNT
public static final java.lang.String ARG_THIS_VERSION
public static final java.lang.String ARG_TYPE_ID
public static final java.lang.String ARG_TYPES
public static final java.lang.String ARG_UNFILE_OBJECTS
public static final java.lang.String ARG_VERSIONING_STATE
public static final java.lang.String ARG_SOURCE_FOLDER_ID
public static final java.lang.String ARG_INCLUDE_ACL
public static final java.lang.String ARG_RENDITION_FILTER
public static final java.lang.String ARG_CHANGE_LOG_TOKEN
public static final java.lang.String ARG_ORDER_BY
public void setServiceRegistry(org.alfresco.service.ServiceRegistry services)
services
- the service registrypublic void setPaging(Paging paging)
paging
- the paging helperpublic void setCMISService(org.alfresco.cmis.CMISServices cmisService)
cmisService
- the cmis servicepublic void setCMISDictionaryService(org.alfresco.cmis.CMISDictionaryService cmisDictionaryService)
cmisDictionaryService
- the cmis dictionary servicepublic void setCMISQueryService(org.alfresco.cmis.CMISQueryService cmisQueryService)
cmisQueryService
- the cmis query servicepublic void setCMISAccessControlService(org.alfresco.cmis.CMISAccessControlService cmisAccessControlService)
cmisAccessControlService
- the access control servicepublic void setCMISChangeLogService(org.alfresco.cmis.CMISChangeLogService cmisChangeLogService)
cmisChangeLogService
- the change log servicepublic void setCMISReferenceFactory(ReferenceFactory referenceFactory)
referenceFactory
- the reference factorypublic java.lang.String getVersion()
public java.lang.String getSpecTitle()
public java.lang.String getDefaultRootFolderPath()
public org.alfresco.repo.jscript.ScriptNode getDefaultRootFolder()
public java.lang.String getDefaultTypesFilter()
public boolean isValidTypesFilter(java.lang.String typesFilter)
typesFilter
- types filterpublic org.alfresco.cmis.CMISRepositoryReference createRepoReferenceFromUrl(java.util.Map args, java.util.Map templateArgs)
args
- url argumentstemplateArgs
- url template argumentspublic org.alfresco.cmis.CMISObjectReference createObjectReferenceFromUrl(java.util.Map args, java.util.Map templateArgs)
args
- url argumentstemplateArgs
- url template argumentspublic org.alfresco.cmis.CMISRelationshipReference createRelationshipReferenceFromUrl(java.util.Map args, java.util.Map templateArgs)
args
- url argumentstemplateArgs
- url template argumentspublic org.alfresco.cmis.CMISObjectReference createObjectIdReference(java.lang.String objectId)
repo
- repository referenceobject
- id object id (NodeRef.toString() format)public org.alfresco.repo.jscript.ScriptNode getNode(org.alfresco.cmis.CMISObjectReference ref)
ref
- object referencepublic org.alfresco.repo.jscript.Association getAssociation(org.alfresco.cmis.CMISRelationshipReference ref)
ref
- relationship referencepublic PagedResults queryChildren(org.alfresco.repo.jscript.ScriptNode parent, java.lang.String typesFilter, java.lang.String orderBy, Page page)
parent
- node to query children fortypesFilter
- types filterorderBy
- comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC"
for each query namepage
- page to query forpublic PagedResults queryRelationships(org.alfresco.repo.jscript.ScriptNode node, org.alfresco.cmis.CMISTypeDefinition relDef, boolean includeSubTypes, org.alfresco.cmis.CMISRelationshipDirectionEnum direction, Page page)
node
- relDef
- includeSubTypes
- direction
- page
- public PagedResults queryCheckedOut(java.lang.String username, org.alfresco.repo.jscript.ScriptNode folder, boolean includeDescendants, Page page)
username
- userfolder
- folderincludeDescendants
- true = include descendantspage
- public PagedResults queryTypeChildren(org.alfresco.cmis.CMISTypeDefinition typeDef, Page page)
typeDef
- the type defpage
- the pagepublic org.alfresco.cmis.CMISTypeDefinition queryType(java.lang.String typeId)
typeId
- the type idpublic org.alfresco.cmis.CMISTypeDefinition queryType(org.alfresco.repo.jscript.ScriptNode node)
node
- the nodepublic org.alfresco.cmis.CMISPropertyDefinition queryProperty(java.lang.String propertyName)
propertyName
- the property namepublic void setAspects(org.alfresco.repo.jscript.ScriptNode node, java.lang.Iterable aspectsToRemove, java.lang.Iterable aspectsToAdd)
node
- the nodeaspectsToRemove
- the aspects to removeaspectsToAdd
- the aspects to addorg.springframework.extensions.webscripts.WebScriptException
- if an argument is invalidpublic boolean getPwcSearchable()
public boolean getAllVersionsSearchable()
public org.alfresco.cmis.CMISQueryEnum getQuerySupport()
public org.alfresco.cmis.CMISJoinEnum getJoinSupport()
public PagedResults query(java.lang.String statement, Page page)
statement
- query statementpage
- the pagepublic org.alfresco.cmis.CMISAclCapabilityEnum getAclCapability()
public org.alfresco.cmis.CMISAclSupportedPermissionEnum getAclSupportedPermissions()
public org.alfresco.cmis.CMISAclPropagationEnum getAclPropagation()
public java.util.List getRepositoryPermissions()
public java.util.List getPermissionMappings()
public java.lang.String getPrincipalAnonymous()
public java.lang.String getPrincipalAnyone()
public void applyACL(org.alfresco.repo.jscript.ScriptNode node, java.io.Serializable principalIds, java.io.Serializable permissions)
node
- the nodeprincipalIds
- the principal IDspermissions
- the permissions for each principal IDpublic org.alfresco.cmis.CMISCapabilityChanges getChangeLogCapability()
public java.lang.String getLastChangeLogToken()
public java.lang.String[] getChangesOnType()
public boolean getChangesIncomplete()
false
if the change log can return all changes ever made to every object.true
if the change log includes all changes made since a particular point in time, but not all changes ever
made.public org.mozilla.javascript.Scriptable getChangeLog(java.lang.String changeLogToken, java.lang.Integer maxItems)
changeLogToken
- the change log tokenmaxItems
- the maximum number of events to include to return or null
public org.alfresco.repo.jscript.ScriptNode applyVersioningState(org.alfresco.repo.jscript.ScriptNode source, java.lang.String versioningState)
source
- the sourceversioningState
- the versioning stateorg.alfresco.cmis.CMISConstraintException
public org.alfresco.repo.jscript.ScriptNode checkOut(java.lang.String objectId)
objectId
- the object idpublic org.alfresco.repo.jscript.ScriptNode checkIn(org.alfresco.repo.jscript.ScriptNode source, java.lang.String checkinComment, boolean isMajor)
source
- the nodecheckinComment
- the checkin commentisMajor
- is this a major version?public void cancelCheckOut(org.alfresco.repo.jscript.ScriptNode source)
source
- the private working copypublic org.mozilla.javascript.Scriptable getAllVersions(org.alfresco.repo.jscript.ScriptNode source)
source
- the nodepublic org.alfresco.repo.jscript.ScriptNode getReturnVersion(org.alfresco.repo.jscript.ScriptNode source, java.lang.String returnVersion)
source
- the nodereturnVersion
- value indicating version requiredpublic void deleteTree(org.alfresco.repo.jscript.ScriptNode source, org.springframework.extensions.webscripts.Status status, boolean continueOnFailure, boolean unfile, boolean deleteAllVersions)
source
- the folder nodestatus
- the statuscontinueOnFailure
- should we continue if an error occurs with one of the children?unfile
- should we remove non-primary associations to nodes rather than delete them?deleteAllVersions
- should we delete all the versions of the nodes we delete?public void deleteContentStream(org.alfresco.repo.jscript.ScriptNode source)
source
- the nodepublic void deleteObject(org.alfresco.repo.jscript.ScriptNode source, boolean allVersions)
source
- the nodeallVersions
- should we delete all the versions of the node?public void deleteObject(org.alfresco.repo.jscript.Association assoc)
assoc
- the associationpublic void addObjectToFolder(org.alfresco.repo.jscript.ScriptNode child, org.alfresco.repo.jscript.ScriptNode parent)
child
- the object to addparent
- the folderpublic void moveObject(org.alfresco.repo.jscript.ScriptNode child, org.alfresco.repo.jscript.ScriptNode targetFolder, java.lang.String sourceFolderId)
child
- the object to movetargetFolder
- the target foldersourceFolderId
- the source folder object IDpublic org.alfresco.repo.jscript.ScriptNode createPolicy(java.lang.String typeId, org.alfresco.repo.jscript.ScriptNode parent)
typeId
- the policy typeparent
- parent folder for this new policyorg.springframework.extensions.webscripts.WebScriptException
- on errorpublic void applyPolicy(java.lang.String policyId, org.alfresco.repo.jscript.ScriptNode target)
policyId
- policy Idtarget
- target nodeorg.springframework.extensions.webscripts.WebScriptException
- on errorpublic PagedResults getAppliedPolicies(org.alfresco.repo.jscript.ScriptNode source, java.lang.String filter, Page page)
source
- source nodefilter
- property filterorg.springframework.extensions.webscripts.WebScriptException
- on errorpublic void removePolicy(java.lang.String policyId, java.lang.String objectId)
policyId
- policy IdobjectId
- target object Id.org.springframework.extensions.webscripts.WebScriptException
- on errorCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.