FreeMarker macros in Tiny Marbles CMS

In Tiny Marbles CMS all HTML pages are created with the Java template engine FreeMarker. FreeMarker is designed to be practical for the generation of HTML Web pages, particularly by servlet-based applications following the MVC (Model View Controller) pattern, which is in case of Tiny Marbles CMS the Apache Struts framework.

Each FreeMarker template of Tiny Marbles CMS in turn calls FreeMarker macros, these macros are called 'widgets' to consistently generate user interfaces in HTML. The most important widgets are declared in the 'widget templates' of the package 'webcore' of the Tiny Marbles Framework. The FreeMarker templates in the folder /web/templates/ of package 'webcore' are devided in in three areas:

The approach with the FreeMarker templates and FreeMarker macros is a powerful feature of Tiny Marbles to create HTML code for administration pages as well as for public websites in a simple and intuitive way. Filtered lists, pagination, trees, tabs, image galleries or Ajax requests can be build very quickly using the widgets of the FreeMarker macro library.  

The widgets can be called with @show, @edit or @data from the following modules of the Tiny Marbles Framework: webcore, MUM, CMS and WSM. Here an example for creating a submit button for an HTML form:

<@edit.button label=action.getText("control.Zone.submit") />
more Complete article

An introduction to the Tiny Marbles Framework

If you like the Tiny Marbles CMS it might be interesting to get a deeper look at the technology behind the system. All features of the Tiny Marbles CMS are internally organized from the viewpoint of a developer as libraries and frameworks. In fact, the idea is very simple: take the best Java Open Source frameworks for web applications which are available on the market and create your own libraries on top of them. This is exactly what happened in the last couple of years. You can find the most important Open Source libraries of Tiny Marbles Framework here.

uml_components_big.png All these modules are combined in a logical order, the dependencies you can see in the component model in the drawing on the left. The website manager (WSM) has included all modules, and it is called 'Tiny Marbles CMS'. On the other hand, all modules can be used independently. You are looking for an authorization engine for your project: you could use Talos for that. You need a user management system? In this case you could try out MUM. Or check out the Repository in case you would like to organize your database access upon the DAO pattern and Hibernate. If you like to care about the website layout yourself, you could use the CMS module without the website manager (WSM).

The complete set of modules from the view point of a developer for independent usage is called the 'Tiny Marbles Framework'. The framework is solid, well tested and is used in a variety of running public web applications.

more Complete article