Skip to main content

Office of Information Technology (OIT)

UT Arlington
OIT: Office of Information Technology ·  Work Order · 817-272-2208 · System Status

We are your IT partner!


UT Arlington Velocity Examples

The .zip file XMLandVelocityExamples contains several Velocity examples (.vm file) and the corresponding XML files. The examples were implemented on the HR site. The following links point to the pages generated by the Velocity transformation:

HR - About Us 

HR - staff-hr-page

HR - job families-all-lst

HR - job-family-i-lst

TOC Page

Velocity Context

These examples make ample use of variables and tools available within Cascade Server's Velocity Context. Please refer to Hannon Hill's knowledgebase for more information: Velocity Tools.

JDOM element representing the full XML contents of the Block assigned to the Region to which your Velocity Format is applied.

XPath support allows selecting specific sections of the XML structure using XPath expressions.

Support for XPath statements allows users to query the JDOM XML structure using an XPath expression, similar to using an XPath expression in the "select" attribute of an XSL template.

WYSIWYG fields have HTML-styled content with nested HTML tags. This structure needs to be serialized to make sure all nested tags are being formatted for document output. The Serializer Tool should also be used for special characters in plain text values.

The Serializer Tool can take any node in the XML hierarchy backed by JDOM and serialize it into its underlying XML, without having to output each node in the JDOM tree manually.

Provides easy sorting functionality to Velocity Scripts.

The Sort Tool is modeled after the <xsl:sort/> directive and contains two methods: sort() and addSortCriterion().  The sort() method takes a list of JDOM Elements, which can be acquired using the XPath Tool, and sorts them based on the criteria specified using the addSortCriterion() method. The addSortCriterion() method takes 5 arguments: a selection string, language, data type, sort order, and case order.

Provides convenience methods for dat comparisons and date formatting.

Provides convenience methods for manipulating text data.

The String Tool contains two methods, substringBefore() and substringAfter(). For example, if one were to call the substringAfter() method with the arguments "/path/to/asset" and "path", the result would be "/to/asset".

Related Resources

Hannon Hill Velocity info:     (Technical – Velocity Resources) All features listed under “Velocity Tools” are only available with Cascade Server 6.2.x.

Hannon Hill Velocity Webinar


JDOM Element:

Velocity User Guide:

Velocity and XML:

VTL (Velocity Template Language):