<
From version < 21.2 >
edited by Manuel Smeria
on 2014/06/20
To version < 22.1 >
edited by Clemens Robbenhaar
on 2014/06/20
>
Change comment: describe XRENDERING-349

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ManuelSmeria
1 +XWiki.ClemensRobbenhaar
Content
... ... @@ -74,6 +74,15 @@
74 74  
75 75  In this second sample, the macro will fail with an AccessDeniedException if the right is not allowed.
76 76  
77 +== Access to BlockMatchers from velocity scripts ==
78 +
79 +To be able to use the ##Block.getBlocks(BlockMatcher, Block.Axes)## method on the rendering blocks in the documents XDOM from velocity, a converter has been introduced that maps string expressions to BlockMatcher objects. The current implementation only supports mapping to ClassBlockMatchers, and allows to get all blocks of a given type from the XDOM.
80 +
81 +{{code language="velocity"}}
82 +#foreach($headerBlock in $doc.getDocument().getXDOM().getBlocks("class:HeaderBlock", "DESCENDANT"))
83 + ... do something with the header block ...
84 +{{/code}}
85 +
77 77  == Deprecated and Retired projects ==
78 78  
79 79  <description of deprecated and retired projects>

Get Connected