On 9/3/2011 3:08 AM, Vincent Massol wrote:
Hi,
On Sep 2, 2011, at 10:48 PM, Mark Wallace wrote:
I have a macro (implemented in Java) with this interface:
public List<Block> execute(InferenceParameter parameters, String content, MacroTransformationContext context) ;
I want to call this macro from within a velocity script. When I do, it returns a List<Block>. How do I get the velocity script to render the List<Block> properly? You could check the tutorial at http://rendering.xwiki.org/xwiki/bin/view/Main/ExtendingMacro (check the deployment at the end).
I'm not having a problem invoking the macro in a wiki page. But sometimes I'd like to invoke it from within a larger velocity script. I.e. I can do this: {{mymacro param="hello"/}} But I'd also like to do this: {{velocity}} #set($words = ["Some", "velocity", "code"]) #foreach($word in $words) $word ## $services.mymacro($word) #end {{/velocity}} I didn't see anything in the deployment part of the tutorial about doing this. -Mark