Scope
user generated templates
TO DISCUSS: UGD only? SMS? Future outgoing integration event REST calls? PDF??
Better defined functional use cases (incl. UI) + some example expected documents??
It's simpler to keep template processing on the server-side, only. For now at least.
User generated documents should use a template engine. Candidates to choose from include:
Name | Reflection | LastRelease | Version | License | Comment | |
---|---|---|---|---|---|---|
StringTemplate | yes | Jan 4, 2013 | 4.0.7 | BSD License | ||
Freemarker | yes | Feb 29, 2012 | 2.3.19 | BSD-style license | ||
Velocity | yes | Nov 29, 2010 | 1.7 | Apache License 2.0 | ||
moustache.java | yes | May 06, 2013 | 0.8.12 | Apache License 2.0 | Mustache.java is a Java 6 implementation of the mustache language used by Netflix and Twitter | |
Thymeleaf | yes | Jun 09, 2013 | 2.0.17 | Apache License 2.0 | ||
Jamon | Dec 20, 2011 | 2.4.1 | Mozilla Public License | |||
Tea | 4.1 | Apache License 2.0 | ||||
Xtend | Jun 26, 2013 | 2.4.2 | Eclipse Public License | |||
Cambridge | "upcoming" | 0.9 | Mailinglist not active since Aug 01 2012 | |||
MVEL | Sep 18, 2012 | 2.1.3 | Apache License 2.0 |
TODO Read up.. learn about features.. compare them (blog?)... pick one!
TemplateDomainService
CRUD and persistance specific functions
TemplateMergeService
Merge data representation into template and return
TODO Document new Java-level interfaces, packages used, utilities needed, etc. etc.
TODO Write some early code! No UI here, yet. No REST interface even. Just TDD! Goal is to illustrate templating, but accessing real entities already (including dynamic custom fields!), consider relationship traversal management, list iteration, etc.
First attempt for template table
CREATE TABLE `m_template` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`text` LONGTEXT NOT NULL,
PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
missing:
how to add metadata, in a generic way?
multitenancy, or do we need to save the creator?
@GET | /templates | getTemplates() | get all templates |
@GET | /templates/{templateID} | getTemplate() | get specific template |
@PUT | /templates/{templateID} | saveTemplate() | create or update template |
@DELETE | /templates/{templateID} | deleteTemplate() | delte template |
@POST | /templates/{templateID} | mergeTemplate() | send data / get template and merge them |
TODO Discuss & refine existing draft mockup. May be after some of above is decided?
TODO Few paragraphs about what we're NOT doing? Non-HTML (e.g. PDF) ? Sophisticated DnD Report Designer?