Package org.apache.wiki.api.exceptions

Examples of org.apache.wiki.api.exceptions.PluginException


        {
            str = super.execute(context, classname, params);
        }
        catch (org.apache.wiki.api.exceptions.PluginException e)
        {
            throw new PluginException( e.getMessage(), e );
        }
        return str;
    }
View Full Code Here


        {
            str = super.execute(context, commandline );
        }
        catch (org.apache.wiki.api.exceptions.PluginException e)
        {
            throw new PluginException( e.getMessage(), e );
        }
        return str;
    }
View Full Code Here

                ( ( ParserStagePlugin )plugin ).executeParser( content, context, params );
            }
        }
        catch( ClassCastException e )
        {
            throw new PluginException( MessageFormat.format( rb.getString( "plugin.error.notawikiplugin" ), content.getPluginName() ), e );
        }
    }
View Full Code Here

        throws PluginException
    {
        String inputName = pluginParams.get( PARAM_INPUTNAME );
        if( inputName == null )
        {
            throw new PluginException( rb.getString( "formselect.namemissing" ) );
        }
   
        String inputValue = pluginParams.get( PARAM_VALUE );
        String previousValue = ctxValues.get( inputName );
        //
View Full Code Here

        String inputName = params.get( PARAM_INPUTNAME );
        String rows = params.get( PARAM_ROWS );
        String cols = params.get( PARAM_COLS );

        if( inputName == null )
            throw new PluginException( rb.getString( "formtextarea.namemissing" ) );

        // In order to isolate posted form elements into their own
        // map, prefix the variable name here. It will be stripped
        // when the handler plugin is executed.
        textarea field = new textarea( HANDLERPARAM_PREFIX + inputName,
View Full Code Here

    {
        ResourceBundle rb = Preferences.getBundle( ctx, WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE );
        String formName = params.get( PARAM_FORM );
        if( formName == null )
        {
            throw new PluginException( MessageFormat.format( rb.getString( "formopen.missingparam" ), PARAM_FORM ) );
        }
        String hide     = params.get( PARAM_HIDEFORM );
        String sourcePage = ctx.getPage().getName();
        String submitServlet = params.get( PARAM_SUBMITHANDLER );
        if( submitServlet == null )
            submitServlet = ctx.getURL( WikiContext.VIEW, sourcePage );

        String method = params.get( PARAM_METHOD );
        if( method == null ) method="post";

        if( !(method.equalsIgnoreCase("get") || method.equalsIgnoreCase("post")) )
        {
            throw new PluginException( rb.getString( "formopen.postorgetonly" ) );
        }

        FormInfo info = getFormInfo( ctx );
        if( info != null )
        {
View Full Code Here

        String inputType  = params.get( PARAM_TYPE );
        String size       = params.get( PARAM_SIZE );
        ResourceBundle rb = Preferences.getBundle( ctx, WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE );

        if( inputName == null )
            throw new PluginException( rb.getString( "forminput.namemissing" ) );
        if( inputValue == null )
            inputValue = "";

        // Don't render if no error and error-only-rendering is on.
        FormInfo info = getFormInfo( ctx );
View Full Code Here

                    m_exclude[i] = pc.compile( ptrns[i] );
                }
            }
            catch( MalformedPatternException e )
            {
                throw new PluginException("Exclude-parameter has a malformed pattern: "+e.getMessage());
            }
        }

        // TODO: Cut-n-paste, refactor
        s = params.get( PARAM_INCLUDE );

        if( s != null )
        {
            try
            {
                PatternCompiler pc = new GlobCompiler();

                String[] ptrns = StringUtils.split( s, "," );

                m_include = new Pattern[ptrns.length];

                for( int i = 0; i < ptrns.length; i++ )
                {
                    m_include[i] = pc.compile( ptrns[i] );
                }
            }
            catch( MalformedPatternException e )
            {
                throw new PluginException("Include-parameter has a malformed pattern: "+e.getMessage());
            }
        }

        // log.debug( "Requested maximum width is "+m_maxwidth );
        s = params.get(PARAM_SHOW);

        if( s != null )
        {
            if( s.equalsIgnoreCase( "count" ) )
            {
                m_show = "count";
            }
        }

        s = params.get( PARAM_LASTMODIFIED );

        if( s != null )
        {
            if( s.equalsIgnoreCase( "true" ) )
            {
                if( m_show.equals( "count" ) )
                {
                    m_lastModified = true;
                }
                else
                {
                    throw new PluginException( "showLastModified=true is only valid if show=count is also specified" );
                }
            }
        }
       
        initSorter( context, params );
View Full Code Here

                }
            }
            catch(Exception e)
            {
                log.error("Could not construct table of contents: Filter Error", e);
                throw new PluginException("Unable to construct table of contents (see logs)");
            }
           
            context.setVariable( VAR_ALREADY_PROCESSING, "x" );
            JSPWikiMarkupParser parser = new JSPWikiMarkupParser( context,
                                                                  new StringReader(wikiText) );
            parser.addHeadingListener( this );

            parser.parse();

            sb.append( "<ul>\n"+m_buf.toString()+"</ul>\n" );
        }
        catch( IOException e )
        {
            log.error("Could not construct table of contents", e);
            throw new PluginException("Unable to construct table of contents (see logs)");
        }

        sb.append("</div>\n</div>\n");

        return sb.toString();
View Full Code Here

        }
        catch( IllegalArgumentException e )
        {
            ResourceBundle rb = Preferences.getBundle( context, WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE );
           
            throw new PluginException( rb.getString("currenttimeplugin.badformat") + e.getMessage() );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.wiki.api.exceptions.PluginException

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.