From 357ad4ecda96adb6c5847f4ba5b74aba8d192693 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 24 Mar 2020 11:26:17 +0200 Subject: [PATCH] Minor bug fixes on the exporter --- .../src/main/java/eu/eudat/logic/managers/RDAManager.java | 2 +- .../java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java index eb10fd753..3a9f2f7a8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/RDAManager.java @@ -29,7 +29,7 @@ public class RDAManager { Dmp rdaDmp = dmpRDAMapper.toRDA(dmp); ObjectMapper mapper = new ObjectMapper(); - mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); + mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss Z")); result = mapper.writeValueAsString(rdaDmp); diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java index 5eb9cc685..da04fe043 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DatasetRDAMapper.java @@ -32,6 +32,7 @@ public class DatasetRDAMapper { rda.setDatasetId(DatasetIdRDAMapper.toRDA(dataset.getId())); rda.setTitle(dataset.getLabel()); rda.setDescription(dataset.getDescription()); +// rda.setAdditionalProperty("template", dataset.getProfile().getId()); try { DatasetWizardModel datasetWizardModel = new DatasetWizardModel().fromDataModel(dataset); @@ -57,7 +58,7 @@ public class DatasetRDAMapper { } List preservationNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.preservation_statement"); if (!preservationNodes.isEmpty()) { - rda.setDataQualityAssurance(preservationNodes.stream().map(preservationNode -> preservationNode.get("value").asText()).collect(Collectors.toList())); + rda.setPreservationStatement(preservationNodes.get(0).get("value").asText()); } List distributionNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.distribution"); if (!distributionNodes.isEmpty()) { @@ -77,7 +78,7 @@ public class DatasetRDAMapper { } List sensitiveDataNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.sensitive_data"); if (!sensitiveDataNodes.isEmpty()) { - rda.setSensitiveData(securityAndPrivacyNodes.stream().map(sensitiveDataNode -> Dataset.SensitiveData.fromValue(sensitiveDataNode.get("value").asText())).findFirst().get()); + rda.setSensitiveData(sensitiveDataNodes.stream().map(sensitiveDataNode -> Dataset.SensitiveData.fromValue(sensitiveDataNode.get("value").asText())).findFirst().get()); } List technicalResourceNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.technical_resource"); if (!technicalResourceNodes.isEmpty()) {