From efe75b49328562ea1c29ea6ef7c0765edd8f5d45 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Thu, 19 Mar 2020 18:22:47 +0200 Subject: [PATCH] Minor fixes on DMP json export --- .../java/eu/eudat/logic/managers/DataManagementPlanManager.java | 2 +- .../java/eu/eudat/models/data/rda/DatasetRDAExportModel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index d655d8ba4..e88e48524 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -1135,7 +1135,7 @@ public class DataManagementPlanManager { mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); String fileName = dmp.getLabel(); fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", ""); - File file = new File(fileName); + File file = new File(fileName + ".json"); try { mapper.writeValue(file, rdaExportModel); } catch (IOException e) { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/rda/DatasetRDAExportModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/rda/DatasetRDAExportModel.java index 0418feca3..c9f509020 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/rda/DatasetRDAExportModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/rda/DatasetRDAExportModel.java @@ -315,7 +315,7 @@ public class DatasetRDAExportModel { if (rdaField.getRdaProperty().equals("dataset.metadata.language")) { metadataRda.setLanguage(rdaField.getRdaValue()); } - if (rdaField.getRdaProperty().equals("dataset.metadata.metadata_standard_id")) { + if (rdaField.getRdaProperty().equals("dataset.metadata.metadata_standard_id") && !rdaField.getRdaValue().isEmpty()) { JSONArray jsonArray = new JSONArray(rdaField.getRdaValue()); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i);