Groovy Macro

This is a XWiki macro, bundled with all the XWiki products by default.
Macro developed by the XWiki Development Team.
This macro cannot currently be downloaded separately.

Groovy Macro

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}}

Parameters definition

See the Script Macro for details.

Example

{{groovy}}
def list = ["one", "two"]
list.each { item ->
  println "* ${item}"
}
{{/groovy}}

Result

  • one
  • two
Warning: Note that since context is a reserved binding in JSR-223 specifications used for Scripting Macros, the XWiki Api Context is now accessible throught xcontext
Tags:
Created by Thomas Mortagne on 2008/12/02 14:52
Last modified by Vincent Massol on 2009/09/01 16:03

This wiki is licensed under a Creative Commons license
2.2.1.27354