From version < 21.1 >
edited by Valdis Vitolins
on 2017/04/19 11:38
To version < 22.1
edited by Valdis Vitolins
on 2017/04/19 11:47
<
Change comment: There is no comment for this version

Summary

Details

ExtensionCode.ExtensionClass[0]
Description
... ... @@ -11,6 +11,7 @@
11 11  {{/groovy}}
12 12  {{/code}}
13 13  
14 +=== Parameters definition ===
14 14  If Groovy script is not supposed to produce any output, for example, [[Groovy Class>>http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyClassHelloWorldTutorial]] with just parameters is defined, declare macro as:
15 15  
16 16  {{code language="java"}}
... ... @@ -17,10 +17,8 @@
17 17  {{groovy output="false"}}
18 18  {{/code}}
19 19  
20 -=== Parameters definition ===
21 +See [[Script Macro]] for details.
21 21  
22 -See the [[Script Macro]] for details.
23 -
24 24  == Example ==
25 25  
26 26  {{code language="java"}}
cogAdds ability to write scripts in Groovy in wiki pages
TypeJAR
Developed by

XWiki Development Team

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Enterprise Manager

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

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

Parameters definition

See the Script Macro for details.

See Script Macro 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

Get Connected