Gardening Application
Automate some gardening actions in order to keep a wiki clean |
Type | XAR |
Category | Application |
Developed by | |
Active Installs | 9 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
This application helps keeping a clean wiki by performing maintenance tasks using predefined scripts.
Concepts
Using this application, you can define two type of elements that will help you keep your wiki clean.
- Query scripts: scripts that will generate a list of documents that should be gardened based on a given concept. For example, a script fetching every document updated in the past X minutes.
- Action scripts: scripts that will perform an action on a given document. The action can be anything from changing the content of the document, to deleting it from the wiki.
When performing a gardening operation, you can select a set of query scripts and one action script. The action script will run on every document provided by the list of all the documents retrieved by the query scripts.
Usage
When installing the application, it comes by default with an administration interface to use the gardening scripts that you defined (see the section Define your own gardening scripts).
Start first by selecting some query scripts and one action script. Once this is saved, you can trigger the start of the gardening operation by clicking on the button "Start mowing!".
descriptions are shown aside from the query and action scripts to help the choice of the scripts.
Test the gardening actions
Before running a gardening action on a wiki, it's usually interesting to see what are going to be the documents concerned by this gardening.
you can test the gardening action by clicking on the button "Test the gardening process". A special gardening job will then be triggered, only using the query scripts to get the list of documents on which a standard gardening job would act on. The complete list of documents found can be seen in the job log.Define your own gardening scripts
Using Wiki Components
You can easily define a gardening query script or a gardening action script using two related XClasses. Those scripts will then be instantly shown in the gardening application UI.
The two XClasess GardeningQueryScriptClass and GardeningActionScriptClass share the following similar structure:
- Name: The name of the script as shown in the admin UI
- Identifier: A script unique identifier
- Description: The description of the script
- Content: The actual script content
Those scripts also use the following variables in order to transmit information:
- $xreturn: used in query scripts, this variable should be set to a list of DocumentReference to select. , a list of serialized serialized document references can be used.
- $documentReference: used in action scripts, contains the DocumentReference of the document to act on.
Using Java Components
You can also create your gardening scripts by implementing the interfaces org.xwiki.contrib.gardening.scripts.GardeningQueryScript and org.xwiki.contrib.gardening.scripts.GardeningActionScript defined in application-gardening-scripts.
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 following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Release Notes
v1.3.5
The following translations have been updated with this release:
v1.3.4
The following translations have been updated with this release:
v1.3.3
The following translations have been updated with this release:
v1.3.2
The following translations have been updated with this release:
v1.3.1
Bugfix release.
v1.3
v1.2
v1.1
Fix minimum required version.
v1.0
Dependencies
Dependencies for this extension (org.xwiki.contrib:application-gardening-ui 1.3.5):
- org.xwiki.contrib:application-gardening-script 1.3.5
- org.xwiki.contrib:application-gardening-wiki-script 1.3.5