Groovy Macro
Version 20.3 by Valdis Vitolins on 2017/04/19 11:38
Adds ability to write scripts in Groovy in wiki pages |
Type | JAR |
Category | |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Bundled With | XWiki Enterprise, XWiki Enterprise Manager |
Table of contents
Description
This is a shortcut for Script Macro equivalent to {{script language="groovy"}} to execute groovy scripts.
Usage
{{groovy}}
def list = ["one", "two"]
list.each { item ->
println "* ${item}"
}
{{/groovy}}
def list = ["one", "two"]
list.each { item ->
println "* ${item}"
}
{{/groovy}}
If Groovy script is not supposed to produce any output, for example, Groovy Class with just parameters is defined, declare macro as:
{{groovy output="false"}}
Parameters definition
See the Script Macro for details.
Example
{{groovy}}
def list = ["one", "two"]
list.each { item ->
println "* ${item}"
}
{{/groovy}}
def list = ["one", "two"]
list.each { item ->
println "* ${item}"
}
{{/groovy}}
Result
- one
- two