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
  • Field Details

  • Constructor Details

    • CMISConnector

      public CMISConnector()
  • Method Details

    • setObjectFilter

      public void setObjectFilter(ObjectFilter objectFilter)
    • setStore

      public void setStore(String store)
      Sets the root store.
      Parameters:
      store - store_type://store_id
    • setSiteService

      public void setSiteService(SiteService siteService)
    • setActivityPoster

      public void setActivityPoster(CmisActivityPoster activityPoster)
    • getActivityPoster

      public CmisActivityPoster getActivityPoster()
    • setHiddenAspect

      public void setHiddenAspect(HiddenAspect hiddenAspect)
    • isHidden

      public boolean isHidden(NodeRef nodeRef)
    • setRootPath

      public void setRootPath(String path)
      Sets the root path.
      Parameters:
      path - path within default store
    • getTypesDefaultMaxItems

      public BigInteger getTypesDefaultMaxItems()
    • setTypesDefaultMaxItems

      public void setTypesDefaultMaxItems(BigInteger typesDefaultMaxItems)
    • getTypesDefaultDepth

      public BigInteger getTypesDefaultDepth()
    • setTypesDefaultDepth

      public void setTypesDefaultDepth(BigInteger typesDefaultDepth)
    • getObjectsDefaultMaxItems

      public BigInteger getObjectsDefaultMaxItems()
    • setObjectsDefaultMaxItems

      public void setObjectsDefaultMaxItems(BigInteger objectsDefaultMaxItems)
    • getObjectsDefaultDepth

      public BigInteger getObjectsDefaultDepth()
    • setObjectsDefaultDepth

      public void setObjectsDefaultDepth(BigInteger objectsDefaultDepth)
    • setContentChangesDefaultMaxItems

      public void setContentChangesDefaultMaxItems(int contentChangesDefaultMaxItems)
      Set the default number of content changes to return if nothing is specified
    • setRenditionKindMapping

      public void setRenditionKindMapping(Map<String,List<String>> renditionKinds)
      Set rendition kind mapping.
    • setOpenHttpSession

      public void setOpenHttpSession(boolean openHttpSession)
    • openHttpSession

      public boolean openHttpSession()
    • setThumbnailService

      @Deprecated public void setThumbnailService(ThumbnailService thumbnailService)
      Deprecated.
      The thumbnails code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.
    • setServiceRegistry

      public void setServiceRegistry(ServiceRegistry serviceRegistry)
    • getServiceRegistry

      public final ServiceRegistry getServiceRegistry()
      Return the service registry
    • setDescriptorService

      public void setDescriptorService(DescriptorService descriptorService)
      Sets the descriptor service.
    • getDescriptorService

      public DescriptorService getDescriptorService()
    • setBehaviourFilter

      public void setBehaviourFilter(BehaviourFilter behaviourFilter)
    • setNodeService

      public void setNodeService(NodeService nodeService)
      Sets the node service.
    • getNodeService

      public NodeService getNodeService()
    • setActionService

      public void setActionService(ActionService actionService)
    • setVersionService

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

      public VersionService getVersionService()
    • setCheckOutCheckInService

      public void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
      Sets the checkOut/checkIn service.
    • getCheckOutCheckInService

      public CheckOutCheckInService getCheckOutCheckInService()
    • getLockService

      public LockService getLockService()
      Sets the lock service.
    • setLockService

      public void setLockService(LockService lockService)
    • setContentService

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

      public ContentService getContentService()
    • setEventPublisher

      public void setEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher)
      Sets the event publisher
    • setrenditionService

      @Deprecated public void setrenditionService(RenditionService renditionService)
      Deprecated.
      The RenditionService is being replace by the simpler async RenditionService2.
      Sets the rendition service.
    • setFileFolderService

      public void setFileFolderService(FileFolderService fileFolderService)
      Sets the file folder service.
    • getFileFolderService

      public FileFolderService getFileFolderService()
    • setTenantAdminService

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

      public void setSingletonCache(SimpleCache<String,Object> singletonCache)
    • setTransactionService

      public void setTransactionService(TransactionService transactionService)
      Sets the transaction service.
    • getTransactionService

      public TransactionService getTransactionService()
    • setAuthenticationService

      public void setAuthenticationService(AuthenticationService authenticationService)
      Sets the authentication service.
    • getAuthenticationService

      public AuthenticationService getAuthenticationService()
    • setPermissionService

      public void setPermissionService(PermissionService permissionService)
      Sets the permission service.
    • setPermissionModelDao

      public void setPermissionModelDao(ModelDAO permissionModelDao)
      Sets the permission model DAO.
    • setOpenCMISDictionaryService

      public void setOpenCMISDictionaryService(CMISDictionaryService cmisDictionaryService)
    • setOpenCMISDictionaryService11

      public void setOpenCMISDictionaryService11(CMISDictionaryService cmisDictionaryService)
    • getOpenCMISDictionaryService

      public CMISDictionaryService getOpenCMISDictionaryService()
    • setOpenCMISQueryService

      public void setOpenCMISQueryService(CMISQueryService cmisQueryService)
      Sets the OpenCMIS query service.
    • setOpenCMISQueryService11

      public void setOpenCMISQueryService11(CMISQueryService cmisQueryService)
    • getOpenCMISQueryService

      public CMISQueryService getOpenCMISQueryService()
    • setMimetypeService

      public void setMimetypeService(MimetypeService mimetypeService)
      Sets the MIME type service.
    • getMimetypeService

      public MimetypeService getMimetypeService()
    • setAuditService

      public void setAuditService(AuditService auditService)
      Sets the audit service.
    • setNamespaceService

      public void setNamespaceService(NamespaceService namespaceService)
      Sets the namespace service.
    • setSearchService

      public void setSearchService(SearchService searchService)
      Sets the search service.
    • getSearchService

      public SearchService getSearchService()
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
    • getDictionaryService

      public DictionaryService getDictionaryService()
    • setProxyUser

      public void setProxyUser(String proxyUser)
      Not implemented
      Throws:
      UnsupportedOperationException - always
    • getProxyUser

      public String 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:
      init in interface TenantDeployer
    • destroy

      public void destroy()
      Specified by:
      destroy in interface TenantDeployer
    • onEnableTenant

      public void onEnableTenant()
      Specified by:
      onEnableTenant in interface TenantDeployer
    • onDisableTenant

      public void onDisableTenant()
      Specified by:
      onDisableTenant in interface TenantDeployer
    • 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<org.springframework.context.event.ApplicationContextEvent>
    • getSortProperty

      public Pair<QName,Boolean> getSortProperty(String cmisPropertyName, String direction)
    • createThumbnails

      public void createThumbnails(NodeRef nodeRef, Set<String> thumbnailNames)
      Asynchronously generates thumbnails for the given node.
      Parameters:
      nodeRef - NodeRef
    • extractMetadata

      public void extractMetadata(NodeRef nodeRef)
      Extracts metadata for the node.
      Parameters:
      nodeRef - NodeRef
    • getSite

      public SiteInfo getSite(NodeRef nodeRef)
    • filter

      public boolean filter(NodeRef nodeRef)
      Should the node be filtered?
    • disableBehaviour

      public boolean disableBehaviour(QName className)
    • enableBehaviour

      public boolean enableBehaviour(QName className)
    • disableBehaviour

      public boolean disableBehaviour(QName className, NodeRef nodeRef)
    • enableBehaviour

      public boolean enableBehaviour(QName className, NodeRef nodeRef)
    • getRootStoreRef

      public StoreRef getRootStoreRef()
    • deleteNode

      public void deleteNode(NodeRef nodeRef, boolean postActivity)
    • getRetryingTransactionHelper

      public RetryingTransactionHelper getRetryingTransactionHelper()
    • getRootNodeRef

      public NodeRef getRootNodeRef()
      Returns the root folder node ref.
    • getName

      public String getName(NodeRef nodeRef)
    • getCurrentVersionId

      public String getCurrentVersionId(String objectId)
      Cuts of the version information from an object id.
    • createNodeInfo

      public CMISNodeInfoImpl createNodeInfo(String objectId)
      Creates an object info object.
    • createNodeInfo

      public CMISNodeInfoImpl createNodeInfo(NodeRef nodeRef)
      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

      public CMISNodeInfoImpl createNodeInfo(AssociationRef assocRef)
      Creates an object info object.
    • constructObjectId

      public String constructObjectId(AssociationRef assocRef, String versionLabel)
    • constructObjectId

      public String constructObjectId(AssociationRef assocRef, String versionLabel, boolean dropStoreRef)
    • constructObjectId

      public String constructObjectId(String incomingObjectId)
    • constructObjectId

      public String constructObjectId(String incomingNodeId, String versionLabel)
    • constructObjectId

      public String constructObjectId(String incomingNodeId, String versionLabel, boolean dropStoreRef)
    • createVersion

      public void createVersion(NodeRef nodeRef, VersionType versionType, String reason)
    • getRequestCmisVersion

      public org.apache.chemistry.opencmis.commons.enums.CmisVersion getRequestCmisVersion()
    • constructObjectId

      public String constructObjectId(NodeRef incomingNodeRef, String versionLabel)
    • constructObjectId

      public String constructObjectId(NodeRef incomingNodeRef, String versionLabel, boolean dropStoreRef)
    • createObjectId

      public String createObjectId(NodeRef nodeRef)
      Compiles a CMIS object if for a live node.
    • createObjectId

      public String createObjectId(NodeRef nodeRef, boolean dropStoreRef)
    • getType

      public TypeDefinitionWrapper getType(NodeRef nodeRef)
      Returns the type definition of a node or null if no type definition could be found.
    • getType

      public TypeDefinitionWrapper getType(AssociationRef assocRef)
      Returns the type definition of an association or null if no type definition could be found.
    • getType

      public TypeDefinitionWrapper getType(String cmisTypeId)
      Returns the type definition of a node or null if 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

      public void checkChildObjectType(CMISNodeInfo folderInfo, String childType)
      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

      public String getPath(NodeRef nodeRef)
    • 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 - NodeRef
      name - String
      mimeType - String
      contentSize - long
      encoding - String
      range - 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

      public List<org.apache.chemistry.opencmis.commons.data.ObjectData> getRelationships(NodeRef nodeRef, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships)
    • 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 - NodeRef
      acl - Acl
      Returns:
      Acl
    • applyACL

      public void applyACL(NodeRef nodeRef, TypeDefinitionWrapper type, org.apache.chemistry.opencmis.commons.data.Acl aces)
      Sets the given ACL.
    • applyPolicies

      public void applyPolicies(NodeRef nodeRef, TypeDefinitionWrapper type, List<String> policies)
    • 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

      public void addSecondaryTypes(NodeRef nodeRef, List<String> secondaryTypes)
    • removeSecondaryTypes

      public void removeSecondaryTypes(NodeRef nodeRef, List<String> secondaryTypes)
    • 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

      public String getNameProperty(org.apache.chemistry.opencmis.commons.data.Properties properties, String fallback)
    • getObjectTypeIdProperty

      public String getObjectTypeIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties)
    • getSourceIdProperty

      public String getSourceIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties)
    • getTargetIdProperty

      public String getTargetIdProperty(org.apache.chemistry.opencmis.commons.data.Properties properties)
    • getRepositoryInfo

      public org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo(org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
      Returns the repository info object.
    • getRepositoryId

      public String getRepositoryId()
      Returns the repository id.