 | Plugin Availability
The Groovy plugin is available in the blojsom add-on bundle. This is a separate download from the blojsom.war file. |
Description
The Groovy plugin allows you to write blojsom plugins using Groovy
. The scripts must implement the org.blojsom.plugin.BlojsomPlugin interface and provide implementations for the appropriate lifecycle methods.
Installation and Setup
After downloading the blojsom add-on bundle, copy the blojsom-addon-plugins-{version}.jar, asm-1.4.1.jar, and groovy-1.0-beta-4.jar file into your /WEB-INF/lib directory.
In your global /WEB-INF/plugin.properties file, add the following line:
groovy=org.blojsom.plugin.scripting.GroovyPlugin
You may then add "groovy" to one of the flavor-based plugin chains. These plugin chains can be found in the individual user's plugin.properties file. For example:
html.blojsom-plugin-chain=..., groovy, ...
Usage and URL Parameters
Usage
Groovy scripts to be executed must be placed in the /WEB-INF/resources/(blog-id)/ directory.
URL Parameters
The plugin looks for a request parameter, groovy-scripts which is a comma-separated list of the scripts to execute. If the Groovy plugin is included more than once in one of the flavor-based plugin chains, the first time the plugin executes, it would use the first script in the groovy-scripts parameter list, and the second time the plugin executes, it would use the second script in the groovy-scripts parameter list, and so on.
At a minimum, one script must be provided for this request parameter before the Groovy plugin will execute, otherwise it simply pass on the entries.
The following table describes the URL parameters that affect the Groovy plugin.
| URL parameter |
Accepted values |
Usage |
| groovy-scripts |
A comma-separated list of scripts to execute |
/blog/?groovy-scripts=script1,script2 |