org.alfresco.repo.cmis.rest
Class CMISScript

java.lang.Object
  extended by org.alfresco.repo.processor.BaseProcessorExtension
      extended by org.alfresco.repo.jscript.BaseScopableProcessorExtension
          extended by org.alfresco.repo.cmis.rest.CMISScript
All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension, org.alfresco.repo.jscript.Scopeable

public class CMISScript
extends org.alfresco.repo.jscript.BaseScopableProcessorExtension

CMIS Javascript API.


Field Summary
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 Summary
CMISScript()
           
 
Method Summary
 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
 
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
 
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARG_CHILD_TYPES

public static final java.lang.String ARG_CHILD_TYPES
See Also:
Constant Field Values

ARG_CONTINUE_ON_FAILURE

public static final java.lang.String ARG_CONTINUE_ON_FAILURE
See Also:
Constant Field Values

ARG_CHECKIN

public static final java.lang.String ARG_CHECKIN
See Also:
Constant Field Values

ARG_CHECKIN_COMMENT

public static final java.lang.String ARG_CHECKIN_COMMENT
See Also:
Constant Field Values

ARG_DEPTH

public static final java.lang.String ARG_DEPTH
See Also:
Constant Field Values

ARG_DIRECTION

public static final java.lang.String ARG_DIRECTION
See Also:
Constant Field Values

ARG_FILTER

public static final java.lang.String ARG_FILTER
See Also:
Constant Field Values

ARG_FOLDER_BY_PATH

public static final java.lang.String ARG_FOLDER_BY_PATH
See Also:
Constant Field Values

ARG_FOLDER_ID

public static final java.lang.String ARG_FOLDER_ID
See Also:
Constant Field Values

ARG_INCLUDE_ALLOWABLE_ACTIONS

public static final java.lang.String ARG_INCLUDE_ALLOWABLE_ACTIONS
See Also:
Constant Field Values

ARG_INCLUDE_PROPERTY_DEFINITIONS

public static final java.lang.String ARG_INCLUDE_PROPERTY_DEFINITIONS
See Also:
Constant Field Values

ARG_INCLUDE_RELATIONSHIPS

public static final java.lang.String ARG_INCLUDE_RELATIONSHIPS
See Also:
Constant Field Values

ARG_INCLUDE_SUB_RELATIONSHIP_TYPES

public static final java.lang.String ARG_INCLUDE_SUB_RELATIONSHIP_TYPES
See Also:
Constant Field Values

ARG_LENGTH

public static final java.lang.String ARG_LENGTH
See Also:
Constant Field Values

ARG_MAJOR

public static final java.lang.String ARG_MAJOR
See Also:
Constant Field Values

ARG_MAJOR_VERSION

public static final java.lang.String ARG_MAJOR_VERSION
See Also:
Constant Field Values

ARG_MAX_ITEMS

public static final java.lang.String ARG_MAX_ITEMS
See Also:
Constant Field Values

ARG_OFFSET

public static final java.lang.String ARG_OFFSET
See Also:
Constant Field Values

ARG_QUERY_STATEMENT

public static final java.lang.String ARG_QUERY_STATEMENT
See Also:
Constant Field Values

ARG_REMOVE_FROM

public static final java.lang.String ARG_REMOVE_FROM
See Also:
Constant Field Values

ARG_RELATIONSHIP_TYPE

public static final java.lang.String ARG_RELATIONSHIP_TYPE
See Also:
Constant Field Values

ARG_REPOSITORY_ID

public static final java.lang.String ARG_REPOSITORY_ID
See Also:
Constant Field Values

ARG_RETURN_VERSION

public static final java.lang.String ARG_RETURN_VERSION
See Also:
Constant Field Values

ARG_SKIP_COUNT

public static final java.lang.String ARG_SKIP_COUNT
See Also:
Constant Field Values

ARG_THIS_VERSION

public static final java.lang.String ARG_THIS_VERSION
See Also:
Constant Field Values

ARG_TYPE_ID

public static final java.lang.String ARG_TYPE_ID
See Also:
Constant Field Values

ARG_TYPES

public static final java.lang.String ARG_TYPES
See Also:
Constant Field Values

ARG_UNFILE_OBJECTS

public static final java.lang.String ARG_UNFILE_OBJECTS
See Also:
Constant Field Values

ARG_VERSIONING_STATE

public static final java.lang.String ARG_VERSIONING_STATE
See Also:
Constant Field Values

