Fixed sharing REST path

This commit is contained in:
Luca Frosini 2021-07-01 12:13:23 +02:00
parent 1924cef56d
commit 257072898a
1 changed files with 7 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import javax.ws.rs.DefaultValue;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import org.gcube.com.fasterxml.jackson.core.JsonProcessingException;
@ -19,6 +20,7 @@ import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.base.reference.IdentifiableElement;
import org.gcube.informationsystem.context.reference.entities.Context;
import org.gcube.informationsystem.model.reference.properties.Header;
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
@ -66,7 +68,7 @@ public class SharingManager {
*
* Each instance is managed without considering the propagation constraint of relations.
*
* POST /sharing/contexts/{CONTEXT_UUID}?operation=(ADD|REMOVE)&[dryRun=true]
* POST /sharing/contexts/{CONTEXT_UUID}?operation=PUT(ADD|REMOVE)&[dryRun=true]
*
* e.g
* POST /resource-registry/contexts/67062c11-9c3a-4906-870d-7df6a43408b0?operation=ADD&dryRun=true
@ -79,7 +81,7 @@ public class SharingManager {
*
*/
// @POST
// @Path("{" + SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}")
// @Path("/{" + SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}")
public String addRemoveNoPropagationConstraint(
@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
@QueryParam(SharingPath.OPERATION_QUERY_PARAMETER) SharingOperation operation,
@ -155,8 +157,9 @@ public class SharingManager {
*
*/
@POST
@Path("{" + SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}/"
+ AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}")
@Path("/" + SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}/"
+ "{" + AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}")
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
public String addRemove(
@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
@PathParam(AccessPath.TYPE_PATH_PARAM) String type,