- Bug fixing: `createLink` method in the GeoportalExport service

[#28641]
This commit is contained in:
Francesco Mangiacrapa 2025-01-20 15:02:39 +01:00
parent eb6ced1506
commit 1ec9e1a5bf
2 changed files with 17 additions and 5 deletions

View File

@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [v2.10.1-SNAPSHOT]
- Geoportal Exporter: added static pages as freemarker templates
- Bug fixing: `createLink` method in the GeoportalExport service [#28641]
## [v2.10.0]

View File

@ -232,9 +232,11 @@ public class GeoportalResolver {
.map(TargetAppGeoportalCodes::getTarget_app).collect(Collectors.toList());
List<String> targetPaths = Arrays.asList(TargetAppGeoportalCodes.values()).stream()
.map(TargetAppGeoportalCodes::getId).collect(Collectors.toList());
throw ExceptionManager.badRequestException(req,
"Target application is wrong. Add a target path as /"+targetPaths+" to resolve towards the applications: " + targetApps, this.getClass(),
helpURI);
throw ExceptionManager
.badRequestException(req,
"Target application is wrong. Add a target path as /" + targetPaths
+ " to resolve towards the applications: " + targetApps,
this.getClass(), helpURI);
}
}
@ -325,7 +327,7 @@ public class GeoportalResolver {
GeoportalConfigApplicationProfileReader reader;
String itemLink = null;
String appID = null;
// Resolving towards Data-Viewer or Data-Entry Application
switch (resoruceGeoportalCodes) {
case GEO_DE: {
@ -469,8 +471,17 @@ public class GeoportalResolver {
String linkURL = String.format("%s/%s/%s/%s/%s/%s", serverUrl, GEO, targetAppGeoportalCodes.getId(),
vreName, jsonRequest.getItemType(), jsonRequest.getItemID());
// ADDING RESOLVES_AS IF PRESENT, bug fixing #28641
if (jsonRequest.getRes() != null) {
linkURL += "?" + GeoportalResolver.QP_RESOLVE_AS + "=" + jsonRequest.getRes();
}
// ADDING QUERY STRING IF PRESENT
if (jsonRequest.getQueryString() != null) {
linkURL += "?" + jsonRequest.getQueryString();
if (!linkURL.contains("?"))
linkURL += "?" + jsonRequest.getQueryString();
else
linkURL += "&" + jsonRequest.getQueryString();
}
LOG.info("Returning " + GeoportalResolver.class.getSimpleName() + " URL: " + linkURL);