Class QuickShareServiceImpl

    • Constructor Detail

      • QuickShareServiceImpl

        public QuickShareServiceImpl()
    • Method Detail

      • setAttributeService

        public void setAttributeService​(AttributeService attributeService)
        Set the attribute service
      • setDictionaryService

        public void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
        Set the dictionary service
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Set the node service
      • setPermissionService

        public void setPermissionService​(org.alfresco.service.cmr.security.PermissionService permissionService)
        Set the Permission service
      • setPersonService

        public void setPersonService​(PersonService personService)
        Set the person service
      • setPolicyComponent

        public void setPolicyComponent​(PolicyComponent policyComponent)
        Set the policy component
      • setTenantService

        public void setTenantService​(org.alfresco.repo.tenant.TenantService tenantService)
        Set the tenant service
      • setThumbnailService

        public void setThumbnailService​(ThumbnailService thumbnailService)
        Set the thumbnail service
      • setEventPublisher

        public void setEventPublisher​(org.alfresco.sync.repo.events.EventPublisher eventPublisher)
        Set the eventPublisher
      • setActionService

        public void setActionService​(ActionService actionService)
        Set the actionService
      • setBehaviourFilter

        public void setBehaviourFilter​(BehaviourFilter behaviourFilter)
        Spring configuration
        Parameters:
        behaviourFilter - the behaviourFilter to set
      • setSearchService

        public void setSearchService​(org.alfresco.service.cmr.search.SearchService searchService)
        Spring configuration
        Parameters:
        searchService - the searchService to set
      • setSiteService

        public void setSiteService​(SiteService siteService)
        Spring configuration
        Parameters:
        siteService - the siteService to set
      • setAuthorityService

        public void setAuthorityService​(AuthorityService authorityService)
        Spring configuration
        Parameters:
        authorityService - the authorityService to set
      • setSysAdminParams

        public void setSysAdminParams​(SysAdminParams sysAdminParams)
        Spring configuration
        Parameters:
        sysAdminParams - the sysAdminParams to set
      • setEmailHelper

        public void setEmailHelper​(EmailHelper emailHelper)
        Spring configuration
        Parameters:
        emailHelper - the emailHelper to set
      • setEnabled

        public void setEnabled​(boolean enabled)
        Enable or disable this service.
      • setDefaultEmailSender

        public void setDefaultEmailSender​(java.lang.String defaultEmailSender)
        Set the default email sender
      • setClientAppConfig

        public void setClientAppConfig​(ClientAppConfig clientAppConfig)
        Set the quickShare clientAppConfig
      • setScheduledPersistedActionService

        public void setScheduledPersistedActionService​(ScheduledPersistedActionService scheduledPersistedActionService)
        Spring configuration
        Parameters:
        scheduledPersistedActionService - the scheduledPersistedActionService to set
      • setQuickShareLinkExpiryActionPersister

        public void setQuickShareLinkExpiryActionPersister​(QuickShareLinkExpiryActionPersister quickShareLinkExpiryActionPersister)
        Spring configuration
        Parameters:
        quickShareLinkExpiryActionPersister - the quickShareLinkExpiryActionPersister to set
      • setExpiryDatePeriod

        public void setExpiryDatePeriod​(java.lang.String expiryDatePeriod)
        Spring configuration
        Parameters:
        expiryDatePeriod - the expiryDatePeriod to set
      • init

        public void init()
        The initialise method. Register our policies.
      • shareContent

        public QuickShareDTO shareContent​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: QuickShareService
        Share content identified by nodeRef.
        Specified by:
        shareContent in interface QuickShareService
        Parameters:
        nodeRef - The NodeRef of the content to share
        Returns:
        QuickDTO with details of the share
      • shareContent

        public QuickShareDTO shareContent​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                          java.util.Date expiryDate)
                                   throws QuickShareDisabledException,
                                          org.alfresco.service.cmr.repository.InvalidNodeRefException
        Description copied from interface: QuickShareService
        Share content identified by nodeRef and optionally set an expiry date for the shared link.
        Specified by:
        shareContent in interface QuickShareService
        Parameters:
        nodeRef - The NodeRef of the content to share
        expiryDate - The expiry date of the shared link
        Returns:
        QuickDTO with details of the share
        Throws:
        QuickShareDisabledException
        org.alfresco.service.cmr.repository.InvalidNodeRefException
      • getMetaData

        public java.util.Map<java.lang.String,​java.lang.Object> getMetaData​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: QuickShareService
        Get QuickShare related metadata for the given node.
        Specified by:
        getMetaData in interface QuickShareService
        Parameters:
        nodeRef - NodeRef
        Returns:
        Map
      • getTenantNodeRefFromSharedId

        public org.alfresco.util.Pair<java.lang.String,​org.alfresco.service.cmr.repository.NodeRef> getTenantNodeRefFromSharedId​(java.lang.String sharedId)
        Description copied from interface: QuickShareService
        Get the tenant domain and node reference for the the given share id.
        Specified by:
        getTenantNodeRefFromSharedId in interface QuickShareService
        Parameters:
        sharedId - String
        Returns:
        Pair
      • getMetaData

        public java.util.Map<java.lang.String,​java.lang.Object> getMetaData​(java.lang.String sharedId)
        Description copied from interface: QuickShareService
        Get QuickShare related metadata for the given shareId.
        Specified by:
        getMetaData in interface QuickShareService
        Parameters:
        sharedId - String
        Returns:
        Map
      • unshareContent

        public void unshareContent​(java.lang.String sharedId)
        Description copied from interface: QuickShareService
        Unshare the content identified by sharedId
        Specified by:
        unshareContent in interface QuickShareService
        Parameters:
        sharedId - The shared id of the content to unshare.
      • canRead

        public boolean canRead​(java.lang.String sharedId)
        Description copied from interface: QuickShareService
        Determine if the current user has permission to read the shared content.
        Specified by:
        canRead in interface QuickShareService
      • getSharedLinkEmailTemplatePath

        protected java.lang.String getSharedLinkEmailTemplatePath​(ClientAppConfig.ClientApp clientApp)
      • canDeleteSharedLink

        public boolean canDeleteSharedLink​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                           java.lang.String sharedByUserId)
        Description copied from interface: QuickShareService
        Determine if the current user has permission to delete the shared link.
        Specified by:
        canDeleteSharedLink in interface QuickShareService
      • isQuickShareEnabled

        public boolean isQuickShareEnabled()
        Description copied from interface: QuickShareService
        Whether the quick share is enabled or not.
        Specified by:
        isQuickShareEnabled in interface QuickShareService
        Returns:
        true if quick share is enabled, false otherwise.
      • saveSharedLinkExpiryAction

        protected void saveSharedLinkExpiryAction​(java.lang.String sharedId,
                                                  java.util.Date expiryDate)
        Creates and persists the quick share link expiry action and its related schedule.
      • deleteQuickShareLinkExpiryAction

        protected void deleteQuickShareLinkExpiryAction​(org.alfresco.service.cmr.repository.NodeRef linkExpiryActionNodeRef)
        Removes (hard deletes) the previously persisted QuickShareLinkExpiryAction and its related schedule ScheduledPersistedAction from the repository.