Search in sources :

Example 1 with ParserStagePlugin

use of org.apache.wiki.api.plugin.ParserStagePlugin in project jspwiki by apache.

the class PluginContent method executeParse.

/**
 * Executes the executeParse() method.
 *
 * @param context The WikiContext
 * @throws PluginException If something goes wrong.
 */
public void executeParse(WikiContext context) throws PluginException {
    PluginManager pm = context.getEngine().getPluginManager();
    if (pm.pluginsEnabled()) {
        ResourceBundle rb = Preferences.getBundle(context, WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE);
        Map<String, String> params = getParameters();
        WikiPlugin plugin = pm.newWikiPlugin(getPluginName(), rb);
        try {
            if (plugin != null && plugin instanceof ParserStagePlugin) {
                ((ParserStagePlugin) plugin).executeParser(this, context, params);
            }
        } catch (ClassCastException e) {
            throw new PluginException(MessageFormat.format(rb.getString("plugin.error.notawikiplugin"), getPluginName()), e);
        }
    }
}
Also used : PluginManager(org.apache.wiki.api.engine.PluginManager) ParserStagePlugin(org.apache.wiki.api.plugin.ParserStagePlugin) PluginException(org.apache.wiki.api.exceptions.PluginException) ResourceBundle(java.util.ResourceBundle) WikiPlugin(org.apache.wiki.api.plugin.WikiPlugin)

Aggregations

ResourceBundle (java.util.ResourceBundle)1 PluginManager (org.apache.wiki.api.engine.PluginManager)1 PluginException (org.apache.wiki.api.exceptions.PluginException)1 ParserStagePlugin (org.apache.wiki.api.plugin.ParserStagePlugin)1 WikiPlugin (org.apache.wiki.api.plugin.WikiPlugin)1