You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bryce Ewing (JIRA)" <ji...@apache.org> on 2008/06/21 01:13:45 UTC

[jira] Updated: (SLING-552) Improved Freemarker scripting support through adding wrappers for JCR Nodes and Properties

     [ https://issues.apache.org/jira/browse/SLING-552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryce Ewing updated SLING-552:
------------------------------

    Attachment: freemarkerwrappers.patch

> 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. ${currentNode.@title} will output the title property of the current node
>   * child nodes can be accessed directly via "." e.g. ${currentNode.section.@title} 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>${child.@title}</#list> will iterate over the child nodes of current node outputting the title property
>   * multi value property nodes can be iterated over, <#list currentNode.@multiValue 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.