task_24792 #7

Merged
francesco.mangiacrapa merged 35 commits from task_24792 into master 2023-03-28 12:30:20 +02:00
1 changed files with 49 additions and 14 deletions
Showing only changes of commit 4ba61bf232 - Show all commits

View File

@ -73,13 +73,51 @@ public class GeoportalResolver {
PUBLIC, PRIVATE PUBLIC, PRIVATE
} }
/**
* Resolve geoportal.
*
* @param req the req
* @param targetAppId the target app id
* @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("/{vre_name}/{usecase_id}/{project_id}")
public Response resolveGeoportalNoAppDef(@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 {
LOG.info(this.getClass().getSimpleName() + " resolveGeoportalNoAppDef - GET starts...");
TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, null);
LOG.info("The target app is: " + targetAppGeoportalCodes);
return genericGet(req, targetAppGeoportalCodes, vreName, ucdID, projectID, resolveAs);
}
/**
* Resolve geoportal.
*
* @param req the req
* @param targetAppId the target app id
* @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 @GET
@Path("/{targetAppId}/{vre_name}/{usecase_id}/{project_id}") @Path("/{targetAppId}/{vre_name}/{usecase_id}/{project_id}")
public Response resolveGeoportal(@Context HttpServletRequest req, @PathParam(PATH_TARGET_APP) String targetAppId, public Response resolveGeoportal(@Context HttpServletRequest req, @PathParam(PATH_TARGET_APP) String targetAppId,
@PathParam(PATH_VRE_NAME) String vreName, @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_VRE_NAME) String vreName, @PathParam(PATH_USECASE_ID) String ucdID,
@PathParam(PATH_PROJECT_ID) String projectID, @QueryParam(QP_RESOLVE_AS) String resolveAs) @PathParam(PATH_PROJECT_ID) String projectID, @QueryParam(QP_RESOLVE_AS) String resolveAs)
throws WebApplicationException { throws WebApplicationException {
// String targetAppId = GEO;
LOG.info(this.getClass().getSimpleName() + " resolveGeoportal - GET starts...");
TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, targetAppId); TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, targetAppId);
LOG.info("The target app is: " + targetAppGeoportalCodes); LOG.info("The target app is: " + targetAppGeoportalCodes);
return genericGet(req, targetAppGeoportalCodes, vreName, ucdID, projectID, resolveAs); return genericGet(req, targetAppGeoportalCodes, vreName, ucdID, projectID, resolveAs);
@ -87,10 +125,9 @@ public class GeoportalResolver {
} }
/** /**
* Create a Catalogue Link. * Post geoportal no app def.
* *
* @param req the req * @param req the req
* @param targetAppId the target app id
* @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
@ -101,8 +138,8 @@ public class GeoportalResolver {
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN)
public Response postGeoportalNoAppDef(@Context HttpServletRequest req, GeoportalRequest jsonRequest) public Response postGeoportalNoAppDef(@Context HttpServletRequest req, GeoportalRequest jsonRequest)
throws WebApplicationException { throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " POST starts...");
// String targetAppId = GEO; LOG.info(this.getClass().getSimpleName() + " postGeoportalNoAppDef - POST starts...");
TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, null); TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, null);
LOG.info("The target app is: " + targetAppGeoportalCodes); LOG.info("The target app is: " + targetAppGeoportalCodes);
return genericPost(req, jsonRequest, targetAppGeoportalCodes); return genericPost(req, jsonRequest, targetAppGeoportalCodes);
@ -123,8 +160,8 @@ public class GeoportalResolver {
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN)
public Response postGeoportal(@Context HttpServletRequest req, @PathParam(PATH_TARGET_APP) String targetAppId, public Response postGeoportal(@Context HttpServletRequest req, @PathParam(PATH_TARGET_APP) String targetAppId,
GeoportalRequest jsonRequest) throws WebApplicationException { GeoportalRequest jsonRequest) throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " POST starts...");
// String targetAppId = GEO; LOG.info(this.getClass().getSimpleName() + " postGeoportal - POST starts...");
TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, targetAppId); TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, targetAppId);
LOG.info("The target app is: " + targetAppGeoportalCodes); LOG.info("The target app is: " + targetAppGeoportalCodes);
return genericPost(req, jsonRequest, targetAppGeoportalCodes); return genericPost(req, jsonRequest, targetAppGeoportalCodes);
@ -180,8 +217,6 @@ public class GeoportalResolver {
@PathParam(PATH_PROJECT_ID) String projectID, @QueryParam(QP_RESOLVE_AS) String resolveAs) @PathParam(PATH_PROJECT_ID) String projectID, @QueryParam(QP_RESOLVE_AS) String resolveAs)
throws WebApplicationException { throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " GET starts...");
try { try {
InnerMethodName.instance.set("resolveGeoportalPublicLink"); InnerMethodName.instance.set("resolveGeoportalPublicLink");
@ -391,8 +426,8 @@ public class GeoportalResolver {
"The scope '" + scope + "' does not matching any scope in the infrastructure. Is it valid?", "The scope '" + scope + "' does not matching any scope in the infrastructure. Is it valid?",
this.getClass(), helpURI); this.getClass(), helpURI);
String linkURL = String.format("%s/%s%s/%s/%s/%s", serverUrl, GEO, targetAppGeoportalCodes.getId(), vreName, String linkURL = String.format("%s/%s/%s/%s/%s/%s", serverUrl, GEO, targetAppGeoportalCodes.getId(),
jsonRequest.getItemType(), jsonRequest.getItemID()); vreName, jsonRequest.getItemType(), jsonRequest.getItemID());
if (jsonRequest.getQueryString() != null) { if (jsonRequest.getQueryString() != null) {
linkURL += "?" + jsonRequest.getQueryString(); linkURL += "?" + jsonRequest.getQueryString();