Version 12.1 by Jerome on 2010/12/06 12:59

cog
Typejavamacro
Category
Developed byUnknown
Rating
0 Votes
LicenseUnknown

Description

This is a shortcut for ScriptMacro 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 ScriptMacro for details.

Example

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

Result

  • one
  • two

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: groovy script
    

Get Connected