ARG_SOURCE_FOLDER_ID

public static final java.lang.String ARG_SOURCE_FOLDER_ID
See Also:
Constant Field Values

ARG_INCLUDE_ACL

public static final java.lang.String ARG_INCLUDE_ACL
See Also:
Constant Field Values

ARG_RENDITION_FILTER

public static final java.lang.String ARG_RENDITION_FILTER
See Also:
Constant Field Values

ARG_CHANGE_LOG_TOKEN

public static final java.lang.String ARG_CHANGE_LOG_TOKEN
See Also:
Constant Field Values

ARG_ORDER_BY

public static final java.lang.String ARG_ORDER_BY
See Also:
Constant Field Values
Constructor Detail

CMISScript

public CMISScript()
Method Detail

setServiceRegistry

public void setServiceRegistry(org.alfresco.service.ServiceRegistry services)
Set the service registry

Parameters:
services - the service registry

setPaging

public void setPaging(Paging paging)
Set the paging helper.

Parameters:
paging - the paging helper

setCMISService

public void setCMISService(org.alfresco.cmis.CMISServices cmisService)
Set the CMIS Service.

Parameters:
cmisService - the cmis service

setCMISDictionaryService

public void setCMISDictionaryService(org.alfresco.cmis.CMISDictionaryService cmisDictionaryService)
Set the CMIS Dictionary Service.

Parameters:
cmisDictionaryService - the cmis dictionary service

setCMISQueryService

public void setCMISQueryService(org.alfresco.cmis.CMISQueryService cmisQueryService)
Set the CMIS Query Service.

Parameters:
cmisQueryService - the cmis query service

setCMISAccessControlService

public void setCMISAccessControlService(org.alfresco.cmis.CMISAccessControlService cmisAccessControlService)
Sets the CMIS access control service.

Parameters:
cmisAccessControlService - the access control service

setCMISChangeLogService

public void setCMISChangeLogService(org.alfresco.cmis.CMISChangeLogService cmisChangeLogService)
Sets the CMIS change log service.

Parameters:
cmisChangeLogService - the change log service

setCMISReferenceFactory

public void setCMISReferenceFactory(ReferenceFactory referenceFactory)
Set the CMIS Reference Factory.

Parameters:
referenceFactory - the reference factory

getVersion

public java.lang.String getVersion()
Gets the supported CMIS Version

Returns:
CMIS version

getSpecTitle

public java.lang.String getSpecTitle()
Gets the supported CMIS Specification Title

Returns:
CMIS Specification Title

getDefaultRootFolderPath

public java.lang.String getDefaultRootFolderPath()
Gets the default root folder path

Returns:
default root folder path

getDefaultRootFolder

public org.alfresco.repo.jscript.ScriptNode getDefaultRootFolder()
Gets the default root folder

Returns:
default root folder

getDefaultTypesFilter

public java.lang.String getDefaultTypesFilter()
Gets the default Types filter

Returns:
default types filter

isValidTypesFilter

public boolean isValidTypesFilter(java.lang.String typesFilter)
Is specified Types filter valid?

Parameters:
typesFilter - types filter
Returns:
true => valid

createRepoReferenceFromUrl

public org.alfresco.cmis.CMISRepositoryReference createRepoReferenceFromUrl(java.util.Map args,
                                                                            java.util.Map templateArgs)
Create CMIS Repository Reference from URL segments

Parameters:
args - url arguments
templateArgs - url template arguments
Returns:
Repository Reference (or null, in case of bad url)

createObjectReferenceFromUrl

public org.alfresco.cmis.CMISObjectReference createObjectReferenceFromUrl(java.util.Map args,
                                                                          java.util.Map templateArgs)
Create CMIS Object Reference from URL segments

Parameters:
args - url arguments
templateArgs - url template arguments
Returns:
Repository Reference (or null, in case of bad url)

createRelationshipReferenceFromUrl

public org.alfresco.cmis.CMISRelationshipReference createRelationshipReferenceFromUrl(java.util.Map args,
                                                                                      java.util.Map templateArgs)
Create CMIS Relationship Reference from URL segments

Parameters:
args - url arguments
templateArgs - url template arguments
Returns:
Repository Reference (or null, in case of bad url)

createObjectIdReference

public org.alfresco.cmis.CMISObjectReference createObjectIdReference(java.lang.String objectId)
Create Object Reference

