Script Component
Very easily register fast components defined using scripts |
Type | JAR |
Category | |
Developed by | |
Active Installs | 4 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
This tool allows registering components in a wiki page by defining a class in script and standard XWiki component annotations like you would in Java.
To do that you need to:
- add a XWiki.ScriptComponentClass object to a page
- select the script language you are going to use (default choices currently are Groovy or Python)
- choose where it's going to be registered (for the current whole wiki, only for the author, for the whole farm)
- write the component and indicate the role, hint and dependency using the Java annotations (@Component, @Named, @Inject)
- save and your component is automatically registered
See Component Module for more details about XWiki Components.
Use it in an extension
If you plan to use this feature in an extension you should add the module in your extension dependencies.
In Maven, you can add the following to your pom.xml file:
<groupId>org.xwiki.contrib</groupId>
<artifactId>scriptcomponent</artifactId>
<version>1.0</version>
</dependency>
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
Dependencies
Dependencies for this extension (org.xwiki.contrib:scriptcomponent 1.0):
- org.xwiki.platform:xwiki-platform-component-wiki 9.11
- org.xwiki.commons:xwiki-commons-component-default 9.11