Review findings

This commit is contained in:
Alphonse Bendt
2024-10-24 00:14:35 +02:00
committed by Kim Shepherd
parent 7b04a1eb2f
commit 81c5ec868d
6 changed files with 14 additions and 27 deletions

View File

@@ -516,10 +516,6 @@
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>

View File

@@ -221,7 +221,7 @@ public class CitationDocumentServiceImpl implements CitationDocumentService, Ini
}
// If previous logic didn't return true, then we're false.
return true;
return false;
}
/**

View File

@@ -45,7 +45,9 @@ public class CoverPageService {
/**
* Render a PDF coverpage for the given Item. The implementation may use the context and
* any relevant meta data from the Item to populuate dynamic content in the rendered page.
* any relevant meta data from the Item to populate dynamic content in the rendered page.
* All metadata fields (using format schema_field_qualifier) are passed to coverPageContributor
* and can be referenced in HTML template
*
* @param item the current item
* @return a PDDocument containing the rendered coverpage.
@@ -58,7 +60,7 @@ public class CoverPageService {
// The contributor allows to calculate additional parameters for the template or to replace existing ones.
parameters = coverPageContributor.processCoverPageParams(item, parameters);
LOG.info("Rendering cover document with params = {}", parameters);
LOG.debug("Rendering cover document with params = {}", parameters);
var html = pdfGenerator.parseThymeleafTemplate(coverTemplate, parameters);

View File

@@ -26,7 +26,7 @@ public class DefaultCoverPageContributor implements CoverPageContributor {
if (StringUtils.isBlank(dcTitleSubtitle)) {
parameters.put("metadata_title", dcTitle);
} else {
parameters.put("metadata_title", "%s: %s".formatted(dcTitle, dcTitleSubtitle));
parameters.put("metadata_title", String.format("%s: %s", dcTitle, dcTitleSubtitle));
}
// join authors to list

View File

@@ -14,6 +14,11 @@
<!-- only limited subset of CSS v3 features are supported. Be careful to check the rendered result! -->
<style>
/* check the documentation for details how to configure the page size
https://flyingsaucerproject.github.io/flyingsaucer/r8/guide/users-guide-R8.html#xil_34
*/
@page { size: A4 }
body {
background: white;
height: 100%; /* Ensure the html and body are full height */
@@ -101,6 +106,7 @@
<div class="body">
<div class="metadata">
<!-- The metadata fields from the current item can be referenced here in the format schema_field_qualifier -->
<div class="title" th:text="${metadata_title}">Test title</div>
<div class="author" th:text="${metadata_author}">Autor 1; Author 2; Author 3</div>

View File

@@ -22,22 +22,5 @@
# Customize the text/appearance of the citation PDF
# Citation page format, either LETTER or A4
#default => LETTER
#citation-page.page_format = LETTER
# First row of header, perhaps put your institution/university name
# A comma separator will create a header with multiple sections on one line.
#citation-page.header1=DSpace Institution
# Second row of header, perhaps put your DSpace branded name, and url to your DSpace
# A comma separator will create a header with multiple sections on one line.
#citation-page.header2=DSpace Repository,http://dspace.org
# Metadata fields to display on the citation PDF.
# Specify in schema.element.qualifier form, and separate fields by commas. If you want a horizontal line, use _line_
#citation-page.fields=dc.date.issued,dc.title,dc.creator,dc.contributor.author,dc.publisher,_line_,dc.identifier.citation,dc.identifier.uri
# Footer text, either some type of license/copyright info, or just letting them know where they got the document from.
# Any commas in this footer should be escaped (\,)
#citation-page.footer=Downloaded from DSpace Repository\, DSpace Institution's institutional repository
#Name of the cover page template (is loaded as resource)
#citation-page.cover-template=dspace_coverpage