task_24792 #7
|
@ -26,7 +26,7 @@ public class GeoportalRequest {
|
||||||
@JsonProperty(P_GCUBE_SCOPE)
|
@JsonProperty(P_GCUBE_SCOPE)
|
||||||
private String gcubeScope;
|
private String gcubeScope;
|
||||||
@JsonProperty(P_TARGET_APP)
|
@JsonProperty(P_TARGET_APP)
|
||||||
private String targetApp;
|
private String targetAppName;
|
||||||
/**
|
/**
|
||||||
* It is the UCD ID {usecase_id}
|
* It is the UCD ID {usecase_id}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -285,19 +285,25 @@ 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);
|
||||||
|
|
||||||
TargetAppGeoportalCodes resoruceGeoportalCodes = TargetAppGeoportalCodes
|
String targetAppName = jsonRequest.getTargetAppName();
|
||||||
.valueOfName(jsonRequest.getTargetApp());
|
|
||||||
|
|
||||||
if (resoruceGeoportalCodes == null) {
|
TargetAppGeoportalCodes resoruceGeoportalCodes = null;
|
||||||
LOG.error("Target application parameter is null/malformed");
|
|
||||||
|
if (targetAppName == null) {
|
||||||
resoruceGeoportalCodes = TargetAppGeoportalCodes.GEO;
|
resoruceGeoportalCodes = TargetAppGeoportalCodes.GEO;
|
||||||
LOG.info("Target application using default: " + resoruceGeoportalCodes);
|
LOG.error("Target application parameter is null, using default: " + resoruceGeoportalCodes);
|
||||||
} else {
|
} else {
|
||||||
List<String> targetApps = Arrays.asList(TargetAppGeoportalCodes.values()).stream()
|
|
||||||
.map(TargetAppGeoportalCodes::getTarget_app).collect(Collectors.toList());
|
|
||||||
|
|
||||||
throw ExceptionManager.badRequestException(req,
|
resoruceGeoportalCodes = TargetAppGeoportalCodes.valueOfName(jsonRequest.getTargetAppName());
|
||||||
"Target application is null/malformed. It must be: " + targetApps, this.getClass(), helpURI);
|
|
||||||
|
if (resoruceGeoportalCodes == null) {
|
||||||
|
LOG.error("Target application parameter is malformed");
|
||||||
|
List<String> targetApps = Arrays.asList(TargetAppGeoportalCodes.values()).stream()
|
||||||
|
.map(TargetAppGeoportalCodes::getTarget_app).collect(Collectors.toList());
|
||||||
|
throw ExceptionManager.badRequestException(req,
|
||||||
|
"Target application is wrong. It must be one value of: " + targetApps, this.getClass(),
|
||||||
|
helpURI);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String linkURL = String.format("%s/%s/%s/%s/%s", serverUrl, resoruceGeoportalCodes.getId(), vreName,
|
String linkURL = String.format("%s/%s/%s/%s/%s", serverUrl, resoruceGeoportalCodes.getId(), vreName,
|
||||||
|
|
Loading…
Reference in New Issue