org.alfresco.cmis.mapping
Class CMISServicesImpl

java.lang.Object
  extended by org.alfresco.cmis.mapping.CMISServicesImpl
All Implemented Interfaces:
java.util.EventListener, CMISServices, org.alfresco.repo.tenant.TenantDeployer, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

public class CMISServicesImpl
extends java.lang.Object
implements CMISServices, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener, org.alfresco.repo.tenant.TenantDeployer

CMIS Services Implementation.


Field Summary
 
Fields inherited from interface org.alfresco.cmis.CMISServices
ASSOC_ID_PREFIX
 
Constructor Summary
CMISServicesImpl()
           
 
Method Summary
 void addObjectToFolder(java.lang.String objectId, java.lang.String folderId)
          Adds a secondary child association to an object from a folder.
 void applyPolicy(java.lang.String policyId, java.lang.String objectId)
          Applies a policy object to a target object.
 org.alfresco.service.cmr.repository.NodeRef applyVersioningState(org.alfresco.service.cmr.repository.NodeRef source, CMISVersioningStateEnum versioningState)
          Applies a versioning state to a new node, potentially resulting in a new node.
 void cancelCheckOut(java.lang.String objectId)
          Cancels check out of a private working copy.
 org.alfresco.service.cmr.repository.NodeRef checkIn(java.lang.String objectId, java.lang.String checkinComment, boolean isMajor)
          Checks in a private working copy.
 org.alfresco.service.cmr.repository.NodeRef checkOut(java.lang.String objectId)
          Checks out an object.
 java.lang.String createPolicy(java.util.Map properties, java.lang.String folderId, java.util.List policies)
          Creates a policy object of the specified type, and optionally adds the policy to a folder.
 void deleteContentStream(java.lang.String objectId)
          Deletes a document's content stream.
 void deleteObject(java.lang.String objectId, boolean allVersions)
          Deletes an object.
 java.util.List deleteTree(java.lang.String objectId, boolean continueOnFailure, boolean unfile, boolean deleteAllVersions)
          Deletes a folder and its children, without raising any exceptions.
 void deleteTreeReportLastError(java.lang.String objectId, boolean continueOnFailure, boolean unfile, boolean deleteAllVersions)
          Deletes a folder and its children, raising an exception for the last error encountered.
 void destroy()
           
 java.util.List getAllVersions(java.lang.String objectId)
          Gets all versions of an object.
 java.util.List getAppliedPolicies(java.lang.String objectId, java.lang.String filter)
          Gets the list of policy objects currently applied to a target object.
 java.util.Set getAspects(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Gets the aspects applied to a node.
 java.util.Collection getBaseTypes()
          Gets the CMIS base types.
 org.alfresco.service.cmr.repository.NodeRef[] getCheckedOut(java.lang.String username, org.alfresco.service.cmr.repository.NodeRef folder, boolean includeDescendants, java.lang.String orderBy)
          Query for checked out items
 org.alfresco.service.cmr.repository.NodeRef[] getChildren(org.alfresco.service.cmr.repository.NodeRef parent, CMISTypesFilterEnum typesFilter, java.lang.String orderBy)
          Query for node children
 java.lang.String getCMISSpecTitle()
          Gets the supported CMIS Specification Title
 java.lang.String getCMISVersion()
          Gets the supported CMIS Version
 org.alfresco.service.cmr.repository.NodeRef getDefaultRootNodeRef()
          Gets the default root node ref
 java.lang.String getDefaultRootPath()
          Gets the default root node path
 org.alfresco.service.cmr.repository.StoreRef getDefaultRootStoreRef()
          Gets the default store ref
 org.alfresco.service.cmr.repository.NodeRef getFolder(java.lang.String objectId)
          Gets a folder from an object ID.
 org.alfresco.service.cmr.repository.NodeRef getFolderParent(java.lang.String folderId)
          Gets parent of a folder.
 org.alfresco.service.cmr.repository.NodeRef getLatestVersion(java.lang.String objectId, boolean major)
          Gets the latest version of an object and optionally the latest major version.
 org.alfresco.service.cmr.repository.NodeRef getNode(java.lang.String referenceType, java.lang.String[] reference)
          Finds a NodeRef given a repository reference
 java.lang.Object getObject(java.lang.String objectId, java.lang.Class requiredType, boolean forUpdate, boolean isVersionable, boolean isPwc)
          Gets an object or a required type from an object ID.
 java.util.Map getProperties(org.alfresco.service.cmr.repository.AssociationRef assocRef)
          Get all properties of an association's type.
 java.util.Map getProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get all properties of a node's type.
 java.util.Map getProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, CMISTypeDefinition typeDef)
          Get all of a node's values for the properties in the given type or aspect.
 java.io.Serializable getProperty(org.alfresco.service.cmr.repository.AssociationRef assocRef, java.lang.String propertyName)
          Get a single property for an association.
 java.io.Serializable getProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef, CMISTypeDefinition typeDef, java.lang.String propertyName)
          Get a single property, optionally constrained to a given node type or aspect
 java.io.Serializable getProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String propertyName)
          Get a single property belonging to the node's type.
 java.lang.Object getReadableObject(java.lang.String objectId, java.lang.Class requiredType)
          Gets a readable object of a required type from an object ID.
 org.alfresco.service.cmr.repository.AssociationRef[] getRelationships(org.alfresco.service.cmr.repository.NodeRef node, CMISTypeDefinition relDef, boolean includeSubTypes, CMISRelationshipDirectionEnum direction)
          Query for relationships.
 java.util.Map getRenditions(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String renditionFilter)
          Gets a map of node attributes relating to renditions.
 CMISTypeDefinition getTypeDefinition(org.alfresco.service.cmr.repository.AssociationRef associationRef)
          Gets the type definition for an association.
 CMISTypeDefinition getTypeDefinition(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Gets the type definition for a node.
 CMISTypeDefinition getTypeDefinition(java.lang.Object object)
          Gets the type definition for a given object.
 CMISTypeDefinition getTypeDefinition(java.lang.String typeId)
          Gets the type definition for a given type ID.
 java.lang.Object getVersionSeries(java.lang.String objectId, java.lang.Class requiredType, boolean isVersionable)
          Gets the version series of an object.
 void init()
           
 void moveObject(java.lang.String objectId, java.lang.String targetFolderId, java.lang.String sourceFolderId)
          Moves an object from one folder to another.
 void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
           
 void onDisableTenant()
           
 void onEnableTenant()
           
 void removeObjectFromFolder(java.lang.String objectId, java.lang.String folderId)
          Removes a secondary child association to an object from a folder.
 void removePolicy(java.lang.String policyId, java.lang.String objectId)
          Removes a previously applied policy from a target object.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setAspects(org.alfresco.service.cmr.repository.NodeRef node, java.lang.Iterable aspectsToRemove, java.lang.Iterable aspectsToAdd)
          Sets the aspects on a node (Alfresco extension).
 void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
          Sets the check out check in service.
 void setCMISDictionaryService(CMISDictionaryService cmisDictionaryService)
           
 void setCMISRenditionService(CMISRenditionService cmisRenditionService)
          Sets the cmis rendition service.
 void setCMISSpecTitle(java.lang.String cmisSpecTitle)
          Sets the CMIS specification title
 void setCMISSpecVersion(java.lang.String cmisVersion)
          Sets the supported version of the CMIS specification
 void setContentService(ContentService contentService)
          Sets the content service.
 boolean setContentStream(java.lang.String objectId, org.alfresco.service.namespace.QName propertyQName, boolean overwriteFlag, java.io.InputStream contentStream, java.lang.String mimeType)
          Sets the content stream on an object.
 void setDefaultRootPath(java.lang.String path)
          Sets the default root path
 void setDefaultStore(java.lang.String store)
          Sets the default root store
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setFileFolderService(FileFolderService fileFolderService)
           
 void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
          Sets the mimetype service.
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef, CMISTypeDefinition typeDef, java.lang.String propertyName, java.io.Serializable value)
          Set a single property, optionally constrained to a given node type or aspect
 void setProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String propertyName, java.io.Serializable value)
          Set a single property belonging to the node's type.
 void setRepository(Repository repository)
          Sets the repository.
 void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
           
 void setTenantAdminService(TenantAdminService tenantAdminService)
          Sets the tenant admin service
 void setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
          Sets helper that provides transaction callbacks
 void setVersionService(VersionService versionService)
          Sets the version service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMISServicesImpl

