mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
126514 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 122926 jvonka: (Quick) Shared Links API - updates and fixes - A/C changed from 400 to 409 if shared link already exists - tweak 404 error message (entity id not found) - change response from sharedId to just id - add optional filter when finding links, eg. where=(sharedByUser/id='userId') (userId can also be -me-) - TODO add a few more tests (rendition download, filtered find) RA-708, RA-777 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126858 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
100 lines
3.4 KiB
Java
100 lines
3.4 KiB
Java
/*
|
|
* Copyright (C) 2005-2016 Alfresco Software Limited.
|
|
*
|
|
* This file is part of Alfresco
|
|
*
|
|
* Alfresco is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Alfresco is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package org.alfresco.rest.api;
|
|
|
|
import org.alfresco.rest.api.model.QuickShareLink;
|
|
import org.alfresco.rest.api.model.QuickShareLinkEmailRequest;
|
|
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
|
|
import org.alfresco.rest.framework.resource.content.BinaryResource;
|
|
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
|
import org.alfresco.rest.framework.resource.parameters.Parameters;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Centralises access to quick share services and maps between representations.
|
|
*
|
|
* @author janv
|
|
* @author Jamal Kaabi-Mofrad
|
|
*
|
|
* @since publicapi1.0
|
|
*/
|
|
public interface QuickShareLinks
|
|
{
|
|
/**
|
|
* Returns limited metadata regarding the shared (content) link.
|
|
*
|
|
* Note: does *not* require authenticated access for (public) shared link.
|
|
*/
|
|
QuickShareLink readById(String sharedId, Parameters parameters);
|
|
|
|
/**
|
|
* Download file content (or rendition content) via shared link.
|
|
*
|
|
* Note: does *not* require authenticated access for (public) shared link.
|
|
*
|
|
* @param sharedId
|
|
* @param renditionId - optional
|
|
* @param parameters {@link Parameters}
|
|
* @return
|
|
* @throws EntityNotFoundException
|
|
*/
|
|
BinaryResource readProperty(String sharedId, String renditionId, Parameters parameters) throws EntityNotFoundException;
|
|
|
|
/**
|
|
* Delete the shared link.
|
|
*
|
|
* Once deleted, the shared link will no longer exist hence get/download will no longer work (ie. return 404).
|
|
* If the link is later re-created then a new unique shared id will be generated.
|
|
*
|
|
* Requires authenticated access.
|
|
*
|
|
* @param sharedId String id of the quick share
|
|
*/
|
|
void delete(String sharedId, Parameters parameters);
|
|
|
|
/**
|
|
* Create quick share.
|
|
*
|
|
* Requires authenticated access.
|
|
*
|
|
* @param nodeIds
|
|
* @param parameters
|
|
* @return
|
|
*/
|
|
List<QuickShareLink> create(List<QuickShareLink> nodeIds, Parameters parameters);
|
|
|
|
/**
|
|
* Notifies users by email that a content has been shared with them.
|
|
*
|
|
* @param nodeId The content id
|
|
* @param emailRequest The email details including its template details
|
|
* @param parameters The {@link Parameters} object to get the parameters passed into the request
|
|
*/
|
|
void emailSharedLink(String nodeId, QuickShareLinkEmailRequest emailRequest, Parameters parameters);
|
|
|
|
/**
|
|
* Find (search) for shared links visible to current user.
|
|
* Optionally filter by "sharedByUser/id" (if -me- then filter by current user).
|
|
*
|
|
* @param parameters
|
|
* @return
|
|
*/
|
|
CollectionWithPagingInfo<QuickShareLink> findLinks(Parameters parameters);
|
|
} |