Scripts in XWiki
Explanation
Scripting lets you build web applications at the XWiki page level, without compiling code or deploying software components. You write scripting syntax alongside wiki markup inside the content of a page (see the script syntax for the XWiki 2.1 syntax).
XWiki integrates JSR-223 scripting, giving pages access to XWiki's programming API. This means a page can query, read, and manipulate the wiki and its documents directly, rather than relying on a separately deployed component.
Scripts run through dedicated macros, one per supported language. XWiki provides a generic Script Macro plus one dedicated macro per scripting language.
- Velocity Macro (installed by default in XWiki)
- Groovy Macro (installed by default in XWiki)
- Python Macro (installed by default in XWiki)
- Ruby Macro (not installed by default in XWiki)
- PHP Macro (not installed by default in XWiki)
Macros not installed by default require installing the corresponding extension before use.
FAQ
Can anyone insert and run scripts?
No. Only users with Programming or Script permissions can run the scripts. If you don't have the required permissions, you'll see an error similar to:
Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:a.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.This error means your administrator needs to grant you Script/Programming permissions before you can insert or edit scripts.
More
To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.