Changes for page Scripting

Last modified by Simpel on 2023/02/14

<
From version < 30.2 >
edited by Vincent Massol
on 2010/12/09
To version < 30.3 >
edited by Vincent Massol
on 2010/12/10
>
Change comment: Point to extensions

Summary

Details

Page properties
Content
... ... @@ -6,17 +6,17 @@
6 6  
7 7  XWiki integrates [[jsr-223>>http://scripting.dev.java.net/]] scripting. You can script using several available languages by using one of the following macros:
8 8  
9 -* [[Velocity Macro>>code:Macros.VelocityMacro]] (installed by default in XWiki Enterprise)
10 -* [[Groovy Macro>>code:Macros.GroovyMacro]] (installed by default in XWiki Enterprise)
11 -* [[Python Macro>>code:Macros.PythonMacro]] (installed by default in XWiki Enterprise)
12 -* [[Ruby Macro>>code:Macros.RubyMacro]] (not installed by default in XWiki Enterprise)
13 -* [[PHP Macro>>code:Macros.PHPMacro]] (not installed by default in XWiki Enterprise)
9 +* [[Velocity Macro>>extensions:Extension.Velocity Macro]] (installed by default in XWiki Enterprise)
10 +* [[Groovy Macro>>extensions:Extension.Groovy Macro]] (installed by default in XWiki Enterprise)
11 +* [[Python Macro>>extensions:Extension.Python Macro]] (installed by default in XWiki Enterprise)
12 +* [[Ruby Macro>>extensions:Extension.Ruby Macro]] (not installed by default in XWiki Enterprise)
13 +* [[PHP Macro>>extensions:Extension.PHP Macro]] (not installed by default in XWiki Enterprise)
14 14  
15 15  = XWiki Scripting API =
16 16  
17 -The API is documented in Javadoc format and can be accessed here: [[XWiki API Javadoc>>DevGuide.API]]. If you are not familiar with Java or object oriented programming, you will probably be confused by the API documentation. It is not within the scope of our documentation to teach you all the details about Java, or object oriented programming. You can find all of that information already online. You can also explore the page code found throughout the [[Code Zone>>code:Main.WebHome]] area to see how others have figured out how to achieve a variety of results.
17 +The API is documented in Javadoc format and can be accessed here: [[XWiki API Javadoc>>DevGuide.API]]. If you are not familiar with Java or object oriented programming, you will probably be confused by the API documentation. It is not within the scope of our documentation to teach you all the details about Java, or object oriented programming. You can find all of that information already online. You can also explore the page code found throughout the [[Extensions wiki>>extensions:Main.WebHome]] area to see how others have figured out how to achieve a variety of results.
18 18  
19 -== [[Bindings>>code:Macros.ScriptMacro#HBindings]] ==
19 +== [[Bindings>>extensions:Extension.Script Macro#HBindings]] ==
20 20  
21 21  These objects are available to you in scripting languages.
22 22  
... ... @@ -26,7 +26,7 @@
26 26  * [[The Response object>>http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/web/XWikiResponse.html]]: **##response##**
27 27  * [[The XWiki object>>http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/api/XWiki.html]]: **##xwiki##**
28 28  
29 -== [[XWiki Component>>code:Modules.ComponentModule]] Access ==
29 +== [[XWiki Component>>extensions:Extension.Component Module]] Access ==
30 30  
31 31  You can also gain direct access to XWiki components using the following code snippet:
32 32  Also see: [[Accessing components from Groovy>>DevGuide.WritingComponents#HAccessingacomponentfromgroovy]]
... ... @@ -157,7 +157,7 @@
157 157  
158 158  Currently all non Velocity scripting languages are only allowed for administrators of a wiki (or users having the 'programming' right).
159 159  
160 -* See Groovy examples in the [[Code Zone>>code:Main.WebHome]], more specifically in the [[Code Snippets area>>code:Snippets.WebHome]]
160 +* See Groovy examples in the [[Extensions wiki>>extensions:Main.WebHome]]
161 161  * [[Feeling Groovy>>http://www-128.ibm.com/developerworks/java/library/j-alj08034.html]]
162 162  * [[MVC programming with Groovy templates>>http://www-128.ibm.com/developerworks/java/library/j-pg02155/]]
163 163  
... ... @@ -207,7 +207,7 @@
207 207  {{/python}}{{/code}}
208 208  
209 209  {{warning}}
210 -Versions prior to [[XWiki Enterprise 2.4>>xwiki:ReleaseNotes.ReleaseNotesXWikiEnterprise24]] have a bug which prevents you from having access to the default objects (doc, xcontext, request, etc.) a [[workaround is available in the code zone>>code:Snippets.AccessToBindingsInPythonSnippet]]
210 +Versions prior to [[XWiki Enterprise 2.4>>xwiki:ReleaseNotes.ReleaseNotesXWikiEnterprise24]] have a bug which prevents you from having access to the default objects (doc, xcontext, request, etc.) a [[workaround is available in the Extensions wiki>>extensions:Extension.Access To Bindings In Python]]
211 211  {{/warning}}
212 212  
213 213  = Scripting In XWiki Syntax 1.0 =
... ... @@ -216,7 +216,7 @@
216 216  
217 217  * The only scripting languages available to you are Velocity and Groovy.
218 218  * In Groovy, the context is known as: **##context##** not **##xcontext##**
219 -* The beginning and end of Groovy scripts are denoted by <% and %> rather than through the [[code:Macros.GroovyMacro]] (using ~{~{groovy}} and ~{~{/groovy}})
220 -* Velocity is parsed in a page no matter what (there is no need to invoke the [[code:Macros.VelocityMacro]] using ~{~{velocity}} and ~{~{/velocity}})
219 +* The beginning and end of Groovy scripts are denoted by <% and %> rather than through the [[extensions:Extension.Groovy Macro]] (using ~{~{groovy}} and ~{~{/groovy}})
220 +* Velocity is parsed in a page no matter what (there is no need to invoke the [[extensions:Extension.Velocity Macro]] using ~{~{velocity}} and ~{~{/velocity}})
221 221  
222 222  The last part is important because it means you need to be careful of using $ and # in your document. This is still true inside of <% and %> so you have to be careful writing Groovy.

Get Connected