You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2008/06/23 10:38:45 UTC
[jira] Resolved: (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 ]
Bertrand Delacretaz resolved SLING-552.
---------------------------------------
Resolution: Fixed
Code and especially tests reviewed, patch applied in revision 670480, many thanks for your contribution!
Please cross-check and close this issue if ok.
> 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
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Attachments: freemarkerwrapper.patch, pom.xml
>
>
> 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.