Back To Jetspeed 2 Wiki Home


The current implementation of Jetspeed includes the initial framework for handling layouts and decorators. The first task would be done finalize the architecture and document it. The purpose of this document is to describe the current state, propose changes and serve as the design document for the J2 Layouts. Over time chapter 3 (proposed changes) should disappear.


Here is a list of terms and definitions used in the layout and decorator handling specifications:




Defines the fashion in which grouping of Fragments will organized relative to the final, aggregated content of a request to the portal. A Page is an example of a grouping of Fragments.


Frame around page


Content whose source is that of a dynamic nature e.g. generated by a Porlet or a Page The content of a Fragment should not be manipulated by a Decoration.


Any static or semi-static markup surrounding a dynamically generated Fragment. Decoration does not have access to alter a Fragment's generated mark up.


An aggregate of Fragments. A Page is considered to be type of Fragment and generates immutable markup as such.

Page Decorator

A type of decoration specifically designed decorate a Page's generated markup. Page markup consists of that Page's Layout and Fragments.

Portlet Decorator

A type of decoration specifically designed decorate a Portlet's generated markup.

Current Implementation

File Structure and Location of Layout Information

The layout information is stored in the following location: \WEB-INF\templates\layout\html\

The decorator information is stored in the following location: \WEB-INF\decorations\portlet\html

Graphical Overwiew

The following picture shows the graphical overview (what's on the screen) and what elements (layouts/decorators) are involved. For simplicity we use Jetspeed as the Layout.

Loading the Layout and Decorations

The loading of the pages are implemented in two components the SimpleLayoutValve and the aggregator. The code in the valve is simple and can be accomplished by the aggregator (see proposed changes in chapter 3).

  1. For each request the page header and footer of an HTML page are added by the VerySimpleLayoutValveImpl.

    • The valve implementation isn't mimetype sensitive and just creates HTML format.
  2. The AggregatorValve reads the psml file (pages directory) which defines the tempaltes and portlet decorators to load.

    • Two template locators are created (templates & decorations) to find the layout and decorators based on names.

Proposed Changes

This chapter lists proposed changes to the current implementation


Once the proposed changes are in the stream the section should be removed from this chapter and added to chapter 2.

Changed to File Stucture

Proposal: Update naming convention. Uses pages instead of Layout.
Task: Change directory structure under WEB-INF/ to from Layout to page (e.g decorations/page/). It's easier to understand the concepts of pages and Layout. A page could switch it's layout from 3 col to 2 col and still retain the same decoration. I like to think of a Page as using or containing a layout, and the decoration decorates the Page itself not the layout, which in fact is itself a portlet generating a fragment.
Proposal: Adding style sheets to decorations
Task: Currently, the style definitions for the portlet decorations is stored in the page decoration (Layout). We need to changes so that each decoration can contribute a self-contained CSS to be added dynamically by the page rendering process.
Location for style sheets: