Stylesheet Descriptors & Preferences
The portal rendering pipeline makes use of XSLT for incremental transformation of the users layout into the final HTML page. The XSLT component uses runtime data to configure the output properties, parameters and layout attributes used when performing the transform. The XSL stylesheets and the properties, parameters and attributes they support are configured in the portal by IStylesheetDescriptor
. The user specific runtime data is sourced from the IStylesheetUserPreferences
.
IStylesheetDescriptor
Describes the XSL with a unique name and an optional description. The XSL location is specified as a valid Spring Resource String.
Stylesheet Data
There are three types of stylesheet data with different runtime uses. They do share most of the same properties
- Scope - REQUEST, SESSION, or PERSISTENT. This is the scope at which the portal will track user customizations to the data.
- Default Value - An optional default value the portal will use if the user has made no customizations to the data
Output Properties
Output properties are used with the Transformer.setOutputProperties(Properties) API to configure the transformer.
Stylesheet Parameters
Parameters are used with the Transformer.setParameter(String, Object) API to provided data to the XSL.
Layout Attributes
Layout attributes aren't directly involved with the Transformer but the rendering pipeline uses them to add XML attributes to specific nodes in the users layout immediately before the transform runs. Layout attributes have an additional targetElement field that the other two data types do not. This configured which element types in the layout XML the attribute will be applied do. Multiple targetElements may be specified.
Example Data File
Expand the section below for an example portal data file (used in the import process) for the DLM themes and columns structure transformation.
IStylesheetUserPreferences
Accessed via the IStylesheetUserPreferencesService
this class stores customizations the user has made to the stylesheet output properties, parameters and layout attributes. The scope configuration of the IStylesheetDescriptor
is handled automatically by the implementations.
For any data set on the IStylesheetUserPreferences
to actually be stored the appropriate attribute/property MUST be defined on the IStylesheetDescriptor
for the preferences. If data is set that does not have a definition a WARN level log message is issued but no exception is thrown.
Output Properties & Stylesheet Parameters
Simply set the name/value pairs to be stored.
Layout Attributes
In addition to a name and a value a layout nodeId is required when storing layout attributes. The value for the named attribute will only be added to the layout node with the specified id.