Package org.apache.wiki.api.engine

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


    private String executePlugin( String plugin, String args, String body )
        throws PluginException, IOException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        PluginManager pm  = engine.getPluginManager();

        m_evaluated = true;

        Map<String, String> argmap = pm.parseArgs( args );
       
        if( body != null )
        {
            argmap.put( "_body", body );
        }

        String result = pm.execute( m_wikiContext, plugin, argmap );

        return result;       
    }
View Full Code Here


    private String executePlugin( String plugin, String args, String body )
        throws PluginException, IOException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        PluginManager pm  = engine.getPluginManager();

        m_evaluated = true;

        Map<String, String> argmap = pm.parseArgs( args );
       
        if( body != null )
        {
            argmap.put( "_body", body );
        }

        String result = pm.execute( m_wikiContext, plugin, argmap );

        return result;       
    }
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

            registerAdminBean( new PluginBean(m_engine) );
        } catch( NotCompliantMBeanException e ) {
            log.error( e.getMessage(), e );
        }
        registerBeans( m_engine.getEditorManager().modules() );
        PluginManager pm = m_engine.getPluginManager();
        registerBeans( pm.modules() );
    }
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

        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        registerBeans( m_engine.getEditorManager().modules() );
        PluginManager pm = m_engine.getPluginManager();
        registerBeans( pm.modules() );
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public String doGet(WikiContext context)
    {
        PluginManager pm = m_engine.getPluginManager();
        Collection<WikiPluginInfo> plugins = pm.modules();

        div root = new div();

        root.addElement( new h4("Plugins") );
View Full Code Here

        if( isPluginLink( linktext ) )
        {
            try
            {
                PluginManager pm = m_engine.getPluginManager();
                PluginContent pluginContent = pm.parsePluginLine( m_context, linktext, pos );
                //
                //  This might sometimes fail, especially if there is something which looks
                //  like a plugin invocation but is really not.
                //
                if( pluginContent != null )
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.