public CMISServicesImpl()
Method Detail

setCMISSpecVersion

public void setCMISSpecVersion(java.lang.String cmisVersion)
Sets the supported version of the CMIS specification

Parameters:
cmisVersion -

setCMISSpecTitle

public void setCMISSpecTitle(java.lang.String cmisSpecTitle)
Sets the CMIS specification title

Parameters:
cmisTitle -

setDefaultStore

public void setDefaultStore(java.lang.String store)
Sets the default root store

Parameters:
store - store_type://store_id

setDefaultRootPath

public void setDefaultRootPath(java.lang.String path)
Sets the default root path

Parameters:
path - path within default store

setTenantAdminService

public void setTenantAdminService(TenantAdminService tenantAdminService)
Sets the tenant admin service


setTransactionHelper

public void setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
Sets helper that provides transaction callbacks


setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Parameters:
namespaceService -

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Parameters:
dictionaryService -

setCMISDictionaryService

public void setCMISDictionaryService(CMISDictionaryService cmisDictionaryService)
Parameters:
cmisDictionaryService -

setSearchService

public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Parameters:
searchService -

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService -

setFileFolderService

public void setFileFolderService(FileFolderService fileFolderService)
Parameters:
fileFolderService -

setContentService

public void setContentService(ContentService contentService)
Sets the content service.

