Examples of MacroExecutionException


Examples of com.atlassian.confluence.macro.MacroExecutionException

    } catch (IOException e) {
      log.debug("IOException: ",e);
      return renderErrorWithTemplate(i18n_getText("confluenceadvancedcodeblockplugin.exceptiontext.ioexception", new String[]{e.getMessage()}), macroType, null);
    } catch(Exception e) {
      log.error("Unexpected Exception: ",e);
      throw new MacroExecutionException(e);
    }
      context.put(VELOCITY_PLACEHOLDER_MACROID, macroid);
      if (isValidLanguage(lang)) {
        context.put(VELOCITY_PLACEHOLDER_LANG, "prettyprint lang-"+lang);
      }
View Full Code Here

Examples of com.atlassian.confluence.macro.MacroExecutionException

    } catch (IOException e) {
      log.debug("IOException: ",e);
      return renderErrorWithTemplate(i18n_getText("confluenceadvancedcodeblockplugin.exceptiontext.ioexception", new String[]{e.getMessage()}), macroType, null);
    } catch(Exception e) {
      log.error("Unexpected Exception: ",e);
      throw new MacroExecutionException(e);
    }
      context.put(VELOCITY_PLACEHOLDER_MACROID, macroid);
      if (isValidLanguage(lang)) {
        context.put(VELOCITY_PLACEHOLDER_LANG, "prettyprint lang-"+lang);
      }
View Full Code Here

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

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

        {
            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

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

            return defaultValue;
        }

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

        return i;
    }
View Full Code Here

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

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

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

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

                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

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

                    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

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

                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

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

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

        // Reinit macro
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.