Changes for page Creating XWiki Components

Last modified by Simon Urli on 2023/10/10

<
From version < 66.2 >
edited by Vincent Massol
on 2017/02/24
To version < 67.1 >
edited by Thomas Mortagne
on 2017/05/28
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.ThomasMortagne
Content
... ... @@ -278,10 +278,18 @@
278 278  The component hint used (the ##hello## part in the ##@Component##) is the name under which the script service will be accessible from scripting languages.
279 279  {{/info}}
280 280  
281 -For example to access it in Velocity you'd write: {{code language="velocity"}}$services.hello.greet(){{/code}}.
281 +For example to access it in Velocity you'd write:
282 282  
283 -From Groovy: {{code language="groovy"}}services.hello.greet(){{/code}}.
283 +{{code language="velocity"}}{{velocity}}
284 +$services.hello.greet()
285 +{{/velocity}}{{/code}}.
284 284  
287 +From Groovy:
288 +
289 +{{code language="groovy"}}{{groovy}}
290 +services.hello.greet()
291 +{{/groovy}}{{/code}}.
292 +
285 285  Now for our script service to work we need to register it as a component and thus add it to the ##META-INF/components.txt## file:
286 286  
287 287  {{code language="none"}}

Get Connected