Parameters:
repo - repository reference
object - id object id (NodeRef.toString() format)
Returns:
object id reference

getNode

public org.alfresco.repo.jscript.ScriptNode getNode(org.alfresco.cmis.CMISObjectReference ref)
Get Node from Object Reference

Parameters:
ref - object reference
Returns:
node

getAssociation

public org.alfresco.repo.jscript.Association getAssociation(org.alfresco.cmis.CMISRelationshipReference ref)
Get Association from Relationship Reference

Parameters:
ref - relationship reference
Returns:
association

queryChildren

public PagedResults queryChildren(org.alfresco.repo.jscript.ScriptNode parent,
                                  java.lang.String typesFilter,
                                  java.lang.String orderBy,
                                  Page page)
Query for node children

Parameters:
parent - node to query children for
typesFilter - types filter
orderBy - comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC" for each query name
page - page to query for
Returns:
paged result set of children

queryRelationships

public 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

Parameters:
node -
relDef -
includeSubTypes -
direction -
page -
Returns:

queryCheckedOut

public 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)

Parameters:
username - user
folder - folder
includeDescendants - true = include descendants
page -
Returns:
paged result set of checked-out items

queryTypeChildren

public 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).

Parameters:
typeDef - the type def
page - the page
Returns:
the paged results

queryType

public org.alfresco.cmis.CMISTypeDefinition queryType(java.lang.String typeId)
Query for a Type Definition given a CMIS Type Id.

Parameters:
typeId - the type id
Returns:
CMIS Type Definition

queryType

public org.alfresco.cmis.CMISTypeDefinition queryType(org.alfresco.repo.jscript.ScriptNode node)
Query the Type Definition for the given Node.

Parameters:
node - the node
Returns:
CMIS Type Definition

queryProperty

public org.alfresco.cmis.CMISPropertyDefinition queryProperty(java.lang.String propertyName)
Query the Property Definition for the given Property.

Parameters:
propertyName - the property name
Returns:
the CMIS property definition

setAspects

public void setAspects(org.alfresco.repo.jscript.ScriptNode node,
                       java.lang.Iterable aspectsToRemove,
                       java.lang.Iterable aspectsToAdd)
Sets the aspects on a node (Alfresco extension).

Parameters:
node - the node
aspectsToRemove - the aspects to remove
aspectsToAdd - the aspects to add
Throws:
org.springframework.extensions.webscripts.WebScriptException - if an argument is invalid

getPwcSearchable

public boolean getPwcSearchable()
Can you query the private working copy of a document.

Returns:
is the PWC searchable?

getAllVersionsSearchable

public boolean getAllVersionsSearchable()
Can you query non-latest versions of a document. The current latest version is always searchable according to the type definition.

Returns:

getQuerySupport

public org.alfresco.cmis.CMISQueryEnum getQuerySupport()
Get the query support level.

Returns:
the query support level

getJoinSupport

public org.alfresco.cmis.CMISJoinEnum getJoinSupport()
Get the join support level in queries.

Returns:
the join support level

query

public PagedResults query(java.lang.String statement,
                          Page page)
Issue query.

Parameters:
statement - query statement
page - the page
Returns:
paged result set

getAclCapability

public org.alfresco.cmis.CMISAclCapabilityEnum getAclCapability()
Gets the ACL capability.

Returns:
the ACL capability

getAclSupportedPermissions

public org.alfresco.cmis.CMISAclSupportedPermissionEnum getAclSupportedPermissions()
Gets the supported permission types.

Returns:
the supported permission types

getAclPropagation

public org.alfresco.cmis.CMISAclPropagationEnum getAclPropagation()
Gets the ACL propagation.

Returns:
the ACL propagation

getRepositoryPermissions

public java.util.List getRepositoryPermissions()
Get all the permissions defined by the repository.

Returns:
a list of permissions

getPermissionMappings

public java.util.List getPermissionMappings()
Get the list of permission mappings.

Returns:
get the permission mapping as defined by the CMIS specification.

getPrincipalAnonymous

public java.lang.String getPrincipalAnonymous()
Gets the name of the principal who is used for anonymous access. This principal can then be passed to the ACL services to specify what permissions anonymous users should have.

Returns:
name of the principal who is used for anonymous access

getPrincipalAnyone

public java.lang.String getPrincipalAnyone()
Gets the name of the principal who is used to indicate any authenticated user. This principal can then be passed to the ACL services to specify what permissions any authenticated user should have.

