|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PluginManager
Field Summary | |
---|---|
static String |
DEFAULT_PACKAGE
This is the default package to try in case the instantiation fails. |
static String |
PARAM_BODY
The name of the body content. |
static 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 String |
PARAM_CMDLINE
The name of the command line content parameter. |
static String |
PARAM_DEBUG
A special name to be used in case you want to see debug output |
static String |
PROP_EXTERNALJARS
The property name defining which external jars will be added to the classpath when searching for plugin classes. |
static String |
PROP_SEARCHPATH
The property name defining which packages will be searched for plugin classes. |
Method Summary | |
---|---|
void |
enablePlugins(boolean enabled)
Enables or disables plugin execution. |
String |
execute(WikiContext context,
String commandline)
Parses a plugin. |
String |
execute(WikiContext context,
String classname,
Map<String,String> params)
Executes a plugin class in the given context. |
org.apache.oro.text.regex.Pattern |
getPluginPattern()
Returns plugin insert pattern. |
String |
getPluginSearchPath()
Returns plugins' search path. |
Collection |
modules()
Returns a collection of modules currently managed by this ModuleManager. |
WikiPlugin |
newWikiPlugin(String pluginName,
ResourceBundle rb)
Creates a WikiPlugin . |
Map<String,String> |
parseArgs(String argstring)
Parses plugin arguments. |
boolean |
pluginsEnabled()
Returns plugin execution status. |
Field Detail |
---|
static final String PROP_SEARCHPATH
static final String PROP_EXTERNALJARS
static final String DEFAULT_PACKAGE
static final String PARAM_BODY
static final String PARAM_CMDLINE
static final String PARAM_BOUNDS
static final String PARAM_DEBUG
Method Detail |
---|
void enablePlugins(boolean enabled)
enabled
- True, if plugins should be globally enabled; false, if disabled.boolean pluginsEnabled()
org.apache.oro.text.regex.Pattern getPluginPattern()
String getPluginSearchPath()
String execute(WikiContext context, String classname, Map<String,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.Map<String,String> parseArgs(String argstring) throws 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.
IOException
- If the parsing fails.String execute(WikiContext context, String commandline) throws PluginException
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!Collection modules()
WikiPlugin newWikiPlugin(String pluginName, ResourceBundle rb) throws PluginException
WikiPlugin
.
pluginName
- plugin's classnamerb
- ResourceBundle
with i18ned text for exceptions.
WikiPlugin
.
PluginException
- if there is a problem building the WikiPlugin
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |