Package org.apache.maven.doxia.macro

Examples of org.apache.maven.doxia.macro.MacroExecutionException


*/
public class OhlohMacro extends AbstractMacro {
    public void execute(Sink sink, MacroRequest request) throws MacroExecutionException {
        String project = (String)request.getParameter("project");
        if (project == null) {
            throw new MacroExecutionException("'project' macro parameter is required");
        }
        String widgets = (String)request.getParameter("widgets");
        if (widgets == null) {
            throw new MacroExecutionException("'widgets' macro parameter is required");
        }
        for (String widget : widgets.split(",")) {
            sink.rawText("<div class=\"gadgetContainer\" style=\"float: left\"><script type=\"text/javascript\" src=\"http://www.ohloh.net/p/"
                    + project + "/widgets/project_" + widget + ".js\"></script></div>");
        }
View Full Code Here


        {
            parser.parse( new StringReader( source ), tocSink );
        }
        catch ( ParseException e )
        {
            throw new MacroExecutionException( "ParseException: " + e.getMessage(), e );
        }

        if ( index.getChildEntries().size() > 0 )
        {
            sink.list( getAttributesFromMap( request.getParameters() ) );
View Full Code Here

            return defaultValue;
        }

        if ( i < 0 )
        {
            throw new MacroExecutionException( "The " + parameter + "=" + i + " should be positive." );
        }

        return i;
    }
View Full Code Here

        {
            snippet = getSnippet( url, id );
        }
        catch ( IOException e )
        {
            throw new MacroExecutionException( "Error reading snippet", e );
        }

        if ( verbatim )
        {
            sink.verbatim( SinkEventAttributeSet.BOXED );
View Full Code Here

                macroParameters = new HashMap<String, Object>();
            }

            if ( StringUtils.isEmpty( macroName ) )
            {
                throw new MacroExecutionException( "The '" + Attribute.NAME.toString()
                        + "' attribute for the '" + MACRO_TAG.toString() + "' tag is required." );
            }
        }
    }
View Full Code Here

                    executeMacro( macroName, request, sink );
                    sink.close();
                    buffer.append( sw.toString() );
                } catch ( MacroNotFoundException me )
                {
                    throw new MacroExecutionException( "Macro not found: " + macroName, me );
                }
            }
        }

        // Reinit macro
View Full Code Here

                String paramValue = parser.getAttributeValue( null,
                        Attribute.VALUE.toString() );

                if ( StringUtils.isEmpty( paramName ) || StringUtils.isEmpty( paramValue ) )
                {
                    throw new MacroExecutionException( "'" + Attribute.NAME.toString()
                            + "' and '" + Attribute.VALUE.toString() + "' attributes for the '" + PARAM.toString()
                            + "' tag are required inside the '" + MACRO_TAG.toString() + "' tag." );
                }

                macroParameters.put( paramName, paramValue );
View Full Code Here

                {
                    executeMacro( macroName, request, sink );
                }
                catch ( MacroNotFoundException me )
                {
                    throw new MacroExecutionException( "Macro not found: " + macroName, me );
                }
            }
        }

        // Reinit macro
View Full Code Here

                macroParameters = new HashMap<String, Object>();
            }

            if ( StringUtils.isEmpty( macroName ) )
            {
                throw new MacroExecutionException(
                    "The '" + Attribute.NAME.toString() + "' attribute for the '" + MACRO_TAG.toString()
                        + "' tag is required." );
            }
        }
    }
View Full Code Here

                String paramName = parser.getAttributeValue( null, Attribute.NAME.toString() );
                String paramValue = parser.getAttributeValue( null, Attribute.VALUE.toString() );

                if ( StringUtils.isEmpty( paramName ) || StringUtils.isEmpty( paramValue ) )
                {
                    throw new MacroExecutionException(
                        "'" + Attribute.NAME.toString() + "' and '" + Attribute.VALUE.toString()
                            + "' attributes for the '" + PARAM.toString() + "' tag are required inside the '"
                            + MACRO_TAG.toString() + "' tag." );
                }
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.macro.MacroExecutionException

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.