You are here

FreeMarker template methods

The FreeMarker template language supports the notion of a method, which encapsulates an action to perform on a set of input parameters and can return an output value.
Although FreeMarker provides many methods of its own, it also allows the registration of custom methods. The Web Script Framework provides the following methods specifically for developers of web script response templates.

absurl(url)
Returns an absolute URL representation of the passed URL. Useful when rendering links within Atom (and similar formats).
xmldate(date)
Returns an ISO8601-formatted result of the passed date. Useful when rendering dates within XML.
scripturl(queryString)
Returns a URL that references this web script. The passed queryString is added to the URL. System arguments such as guest and format are automatically added. This method is particularly useful for protection against the runtime environment within which the web script is executing. In some environments, such as a Portal, the URL is encoded.
clienturlfunction(funcName)
Generates a client-side JavaScript function that can generate a URL back to this web script.
argreplace(argString, argName, argValue, ...)
Replaces the specified argName with argValue or adds argName if it does not exist in argString.
encodeuri(uriString)
Encodes the string into URL-safe form.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.