From 15af1f527e093f59bf88f54e29c21cfe54951082 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 24 Sep 2020 15:20:56 +0200 Subject: [PATCH] modified to consider the topic information --- .../actionmanager/project/PrepareProjects.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java index 78aed1a69..948b7d6de 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/project/PrepareProjects.java @@ -97,10 +97,26 @@ public class PrepareProjects { if (csvProject.isPresent()) { String[] programme = csvProject.get().getProgramme().split(";"); + String topic = csvProject.get().getTopics(); + String topicdescription = Optional + .ofNullable(csvProject.get().getTopics()) + .map(topics -> { + if (topic.equalsIgnoreCase(value._1().getTopiccode())) { + return value._1().getTopicdescription(); + } + return null; + }) + .orElse(null); + Arrays .stream(programme) .forEach(p -> { CSVProject proj = new CSVProject(); + proj.setTopics(topic); + if (topicdescription != null) { + proj.setTopicdescription(topicdescription); + } + proj.setProgramme(p); proj.setId(csvProject.get().getId()); csvProjectList.add(proj);