mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
trabajando en el pdf
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
// com.imprimelibros.erp.pdf.TemplateRegistry.java
|
||||
package com.imprimelibros.erp.pdf;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -9,10 +8,15 @@ public class TemplateRegistry {
|
||||
|
||||
public TemplateRegistry(PdfModuleConfig config) {
|
||||
this.config = config;
|
||||
System.out.println("PDF templates registrados => " + config.getTemplates());
|
||||
}
|
||||
|
||||
public String resolve(DocumentType type, String templateId) {
|
||||
String key = type.name() + ":" + templateId;
|
||||
String keyAlt = type.name() + "_" + templateId; // compatibilidad con properties
|
||||
if (config.getTemplates() == null) return null;
|
||||
return config.getTemplates().get(type.name() + ":" + templateId);
|
||||
String value = config.getTemplates().get(key);
|
||||
if (value == null) value = config.getTemplates().get(keyAlt);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user