Package org.alfresco.repo.quickshare
Class QuickShareServiceImpl
java.lang.Object
org.alfresco.repo.quickshare.QuickShareServiceImpl
- All Implemented Interfaces:
CopyServicePolicies.OnCopyNodePolicy,NodeServicePolicies.BeforeDeleteNodePolicy,NodeServicePolicies.OnRestoreNodePolicy,ClassPolicy,Policy,QuickShareService
public class QuickShareServiceImpl
extends Object
implements QuickShareService, NodeServicePolicies.BeforeDeleteNodePolicy, CopyServicePolicies.OnCopyNodePolicy, NodeServicePolicies.OnRestoreNodePolicy
QuickShare Service implementation.
In addition to the quick share service, this class also provides a BeforeDeleteNodePolicy and OnCopyNodePolicy for content with the QuickShare aspect.
- Author:
- Alex Miller, janv, Jamal Kaabi-Mofrad
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an email request to send a quick share link.Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg -
Field Summary
Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy
ARG_0, ARG_1, QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy
QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeDeleteNode(NodeRef beforeDeleteNodeRef) Called before a node is deleted.booleancanDeleteSharedLink(NodeRef nodeRef, String sharedByUserId) Determine if the current user has permission to delete the shared link.booleanDetermine if the current user has permission to read the shared content.voiddeleteQuickShareLinkExpiryAction(QuickShareLinkExpiryAction linkExpiryAction) Removes (hard deletes) the previously persistedQuickShareLinkExpiryActionand its related scheduleScheduledPersistedActionfrom the repository.protected voiddeleteQuickShareLinkExpiryAction(NodeRef linkExpiryActionNodeRef) Removes (hard deletes) the previously persistedQuickShareLinkExpiryActionand its related scheduleScheduledPersistedActionfrom the repository.getCopyCallback(QName classRef, CopyDetails copyDetails) Called for all types and aspects before copying a node.getMetaData(String sharedId) Get QuickShare related metadata for the given shareId.getMetaData(NodeRef nodeRef) Get QuickShare related metadata for the given node.protected StringgetTenantNodeRefFromSharedId(String sharedId) Get the tenant domain and node reference for the the given share id.voidinit()The initialise method.booleanWhether the quick share is enabled or not.voidonRestoreNode(ChildAssociationRef childAssocRef) Called after an archived node is restored.protected voidsaveSharedLinkExpiryAction(String sharedId, Date expiryDate) Creates and persists the quick share link expiry action and its related schedule.voidNotifies users by email that a content has been shared with them, and the details of it.voidsetActionService(ActionService actionService) Set the actionServicevoidsetAttributeService(AttributeService attributeService) Set the attribute servicevoidsetAuthorityService(AuthorityService authorityService) Spring configurationvoidsetBehaviourFilter(BehaviourFilter behaviourFilter) Spring configurationvoidsetClientAppConfig(ClientAppConfig clientAppConfig) Set the quickShare clientAppConfigvoidsetDefaultEmailSender(String defaultEmailSender) Set the default email sendervoidsetDictionaryService(DictionaryService dictionaryService) Set the dictionary servicevoidsetEmailHelper(EmailHelper emailHelper) Spring configurationvoidsetEnabled(boolean enabled) Enable or disable this service.voidsetEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher) Set the eventPublishervoidsetExpiryDatePeriod(String expiryDatePeriod) Spring configurationvoidsetNodeService(NodeService nodeService) Set the node servicevoidsetPermissionService(PermissionService permissionService) Set the Permission servicevoidsetPersonService(PersonService personService) Set the person servicevoidsetPolicyComponent(PolicyComponent policyComponent) Set the policy componentvoidsetQuickShareLinkExpiryActionPersister(QuickShareLinkExpiryActionPersister quickShareLinkExpiryActionPersister) Spring configurationvoidsetScheduledPersistedActionService(ScheduledPersistedActionService scheduledPersistedActionService) Spring configurationvoidsetSearchService(SearchService searchService) Spring configurationvoidsetSiteService(SiteService siteService) Spring configurationvoidsetSysAdminParams(SysAdminParams sysAdminParams) Spring configurationvoidsetTenantService(TenantService tenantService) Set the tenant servicevoidsetThumbnailService(ThumbnailService thumbnailService) Set the thumbnail serviceshareContent(NodeRef nodeRef) Share content identified by nodeRef.shareContent(NodeRef nodeRef, Date expiryDate) Share content identified by nodeRef and optionally set an expiry date for the shared link.voidunshareContent(String sharedId) Unshare the content identified by sharedId
-
Constructor Details
-
QuickShareServiceImpl
public QuickShareServiceImpl()
-
-
Method Details
-
setAttributeService
Set the attribute service -
setDictionaryService
Set the dictionary service -
setNodeService
Set the node service -
setPermissionService
Set the Permission service -
setPersonService
Set the person service -
setPolicyComponent
Set the policy component -
setTenantService
Set the tenant service -
setThumbnailService
Set the thumbnail service -
setEventPublisher
public void setEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher) Set the eventPublisher -
setActionService
Set the actionService -
setBehaviourFilter
Spring configuration- Parameters:
behaviourFilter- the behaviourFilter to set
-
setSearchService
Spring configuration- Parameters:
searchService- the searchService to set
-
setSiteService
Spring configuration- Parameters:
siteService- the siteService to set
-
setAuthorityService
Spring configuration- Parameters:
authorityService- the authorityService to set
-
setSysAdminParams
Spring configuration- Parameters:
sysAdminParams- the sysAdminParams to set
-
setEmailHelper
Spring configuration- Parameters:
emailHelper- the emailHelper to set
-
setEnabled
public void setEnabled(boolean enabled) Enable or disable this service. -
setDefaultEmailSender
Set the default email sender -
setClientAppConfig
Set the quickShare clientAppConfig -
setScheduledPersistedActionService
public void setScheduledPersistedActionService(ScheduledPersistedActionService scheduledPersistedActionService) Spring configuration- Parameters:
scheduledPersistedActionService- the scheduledPersistedActionService to set
-
setExpiryDatePeriod
Spring configuration- Parameters:
expiryDatePeriod- the expiryDatePeriod to set
-
init
public void init()The initialise method. Register our policies. -
getMetaData
Description copied from interface:QuickShareServiceGet QuickShare related metadata for the given node.- Specified by:
getMetaDatain interfaceQuickShareService- Parameters:
nodeRef- NodeRef- Returns:
- Map
-
getMetaData
Description copied from interface:QuickShareServiceGet QuickShare related metadata for the given shareId.- Specified by:
getMetaDatain interfaceQuickShareService- Parameters:
sharedId- String- Returns:
- Map
-
beforeDeleteNode
Description copied from interface:NodeServicePolicies.BeforeDeleteNodePolicyCalled before a node is deleted.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
beforeDeleteNodeRef- the node reference
-
onRestoreNode
Description copied from interface:NodeServicePolicies.OnRestoreNodePolicyCalled after an archived node is restored.- Specified by:
onRestoreNodein interfaceNodeServicePolicies.OnRestoreNodePolicy- Parameters:
childAssocRef- the newly created child association reference
-
getCopyCallback
Description copied from interface:CopyServicePolicies.OnCopyNodePolicyCalled for all types and aspects before copying a node.- Specified by:
getCopyCallbackin interfaceCopyServicePolicies.OnCopyNodePolicy- Parameters:
classRef- the type or aspect qualified namecopyDetails- the details of the impending copy- Returns:
- Return the callback that will be used to modify the copy behaviour for this dictionary class. Return null to assume the default.
- See Also:
-
canRead
Description copied from interface:QuickShareServiceDetermine if the current user has permission to read the shared content.- Specified by:
canReadin interfaceQuickShareService
-