Skip to content

Commit

Permalink
Template: Add reasons for closed and restricted dataset from frontend…
Browse files Browse the repository at this point in the history
… into templates
  • Loading branch information
GeoffreyKarnbach committed Oct 7, 2024
1 parent bb1a277 commit f0a3985
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,28 @@ protected void repoInformation() {
repoInformation + (repoInformation.isEmpty() ? "" : ";"));
}

protected void closeAndRestrictedDataInformation() {
String closedReasons = "";
if (dmp.getClosedAccessInfo() != null && !dmp.getClosedAccessInfo().isBlank()) {
closedReasons = dmp.getClosedAccessInfo();
}
addReplacement(
replacements,
"[closeddatasetreasons]", closedReasons);

String restrictedReasons = "";
if (dmp.getRestrictedAccessInfo() != null && !dmp.getRestrictedAccessInfo().isBlank()) {
restrictedReasons = dmp.getRestrictedAccessInfo();
}
addReplacement(
replacements,
"[restricteddatasetreasons]", restrictedReasons);
}

/** repoinfoAndToolsInformation. */
public void repoinfoAndToolsInformation() {
repoInformation();
closeAndRestrictedDataInformation();

if (dmp.getTools() != null) {
if (!Objects.equals(dmp.getTools(), "")) {
Expand Down Expand Up @@ -1203,7 +1222,7 @@ public void composeTableDatasetPublication(XWPFTable xwpfTable) {
&& !newDatasets.get(i).getDataAccess().equals(EDataAccessType.CLOSED)) {

ELicense license = newDatasets.get(i).getLicense();
XWPFParagraph paragraph = newRow.getCell(6).getParagraphs().get(0);
XWPFParagraph paragraph = newRow.getCell(5).getParagraphs().get(0);
turnRunIntoHyperlinkRun(paragraph.getRuns().get(0), license.getUrl());
commitTableRows(xwpfTable);
}
Expand Down
Binary file modified src/main/resources/org/damap/base/template/FWFTemplate.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit f0a3985

Please sign in to comment.