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

@ -11,6 +11,7 @@
<wb-module deploy-name="uri-resolver-2.8.1"> <wb-module deploy-name="uri-resolver-2.8.1">
@ -24,6 +25,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -37,6 +39,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -50,6 +53,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -63,7 +67,12 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <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>
@ -89,6 +98,7 @@
<property name="java-output-path" value="/uri-resolver/target/classes"/> <property name="java-output-path" value="/uri-resolver/target/classes"/>
@ -102,6 +112,7 @@
</wb-module> </wb-module>
@ -115,4 +126,5 @@
</project-modules> </project-modules>

View File

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