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