Class 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
    • Constructor Detail

      • CMISConnector

        public CMISConnector()
    • Method Detail

      • 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)
      • 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.
      • setBehaviourFilter

        public void setBehaviourFilter​(BehaviourFilter behaviourFilter)
      • setNodeService

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

        public void setActionService​(ActionService actionService)
      • setVersionService

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

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

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

        public void setLockService​(LockService lockService)
      • setContentService

        public void setContentService​(ContentService contentService)
        Sets the content service.
      • 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.
      • setTenantAdminService

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

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

        public void setAuthenticationService​(AuthenticationService authenticationService)
        Sets the authentication service.
      • 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)
      • setOpenCMISQueryService

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

        public void setOpenCMISQueryService11​(CMISQueryService cmisQueryService)
      • setMimetypeService

        public void setMimetypeService​(MimetypeService mimetypeService)
        Sets the MIME type service.
      • 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.
      • setDictionaryService

        public void setDictionaryService​(DictionaryService dictionaryService)
      • 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()
      • 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>
      • 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
      • 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)
      • getRootNodeRef

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

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

        public String constructObjectId​(String incomingObjectId)
      • constructObjectId

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

        public String constructObjectId​(String incomingNodeId,
                                        String versionLabel,
                                        boolean dropStoreRef)
      • 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​(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.
      • 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.
      • 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)
      • 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.