Fixing REST API
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@130972 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
383306c558
commit
32702a4f10
|
@ -37,35 +37,35 @@ public class Access {
|
|||
public String query(@QueryParam(AccessRESTPath.QUERY_PARAM) String query,
|
||||
@QueryParam(AccessRESTPath.FETCH_PLAN_PARAM) String fetchPlan)
|
||||
throws InvalidQueryException {
|
||||
logger.trace("Requested query (fetch plan {}):\n{}", fetchPlan, query);
|
||||
logger.info("Requested query (fetch plan {}):\n{}", fetchPlan, query);
|
||||
return queryManager.execute(query, fetchPlan);
|
||||
}
|
||||
|
||||
@GET @Path(AccessRESTPath.FACET_INSTANCE_PATH_PART + "/" + AccessRESTPath.FACET_ID_PATH_PART)
|
||||
@GET @Path(AccessRESTPath.FACET_INSTANCE_PATH_PART + "/{" + AccessRESTPath.FACET_ID_PATH_PART + "}")
|
||||
public String getFacet(@PathParam(AccessRESTPath.FACET_ID_PATH_PART) String facetId)
|
||||
throws FacetNotFoundException, ResourceRegistryException {
|
||||
logger.trace("Requested Facet with id {}", facetId);
|
||||
logger.info("Requested Facet with id {}", facetId);
|
||||
return entityManager.readFacet(facetId);
|
||||
}
|
||||
|
||||
@GET @Path(AccessRESTPath.FACET_SCHEMA_PATH_PART + "/" + AccessRESTPath.FACET_TYPE_PATH_PART)
|
||||
@GET @Path(AccessRESTPath.FACET_SCHEMA_PATH_PART + "/{" + AccessRESTPath.FACET_TYPE_PATH_PART + "}")
|
||||
public String getFacetSchema(@PathParam(AccessRESTPath.FACET_TYPE_PATH_PART) String facetType)
|
||||
throws SchemaNotFoundException {
|
||||
logger.trace("Requested Facet Schema for type {}", facetType);
|
||||
logger.info("Requested Facet Schema for type {}", facetType);
|
||||
return schemaManager.getFacetSchema(facetType);
|
||||
}
|
||||
|
||||
@GET @Path(AccessRESTPath.RESOURCE_INSTANCE_PATH_PART + "/" + AccessRESTPath.RESOURCE_ID_PATH_PART)
|
||||
@GET @Path(AccessRESTPath.RESOURCE_INSTANCE_PATH_PART + "/{" + AccessRESTPath.RESOURCE_ID_PATH_PART + "}")
|
||||
public String getResource(@PathParam(AccessRESTPath.RESOURCE_ID_PATH_PART) String resourceId)
|
||||
throws ResourceNotFoundException, ResourceRegistryException {
|
||||
logger.trace("Requested Resource with id {}", resourceId);
|
||||
logger.info("Requested Resource with id {}", resourceId);
|
||||
return entityManager.readResource(resourceId);
|
||||
}
|
||||
|
||||
@GET @Path(AccessRESTPath.RESOURCE_SCHEMA_PATH_PART + "/" + AccessRESTPath.RESOURCE_TYPE_PATH_PART)
|
||||
@GET @Path(AccessRESTPath.RESOURCE_SCHEMA_PATH_PART + "/{" + AccessRESTPath.RESOURCE_TYPE_PATH_PART + "}")
|
||||
public String getResourceSchema(@PathParam(AccessRESTPath.RESOURCE_TYPE_PATH_PART) String resourceType)
|
||||
throws SchemaNotFoundException {
|
||||
logger.trace("Requested Resource Schema for type {}", resourceType);
|
||||
logger.info("Requested Resource Schema for type {}", resourceType);
|
||||
return schemaManager.getResourceSchema(resourceType);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import javax.ws.rs.DELETE;
|
|||
import javax.ws.rs.PUT;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.QueryParam;
|
||||
|
||||
import org.gcube.informationsystem.resourceregistry.api.ContextManagement;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextException;
|
||||
|
@ -31,14 +32,14 @@ public class ContextManager {
|
|||
|
||||
@PUT
|
||||
@Path("create/{parentContextId}")
|
||||
public String create(@PathParam("parentContextId") String parentContextId, String name) throws Exception {
|
||||
public String create(@PathParam("parentContextId") String parentContextId, @QueryParam("name") String name) throws Exception {
|
||||
logger.trace("requested create context with json : {} ", name);
|
||||
return contextManager.create(parentContextId, name);
|
||||
}
|
||||
|
||||
@PUT
|
||||
@Path("rename/{contextId}")
|
||||
public String rename(@PathParam("contextId") String uuid, String name)
|
||||
public String rename(@PathParam("contextId") String uuid, @QueryParam("name") String name)
|
||||
throws ContextNotFoundException, ContextException{
|
||||
logger.trace("requested rename context id {} with {} ", uuid, name);
|
||||
return contextManager.rename(uuid, name);
|
||||
|
@ -46,7 +47,7 @@ public class ContextManager {
|
|||
|
||||
@PUT
|
||||
@Path("move/{contextId}")
|
||||
public String move(@PathParam("contextId") String uuid, String newParentId)
|
||||
public String move(@PathParam("contextId") String uuid, @QueryParam("newParentId") String newParentId)
|
||||
throws ContextNotFoundException , ContextException{
|
||||
logger.trace("requested move context id {} with new parend id {} ", uuid, newParentId);
|
||||
return contextManager.move(newParentId, uuid);
|
||||
|
|
Loading…
Reference in New Issue