Parameters:
contentService - the content service

setRepository

public void setRepository(Repository repository)
Sets the repository.

Parameters:
repository - the repository

setCMISRenditionService

public void setCMISRenditionService(CMISRenditionService cmisRenditionService)
Sets the cmis rendition service.

Parameters:
cmisRenditionService - the cmis rendition service

setCheckOutCheckInService

public void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
Sets the check out check in service.

Parameters:
checkOutCheckInService - the check out check in service

setVersionService

public void setVersionService(VersionService versionService)
Sets the version service.

Parameters:
versionService - the version service

setMimetypeService

public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Sets the mimetype service.

Parameters:
mimetypeService - the mimetype service

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

onApplicationEvent

public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener

onEnableTenant

public void onEnableTenant()
Specified by:
onEnableTenant in interface org.alfresco.repo.tenant.TenantDeployer

onDisableTenant

public void onDisableTenant()
Specified by:
onDisableTenant in interface org.alfresco.repo.tenant.TenantDeployer

init

public void init()
Specified by:
init in interface org.alfresco.repo.tenant.TenantDeployer

destroy

public void destroy()
Specified by:
destroy in interface org.alfresco.repo.tenant.TenantDeployer

getCMISVersion

public java.lang.String getCMISVersion()
Description copied from interface: CMISServices
Gets the supported CMIS Version

Specified by:
getCMISVersion in interface CMISServices
Returns:
version of CMIS specification supported

getCMISSpecTitle

public java.lang.String getCMISSpecTitle()
Description copied from interface: CMISServices
Gets the supported CMIS Specification Title

Specified by:
getCMISSpecTitle in interface CMISServices
Returns:
CMIS pecification Title

getDefaultRootPath

public java.lang.String getDefaultRootPath()
Description copied from interface: CMISServices
Gets the default root node path

Specified by:
getDefaultRootPath in interface CMISServices
Returns:
root node path

getDefaultRootNodeRef

public org.alfresco.service.cmr.repository.NodeRef getDefaultRootNodeRef()
Description copied from interface: CMISServices
Gets the default root node ref

Specified by:
getDefaultRootNodeRef in interface CMISServices
Returns:
root node ref

getDefaultRootStoreRef

public org.alfresco.service.cmr.repository.StoreRef getDefaultRootStoreRef()
Description copied from interface: CMISServices
Gets the default store ref

Specified by:
getDefaultRootStoreRef in interface CMISServices
Returns:
store ref

getNode

public org.alfresco.service.cmr.repository.NodeRef getNode(java.lang.String referenceType,
                                                           java.lang.String[] reference)
Description copied from interface: CMISServices
Finds a NodeRef given a repository reference

Specified by:
getNode in interface CMISServices
Parameters:
referenceType - node, path
reference - node => id, path => path
Returns:
nodeRef (or null, if not found)

getRenditions

public java.util.Map getRenditions(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                   java.lang.String renditionFilter)
                            throws CMISFilterNotValidException
Description copied from interface: CMISServices
Gets a map of node attributes relating to renditions.

Specified by:
getRenditions in interface CMISServices
Parameters:
nodeRef - the node ref
renditionFilter - the rendition filter
Returns:
the attribute map
Throws:
CMISFilterNotValidException - if the rendition filter is invalid

getChildren

public org.alfresco.service.cmr.repository.NodeRef[] getChildren(org.alfresco.service.cmr.repository.NodeRef parent,
                                                                 CMISTypesFilterEnum typesFilter,
                                                                 java.lang.String orderBy)
                                                          throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Query for node children

Specified by:
getChildren in interface CMISServices
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
Returns:
children of node
Throws:
CMISInvalidArgumentException

getCheckedOut

public org.alfresco.service.cmr.repository.NodeRef[] getCheckedOut(java.lang.String username,
                                                                   org.alfresco.service.cmr.repository.NodeRef folder,
                                                                   boolean includeDescendants,
                                                                   java.lang.String orderBy)
                                                            throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Query for checked out items

Specified by:
getCheckedOut in interface CMISServices
Parameters:
username - for user
folder - (optional) within folder
includeDescendants - true => include descendants of folder, false => only children of folder
orderBy - comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC" for each query name
Returns:
checked out items
Throws:
CMISInvalidArgumentException

getRelationships

public org.alfresco.service.cmr.repository.AssociationRef[] getRelationships(org.alfresco.service.cmr.repository.NodeRef node,
                                                                             CMISTypeDefinition relDef,
                                                                             boolean includeSubTypes,
                                                                             CMISRelationshipDirectionEnum direction)
                                                                      throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Query for relationships.

Specified by:
getRelationships in interface CMISServices
Parameters:
node - the node
relDef - type of relationship to query (or null, for all relationships)
includeSubTypes - the include sub types
direction - limit direction of relationships to query (or null, for both directions)
Returns:
relationships
Throws:
CMISInvalidArgumentException - if an argument is invalid

getProperty

public java.io.Serializable getProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                        java.lang.String propertyName)
                                 throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Get a single property belonging to the node's type.

Specified by:
getProperty in interface CMISServices
Parameters:
nodeRef - the node
propertyName - the property name
Returns:
value
Throws:
CMISInvalidArgumentException - if an argument is invalid

getProperty

public java.io.Serializable getProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                        CMISTypeDefinition typeDef,
                                        java.lang.String propertyName)
                                 throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Get a single property, optionally constrained to a given node type or aspect

Specified by:
getProperty in interface CMISServices
Parameters:
nodeRef - the node
typeDef - the node type or aspect or null if any property can be returned
propertyName - the property name
Returns:
value
Throws:
CMISInvalidArgumentException - if an argument is invalid

getTypeDefinition

public CMISTypeDefinition getTypeDefinition(org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                     throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Gets the type definition for a node.

Specified by:
getTypeDefinition in interface CMISServices
Parameters:
nodeRef - the node
Returns:
the type definition
Throws:
CMISInvalidArgumentException - if an argument is invalid

getTypeDefinition

public CMISTypeDefinition getTypeDefinition(org.alfresco.service.cmr.repository.AssociationRef associationRef)
                                     throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Gets the type definition for an association.

Specified by:
getTypeDefinition in interface CMISServices
Parameters:
associationRef - the association
Returns:
the type definition
Throws:
CMISInvalidArgumentException - if an argument is invalid

getTypeDefinition

public CMISTypeDefinition getTypeDefinition(java.lang.String typeId)
                                     throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Gets the type definition for a given type ID.

Specified by:
getTypeDefinition in interface CMISServices
Parameters:
typeId - the type id
Returns:
the type definition
Throws:
CMISInvalidArgumentException - if an argument is invalid

getTypeDefinition

public CMISTypeDefinition getTypeDefinition(java.lang.Object object)
                                     throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Gets the type definition for a given object.

Specified by:
getTypeDefinition in interface CMISServices
Parameters:
object - the object
Returns:
the type definition
Throws:
CMISInvalidArgumentException - if an argument is invalid

getBaseTypes

public java.util.Collection getBaseTypes()
Description copied from interface: CMISServices
Gets the CMIS base types.

Specified by:
getBaseTypes in interface CMISServices
Returns:
the base types

getProperty

public java.io.Serializable getProperty(org.alfresco.service.cmr.repository.AssociationRef assocRef,
                                        java.lang.String propertyName)
                                 throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Get a single property for an association.

Specified by:
getProperty in interface CMISServices
Parameters:
assocRef - the association
propertyName - the property name
Returns:
value
Throws:
CMISInvalidArgumentException - if an argument is invalid

getProperties

public java.util.Map getProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef)
                            throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Get all properties of a node's type.

Specified by:
getProperties in interface CMISServices
Parameters:
nodeRef - the node ref
Returns:
the properties
Throws:
CMISInvalidArgumentException - if an argument is invalid

getProperties

public java.util.Map getProperties(org.alfresco.service.cmr.repository.AssociationRef assocRef)
                            throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Get all properties of an association's type.

