brick_addVery easily register fast components defined using scripts
TypeJAR
Developed by

Thomas Mortagne

Active Installs2
Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager

Description

This tool allow registering components in a wiki page by describing using 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

Not that the author of the script needs programming right to use this feature.

object.png

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:

   <dependency>
     <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). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

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):

Tags:
Created by Thomas Mortagne on 2019/07/24 13:43
    

Get Connected