14.01.2013 Views

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VTL uses references to embed dynamic content, and a variable is one type of reference.<br />

Variables can be set using a VTL statement. Here is an example of a VTL statement:<br />

#set( $a = "Velocity" )<br />

The following rule of thumb may be useful to better understand how Velocity works:<br />

References begin with $ and are used to get something. Directives begin with # and<br />

are used to do something.<br />

The #macro script element allows template designers to define a repeated segment of a<br />

VTL template, called a Velocimacro. <strong>JHeadstart</strong> has defined several macros like<br />

#ADVANCED_SEARCH_ITEMS. You can find the macro definitions in the project<br />

subfolder templates/default/common.<br />

A single line comment begins with ## and finishes at the end of the line. Multi-line<br />

comments begin with #* and end with *#.<br />

Text that is not interpreted by the Velocity Template Engine is copied literally.<br />

Reference: See the following three documents at the Velocity website:<br />

User’s <strong>Guide</strong> http://jakarta.apache.org/velocity/docs/user-guide.html<br />

<strong>Developer's</strong><br />

<strong>Guide</strong><br />

Reference<br />

<strong>Guide</strong><br />

4.7.5. <strong>JHeadstart</strong> specific constructs in the Velocity Templates<br />

http://jakarta.apache.org/velocity/docs/developerguide.html <br />

http://jakarta.apache.org/velocity/docs/vtl-referenceguide.html<br />

In addition to the normal Velocity capabilities, <strong>JHeadstart</strong> has created some<br />

Velocimacros and other constructs that you can use in your custom templates.<br />

You can access all metadata elements you enter through the Application Definition<br />

Editor:<br />

• ${JHS.service}<br />

• ${JHS.current.group}<br />

• ${JHS.current.item}<br />

• ${JHS.current.regionContainer}<br />

• ${JHS.current.itemRegion}<br />

• ${JHS.current.groupRegion}<br />

• ...<br />

You can use all the attributes of these elements, for example ${JHS.current.group.name}.<br />

For the proper attribute names, see the XML Schema of the Application Definition at<br />

[JDEV_HOME]\ jdev\extensions\oracle.jheadstart.10.1.3\doc\<br />

ApplicationDefinition.xsd. You can add this file to your ViewController project like this:<br />

<strong>JHeadstart</strong> Developer’s <strong>Guide</strong> Using the <strong>JHeadstart</strong> Addins 4 - 29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!