mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.2.0 (5.2.0) to HEAD (5.2)
133219 jkaabimofrad: Merged WEBAPP-API (5.2.1) to 5.2.N (5.2.1) 133145 jkaabimofrad: APPSREPO-54: Added support to the quick-share V1 API to allow setting an optional expiry date when creating a shared link. - Also, fixed the overloaded shareContent method which was missed during code clean-up. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@133404 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.QuickShareModel;
|
||||
import org.alfresco.query.PagingRequest;
|
||||
import org.alfresco.repo.quickshare.QuickShareClientNotFoundException;
|
||||
import org.alfresco.repo.quickshare.QuickShareLinkExpiryActionException;
|
||||
import org.alfresco.repo.quickshare.QuickShareServiceImpl.QuickShareEmailRequest;
|
||||
import org.alfresco.repo.search.QueryParameterDefImpl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -329,13 +330,17 @@ public class QuickShareLinksImpl implements QuickShareLinks, RecognizedParamsExt
|
||||
// Note: since we already check node exists above, we can assume that InvalidNodeRefException (=> 404) here means not content (see type check)
|
||||
try
|
||||
{
|
||||
QuickShareDTO qsDto = quickShareService.shareContent(nodeRef);
|
||||
QuickShareDTO qsDto = quickShareService.shareContent(nodeRef, qs.getExpiresAt());
|
||||
result.add(getQuickShareInfo(qsDto.getId(), false, includeParam));
|
||||
}
|
||||
catch (InvalidNodeRefException inre)
|
||||
{
|
||||
throw new InvalidArgumentException("Unable to create shared link to non-file content: " + nodeId);
|
||||
}
|
||||
catch (QuickShareLinkExpiryActionException ex)
|
||||
{
|
||||
throw new InvalidArgumentException(ex.getMessage());
|
||||
}
|
||||
}
|
||||
catch (AccessDeniedException ade)
|
||||
{
|
||||
@@ -576,6 +581,7 @@ public class QuickShareLinksImpl implements QuickShareLinks, RecognizedParamsExt
|
||||
qs.setModifiedAt((Date) map.get("modified"));
|
||||
qs.setModifiedByUser(modifiedByUser);
|
||||
qs.setSharedByUser(sharedByUser);
|
||||
qs.setExpiresAt((Date) map.get("expiryDate"));
|
||||
|
||||
// note: if noAuth mode then do not return allowable operations (eg. but can be optionally returned when finding shared links)
|
||||
if ((! noAuth) && includeParam.contains(PARAM_INCLUDE_ALLOWABLEOPERATIONS))
|
||||
|
Reference in New Issue
Block a user