O'Reilly logo

Professional Alfresco: Practical Solutions for Enterprise Content Management by Kevin Roast, Michael G. Uzquiano, Michael Farman, John Newton, David Caruana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. Repository FreeMarker Template API

Templates are widespread throughout Alfresco: They are used within the repository core to generate emails and activities, in the Explorer client to build custom views, at the remote REST API layer, and also as the default rendering mechanism for the Web Script and Surf Frameworks.

Alfresco provides a number of ways to process templates; REST-style URL, Web script components, and JSF UI components. In addition, AVM repository data can be processed in templates.

Multiple template engines are supported, with FreeMarker as the default. The template engine is not tied to any output file format: Templates can output entire HTML files as well as snippets of HTML, XML, JSON, or any other format desired. This makes them extremely flexible and appropriate for developing all kinds of solutions with Alfresco.

TEMPLATE FILES

Templates can be stored either on the classpath (for example, in alfresco/config/templates) or in the repository store.

Each template file will be specific to a particular template engine. The template service will pick the appropriate engine based on the file extension. By default, FreeMarker template files will be used. In the case of the Web Script and Surf Frameworks, FreeMarker is always selected as the template engine.

TEMPLATE MODELS

A model consists of a number of objects or a hierarchy of objects from which a template file retrieves values that can be used to dynamically generate the output. The model is like the API for the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required