Specified by:
getProperties in interface CMISServices
Parameters:
assocRef - the association
Returns:
the properties
Throws:
CMISInvalidArgumentException - if an argument is invalid

getProperties

public java.util.Map getProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                   CMISTypeDefinition typeDef)
                            throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Get all of a node's values for the properties in the given type or aspect.

Specified by:
getProperties in interface CMISServices
Parameters:
nodeRef - the node ref
typeDef - the type or aspect definition
Returns:
the properties
Throws:
CMISInvalidArgumentException - if an argument is invalid

getAspects

public java.util.Set getAspects(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: CMISServices
Gets the aspects applied to a node.

Specified by:
getAspects in interface CMISServices
Parameters:
nodeRef - the node ref
Returns:
the aspect definitions

setProperty

public void setProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                        java.lang.String propertyName,
                        java.io.Serializable value)
                 throws CMISInvalidArgumentException,
                        CMISConstraintException
Description copied from interface: CMISServices
Set a single property belonging to the node's type.

Specified by:
setProperty in interface CMISServices
Parameters:
nodeRef - the node ref
propertyName - the property name
value - the value
Throws:
CMISInvalidArgumentException - if an argument is invalid
CMISConstraintException - if the property cannot be set

setProperty

public void setProperty(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                        CMISTypeDefinition typeDef,
                        java.lang.String propertyName,
                        java.io.Serializable value)
                 throws CMISInvalidArgumentException,
                        CMISConstraintException
Description copied from interface: CMISServices
Set a single property, optionally constrained to a given node type or aspect

Specified by:
setProperty in interface CMISServices
Parameters:
nodeRef - the node ref
typeDef - the node type or aspect or null if any valid property should be set (corresponding aspect added automatically).
propertyName - the property name
value - the value
Throws:
CMISInvalidArgumentException - if an argument is invalid
CMISConstraintException - if the property cannot be set

setAspects

public void setAspects(org.alfresco.service.cmr.repository.NodeRef node,
                       java.lang.Iterable aspectsToRemove,
                       java.lang.Iterable aspectsToAdd)
                throws CMISInvalidArgumentException
Description copied from interface: CMISServices
Sets the aspects on a node (Alfresco extension).

Specified by:
setAspects in interface CMISServices
Parameters:
node - the node
aspectsToRemove - the aspects to remove
aspectsToAdd - the aspects to add
Throws:
CMISInvalidArgumentException - if an argument is invalid

applyVersioningState

public org.alfresco.service.cmr.repository.NodeRef applyVersioningState(org.alfresco.service.cmr.repository.NodeRef source,
                                                                        CMISVersioningStateEnum versioningState)
                                                                 throws CMISConstraintException,
                                                                        CMISInvalidArgumentException
Description copied from interface: CMISServices
Applies a versioning state to a new node, potentially resulting in a new node.

Specified by:
applyVersioningState in interface CMISServices
Parameters:
source - the node
versioningState - the versioning state
Returns:
the node to write changes to
Throws:
CMISConstraintException - if it's not possible to apply the state
CMISInvalidArgumentException - if an argument is invalid

checkOut

public org.alfresco.service.cmr.repository.NodeRef checkOut(java.lang.String objectId)
                                                     throws CMISConstraintException,
                                                            CMISVersioningException,
                                                            CMISObjectNotFoundException,
                                                            CMISInvalidArgumentException,
                                                            CMISPermissionDeniedException
Description copied from interface: CMISServices
Checks out an object.

Specified by:
checkOut in interface CMISServices
Parameters:
objectId - the object id
Returns:
the resulting private working copy node
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

checkIn

public org.alfresco.service.cmr.repository.NodeRef checkIn(java.lang.String objectId,
                                                           java.lang.String checkinComment,
                                                           boolean isMajor)
                                                    throws CMISConstraintException,
                                                           CMISVersioningException,
                                                           CMISObjectNotFoundException,
                                                           CMISInvalidArgumentException,
                                                           CMISPermissionDeniedException
Description copied from interface: CMISServices
Checks in a private working copy.

Specified by:
checkIn in interface CMISServices
Parameters:
objectId - the object id of the private working copy
checkinComment - the checkin comment
isMajor - Is this a major version?
Returns:
the checked in node
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

cancelCheckOut

public void cancelCheckOut(java.lang.String objectId)
                    throws CMISConstraintException,
                           CMISVersioningException,
                           CMISObjectNotFoundException,
                           CMISInvalidArgumentException,
                           CMISPermissionDeniedException
