Updated paths

This commit is contained in:
Francesco Mangiacrapa 2023-03-24 14:47:32 +01:00
parent f6004df3db
commit b57bd03889
2 changed files with 103 additions and 88 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -12,7 +13,8 @@
<wb-module deploy-name="uri-resolver-2.8.1">
@ -25,7 +27,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -38,7 +41,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -51,7 +55,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -64,7 +69,11 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="uri-resolver-manager-1.6.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/uri-resolver-manager/uri-resolver-manager">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -77,7 +86,8 @@
<property name="context-root" value="uri-resolver"/>
@ -90,7 +100,8 @@
<property name="java-output-path" value="/uri-resolver/target/classes"/>
@ -103,7 +114,8 @@
</wb-module>

View File

@ -46,19 +46,19 @@ import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
*
* Mar 23, 2023
*/
@Path("")
@Path("/")
public class GeoportalResolver {
public static final String GEO_DE = "geo-de";
public static final String GEO = "geo";
public static final String GEO_DV = "geo-dv";
private static final String QP_RESOLVE_AS = "res";
private static final String PATH_PROJECT_ID = "project_id";
private static final String PATH_USECASE_ID = "usecase_id";
private static final String PATH_VRE_NAME = "vre_name";
private static final String PATH_TARGET_APP = "targetAppId";
private static final Logger LOG = LoggerFactory.getLogger(GeoportalResolver.class);
private static String helpURI = "https://wiki.gcube-system.org/gcube/URI_Resolver#Geoportal_Resolver";
@ -85,7 +85,7 @@ public class GeoportalResolver {
* @throws WebApplicationException the web application exception
*/
@GET
@Path(GEO+"/{vre_name}/{usecase_id}/{project_id}")
@Path(GEO + "/{vre_name}/{usecase_id}/{project_id}")
public Response resolveGeoportal(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName,
@PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID,
@QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException {
@ -94,47 +94,47 @@ public class GeoportalResolver {
}
/**
* Resolve geoportal DV.
*
* @param req the req
* @param vreName the vre name
* @param ucdID the ucd ID
* @param projectID the project ID
* @param resolveAs the resolve as
* @return the response
* @throws WebApplicationException the web application exception
*/
@GET
@Path(GEO_DV+"/{vre_name}/{usecase_id}/{project_id}")
public Response resolveGeoportalDV(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName,
@PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID,
@QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException {
String targetAppId = GEO_DV;
return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs);
}
/**
* Resolve geoportal DE.
*
* @param req the req
* @param vreName the vre name
* @param ucdID the ucd ID
* @param projectID the project ID
* @param resolveAs the resolve as
* @return the response
* @throws WebApplicationException the web application exception
*/
@GET
@Path(GEO_DE+"/{vre_name}/{usecase_id}/{project_id}")
public Response resolveGeoportalDE(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName,
@PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID,
@QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException {
String targetAppId = GEO_DE;
return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs);
}
// /**
// * Resolve geoportal DV.
// *
// * @param req the req
// * @param vreName the vre name
// * @param ucdID the ucd ID
// * @param projectID the project ID
// * @param resolveAs the resolve as
// * @return the response
// * @throws WebApplicationException the web application exception
// */
// @GET
// @Path(GEO_DV + "/{vre_name}/{usecase_id}/{project_id}")
// public Response resolveGeoportalDV(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName,
// @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID,
// @QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException {
// String targetAppId = GEO_DV;
// return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs);
//
// }
//
// /**
// * Resolve geoportal DE.
// *
// * @param req the req
// * @param vreName the vre name
// * @param ucdID the ucd ID
// * @param projectID the project ID
// * @param resolveAs the resolve as
// * @return the response
// * @throws WebApplicationException the web application exception
// */
// @GET
// @Path(GEO_DE + "/{vre_name}/{usecase_id}/{project_id}")
// public Response resolveGeoportalDE(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName,
// @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID,
// @QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException {
// String targetAppId = GEO_DE;
// return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs);
//
// }
/**
* Create a Catalogue Link.
@ -148,45 +148,48 @@ public class GeoportalResolver {
@Path(GEO)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public Response postGeoportal(@Context HttpServletRequest req, GeoportalRequest jsonRequest) throws WebApplicationException {
public Response postGeoportal(@Context HttpServletRequest req, GeoportalRequest jsonRequest)
throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " POST starts...");
String targetAppId = GEO;
return genericPost(req, jsonRequest, targetAppId);
}
/**
* Post geoportal DV.
*
* @param req the req
* @param jsonRequest the json request
* @return the response
* @throws WebApplicationException the web application exception
*/
@Path(GEO_DV)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public Response postGeoportalDV(@Context HttpServletRequest req, GeoportalRequest jsonRequest) throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " POST starts...");
String targetAppId = GEO_DV;
return genericPost(req, jsonRequest, targetAppId);
}
/**
* Post geoportal DE.
*
* @param req the req
* @param jsonRequest the json request
* @return the response
* @throws WebApplicationException the web application exception
*/
@Path(GEO_DE)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public Response postGeoportalDE(@Context HttpServletRequest req, GeoportalRequest jsonRequest) throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " POST starts...");
String targetAppId = GEO_DE;
return genericPost(req, jsonRequest, targetAppId);
}
// /**
// * Post geoportal DV.
// *
// * @param req the req
// * @param jsonRequest the json request
// * @return the response
// * @throws WebApplicationException the web application exception
// */
// @Path(GEO_DV)
// @Consumes(MediaType.APPLICATION_JSON)
// @Produces(MediaType.TEXT_PLAIN)
// public Response postGeoportalDV(@Context HttpServletRequest req, GeoportalRequest jsonRequest)
// throws WebApplicationException {
// LOG.info(this.getClass().getSimpleName() + " POST starts...");
// String targetAppId = GEO_DV;
// return genericPost(req, jsonRequest, targetAppId);
// }
//
// /**
// * Post geoportal DE.
// *
// * @param req the req
// * @param jsonRequest the json request
// * @return the response
// * @throws WebApplicationException the web application exception
// */
// @Path(GEO_DE)
// @Consumes(MediaType.APPLICATION_JSON)
// @Produces(MediaType.TEXT_PLAIN)
// public Response postGeoportalDE(@Context HttpServletRequest req, GeoportalRequest jsonRequest)
// throws WebApplicationException {
// LOG.info(this.getClass().getSimpleName() + " POST starts...");
// String targetAppId = GEO_DE;
// return genericPost(req, jsonRequest, targetAppId);
// }
/**
* Generic get.