h2020.docx & WordBuilder.java: Updated h2020.docx DMP template and added export of DMP description.

(cherry picked from commit 28c1c9b71d)
This commit is contained in:
Konstantina Galouni 2023-02-28 11:01:44 +02:00 committed by Diamantis Tziotzios
parent 7185b5d117
commit 13e62fd409
2 changed files with 14 additions and 3 deletions

View File

@ -941,10 +941,14 @@ public class WordBuilder {
} else if(datasetEntity != null && text.contains("{ARGOS.DATASET.TITLE}")) { } else if(datasetEntity != null && text.contains("{ARGOS.DATASET.TITLE}")) {
text = text.replace("{ARGOS.DATASET.TITLE}", datasetEntity.getLabel()); text = text.replace("{ARGOS.DATASET.TITLE}", datasetEntity.getLabel());
r.setText(text, 0); r.setText(text, 0);
} else if(datasetEntity != null && text.contains("{ARGOS.DATASET.DESCRIPTION}")) { } else if((dmpEntity != null && text.contains("{ARGOS.DMP.DESCRIPTION}")) || (datasetEntity != null && text.contains("{ARGOS.DATASET.DESCRIPTION}"))) {
descrParPos = parPos; descrParPos = parPos;
descrPar = p; descrPar = p;
if(dmpEntity != null) {
text = text.replace("{ARGOS.DMP.DESCRIPTION}", "");
} else {
text = text.replace("{ARGOS.DATASET.DESCRIPTION}", ""); text = text.replace("{ARGOS.DATASET.DESCRIPTION}", "");
}
r.setText(text, 0); r.setText(text, 0);
} else if(text.equals("{ARGOS.DMP.RESEARCHERS}")) { } else if(text.equals("{ARGOS.DMP.RESEARCHERS}")) {
String researchersNames = ""; String researchersNames = "";
@ -974,7 +978,14 @@ public class WordBuilder {
} }
parPos++; parPos++;
} }
if(descrParPos != -1 && datasetEntity.getDescription() != null) { if(descrParPos != -1 && dmpEntity!=null && dmpEntity.getDescription() != null) {
XmlCursor cursor = descrPar.getCTP().newCursor();
cursor.toNextSibling();
Document htmlDoc = Jsoup.parse(((String)dmpEntity.getDescription()).replaceAll("\n", "<br>"));
HtmlToWorldBuilder htmlToWorldBuilder = new HtmlToWorldBuilder(descrPar, 0, cursor);
NodeTraversor.traverse(htmlToWorldBuilder, htmlDoc);
}
if(descrParPos != -1 && datasetEntity != null && datasetEntity.getDescription() != null) {
XmlCursor cursor = descrPar.getCTP().newCursor(); XmlCursor cursor = descrPar.getCTP().newCursor();
cursor.toNextSibling(); cursor.toNextSibling();
Document htmlDoc = Jsoup.parse(((String)datasetEntity.getDescription()).replaceAll("\n", "<br>")); Document htmlDoc = Jsoup.parse(((String)datasetEntity.getDescription()).replaceAll("\n", "<br>"));