Groovy Macro
Adds ability to write scripts in Groovy in wiki pages |
Type | JAR |
Category | |
Developed by | |
Active Installs | 6 |
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
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:
See Script Macro for details.
Example
def list = ["one", "two"]
list.each { item ->
println "* ${item}"
}
{{/groovy}}
Result
- one
- two
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-rendering-macro-groovy 16.9.0):
- org.xwiki.platform:xwiki-platform-groovy 16.9.0
- org.xwiki.platform:xwiki-platform-rendering-macro-script 16.9.0
- org.xwiki.rendering:xwiki-rendering-api 16.9.0
- org.xwiki.rendering:xwiki-rendering-transformation-macro 16.9.0