Package org.alfresco.opencmis
Class CMISConnector
java.lang.Object
org.alfresco.opencmis.CMISConnector
- All Implemented Interfaces:
EventListener,TenantDeployer,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
public class CMISConnector
extends Object
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>, TenantDeployer
Bridge connecting Alfresco and OpenCMIS.
This class provides many of the typical services that the
CmisService implementation will need to use Alfresco.- Author:
- florian.mueller, Derek Hulley, steveglover
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final charstatic final Stringstatic final Stringstatic final Stringstatic final charstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSecondaryTypes(NodeRef nodeRef, List<String> secondaryTypes) voidappendContent(CMISNodeInfo nodeInfo, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, boolean isLastChunk) voidapplyACL(NodeRef nodeRef, TypeDefinitionWrapper type, org.apache.chemistry.opencmis.commons.data.Acl aces) Sets the given ACL.voidapplyACL(NodeRef nodeRef, TypeDefinitionWrapper type, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces) Applies the given ACLs.voidapplyPolicies(NodeRef nodeRef, TypeDefinitionWrapper type, List<String> policies) voidapplyVersioningState(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Applies a versioning state to a document.voidcheckChildObjectType(CMISNodeInfo folderInfo, String childType) Checks if a child of a given type can be added to a given folder.constructObjectId(String incomingObjectId) constructObjectId(String incomingNodeId, String versionLabel) constructObjectId(String incomingNodeId, String versionLabel, boolean dropStoreRef) constructObjectId(AssociationRef assocRef, String versionLabel) constructObjectId(AssociationRef assocRef, String versionLabel, boolean dropStoreRef) constructObjectId(NodeRef incomingNodeRef, String versionLabel) constructObjectId(NodeRef incomingNodeRef, String versionLabel, boolean dropStoreRef) org.apache.chemistry.opencmis.commons.data.ObjectDatacreateCMISObject(CMISNodeInfo info, String filter, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, boolean includePolicyIds, boolean includeAcl) Creates the CMIS object for a node.createNodeInfo(String objectId) Creates an object info object.createNodeInfo(AssociationRef assocRef) Creates an object info object.createNodeInfo(NodeRef nodeRef) Creates an object info object.createNodeInfo(NodeRef nodeRef, QName nodeType, Map<QName, Serializable> nodeProps, VersionHistory versionHistory, boolean checkExists) Creates an object info object.createObjectId(NodeRef nodeRef) Compiles a CMIS object if for a live node.createObjectId(NodeRef nodeRef, boolean dropStoreRef) voidcreateThumbnails(NodeRef nodeRef, Set<String> thumbnailNames) Asynchronously generates thumbnails for the given node.voidcreateVersion(NodeRef nodeRef, VersionType versionType, String reason) voiddeleteNode(NodeRef nodeRef, boolean postActivity) voiddestroy()booleandisableBehaviour(QName className) booleandisableBehaviour(QName className, NodeRef nodeRef) booleanenableBehaviour(QName className) booleanenableBehaviour(QName className, NodeRef nodeRef) protected org.apache.chemistry.opencmis.commons.data.AclexcludeInheritedAces(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.data.Acl acl) Filter acl to ignore inherited ACEsvoidextractMetadata(NodeRef nodeRef) Extracts metadata for the node.booleanShould the node be filtered?org.apache.chemistry.opencmis.commons.data.Aclorg.apache.chemistry.opencmis.commons.data.AllowableActionsList<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement>getAspectExtensions(CMISNodeInfo info, String filter, Set<String> alreadySetProperties) Builds aspect extension.org.apache.chemistry.opencmis.commons.data.PropertiesgetAssocProperties(CMISNodeInfo info, String filter) intintintorg.apache.chemistry.opencmis.commons.data.ObjectListgetContentChanges(org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogToken, BigInteger maxItems) Returns content changes.org.apache.chemistry.opencmis.commons.data.ContentStreamgetContentStream(CMISNodeInfo info, String streamId, BigInteger offset, BigInteger length) Gets the content from the repository.getCurrentVersionId(String objectId) Cuts of the version information from an object id.getIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties, String propertyId) Returns the value of the given property if it exists and is of the correct type.Sets the lock service.getNameProperty(org.apache.chemistry.opencmis.commons.data.Properties properties, String fallback) org.apache.chemistry.opencmis.commons.data.PropertiesgetNodeProperties(CMISNodeInfo info, String filter) org.apache.chemistry.opencmis.commons.data.ObjectListgetObjectRelationships(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.enums.RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions, BigInteger maxItems, BigInteger skipCount) getObjectTypeIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties) List<org.apache.chemistry.opencmis.commons.data.ObjectData>getRelationships(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships) List<org.apache.chemistry.opencmis.commons.data.RenditionData>getRenditions(NodeRef nodeRef, String renditionFilter, BigInteger maxItems, BigInteger skipCount) Returns the repository id.org.apache.chemistry.opencmis.commons.data.RepositoryInfogetRepositoryInfo(org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion) Returns the repository info object.org.apache.chemistry.opencmis.commons.enums.CmisVersionReturns the root folder node ref.final ServiceRegistryReturn the service registrygetSortProperty(String cmisPropertyName, String direction) getSourceIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties) getStringProperty(org.apache.chemistry.opencmis.commons.data.Properties properties, String propertyId) Returns the value of the given property if it exists and is of the correct type.getTargetIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties) Returns the type definition of a node ornullif no type definition could be found.getType(AssociationRef assocRef) Returns the type definition of an association ornullif no type definition could be found.Returns the type definition of a node ornullif no type definition could be found.getTypeForCreate(String cmisTypeId, org.apache.chemistry.opencmis.commons.enums.BaseTypeId baseTypeId) Returns the definition after it has checked if the type can be used for object creation.voidinit()booleanvoidonApplicationEvent(org.springframework.context.event.ApplicationContextEvent event) voidvoidbooleanprotected voidpublishReadEvent(NodeRef nodeRef, String name, String mimeType, long contentSize, String encoding, String range) Notifies listeners that a read has taken place.org.apache.chemistry.opencmis.commons.data.ObjectListquery(String statement, Boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, BigInteger maxItems, BigInteger skipCount) voidremoveSecondaryTypes(NodeRef nodeRef, List<String> secondaryTypes) voidsetActionService(ActionService actionService) voidsetActivityPoster(CmisActivityPoster activityPoster) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetAuditService(AuditService auditService) Sets the audit service.voidsetAuthenticationService(AuthenticationService authenticationService) Sets the authentication service.voidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetBulkBatchSize(int size) voidsetBulkMaxItems(int size) Sets bulk update properties.voidsetBulkWorkerThreads(int threads) voidsetCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService) Sets the checkOut/checkIn service.voidsetContentChangesDefaultMaxItems(int contentChangesDefaultMaxItems) Set the default number of content changes to return if nothing is specifiedvoidsetContentService(ContentService contentService) Sets the content service.voidsetDescriptorService(DescriptorService descriptorService) Sets the descriptor service.voidsetDictionaryService(DictionaryService dictionaryService) voidsetEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher) Sets the event publishervoidsetFileFolderService(FileFolderService fileFolderService) Sets the file folder service.voidsetHiddenAspect(HiddenAspect hiddenAspect) voidsetLockService(LockService lockService) voidsetMimetypeService(MimetypeService mimetypeService) Sets the MIME type service.voidsetNamespaceService(NamespaceService namespaceService) Sets the namespace service.voidsetNodeService(NodeService nodeService) Sets the node service.voidsetObjectFilter(ObjectFilter objectFilter) voidsetObjectsDefaultDepth(BigInteger objectsDefaultDepth) voidsetObjectsDefaultMaxItems(BigInteger objectsDefaultMaxItems) voidsetOpenCMISDictionaryService(CMISDictionaryService cmisDictionaryService) voidsetOpenCMISDictionaryService11(CMISDictionaryService cmisDictionaryService) voidsetOpenCMISQueryService(CMISQueryService cmisQueryService) Sets the OpenCMIS query service.voidsetOpenCMISQueryService11(CMISQueryService cmisQueryService) voidsetOpenHttpSession(boolean openHttpSession) voidsetPermissionModelDao(ModelDAO permissionModelDao) Sets the permission model DAO.voidsetPermissionService(PermissionService permissionService) Sets the permission service.voidsetProperties(NodeRef nodeRef, TypeDefinitionWrapper type, org.apache.chemistry.opencmis.commons.data.Properties properties, String... exclude) Sets property values.voidsetProperty(NodeRef nodeRef, TypeDefinitionWrapper type, String propertyId, Serializable value) Sets a property value.voidsetProxyUser(String proxyUser) Not implementedvoidsetRenditionKindMapping(Map<String, List<String>> renditionKinds) Set rendition kind mapping.voidsetrenditionService(RenditionService renditionService) Deprecated.The RenditionService is being replace by the simpler async RenditionService2.voidsetRootPath(String path) Sets the root path.voidsetSearchService(SearchService searchService) Sets the search service.voidsetServiceRegistry(ServiceRegistry serviceRegistry) voidsetSingletonCache(SimpleCache<String, Object> singletonCache) voidsetSiteService(SiteService siteService) voidSets the root store.voidsetTenantAdminService(TenantAdminService tenantAdminService) Sets the tenant admin service.voidsetThumbnailService(ThumbnailService thumbnailService) Deprecated.The thumbnails code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.voidsetTransactionService(TransactionService transactionService) Sets the transaction service.voidsetTypesDefaultDepth(BigInteger typesDefaultDepth) voidsetTypesDefaultMaxItems(BigInteger typesDefaultMaxItems) voidsetup()voidsetVersionService(VersionService versionService) Sets the version service.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
ID_SEPERATOR
public static final char ID_SEPERATOR- See Also:
-
REPLACEMENT_CHAR
public static final char REPLACEMENT_CHAR- See Also:
-
ASSOC_ID_PREFIX
- See Also:
-
PWC_VERSION_LABEL
- See Also:
-
UNVERSIONED_VERSION_LABEL
- See Also:
-
RENDITION_NONE
- See Also:
-
CMIS_CHANGELOG_AUDIT_APPLICATION
- See Also:
-
ALFRESCO_EXTENSION_NAMESPACE
- See Also:
-
CMIS_NAMESPACE
- See Also:
-
ASPECTS
- See Also:
-
SET_ASPECTS
- See Also:
-
APPLIED_ASPECTS
- See Also:
-
ASPECTS_TO_ADD
- See Also:
-
ASPECTS_TO_REMOVE
- See Also:
-
PROPERTIES
- See Also:
-
-
Constructor Details
-
CMISConnector
public CMISConnector()
-
-
Method Details
-
setObjectFilter
-
setStore
Sets the root store.- Parameters:
store- store_type://store_id
-
setSiteService
-
setActivityPoster
-
getActivityPoster
-
setHiddenAspect
-
isHidden
-
setRootPath
Sets the root path.- Parameters:
path- path within default store
-
getTypesDefaultMaxItems
-
setTypesDefaultMaxItems
-
getTypesDefaultDepth
-
setTypesDefaultDepth
-
getObjectsDefaultMaxItems
-
setObjectsDefaultMaxItems
-
getObjectsDefaultDepth
-
setObjectsDefaultDepth
-
setContentChangesDefaultMaxItems
public void setContentChangesDefaultMaxItems(int contentChangesDefaultMaxItems) Set the default number of content changes to return if nothing is specified -
setRenditionKindMapping
Set rendition kind mapping. -
setOpenHttpSession
public void setOpenHttpSession(boolean openHttpSession) -
openHttpSession
public boolean openHttpSession() -
setThumbnailService
Deprecated.The thumbnails code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries. -
setServiceRegistry
-
getServiceRegistry
Return the service registry -
setDescriptorService
Sets the descriptor service. -
getDescriptorService
-
setBehaviourFilter
-
setNodeService
Sets the node service. -
getNodeService
-
setActionService
-
setVersionService
Sets the version service. -
getVersionService
-
setCheckOutCheckInService
Sets the checkOut/checkIn service. -
getCheckOutCheckInService
-
getLockService
Sets the lock service. -
setLockService
-
setContentService
Sets the content service. -
getContentService
-
setEventPublisher
public void setEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher) Sets the event publisher -
setrenditionService
Deprecated.The RenditionService is being replace by the simpler async RenditionService2.Sets the rendition service. -
setFileFolderService
Sets the file folder service. -
getFileFolderService
-
setTenantAdminService
Sets the tenant admin service. -
setSingletonCache
-
setTransactionService
Sets the transaction service. -
getTransactionService
-
setAuthenticationService
Sets the authentication service. -
getAuthenticationService
-
setPermissionService
Sets the permission service. -
setPermissionModelDao
Sets the permission model DAO. -
setOpenCMISDictionaryService
-
setOpenCMISDictionaryService11
-
getOpenCMISDictionaryService
-
setOpenCMISQueryService
Sets the OpenCMIS query service. -
setOpenCMISQueryService11
-
getOpenCMISQueryService
-
setMimetypeService
Sets the MIME type service. -
getMimetypeService
-
setAuditService
Sets the audit service. -
setNamespaceService
Sets the namespace service. -
setSearchService
Sets the search service. -
getSearchService
-
setDictionaryService
-
getDictionaryService
-
setProxyUser
Not implemented- Throws:
UnsupportedOperationException- always
-
getProxyUser
-
setBulkMaxItems
public void setBulkMaxItems(int size) Sets bulk update properties. -
getBulkMaxItems
public int getBulkMaxItems() -
setBulkBatchSize
public void setBulkBatchSize(int size) -
getBulkBatchSize
public int getBulkBatchSize() -
setBulkWorkerThreads
public void setBulkWorkerThreads(int threads) -
getBulkWorkerThreads
public int getBulkWorkerThreads() -
setup
public void setup() -
init
public void init()- Specified by:
initin interfaceTenantDeployer
-
destroy
public void destroy()- Specified by:
destroyin interfaceTenantDeployer
-
onEnableTenant
public void onEnableTenant()- Specified by:
onEnableTenantin interfaceTenantDeployer
-
onDisableTenant
public void onDisableTenant()- Specified by:
onDisableTenantin interfaceTenantDeployer
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
-
getSortProperty
-
createThumbnails
Asynchronously generates thumbnails for the given node.- Parameters:
nodeRef- NodeRef
-
extractMetadata
Extracts metadata for the node.- Parameters:
nodeRef- NodeRef
-
getSite
-
filter
Should the node be filtered? -
disableBehaviour
-
enableBehaviour
-
disableBehaviour
-
enableBehaviour
-
getRootStoreRef
-
deleteNode
-
getRetryingTransactionHelper
-
getRootNodeRef
Returns the root folder node ref. -
getName
-
getCurrentVersionId
Cuts of the version information from an object id. -
createNodeInfo
Creates an object info object. -
createNodeInfo
Creates an object info object. -
createNodeInfo
public CMISNodeInfoImpl createNodeInfo(NodeRef nodeRef, QName nodeType, Map<QName, Serializable> nodeProps, VersionHistory versionHistory, boolean checkExists) Creates an object info object. -
createNodeInfo
Creates an object info object. -
constructObjectId
-
constructObjectId
-
constructObjectId
-
constructObjectId
-
constructObjectId
-
createVersion
-
getRequestCmisVersion
public org.apache.chemistry.opencmis.commons.enums.CmisVersion getRequestCmisVersion() -
constructObjectId
-
constructObjectId
-
createObjectId
Compiles a CMIS object if for a live node. -
createObjectId
-
getType
Returns the type definition of a node ornullif no type definition could be found. -
getType
Returns the type definition of an association ornullif no type definition could be found. -
getType
Returns the type definition of a node ornullif no type definition could be found. -
getTypeForCreate
public TypeDefinitionWrapper getTypeForCreate(String cmisTypeId, org.apache.chemistry.opencmis.commons.enums.BaseTypeId baseTypeId) Returns the definition after it has checked if the type can be used for object creation. -
applyVersioningState
public void applyVersioningState(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.enums.VersioningState versioningState) Applies a versioning state to a document. -
checkChildObjectType
Checks if a child of a given type can be added to a given folder. -
createCMISObject
public org.apache.chemistry.opencmis.commons.data.ObjectData createCMISObject(CMISNodeInfo info, String filter, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, boolean includePolicyIds, boolean includeAcl) Creates the CMIS object for a node. -
getPath
-
getContentStream
public org.apache.chemistry.opencmis.commons.data.ContentStream getContentStream(CMISNodeInfo info, String streamId, BigInteger offset, BigInteger length) Gets the content from the repository. -
publishReadEvent
protected void publishReadEvent(NodeRef nodeRef, String name, String mimeType, long contentSize, String encoding, String range) Notifies listeners that a read has taken place.- Parameters:
nodeRef- NodeRefname- StringmimeType- StringcontentSize- longencoding- Stringrange- String
-
appendContent
public void appendContent(CMISNodeInfo nodeInfo, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, boolean isLastChunk) throws IOException - Throws:
IOException
-
getNodeProperties
public org.apache.chemistry.opencmis.commons.data.Properties getNodeProperties(CMISNodeInfo info, String filter) -
getAssocProperties
public org.apache.chemistry.opencmis.commons.data.Properties getAssocProperties(CMISNodeInfo info, String filter) -
getAspectExtensions
public List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> getAspectExtensions(CMISNodeInfo info, String filter, Set<String> alreadySetProperties) Builds aspect extension. -
getAllowableActions
public org.apache.chemistry.opencmis.commons.data.AllowableActions getAllowableActions(CMISNodeInfo info) -
getRelationships
-
getObjectRelationships
public org.apache.chemistry.opencmis.commons.data.ObjectList getObjectRelationships(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.enums.RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions, BigInteger maxItems, BigInteger skipCount) -
getRenditions
public List<org.apache.chemistry.opencmis.commons.data.RenditionData> getRenditions(NodeRef nodeRef, String renditionFilter, BigInteger maxItems, BigInteger skipCount) -
getACL
public org.apache.chemistry.opencmis.commons.data.Acl getACL(NodeRef nodeRef, boolean onlyBasicPermissions) -
applyACL
public void applyACL(NodeRef nodeRef, TypeDefinitionWrapper type, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces) Applies the given ACLs. -
excludeInheritedAces
protected org.apache.chemistry.opencmis.commons.data.Acl excludeInheritedAces(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.data.Acl acl) Filter acl to ignore inherited ACEs- Parameters:
nodeRef- NodeRefacl- Acl- Returns:
- Acl
-
applyACL
public void applyACL(NodeRef nodeRef, TypeDefinitionWrapper type, org.apache.chemistry.opencmis.commons.data.Acl aces) Sets the given ACL. -
applyPolicies
-
query
public org.apache.chemistry.opencmis.commons.data.ObjectList query(String statement, Boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, String renditionFilter, BigInteger maxItems, BigInteger skipCount) -
setProperties
public void setProperties(NodeRef nodeRef, TypeDefinitionWrapper type, org.apache.chemistry.opencmis.commons.data.Properties properties, String... exclude) Sets property values. -
addSecondaryTypes
-
removeSecondaryTypes
-
setProperty
public void setProperty(NodeRef nodeRef, TypeDefinitionWrapper type, String propertyId, Serializable value) Sets a property value. -
getContentChanges
public org.apache.chemistry.opencmis.commons.data.ObjectList getContentChanges(org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogToken, BigInteger maxItems) Returns content changes. -
getStringProperty
public String getStringProperty(org.apache.chemistry.opencmis.commons.data.Properties properties, String propertyId) Returns the value of the given property if it exists and is of the correct type. -
getIdProperty
public String getIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties, String propertyId) Returns the value of the given property if it exists and is of the correct type. -
getNameProperty
-
getObjectTypeIdProperty
public String getObjectTypeIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties) -
getSourceIdProperty
-
getTargetIdProperty
-
getRepositoryInfo
public org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo(org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion) Returns the repository info object. -
getRepositoryId
Returns the repository id.
-