Jetspeed Power Tool

The Jetspeed Power Tool (JPT) is a velocity tool used in Layouts and Decorators to generate dynamic content. The JPT is a request level velocity tool, and is available to all layouts and decorators. The JPT is referenced in your decorator or layout as:

All public JPT APIs can be accessed with:
  • Java dot notation for methods
  • JavaBean shortcuts for properties (getter/setter)
Example of calling a method:
# call a method 'getTitle' with 2 parameters
$jetspeed.getTitle($myPE, $myF)
Example of calling getting a property:
# get the page bean, equivalent to $jetspeed.getPage()

JPT Velocity API

The table below defines the Jetspeed Power Tool API for Velocity

API decorateAndInclude($fragment)
Description Retrieves the application relative path to a decorator template for a given fragment parameter ($fragment) to be included by Velocity. Should be passed as a parameter to the Velocity #parse function (#parse includes another Velocity template).
Parameter $fragment - the fragment to be included and decorated.
Returns String - Application relative path to a decorator template.
Examples #parse($jetspeed.decorateAndInclude($fragment))

API getAbsoluteUrl(appRelativePath)
Description Given a relative path to an portlet application resource, returns an absolute URL. This API should not be used to reference template ULS since they are usually inaccessible as absolute URLs because they are often located in a CMS or behind the secured WEB-INF directory.
Parameter relativePath - a relative path to a resource in the decorator package.
Returns String - The full absolute path to a web resource
Examples $jetspeed.getAbsoluteUrl("/images/test.gif")

API columns
Description Returns a list of column for the current fragment during a layout aggregation.
Parameter -
Returns List - a standard Java List of sub-fragments or portlets
Examples #set ($table = $jetspeed.columns)
#foreach($entry in $table)