Improved Freemarker scripting support through adding wrappers for JCR Nodes and
Properties
------------------------------------------------------------------------------------------
Key: SLING-552
URL: https://issues.apache.org/jira/browse/SLING-552
Project: Sling
Issue Type: Improvement
Components: Scripting
Reporter: Bryce Ewing
Priority: Minor
Attachments: freemarkerwrappers.patch
Add freemarker wrapper classes for JCR Node's and Property's, I will be adding
further support as I require it but thought I would put in an initial version
of this.
These wrappers provides freemarker support similar to what freemarker does with
XML nodes, e.g.:
* properties of a node can be accessed as @property_name, e.g. [EMAIL
PROTECTED] will output the title property of the current node
* child nodes can be accessed directly via "." e.g. [EMAIL PROTECTED] will
output the title property of the child node of the current node named "section"
* child nodes can be iterated over, e.g. <#list currentNode as child>[EMAIL
PROTECTED]</#list> will iterate over the child nodes of current node outputting
the title property
* multi value property nodes can be iterated over, <#list [EMAIL PROTECTED]
as value>....</#list>
I haven't tested this yet but processing nodes through macro's, as described
for xml here:
http://freemarker.sourceforge.net/docs/xgui_declarative_basics.html should also
work.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.