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

This commit is contained in:
Konstantina Galouni 2023-02-28 11:01:44 +02:00
parent 180e02c829
commit 28c1c9b71d
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}")) {
text = text.replace("{ARGOS.DATASET.TITLE}", datasetEntity.getLabel());
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;
descrPar = p;
text = text.replace("{ARGOS.DATASET.DESCRIPTION}", "");
if(dmpEntity != null) {
text = text.replace("{ARGOS.DMP.DESCRIPTION}", "");
} else {
text = text.replace("{ARGOS.DATASET.DESCRIPTION}", "");
}
r.setText(text, 0);
} else if(text.equals("{ARGOS.DMP.RESEARCHERS}")) {
String researchersNames = "";
@ -974,7 +978,14 @@ public class WordBuilder {
}
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();
cursor.toNextSibling();
Document htmlDoc = Jsoup.parse(((String)datasetEntity.getDescription()).replaceAll("\n", "<br>"));