Hi Bryn,
On 23 Sep 2015 at 07:48:15, Bryn Jeffries
(bryn.jeffries@sydney.edu.au(mailto:bryn.jeffries@sydney.edu.au)) wrote:
I have several scripts (Groovy and Velocity) that
generate output that should not be rendered as a Wiki page. This is necessary, for
example, when rendering JSON. As documented before
(
http://extensions.xwiki.org/xwiki/bin/view/Extension/Output+JSON) , it's possible to
allow such content by including request parameters xpage=plain and outputSyntax=plain.
However, this approach requires all pages that refer to the script to remember to include
these parameters, which is rather error prone.
Is there a way for a script to explicitly disable rendering instead?
Yes, there is :)
For Groovy, see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Script+Macro
(check the output and wiki parameters)
For Velocity, see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Velocity+Macro
(same parameter names).
Thanks
-Vincent