Skip to content
Snippets Groups Projects
Commit d047382a authored by srosse's avatar srosse
Browse files

OO-3874: allow configuration of PDF generator in olat.local.properties

parent fe55fa22
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,8 @@ public class PdfModule extends AbstractSpringModule implements ConfigOnOff { ...@@ -43,6 +43,8 @@ public class PdfModule extends AbstractSpringModule implements ConfigOnOff {
@Value("${pdf.service.enabled:false}") @Value("${pdf.service.enabled:false}")
private boolean enabled; private boolean enabled;
@Value("${pdf.service.spi:}")
private String pdfSpiId;
@Autowired @Autowired
private List<PdfSPI> pdfSpies; private List<PdfSPI> pdfSpies;
...@@ -69,7 +71,7 @@ public class PdfModule extends AbstractSpringModule implements ConfigOnOff { ...@@ -69,7 +71,7 @@ public class PdfModule extends AbstractSpringModule implements ConfigOnOff {
enabled = "true".equals(enabledObj); enabled = "true".equals(enabledObj);
} }
String spiObj = getStringPropertyValue(PDF_SPI, true); String spiObj = getStringPropertyValue(PDF_SPI, pdfSpiId);
if(StringHelper.containsNonWhitespace(spiObj)) { if(StringHelper.containsNonWhitespace(spiObj)) {
for(PdfSPI spi:pdfSpies) { for(PdfSPI spi:pdfSpies) {
if(spiObj.equals(spi.getId())) { if(spiObj.equals(spi.getId())) {
...@@ -100,8 +102,10 @@ public class PdfModule extends AbstractSpringModule implements ConfigOnOff { ...@@ -100,8 +102,10 @@ public class PdfModule extends AbstractSpringModule implements ConfigOnOff {
public void setPdfServiceProvider(PdfSPI pdfSpi) { public void setPdfServiceProvider(PdfSPI pdfSpi) {
this.pdfSpi = pdfSpi; this.pdfSpi = pdfSpi;
if (pdfSpi == null) { if (pdfSpi == null) {
pdfSpiId = null;
removeProperty(PDF_SPI, true); removeProperty(PDF_SPI, true);
} else { } else {
pdfSpiId = pdfSpi.getId();
setStringProperty(PDF_SPI, pdfSpi.getId(), true); setStringProperty(PDF_SPI, pdfSpi.getId(), true);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment