Root objects of FreeMarker

Alfresco provides a default model provided by the JSF template component and template servlet, which provides a number of common root objects useful for most FreeMarker templates. The list of these root objects which you can use for a web script template is as follows:

  • companyhome: The company home template node. This is available only if authenticated.
  • userhome: Current user's home space template node. This is available only if authenticated.
  • person: Current user's person object template node. This is available only if authenticated.
  • args: A map of any URL parameters passed via the Template Content Servlet.
  • session: Session-related information. It provides a single-value session.ticket for the current authentication ticket.
  • classification: Read access to classifications and root categories.
  • url: An object providing access to the URL or parts of the URL that triggered the web script.
  • workflow: Read access to information on workflow objects and the currently executing workflows for a user.
  • avm: Root-level object for a WCM web project. Using this API, it is possible to build templates that display content from files in the staging area or sandbox of a web project-based website.
  • argsM: An associative array of any URL parameters where each key is a parameter name and each value is an array containing the parameter values, even if only one is supplied.
  • guest: A Boolean indicating whether the web script executes as "Guest".
  • date: A date representing the date and time of the web script request.
  • server: An associative array of metadata properties that describe the hosting Alfresco server.
  • roothome: The repository root node.
  • webscript: An associative array of metadata properties that describe this web script.

Apart from all of these root objects, the template also has access to root objects created by the execution script, if any script has been associated with the web script. You can also have JavaBeans associated with the web script, and you can create objects there as well, which will be accessed by this FreeMarker template for the web script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset