[ 
https://issues.apache.org/jira/browse/SLING-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12606983#action_12606983
 ] 

Bertrand Delacretaz commented on SLING-552:
-------------------------------------------

Thanks for this, looks interesting!

I'm going to ask my usual question though: could we have tests with this? 

The scripting/javascript modules has good examples of how to write such tests, 
see for example the ScriptableNodeTest class [1]. 

[1] 
http://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java

> 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: freemarkerwrapper.patch, 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.

Reply via email to