|
|
|
[
Permlink
| « Hide
]
Dick Anderson - 19/Mar/10 01:54 PM
As part of this we should look at making the body of the email configurable by product. i.e. parsed html content or similar. We should also consider doing the same for the broker notification emails as their body text is currently hard coded.
Making the email body configurable suggest a template based approach. The Base product would define default templates which other products could use or override as necessary. The question is, which templating engine should we use?
The most obvious would be XSLT - especially as we already have a command adaptor for XSLT in the Core which would allow us to simply define a service which wraps stylesheet (referenced by URL) and can be invoked like any other command. However, XSL is not the simplest beast to learn and has the drawback that XSL can't easily be edited online. As the templates will be heavy on HTML and quite light on logic (judging by the current hard coded implementation) it would be preferable to be able to edit the templates in standard rich-text JS editors like the one in Alfresco. For these reasons, it would be worthwhile looking at alternatives like Velocity (http://wiki.apache.org/velocity/FrontPage) which is considerably easier to get started with (as a template author) and is compatible with rich-text editors. Adding a Velocity command adaptor to the core might be a good starting point and would allow template authors to choose the engine which best suits their needs. Should we consider some other engines too? As an additional observation: we currently handle email generation in exactly the same way that we handle the generation of any other content - i.e. a widget with hard coded HTML. This approach is fine up to a point, but it would make the system as a whole considerably more flexible if all of these widgets were driven by templates.
This would give product developers enormous flexibility in how UIs are generated without introducing any additional complexity for those who are happy to use the base templates. This JIRA should be used to cover the wholesale refactoring of the UI to a template driven approach. I'm going to backtrack on that last comment. This JIRA should be used to create the facility to generate UI elements from templates, and should implement templates for the user email elements themselves. But the work of converting the whole UI to use templates will be covered under another JIRA to avoid holding this one up.
|
|||||||||||||||||||||||||||||||||||||||||