You can also use $xwiki.parseGroovyFromPage().
Here an example:
http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial
LM
2014-03-17 17:38 GMT+01:00 Thomas Mortagne :
> The cleanest is probably to write a script service in Groovy, see
>
> http://extensions.xwiki.org/xwiki
The cleanest is probably to write a script service in Groovy, see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Create+a+component+using+Groovy
for an example.
On Mon, Mar 17, 2014 at 5:31 PM, Matthias Albert wrote:
> Thanks for your response.
>
> But how can I create o "global" binding to
Thanks for your response.
But how can I create o "global" binding to an instance of my class? The
background is: I would like to avoid programming rights required, and so
I believe, I need Velocity and not a bit of Groovy in the referencing page.
In fact, I need one instance of the groovy class a
It's not really relayed to Groovy, Velocity cannot work with statics.
You will have to work with non static methods and assign one script
binding to an instance of your groovy class like in:
{{groovy}}
class MyClass {
myFunction(out) {
out.println "hello world"
}
mytool = new MyClass()
{{/
Hi all,
after I managed to write a groovy class with a static method within a
groovy block:
{{groovy}}
class MyClass {
static myFunction(out) {
out.println "hello world"
}
MyClass.myFunction(out)
{{/groovy}}
I would like to invoke thos static groovy class function from within a
Velocity bl