Description copied from interface: CMISServices
Cancels check out of a private working copy.

Specified by:
cancelCheckOut in interface CMISServices
Parameters:
objectId - the object id of the private working copy
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

getAllVersions

public java.util.List getAllVersions(java.lang.String objectId)
                              throws CMISConstraintException,
                                     CMISVersioningException,
                                     CMISObjectNotFoundException,
                                     CMISInvalidArgumentException,
                                     CMISPermissionDeniedException
Description copied from interface: CMISServices
Gets all versions of an object.

Specified by:
getAllVersions in interface CMISServices
Parameters:
objectId - the object id
Returns:
the all versions
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

getObject

public java.lang.Object getObject(java.lang.String objectId,
                                  java.lang.Class requiredType,
                                  boolean forUpdate,
                                  boolean isVersionable,
                                  boolean isPwc)
                           throws CMISConstraintException,
                                  CMISVersioningException,
                                  CMISObjectNotFoundException,
                                  CMISInvalidArgumentException,
                                  CMISPermissionDeniedException
Description copied from interface: CMISServices
Gets an object or a required type from an object ID. The object's mutability and versioning state will be validated as required.

Specified by:
getObject in interface CMISServices
Parameters:
objectId - the object id
requiredType - the required type (NodeRef.class, Version.class, AssociationRef.class or Object.class)
forUpdate - Do we require to write to this object? If true then the object must not be checked out and must not be a version history node unless the required type is assignable from Version.class.
isVersionable - Should the object be versionable?
isPwc - If isVersionable is true then the object should either be or not be a private working copy, as indicated by this flag
Returns:
the object
Throws:
CMISConstraintException - if the object can't be returned as the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

getReadableObject

public java.lang.Object getReadableObject(java.lang.String objectId,
                                          java.lang.Class requiredType)
                                   throws CMISConstraintException,
                                          CMISVersioningException,
                                          CMISObjectNotFoundException,
                                          CMISInvalidArgumentException,
                                          CMISPermissionDeniedException
Description copied from interface: CMISServices
Gets a readable object of a required type from an object ID. The object may be immutable. Note that version history nodes can be returned as Versions or Nodes.

Specified by:
getReadableObject in interface CMISServices
Parameters:
objectId - the object id
requiredType - the required type (NodeRef.class, Version.class, AssociationRef.class or Object.class)
Returns:
the readable object
Throws:
CMISConstraintException - if the object can't be returned as the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

getFolder

public org.alfresco.service.cmr.repository.NodeRef getFolder(java.lang.String objectId)
                                                      throws CMISConstraintException,
                                                             CMISVersioningException,
                                                             CMISObjectNotFoundException,
                                                             CMISInvalidArgumentException,
                                                             CMISPermissionDeniedException
Description copied from interface: CMISServices
Gets a folder from an object ID.

Specified by:
getFolder in interface CMISServices
Parameters:
objectId - the object id
Returns:
the folder
Throws:
CMISConstraintException - if the object can't be returned as the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

getFolderParent

public org.alfresco.service.cmr.repository.NodeRef getFolderParent(java.lang.String folderId)
                                                            throws CMISConstraintException,
                                                                   CMISVersioningException,
                                                                   CMISObjectNotFoundException,
                                                                   CMISInvalidArgumentException,
                                                                   CMISPermissionDeniedException
Description copied from interface: CMISServices
Gets parent of a folder.

Specified by:
getFolderParent in interface CMISServices
Parameters:
folderId - the folder id
Returns:
the folder parent
Throws:
CMISConstraintException - if the object can't be returned as the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

getVersionSeries

public java.lang.Object getVersionSeries(java.lang.String objectId,
                                         java.lang.Class requiredType,
                                         boolean isVersionable)
                                  throws CMISConstraintException,
                                         CMISVersioningException,
                                         CMISObjectNotFoundException,
                                         CMISInvalidArgumentException,
                                         CMISPermissionDeniedException
Description copied from interface: CMISServices
Gets the version series of an object.

Specified by:
getVersionSeries in interface CMISServices
Parameters:
objectId - the object id
requiredType - the required type (NodeRef.class, Version.class or AssociationRef.class)
isVersionable - Should the object be versionable?
Returns:
the version series
Throws:
CMISConstraintException - if the object can't be returned as the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

getLatestVersion

public org.alfresco.service.cmr.repository.NodeRef getLatestVersion(java.lang.String objectId,
                                                                    boolean major)
                                                             throws CMISConstraintException,
                                                                    CMISVersioningException,
                                                                    CMISObjectNotFoundException,
                                                                    CMISInvalidArgumentException,
                                                                    CMISPermissionDeniedException
