public class QuickShareServiceImpl extends Object implements QuickShareService, NodeServicePolicies.BeforeDeleteNodePolicy, CopyServicePolicies.OnCopyNodePolicy, NodeServicePolicies.OnRestoreNodePolicy
Modifier and Type | Class and Description |
---|---|
static class |
QuickShareServiceImpl.QuickShareEmailRequest
Represents an email request to send a quick share link.
|
Policy.Arg
QNAME
ARG_0, ARG_1, QNAME
QNAME
Constructor and Description |
---|
QuickShareServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef beforeDeleteNodeRef)
Called before a node is deleted.
|
boolean |
canDeleteSharedLink(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String sharedByUserId)
Determine if the current user has permission to delete the shared link.
|
boolean |
canRead(String sharedId)
Determine if the current user has permission to read the shared content.
|
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. |
void |
deleteQuickShareLinkExpiryAction(QuickShareLinkExpiryAction linkExpiryAction)
Removes (hard deletes) the previously persisted
QuickShareLinkExpiryAction and its related
schedule ScheduledPersistedAction from the repository. |
CopyBehaviourCallback |
getCopyCallback(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
Called for all types and aspects before copying a node.
|
Map<String,Object> |
getMetaData(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get QuickShare related metadata for the given node.
|
Map<String,Object> |
getMetaData(String sharedId)
Get QuickShare related metadata for the given shareId.
|
protected String |
getSharedLinkEmailTemplatePath(ClientAppConfig.ClientApp clientApp) |
org.alfresco.util.Pair<String,org.alfresco.service.cmr.repository.NodeRef> |
getTenantNodeRefFromSharedId(String sharedId)
Get the tenant domain and node reference for the the given share id.
|
void |
init()
The initialise method.
|
boolean |
isQuickShareEnabled()
Whether the quick share is enabled or not.
|
void |
onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Called after an archived node is restored.
|
protected void |
saveSharedLinkExpiryAction(String sharedId,
Date expiryDate)
Creates and persists the quick share link expiry action and its related schedule.
|
void |
sendEmailNotification(QuickShareServiceImpl.QuickShareEmailRequest emailRequest)
Notifies users by email that a content has been shared with them, and the details of it.
|
void |
setActionService(ActionService actionService)
Set the actionService
|
void |
setAttributeService(AttributeService attributeService)
Set the attribute service
|
void |
setAuthorityService(AuthorityService authorityService)
Spring configuration
|
void |
setBehaviourFilter(BehaviourFilter behaviourFilter)
Spring configuration
|
void |
setClientAppConfig(ClientAppConfig clientAppConfig)
Set the quickShare clientAppConfig
|
void |
setDefaultEmailSender(String defaultEmailSender)
Set the default email sender
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service
|
void |
setEmailHelper(EmailHelper emailHelper)
Spring configuration
|
void |
setEnabled(boolean enabled)
Enable or disable this service.
|
void |
setEventPublisher(org.alfresco.repo.events.EventPublisher eventPublisher)
Set the eventPublisher
|
void |
setExpiryDatePeriod(String expiryDatePeriod)
Spring configuration
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service
|
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Set the Permission service
|
void |
setPersonService(PersonService personService)
Set the person service
|
void |
setPolicyComponent(PolicyComponent policyComponent)
Set the policy component
|
void |
setQuickShareLinkExpiryActionPersister(QuickShareLinkExpiryActionPersister quickShareLinkExpiryActionPersister)
Spring configuration
|
void |
setScheduledPersistedActionService(ScheduledPersistedActionService scheduledPersistedActionService)
Spring configuration
|
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Spring configuration
|
void |
setSiteService(SiteService siteService)
Spring configuration
|
void |
setSysAdminParams(SysAdminParams sysAdminParams)
Spring configuration
|
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
Set the tenant service
|
void |
setThumbnailService(ThumbnailService thumbnailService)
Set the thumbnail service
|
QuickShareDTO |
shareContent(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Share content identified by nodeRef.
|
QuickShareDTO |
shareContent(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Date expiryDate)
Share content identified by nodeRef and optionally set an expiry date for the shared link.
|
void |
unshareContent(String sharedId)
Unshare the content identified by sharedId
|
public void setAttributeService(AttributeService attributeService)
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
public void setPersonService(PersonService personService)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setThumbnailService(ThumbnailService thumbnailService)
public void setEventPublisher(org.alfresco.repo.events.EventPublisher eventPublisher)
public void setActionService(ActionService actionService)
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
behaviourFilter
- the behaviourFilter to setpublic void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
searchService
- the searchService to setpublic void setSiteService(SiteService siteService)
siteService
- the siteService to setpublic void setAuthorityService(AuthorityService authorityService)
authorityService
- the authorityService to setpublic void setSysAdminParams(SysAdminParams sysAdminParams)
sysAdminParams
- the sysAdminParams to setpublic void setEmailHelper(EmailHelper emailHelper)
emailHelper
- the emailHelper to setpublic void setEnabled(boolean enabled)
public void setDefaultEmailSender(String defaultEmailSender)
public void setClientAppConfig(ClientAppConfig clientAppConfig)
public void setScheduledPersistedActionService(ScheduledPersistedActionService scheduledPersistedActionService)
scheduledPersistedActionService
- the scheduledPersistedActionService to setpublic void setQuickShareLinkExpiryActionPersister(QuickShareLinkExpiryActionPersister quickShareLinkExpiryActionPersister)
quickShareLinkExpiryActionPersister
- the quickShareLinkExpiryActionPersister to setpublic void setExpiryDatePeriod(String expiryDatePeriod)
expiryDatePeriod
- the expiryDatePeriod to setpublic void init()
public QuickShareDTO shareContent(org.alfresco.service.cmr.repository.NodeRef nodeRef)
QuickShareService
shareContent
in interface QuickShareService
nodeRef
- The NodeRef of the content to sharepublic QuickShareDTO shareContent(org.alfresco.service.cmr.repository.NodeRef nodeRef, Date expiryDate) throws QuickShareDisabledException, org.alfresco.service.cmr.repository.InvalidNodeRefException
QuickShareService
shareContent
in interface QuickShareService
nodeRef
- The NodeRef of the content to shareexpiryDate
- The expiry date of the shared linkQuickShareDisabledException
org.alfresco.service.cmr.repository.InvalidNodeRefException
public Map<String,Object> getMetaData(org.alfresco.service.cmr.repository.NodeRef nodeRef)
QuickShareService
getMetaData
in interface QuickShareService
nodeRef
- NodeRefpublic org.alfresco.util.Pair<String,org.alfresco.service.cmr.repository.NodeRef> getTenantNodeRefFromSharedId(String sharedId)
QuickShareService
getTenantNodeRefFromSharedId
in interface QuickShareService
sharedId
- Stringpublic Map<String,Object> getMetaData(String sharedId)
QuickShareService
getMetaData
in interface QuickShareService
sharedId
- Stringpublic void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef beforeDeleteNodeRef)
NodeServicePolicies.BeforeDeleteNodePolicy
beforeDeleteNode
in interface NodeServicePolicies.BeforeDeleteNodePolicy
beforeDeleteNodeRef
- the node referencepublic void onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
NodeServicePolicies.OnRestoreNodePolicy
onRestoreNode
in interface NodeServicePolicies.OnRestoreNodePolicy
childAssocRef
- the newly created child association referencepublic void unshareContent(String sharedId)
QuickShareService
unshareContent
in interface QuickShareService
sharedId
- The shared id of the content to unshare.public CopyBehaviourCallback getCopyCallback(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
CopyServicePolicies.OnCopyNodePolicy
getCopyCallback
in interface CopyServicePolicies.OnCopyNodePolicy
classRef
- the type or aspect qualified namecopyDetails
- the details of the impending copyCopyServicePolicies
public boolean canRead(String sharedId)
QuickShareService
canRead
in interface QuickShareService
public void sendEmailNotification(QuickShareServiceImpl.QuickShareEmailRequest emailRequest)
QuickShareService
sendEmailNotification
in interface QuickShareService
emailRequest
- The email details including its template detailsprotected String getSharedLinkEmailTemplatePath(ClientAppConfig.ClientApp clientApp)
public boolean canDeleteSharedLink(org.alfresco.service.cmr.repository.NodeRef nodeRef, String sharedByUserId)
QuickShareService
canDeleteSharedLink
in interface QuickShareService
public boolean isQuickShareEnabled()
QuickShareService
isQuickShareEnabled
in interface QuickShareService
protected void saveSharedLinkExpiryAction(String sharedId, Date expiryDate)
public void deleteQuickShareLinkExpiryAction(QuickShareLinkExpiryAction linkExpiryAction)
QuickShareService
QuickShareLinkExpiryAction
and its related
schedule ScheduledPersistedAction
from the repository.deleteQuickShareLinkExpiryAction
in interface QuickShareService
linkExpiryAction
- The QuickShareLinkExpiryAction
to be deleted.protected void deleteQuickShareLinkExpiryAction(org.alfresco.service.cmr.repository.NodeRef linkExpiryActionNodeRef)
QuickShareLinkExpiryAction
and its related
schedule ScheduledPersistedAction
from the repository.Copyright © 2005–2017 Alfresco Software. All rights reserved.