User Tools

Site Tools


dev:server_print_templates

This is an old revision of the document!


Server Print Templates

What's the Problem?

  • Templates whose syntax depends on the UI framework creates inconsistency and is not sustainable.
  • Angular templates must be pre-compiled.
    • Template modification requires local install and use of 'ng build'.
  • Current template editing could be more secure (scrubbing scripts, etc.)

Proposal: Server Templates

  • Templates are configured and stored in the database, similar to Action/Trigger templates, using Template Toolkit.
  • Modifying templates requires permissions.
  • Print templates can be saved per-org (and potentially per workstation if needed).
  • Print templates are managed via admin UI.
  • Support per-locale templates.
  • Templates can produce different content types
  • Templates are compiled for printing on the server
    • At print time, the caller passes template data, template name, etc. to the server and receives a compiled (text, html, etc.) response.
  • Template content can be scrubbed on the server for added security.
  • Note we are already using server-managed templates for self-checkout receipts, some ACQ interfaces, and various others, so the general concept is not new.

Proof of Concept

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/server-print-templates

This creates a purpose-built template processor instead of using Action/Trigger for several reasons:

  • A/T has a lot of moving parts which are not needed
    • Printing needs to be as streamlined as possible to avoid slowing staff work flow.
    • There is no environment building, etc.
  • Provides an opportunity to add locale, content type, etc. support.
  • Uses a mod_perl front-end so template content can be treated like a web page where desired and so the cross-walk to packaging the response as an opensrf message is bypassed.

Offline Caveat

The staff client offline interface will still require a small set of pre-compiled templates that live within the application, since it will not be able to call out for template compilation.

dev/server_print_templates.1555432614.txt.gz · Last modified: 2022/02/10 13:34 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.