Minor bug fixes on the exporter

This commit is contained in:
George Kalampokis 2020-03-24 11:26:17 +02:00
parent 7238252954
commit 357ad4ecda
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -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<JsonNode> 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<JsonNode> distributionNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.distribution");
if (!distributionNodes.isEmpty()) {
@ -77,7 +78,7 @@ public class DatasetRDAMapper {
}
List<JsonNode> 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<JsonNode> technicalResourceNodes = JsonSearcher.findNodes(datasetDescriptionObj, "rdaProperty", "dataset.technical_resource");
if (!technicalResourceNodes.isEmpty()) {