Merge branch 'ui-redesign' of gitlab.eudat.eu:dmp/OpenAIRE-EUDAT-DMP-service-pilot into ui-redesign

This commit is contained in:
apapachristou 2020-07-08 17:54:50 +03:00
commit 3d51b6bd3c
1 changed files with 18 additions and 13 deletions

View File

@ -1684,7 +1684,11 @@ public class DataManagementPlanManager {
dataBuilder.append(" \"description\": \"").append((dmp.getDescription() != null && !dmp.getDescription().isEmpty() ? dmp.getDescription() : "<p></p>")).append("\",\n"); dataBuilder.append(" \"description\": \"").append((dmp.getDescription() != null && !dmp.getDescription().isEmpty() ? dmp.getDescription() : "<p></p>")).append("\",\n");
dataBuilder.append(" \"version\": \"").append(dmp.getVersion()).append("\",\n"); dataBuilder.append(" \"version\": \"").append(dmp.getVersion()).append("\",\n");
dataBuilder.append(" \"access_right\": \""); dataBuilder.append(" \"access_right\": \"");
if (((Boolean)extraProperties.get("visible"))) { if (extraProperties.get("visible") == null) {
dataBuilder.append("restricted\",\n");
dataBuilder.append(" \"access_conditions\": \"\",\n");
} else {
if (((Boolean) extraProperties.get("visible"))) {
Instant publicationDate = Instant.parse(extraProperties.get("publicDate").toString()); Instant publicationDate = Instant.parse(extraProperties.get("publicDate").toString());
if (publicationDate.isBefore(Instant.now())) { if (publicationDate.isBefore(Instant.now())) {
dataBuilder.append("open\",\n"); dataBuilder.append("open\",\n");
@ -1694,12 +1698,13 @@ public class DataManagementPlanManager {
} }
if (extraProperties.get("license") != null) { if (extraProperties.get("license") != null) {
dataBuilder.append(" \"license\": \"").append(((Map)extraProperties.get("license")).get("pid")).append("\",\n"); dataBuilder.append(" \"license\": \"").append(((Map) extraProperties.get("license")).get("pid")).append("\",\n");
} }
} else { } else {
dataBuilder.append("restricted\",\n"); dataBuilder.append("restricted\",\n");
dataBuilder.append(" \"access_conditions\": \"\",\n"); dataBuilder.append(" \"access_conditions\": \"\",\n");
} }
}
if (dmp.isPublic()) { if (dmp.isPublic()) {
dataBuilder.append(" \"related_identifiers\": [{\n"); dataBuilder.append(" \"related_identifiers\": [{\n");
dataBuilder.append(" \t\t\"identifier\": \"").append((this.environment.getProperty("dmp.domain") + "/external/zenodo/" + id.toString())).append("\",\n"); dataBuilder.append(" \t\t\"identifier\": \"").append((this.environment.getProperty("dmp.domain") + "/external/zenodo/" + id.toString())).append("\",\n");