Last modified by Anca Luca on 2023/02/22 11:17

<
From version < 18.1 >
edited by Thomas Mortagne
on 2019/02/11 14:56
To version < 20.1 >
edited by Paul Libbrecht
on 2019/06/26 08:04
>
Change comment: Slight clarifications (using label as in 11.3 for class-names, sentence about included execution less ambiguous).

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.ThomasMortagne
1 +xwiki:XWiki.polx
Content
... ... @@ -22,7 +22,7 @@
22 22  
23 23  Generally speaking, the approach below is quite complex and requires a good level of understanding of the XWiki internals. Not for the faint of hearts! :)
24 24  
25 -You also need programming right to use wiki components and Groovy.
25 +You will also need programming right to use wiki components and Groovy.
26 26  
27 27  = The Concept =
28 28  
... ... @@ -40,7 +40,7 @@
40 40  = Create a Wiki Component Event Listener =
41 41  
42 42  * Create a wiki page, e.g. ##HelloWorldGroovyScriptService##
43 -* Add an object of class {{code}}XWiki.ComponentClass{{/code}} to it, with the following properties:
43 +* Add an object of class //Wiki Component XWiki Class// ({{code}}XWiki.ComponentClass{{/code}}) to it, with the following properties:
44 44  ** Role type: {{code}}org.xwiki.observation.EventListener{{/code}}
45 45  ** Role hint: {{code}}helloWorldGroovyScriptService{{/code}}
46 46  ** Scope: ##Current Wiki##
... ... @@ -47,7 +47,7 @@
47 47  
48 48  = Turn the Component into an Initializable =
49 49  
50 -* Add an object of class {{code}}XWiki.ComponentInterfaceClass{{/code}} to the page, with the following property:
50 +* Add an object of class //Wiki Component Implements Interface XWiki Class// ({{code}}XWiki.ComponentInterfaceClass{{/code}}) to the page, with the following property:
51 51  ** Interface qualified name: {{code}}org.xwiki.component.phase.Initializable{{/code}}
52 52  
53 53  = Add the methods to the component =
... ... @@ -62,7 +62,7 @@
62 62  
63 63  Follow these steps:
64 64  
65 -* Add an object of class {{code}}XWiki.ComponentMethodClass{{/code}} to the page, with the following properties:
65 +* Add an object of class //Wiki Component Method XWiki Class// ({{code}}XWiki.ComponentMethodClass{{/code}}) to the page, with the following properties:
66 66  ** Name: {{code}}initialize{{/code}}
67 67  ** Body code:(((
68 68  {{code language="java"}}
... ... @@ -101,7 +101,7 @@
101 101  {{/code}}
102 102  
103 103  {{info}}
104 -You could of course use any script here in any supported Scripting language. You could also use an [[##~~{~~{include/}}## macro>>doc:Extension.Include Macro]] to get the script to execute from another page.
104 +You could of course use any script here in any supported Scripting language. You could also use an [[##~~{~~{include/}}## macro>>doc:Extension.Include Macro]] macro to let the script execution read code from another page.
105 105  {{/info}}
106 106  )))
107 107  * Add the following method to the component, to make sure the listener has a unique name, e.g. the current page reference converted to a string:

Get Connected