Description copied from interface: CMISServices
Gets the latest version of an object and optionally the latest major version.

Specified by:
getLatestVersion in interface CMISServices
Parameters:
objectId - the object id
major - Should we return the latest major version?
Returns:
the latest version
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

deleteContentStream

public void deleteContentStream(java.lang.String objectId)
                         throws CMISConstraintException,
                                CMISVersioningException,
                                CMISObjectNotFoundException,
                                CMISInvalidArgumentException,
                                CMISPermissionDeniedException
Description copied from interface: CMISServices
Deletes a document's content stream.

Specified by:
deleteContentStream in interface CMISServices
Parameters:
objectId - the object id of the document
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

deleteObject

public void deleteObject(java.lang.String objectId,
                         boolean allVersions)
                  throws CMISConstraintException,
                         CMISVersioningException,
                         CMISObjectNotFoundException,
                         CMISInvalidArgumentException,
                         CMISPermissionDeniedException,
                         CMISRuntimeException,
                         CMISServiceException
Description copied from interface: CMISServices
Deletes an object.

Specified by:
deleteObject in interface CMISServices
Parameters:
objectId - the object id
allVersions - if the object is a document, should we delete all versions?
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied
CMISRuntimeException - on other exceptions
CMISServiceException

deleteTree

public java.util.List deleteTree(java.lang.String objectId,
                                 boolean continueOnFailure,
                                 boolean unfile,
                                 boolean deleteAllVersions)
                          throws CMISConstraintException,
                                 CMISVersioningException,
                                 CMISObjectNotFoundException,
                                 CMISInvalidArgumentException,
                                 CMISPermissionDeniedException
Description copied from interface: CMISServices
Deletes a folder and its children, without raising any exceptions.

Specified by:
deleteTree in interface CMISServices
Parameters:
objectId - the folder's object id
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 documents we delete?
Returns:
list of object IDs of the children we failed to delete
Throws:
CMISConstraintException - if the object isn't of the right type
CMISVersioningException - if the object's versioning state isn't as expected
CMISObjectNotFoundException - if the object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to the object is denied

deleteTreeReportLastError

public void deleteTreeReportLastError(java.lang.String objectId,
                                      boolean continueOnFailure,
                                      boolean unfile,
                                      boolean deleteAllVersions)
                               throws CMISServiceException
Description copied from interface: CMISServices
Deletes a folder and its children, raising an exception for the last error encountered.

Specified by:
deleteTreeReportLastError in interface CMISServices
Parameters:
objectId - the folder's object id
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?
Throws:
CMISServiceException - the last error encountered

addObjectToFolder

public void addObjectToFolder(java.lang.String objectId,
                              java.lang.String folderId)
                       throws CMISConstraintException,
                              CMISVersioningException,
                              CMISObjectNotFoundException,
                              CMISInvalidArgumentException,
                              CMISPermissionDeniedException
Description copied from interface: CMISServices
Adds a secondary child association to an object from a folder.

Specified by:
addObjectToFolder in interface CMISServices
Parameters:
objectId - the object id
folderId - the folder id
Throws:
CMISConstraintException - if an object isn't of the right type
CMISVersioningException - if an object's versioning state isn't as expected
CMISObjectNotFoundException - if an object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to an object is denied

removeObjectFromFolder

public void removeObjectFromFolder(java.lang.String objectId,
                                   java.lang.String folderId)
                            throws CMISNotSupportedException,
                                   CMISConstraintException,
                                   CMISVersioningException,
                                   CMISObjectNotFoundException,
                                   CMISInvalidArgumentException,
                                   CMISPermissionDeniedException
Description copied from interface: CMISServices
Removes a secondary child association to an object from a folder.

Specified by:
removeObjectFromFolder in interface CMISServices
Parameters:
objectId - the object id
folderId - the folder id
Throws:
CMISNotSupportedException - if the child association is primary
CMISConstraintException - if an object isn't of the right type
CMISVersioningException - if an object's versioning state isn't as expected
CMISObjectNotFoundException - if an object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to an object is denied

moveObject

public void moveObject(java.lang.String objectId,
                       java.lang.String targetFolderId,
                       java.lang.String sourceFolderId)
                throws CMISConstraintException,
                       CMISVersioningException,
                       CMISObjectNotFoundException,
                       CMISInvalidArgumentException,
                       CMISPermissionDeniedException
