25.4. RenderSets

25.4.1. What is a RenderSet

A RenderSet can be used to produce the markup containers around portlets and portlet regions. The markup for each region, and each portlet window in a region is identical. Further more, it is most likely identical across several layouts. The way portlets are arranged and decorated will most likely not change across layouts. What will change is the look and feel of the decoration, the images, fonts, and colors used to render each portlet window on the page. This is clearly a task for the web designer, and hence should be realized via the portal theme. The layout only needs to provide enough information to the theme so that it can do its job. The RenderSet is exactly that link between the layout and the theme that takes the information available in the portal and renders markup containing the current state of the page and each portlet on it. It makes sure that the markup around each region and portlet contains the selectors that the theme CSS needs to style the page content appropriately.
A RenderSet consists of the implementations of four interfaces. Each of those interfaces corresponds to a markup container on the page.
Here are the four markup containers and their interface representation:
  • Region - RegionRenderer
  • Window - WindowRenderer
  • Decoration - DecorationRenderer
  • Portlet Content - PortletRenderer
All the renderer interfaces are specified in the org.jboss.portal.theme.render package.
The four markup containers are hierarchical. The region contains one or more windows. A window contains the portlet decoration and the portlet content.
The region is responsible for arranging the positioning and order of each portlet window. Should they be arranged in a row or a column? If there are more then one portlet window in a region, in what order should they appear?
The window is responsible for placing the window decoration, including the portlet title, over the portlet content, or under, or next to it.
The decoration is responsible for inserting the correct markup with the links to the portlet modes and window states currently available for each portlet.
The portlet content is responsible for inserting the actually rendered markup fragment that was produced by the portlet itself.