Returns:
name of the principal who is used to indicate any authenticated user

applyACL

public void applyACL(org.alfresco.repo.jscript.ScriptNode node,
                     java.io.Serializable principalIds,
                     java.io.Serializable permissions)
Applies an ACL to a node.

Parameters:
node - the node
principalIds - the principal IDs
permissions - the permissions for each principal ID

getChangeLogCapability

public org.alfresco.cmis.CMISCapabilityChanges getChangeLogCapability()
Gets the change log capability.

Returns:
the change log capability

getLastChangeLogToken

public java.lang.String getLastChangeLogToken()
Gets the last change log token.

Returns:
the last change log token

getChangesOnType

public java.lang.String[] getChangesOnType()
Gets the list of base types for which changes are available.

Returns:
the list of base types for which changes are available

getChangesIncomplete

public 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.

Returns:
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.

getChangeLog

public org.mozilla.javascript.Scriptable getChangeLog(java.lang.String changeLogToken,
                                                      java.lang.Integer maxItems)
Gets the change log attributes.

Parameters:
changeLogToken - the change log token
maxItems - the maximum number of events to include to return or null
Returns:
the change log attributes

applyVersioningState

public 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.

Parameters:
source - the source
versioningState - the versioning state
Returns:
the node to write changes to
Throws:
org.alfresco.cmis.CMISConstraintException

checkOut

public org.alfresco.repo.jscript.ScriptNode checkOut(java.lang.String objectId)
Checks out an object by ID.

Parameters:
objectId - the object id
Returns:
the private working copy node

checkIn

public 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.

Parameters:
source - the node
checkinComment - the checkin comment
isMajor - is this a major version?
Returns:
the checked-in node

cancelCheckOut

public void cancelCheckOut(org.alfresco.repo.jscript.ScriptNode source)
Cancels a check out.

Parameters:
source - the private working copy

getAllVersions

public org.mozilla.javascript.Scriptable getAllVersions(org.alfresco.repo.jscript.ScriptNode source)
Gets all the versions of a node.

Parameters:
source - the node
Returns:
a Javascript array of all the versions

getReturnVersion

public org.alfresco.repo.jscript.ScriptNode getReturnVersion(org.alfresco.repo.jscript.ScriptNode source,
                                                             java.lang.String returnVersion)
Gets the required version of a node

Parameters:
source - the node
returnVersion - value indicating version required
Returns:
the version

deleteTree

public 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.

Parameters:
source - the folder node
status - the status
continueOnFailure - 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?

deleteContentStream

public void deleteContentStream(org.alfresco.repo.jscript.ScriptNode source)
Deletes a node's content stream.

Parameters:
source - the node

deleteObject

public void deleteObject(org.alfresco.repo.jscript.ScriptNode source,
                         boolean allVersions)
Deletes a node.

Parameters:
source - the node
allVersions - should we delete all the versions of the node?

deleteObject

public void deleteObject(org.alfresco.repo.jscript.Association assoc)
Deletes an association.

Parameters:
assoc - the association

addObjectToFolder

public void addObjectToFolder(org.alfresco.repo.jscript.ScriptNode child,
                              org.alfresco.repo.jscript.ScriptNode parent)
Adds an object to a folder.

Parameters:
child - the object to add
parent - the folder

moveObject

public 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.

Parameters:
child - the object to move
targetFolder - the target folder
sourceFolderId - the source folder object ID

createPolicy

public 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. Currently no policy types can be created in Alfresco.

Parameters:
typeId - the policy type
parent - parent folder for this new policy
Returns:
the created policy object
Throws:
org.springframework.extensions.webscripts.WebScriptException - on error

applyPolicy

public void applyPolicy(java.lang.String policyId,
                        org.alfresco.repo.jscript.ScriptNode target)
Applies a policy object to a target object.

Parameters:
policyId - policy Id
target - target node
Throws:
org.springframework.extensions.webscripts.WebScriptException - on error

getAppliedPolicies

public 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.

Parameters:
source - source node
filter - property filter
Throws:
org.springframework.extensions.webscripts.WebScriptException - on error

removePolicy

public void removePolicy(java.lang.String policyId,
                         java.lang.String objectId)
Removes a previously applied policy from a target object. The policy object is not deleted, and may still be applied to other objects.

Parameters:
policyId - policy Id
objectId - target object Id.
Throws:
org.springframework.extensions.webscripts.WebScriptException - on error


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.