Interface QuickShareService
-
- All Known Implementing Classes:
QuickShareServiceImpl
public interface QuickShareServiceThe QuickShare service. Responsible for creating, updating and retrieving Quick share metadata,- Since:
- Cloud/4.2
- Author:
- Alex Miller, janv
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanDeleteSharedLink(NodeRef nodeRef, String sharedByUserId)Determine if the current user has permission to delete the shared link.booleancanRead(String sharedId)Determine if the current user has permission to read the shared content.voiddeleteQuickShareLinkExpiryAction(QuickShareLinkExpiryAction quickShareLinkExpiryAction)Removes (hard deletes) the previously persistedQuickShareLinkExpiryActionand its related scheduleScheduledPersistedActionfrom the repository.Map<String,Object>getMetaData(String shareId)Get QuickShare related metadata for the given shareId.Map<String,Object>getMetaData(NodeRef nodeRef)Get QuickShare related metadata for the given node.Pair<String,NodeRef>getTenantNodeRefFromSharedId(String sharedId)Get the tenant domain and node reference for the the given share id.booleanisQuickShareEnabled()Whether the quick share is enabled or not.voidsendEmailNotification(QuickShareServiceImpl.QuickShareEmailRequest emailRequest)Notifies users by email that a content has been shared with them, and the details of it.QuickShareDTOshareContent(NodeRef nodeRef)Share content identified by nodeRef.QuickShareDTOshareContent(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
-
-
-
Method Detail
-
shareContent
QuickShareDTO shareContent(NodeRef nodeRef) throws QuickShareDisabledException, InvalidNodeRefException
Share content identified by nodeRef.- Parameters:
nodeRef- The NodeRef of the content to share- Returns:
- QuickDTO with details of the share
- Throws:
QuickShareDisabledExceptionInvalidNodeRefException
-
shareContent
QuickShareDTO shareContent(NodeRef nodeRef, Date expiryDate) throws QuickShareDisabledException, InvalidNodeRefException
Share content identified by nodeRef and optionally set an expiry date for the shared link.- Parameters:
nodeRef- The NodeRef of the content to shareexpiryDate- The expiry date of the shared link- Returns:
- QuickDTO with details of the share
- Throws:
QuickShareDisabledExceptionInvalidNodeRefException
-
getMetaData
Map<String,Object> getMetaData(NodeRef nodeRef) throws QuickShareDisabledException, InvalidNodeRefException
Get QuickShare related metadata for the given node.- Parameters:
nodeRef- NodeRef- Returns:
- Map
- Throws:
QuickShareDisabledExceptionInvalidNodeRefException
-
getMetaData
Map<String,Object> getMetaData(String shareId) throws QuickShareDisabledException, InvalidSharedIdException
Get QuickShare related metadata for the given shareId.- Parameters:
shareId- String- Returns:
- Map
- Throws:
QuickShareDisabledExceptionInvalidSharedIdException
-
getTenantNodeRefFromSharedId
Pair<String,NodeRef> getTenantNodeRefFromSharedId(String sharedId) throws QuickShareDisabledException, InvalidSharedIdException
Get the tenant domain and node reference for the the given share id.- Parameters:
sharedId- String- Returns:
- Pair
- Throws:
QuickShareDisabledExceptionInvalidSharedIdException
-
unshareContent
void unshareContent(String sharedId) throws QuickShareDisabledException, InvalidSharedIdException
Unshare the content identified by sharedId- Parameters:
sharedId- The shared id of the content to unshare.- Throws:
QuickShareDisabledExceptionInvalidSharedIdException
-
canRead
boolean canRead(String sharedId)
Determine if the current user has permission to read the shared content.
-
sendEmailNotification
void sendEmailNotification(QuickShareServiceImpl.QuickShareEmailRequest emailRequest)
Notifies users by email that a content has been shared with them, and the details of it.- Parameters:
emailRequest- The email details including its template details
-
canDeleteSharedLink
boolean canDeleteSharedLink(NodeRef nodeRef, String sharedByUserId)
Determine if the current user has permission to delete the shared link.
-
isQuickShareEnabled
boolean isQuickShareEnabled()
Whether the quick share is enabled or not.- Returns:
- true if quick share is enabled, false otherwise.
- Since:
- 5.2
-
deleteQuickShareLinkExpiryAction
void deleteQuickShareLinkExpiryAction(QuickShareLinkExpiryAction quickShareLinkExpiryAction)
Removes (hard deletes) the previously persistedQuickShareLinkExpiryActionand its related scheduleScheduledPersistedActionfrom the repository.- Parameters:
quickShareLinkExpiryAction- TheQuickShareLinkExpiryActionto be deleted.
-
-