Groovy Macro
Version 23.1 by Vincent Massol on 2021/03/17 17:33
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 Standard |
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}}
Parameters definition
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"}}
See 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