Description copied from interface: CMISServices
Moves an object from one folder to another.

Specified by:
moveObject in interface CMISServices
Parameters:
objectId - the object id
targetFolderId - the target folder id
sourceFolderId - the source folder id
Throws:
CMISConstraintException - if an object isn't of the right type
CMISVersioningException - if an object's versioning state isn't as expected
CMISObjectNotFoundException - if an object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to an object is denied

setContentStream

public boolean setContentStream(java.lang.String objectId,
                                org.alfresco.service.namespace.QName propertyQName,
                                boolean overwriteFlag,
                                java.io.InputStream contentStream,
                                java.lang.String mimeType)
                         throws CMISConstraintException,
                                CMISVersioningException,
                                CMISObjectNotFoundException,
                                CMISContentAlreadyExistsException,
                                CMISStreamNotSupportedException,
                                CMISInvalidArgumentException,
                                CMISPermissionDeniedException
Description copied from interface: CMISServices
Sets the content stream on an object.

Specified by:
setContentStream in interface CMISServices
Parameters:
objectId - the object id
propertyQName - the property q name
overwriteFlag - the overwrite flag
contentStream - the content stream
mimeType - the mime type
Returns:
true if content was overwritten
Throws:
CMISConstraintException - if an object isn't of the right type
CMISVersioningException - if an object's versioning state isn't as expected
CMISObjectNotFoundException - if an object does not exist
CMISContentAlreadyExistsException - if overwrite was false and content already existed
CMISStreamNotSupportedException - if the object's type definition does not allow a content stream
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to an object is denied

createPolicy

public java.lang.String createPolicy(java.util.Map properties,
                                     java.lang.String folderId,
                                     java.util.List policies)
                              throws CMISConstraintException,
                                     CMISRuntimeException,
                                     CMISInvalidArgumentException
Description copied from interface: CMISServices
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.

Specified by:
createPolicy in interface CMISServices
Parameters:
properties - CMIS properties
folderId - parent folder for this new policy
policies - the policies
Returns:
Id of the created policy object
Throws:
CMISConstraintException - if there is a problem with the supplied properties
CMISRuntimeException - on other exceptions
CMISInvalidArgumentException - if an argument is invalid

applyPolicy

public void applyPolicy(java.lang.String policyId,
                        java.lang.String objectId)
                 throws CMISConstraintException,
                        CMISVersioningException,
                        CMISObjectNotFoundException,
                        CMISInvalidArgumentException,
                        CMISPermissionDeniedException
Description copied from interface: CMISServices
Applies a policy object to a target object.

Specified by:
applyPolicy in interface CMISServices
Parameters:
policyId - policy Id
objectId - target object Id
Throws:
CMISConstraintException - if an object isn't of the right type
CMISVersioningException - if an object's versioning state isn't as expected
CMISObjectNotFoundException - if an object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to an object is denied

getAppliedPolicies

public java.util.List getAppliedPolicies(java.lang.String objectId,
                                         java.lang.String filter)
                                  throws CMISConstraintException,
                                         CMISVersioningException,
                                         CMISObjectNotFoundException,
                                         CMISInvalidArgumentException,
                                         CMISPermissionDeniedException,
                                         CMISFilterNotValidException
Description copied from interface: CMISServices
Gets the list of policy objects currently applied to a target object.

Specified by:
getAppliedPolicies in interface CMISServices
Parameters:
objectId - the object id
filter - property filter
Returns:
the applied policies
Throws:
CMISConstraintException - if an object isn't of the right type
CMISVersioningException - if an object's versioning state isn't as expected
CMISObjectNotFoundException - if an object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to an object is denied
CMISFilterNotValidException - if the property filter is invalid

removePolicy

public void removePolicy(java.lang.String policyId,
                         java.lang.String objectId)
                  throws CMISConstraintException,
                         CMISVersioningException,
                         CMISObjectNotFoundException,
                         CMISInvalidArgumentException,
                         CMISPermissionDeniedException
Description copied from interface: CMISServices
Removes a previously applied policy from a target object. The policy object is not deleted, and may still be applied to other objects.

Specified by:
removePolicy in interface CMISServices
Parameters:
policyId - policy Id
objectId - target object Id.
Throws:
CMISConstraintException - if an object isn't of the right type
CMISVersioningException - if an object's versioning state isn't as expected
CMISObjectNotFoundException - if an object does not exist
CMISInvalidArgumentException - if an argument is invalid
CMISPermissionDeniedException - if access to an object is denied


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