java ... -DQrInvoice.DocumentTemplates=/path/to/a/templatedirectory
QR Invoice offers a set of default XSL document templates but also supports additional custom document templates.
Custom document templates can be installed by putting them into an external file directory. The application then needs to be configured to import that directory by defining the QrInvoice.DocumentTemplates
system property like so:
java ... -DQrInvoice.DocumentTemplates=/path/to/a/templatedirectory
The DocumentTemplateRepository
then imports every file ending with ".xsl" and stores them along with the default templates.
Templates receive an external identifier based on their file name. Here are two examples:
".../my_awesome_template.xsl" -> "MY_AWESOME_TEMPLATE" ".../myAwesomeTemplate.xsl" -> "MYAWESOMETEMPLATE"
Registered templates are displayed in the log
INFO c.c.q.d.DocumentTemplateRepository - DocumentTemplate MY_AWESOME_TEMPLATE was registered
Registered templates are contained in the static DocumentTemplateRepository.ALL
property
Templates can also be manually registered like this:
DocumentTemplateRepository.registerTemplate(DocumentTemplate template);
or
DocumentTemplateRepository.registerTemplates(Collection<DocumentTemplate> templates);