Fixes DMP export bug including Dataset Descriptions with Canceled or Deleted status. (Issue #159)

This commit is contained in:
gkolokythas 2019-09-18 13:28:02 +03:00
parent 95168d78c7
commit 26f27f3d6d
1 changed files with 6 additions and 3 deletions

View File

@ -194,13 +194,13 @@ public class DataManagementPlanManager {
wordBuilder.addParagraphContent("Organisations", document, ParagraphStyle.HEADER2, BigInteger.ZERO);
if (dmpEntity.getOrganisations().size() > 0) {
wordBuilder.addParagraphContent(dmpEntity.getOrganisations().stream().map(x -> x.getLabel()).collect(Collectors.joining(", "))
wordBuilder.addParagraphContent(dmpEntity.getOrganisations().stream().map(Organisation::getLabel).collect(Collectors.joining(", "))
, document, ParagraphStyle.TEXT, BigInteger.ZERO);
}
wordBuilder.addParagraphContent("Researchers", document, ParagraphStyle.HEADER2, BigInteger.ZERO);
if (dmpEntity.getResearchers().size() > 0) {
wordBuilder.addParagraphContent(dmpEntity.getResearchers().stream().map(x -> x.getLabel()).collect(Collectors.joining(", "))
wordBuilder.addParagraphContent(dmpEntity.getResearchers().stream().map(Researcher::getLabel).collect(Collectors.joining(", "))
, document, ParagraphStyle.TEXT, BigInteger.ZERO);
}
@ -214,7 +214,10 @@ public class DataManagementPlanManager {
parBreakDMP.setPageBreak(true);
wordBuilder.addParagraphContent("Datasets", document, ParagraphStyle.TITLE, BigInteger.ZERO);
dmpEntity.getDataset().stream().forEach(datasetEntity -> {
dmpEntity.getDataset().stream()
.filter(item -> item.getStatus() != Dataset.Status.CANCELED.getValue())
.filter(item -> item.getStatus() != Dataset.Status.DELETED.getValue())
.forEach(datasetEntity -> {
Map<String, Object> properties = new HashMap<>();
if (datasetEntity.getProperties() != null) {
JSONObject jobject = new JSONObject(datasetEntity.getProperties());