Package org.apache.wiki.api.engine

Examples of org.apache.wiki.api.engine.PluginManager


                {
                    String val = e.getValue();
                    val = engine.getVariableManager().expandVariables( context, val );
                    parsedParams.put( e.getKey(), val );
                }
                PluginManager pm = engine.getPluginManager();
                result = pm.execute( context, m_pluginName, parsedParams );
            }
        }
        catch( Exception e )
        {
            if( wysiwygEditorMode )
View Full Code Here


     @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 );
View Full Code Here

                for (Map.Entry<String, String> e : m_params.entrySet()) {
                    String val = e.getValue();
                    val = engine.getVariableManager().expandVariables(context, val);
                    parsedParams.put(e.getKey(), val);
                }
                PluginManager pm = engine.getPluginManager();
                result = pm.execute(context, m_pluginName, parsedParams);
            }
        } catch (Exception e) {
            if (wysiwygEditorMode) {
                result = "";
            } else {
View Full Code Here

     *
     * @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) {
View Full Code Here

     */
    public static PluginContent parsePluginLine(WikiContext context, String commandline, int pos) throws PluginException {
        PatternMatcher matcher = new Perl5Matcher();

        try {
            PluginManager pm = context.getEngine().getPluginManager();
            if (matcher.contains(commandline, pm.getPluginPattern())) {

                MatchResult res = matcher.getMatch();

                String plugin = res.group(2);
                String args = commandline.substring(res.endOffset(0),
                        commandline.length() -
                                (commandline.charAt(commandline.length() - 1) == '}' ? 1 : 0));
                Map<String, String> arglist = pm.parseArgs(args);

                // set wikitext bounds of plugin as '_bounds' parameter, e.g., [345,396]
                if (pos != -1) {
                    int end = pos + commandline.length() + 2;
                    String bounds = pos + "|" + end;
View Full Code Here

        return CORE;
    }

    @SuppressWarnings("unchecked")
    public String doGet(WikiContext context) {
        PluginManager pm = m_engine.getPluginManager();
        Collection< WikiPluginInfo > plugins = pm.modules();
       
        Element root = XhtmlUtil.element( XHTML.div );
        Element tb =  XhtmlUtil.element( XHTML.table ).setAttribute( "border", "1" );
       
        root.addContent( XhtmlUtil.element( XHTML.h4 ).addContent( "Plugins") )
View Full Code Here

        String error = null;
        try
        {
            // The plugin _can_ modify the parameters, so we make sure
            // they stay with us.
            PluginManager pm = ctx.getEngine().getPluginManager();
            handlerOutput = pm.execute( ctx, handler, info.getSubmission() );
            info.setResult( handlerOutput );
            info.setStatus( FormInfo.EXECUTED );
        }
        catch( PluginException pe )
        {
View Full Code Here

TOP

Related Classes of org.apache.wiki.api.engine.PluginManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.