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:

$jetspeed
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()
$jetspeed.page

JPT Velocity API

The table below defines the Jetspeed Power Tool API for Velocity


APIdecorateAndInclude($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.
ReturnsString - Application relative path to a decorator template.
Examples#parse($jetspeed.decorateAndInclude($fragment))

returns

/WEB-INF/decorations/layout/html/tigris/header.vm

APIgetAbsoluteUrl(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.
ParameterrelativePath - a relative path to a resource in the decorator package.
ReturnsString - The full absolute path to a web resource
Examples$jetspeed.getAbsoluteUrl("/images/test.gif")

returns

http://localhost:8080/jetspeed/portal/images/test.gif

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

#foreach($entry in $table)

API
Description
Parameter
Returns
Examples