Fixed path parameters on AddToContext and RemoveFromContexts
This commit is contained in:
parent
6793b16856
commit
f8ec6b9084
|
@ -30,25 +30,25 @@ public class SharingManagement {
|
||||||
protected void setRESTCalledMethod(HTTPMETHOD httpMethod, String type) {
|
protected void setRESTCalledMethod(HTTPMETHOD httpMethod, String type) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add(SharingPath.SHARING_PATH_PART);
|
list.add(SharingPath.SHARING_PATH_PART);
|
||||||
list.add(SharingPath.CONTEXTS_PATH_PART);
|
|
||||||
list.add("{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}");
|
|
||||||
list.add(type);
|
list.add(type);
|
||||||
list.add("{" + AccessPath.UUID_PATH_PARAM + "}");
|
list.add("{" + AccessPath.UUID_PATH_PARAM + "}");
|
||||||
|
list.add(SharingPath.CONTEXTS_PATH_PART);
|
||||||
|
list.add("{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}");
|
||||||
Access.setRESTCalledMethod(httpMethod, list, null);
|
Access.setRESTCalledMethod(httpMethod, list, null);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PUT /sharing/{CONTEXT_UUID}/{TYPE_NAME}/{UUID}
|
* PUT /sharing/{TYPE_NAME}/{UUID}/contexts/{CONTEXT_UUID}
|
||||||
* e.g PUT
|
* e.g PUT
|
||||||
* /resource-registry/sharing/67062c11-9c3a-4906-870d-7df6a43408b0/HostingNode/16032d09-3823-444e-a1ff-a67de4f350a8
|
* /resource-registry/sharing/HostingNode/16032d09-3823-444e-a1ff-a67de4f350a8/contexts/67062c11-9c3a-4906-870d-7df6a43408b0
|
||||||
* Where 67062c11-9c3a-4906-870d-7df6a43408b0/ is the context UUID
|
* Where 16032d09-3823-444e-a1ff-a67de4f350a8 is the HostingNode UUID
|
||||||
* and 16032d09-3823-444e-a1ff-a67de4f350a8 is the HostingNode UUID
|
* and 67062c11-9c3a-4906-870d-7df6a43408b0/ is the Context UUID
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path(SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" + "/{"
|
@Path("{" + AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}" +
|
||||||
+ AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}")
|
SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" )
|
||||||
public boolean add(@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
|
public boolean add(@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
|
||||||
@PathParam(AccessPath.TYPE_PATH_PARAM) String type, @PathParam(AccessPath.UUID_PATH_PARAM) String id)
|
@PathParam(AccessPath.TYPE_PATH_PARAM) String type, @PathParam(AccessPath.UUID_PATH_PARAM) String id)
|
||||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
|
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||||
|
@ -78,16 +78,16 @@ public class SharingManagement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DELETE /sharing/{CONTEXT_UUID}/{TYPE_NAME}/{UUID}
|
* DELETE /sharing/{TYPE_NAME}/{UUID}/contexts/{CONTEXT_UUID}
|
||||||
* e.g DELETE
|
* e.g DELETE
|
||||||
* /resource-registry/sharing/contexts/67062c11-9c3a-4906-870d-7df6a43408b0/HostingNode/16032d09-3823-444e-a1ff-a67de4f350a8
|
* /resource-registry/sharing/HostingNode/16032d09-3823-444e-a1ff-a67de4f350a8/contexts/67062c11-9c3a-4906-870d-7df6a43408b0
|
||||||
* Where 67062c11-9c3a-4906-870d-7df6a43408b0 is the Context UUID
|
* Where 16032d09-3823-444e-a1ff-a67de4f350a8 is the HostingNode UUID
|
||||||
* and 16032d09-3823-444e-a1ff-a67de4f350a8 is the HostingNode UUID
|
* and 67062c11-9c3a-4906-870d-7df6a43408b0 is the Context UUID
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path(SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" + "/{"
|
@Path("{" + AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}" +
|
||||||
+ AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}")
|
SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" )
|
||||||
public Response remove(@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
|
public Response remove(@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
|
||||||
@PathParam(AccessPath.TYPE_PATH_PARAM) String type, @PathParam(AccessPath.UUID_PATH_PARAM) String id)
|
@PathParam(AccessPath.TYPE_PATH_PARAM) String type, @PathParam(AccessPath.UUID_PATH_PARAM) String id)
|
||||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
|
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||||
|
@ -98,6 +98,8 @@ public class SharingManagement {
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
ElementManagement erManagement = ElementManagementUtility.getERManagement(type);
|
ElementManagement erManagement = ElementManagementUtility.getERManagement(type);
|
||||||
UUID uuid = null;
|
UUID uuid = null;
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
uuid = UUID.fromString(id);
|
uuid = UUID.fromString(id);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue