public interface PluginManager extends ModuleManager
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_PACKAGE
This is the default package to try in case the instantiation fails.
|
static java.lang.String |
PARAM_BODY
The name of the body content.
|
static java.lang.String |
PARAM_BOUNDS
The name of the parameter containing the start and end positions in the read stream of the plugin text (stored as a two-element
int[], start and end resp.).
|
static java.lang.String |
PARAM_CMDLINE
The name of the command line content parameter.
|
static java.lang.String |
PARAM_DEBUG
A special name to be used in case you want to see debug output
|
static java.lang.String |
PROP_EXTERNALJARS
The property name defining which external jars will be added to the classpath when searching for plugin classes.
|
PLUGIN_RESOURCE_LOCATION| Modifier and Type | Method and Description |
|---|---|
void |
enablePlugins(boolean enabled)
Enables or disables plugin execution.
|
java.lang.String |
execute(Context context,
java.lang.String commandline)
Parses a plugin.
|
java.lang.String |
execute(Context context,
java.lang.String classname,
java.util.Map<java.lang.String,java.lang.String> params)
Executes a plugin class in the given context.
|
org.apache.oro.text.regex.Pattern |
getPluginPattern()
Returns plugin insert pattern.
|
Plugin |
newWikiPlugin(java.lang.String pluginName,
java.util.ResourceBundle rb)
Creates a
Plugin. |
java.util.Map<java.lang.String,java.lang.String> |
parseArgs(java.lang.String argstring)
Parses plugin arguments.
|
boolean |
pluginsEnabled()
Returns plugin execution status.
|
checkCompatibility, getModuleInfo, modulesstatic final java.lang.String PROP_EXTERNALJARS
static final java.lang.String DEFAULT_PACKAGE
static final java.lang.String PARAM_BODY
static final java.lang.String PARAM_CMDLINE
static final java.lang.String PARAM_BOUNDS
static final java.lang.String PARAM_DEBUG
void enablePlugins(boolean enabled)
enabled - True, if plugins should be globally enabled; false, if disabled.boolean pluginsEnabled()
org.apache.oro.text.regex.Pattern getPluginPattern()
java.lang.String execute(Context context, java.lang.String classname, java.util.Map<java.lang.String,java.lang.String> params) throws PluginException
Used to be private, but is public since 1.9.21.
context - The current WikiContext.classname - The name of the class. Can also be a shortened version without the package name, since the class name is
searched from the package search path.params - A parsed map of key-value pairs.PluginException - If the plugin execution failed for some reason.java.util.Map<java.lang.String,java.lang.String> parseArgs(java.lang.String argstring) throws java.io.IOException
PARAM_BODY; the plugin's command line into a parameter defined
by PARAM_CMDLINE; and the bounds of the plugin within the wiki page text by a parameter defined by PARAM_BOUNDS,
whose value is stored as a two-element int[] array, i.e., [start,end].argstring - The argument string to the plugin. This is typically a list of key-value pairs, using "'" to escape
spaces in strings, followed by an empty line and then the plugin body. In case the parameter is null, will return an
empty parameter list.java.io.IOException - If the parsing fails.java.lang.String execute(Context context, java.lang.String commandline) throws PluginException
[{INSERT myplugin WHERE param1=value1, param2=value2}]This is the main entry point that is used.
context - The current WikiContext.commandline - The full command line, including plugin name, parameters and body.PluginException - From the plugin itself, it propagates, waah!Plugin newWikiPlugin(java.lang.String pluginName, java.util.ResourceBundle rb) throws PluginException
Plugin.pluginName - plugin's classnamerb - ResourceBundle with i18ned text for exceptions.Plugin.PluginException - if there is a problem building the Plugin.Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.