Updated Paths

This commit is contained in:
Francesco Mangiacrapa 2023-03-24 15:54:40 +01:00
parent de4b608051
commit d4862b88d6
3 changed files with 18 additions and 36 deletions

View File

@ -18,15 +18,12 @@ import lombok.extern.slf4j.Slf4j;
public class GeoportalRequest {
public static final String P_GCUBE_SCOPE = "gcube_scope";
public static final String P_TARGET_APP = "target_app_name";
public static final String P_ITEM_TYPE = "item_type";
public static final String P_ITEM_ID = "item_id";
public static final String P_QUERY_STRING = "query_string";
@JsonProperty(P_GCUBE_SCOPE)
private String gcubeScope;
@JsonProperty(P_TARGET_APP)
private String targetAppName;
/**
* It is the UCD ID {usecase_id}
*/

View File

@ -18,7 +18,6 @@ import org.gcube.datatransfer.resolver.services.GeoportalResolver;
*/
public enum TargetAppGeoportalCodes {
GEO(GeoportalResolver.GEO, "geoportal", "Geoportal"),
GEO_DV(GeoportalResolver.GEO_DV, "data-viewer", "Geoportal Viewer"),
GEO_DE(GeoportalResolver.GEO_DE, "data-entry", "Geoportal Entry");

View File

@ -49,9 +49,9 @@ import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
@Path("/geo")
public class GeoportalResolver {
public static final String GEO_DE = "de";
public static final String GEO = "geo";
public static final String GEO_DV = "dv";
public static final String GEO_DE = "de"; //data-entry
public static final String GEO = "geo"; //geoportal
public static final String GEO_DV = "dv"; //data-viewer
private static final String QP_RESOLVE_AS = "res";
private static final String PATH_PROJECT_ID = "project_id";
@ -73,21 +73,6 @@ public class GeoportalResolver {
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 @Path("/{targetAppId:" + GEO + "|"
* + GEO_DV + "|" + GEO_DE + "}" +
* "/{vre_name}/{usecase_id}/{project_id}")
*/
@GET
@Path("/{targetAppId}/{vre_name}/{usecase_id}/{project_id}")
public Response resolveGeoportal(@Context HttpServletRequest req, @PathParam(PATH_TARGET_APP) String targetAppId,
@ -102,24 +87,25 @@ public class GeoportalResolver {
}
/**
* Resolve geoportal DV.
* Create a Catalogue Link.
*
* @param req the req
* @param vreName the vre name
* @param ucdID the ucd ID
* @param projectID the project ID
* @param resolveAs the resolve as
* @param req the req
* @param targetAppId the target app id
* @param jsonRequest the json request
* @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 {
TargetAppGeoportalCodes targetAppGeoportalCodes = TargetAppGeoportalCodes.GEO_DV;
return genericGet(req, targetAppGeoportalCodes, vreName, ucdID, projectID, resolveAs);
@POST
@Path("")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public Response postGeoportalNoAppDef(@Context HttpServletRequest req, GeoportalRequest jsonRequest)
throws WebApplicationException {
LOG.info(this.getClass().getSimpleName() + " POST starts...");
// String targetAppId = GEO;
TargetAppGeoportalCodes targetAppGeoportalCodes = checkTargetApplictionID(req, null);
LOG.info("The target app is: " + targetAppGeoportalCodes);
return genericPost(req, jsonRequest, targetAppGeoportalCodes);
}
/**