Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

[macro.browser.beans.MacroParameterType] get Unknown type: String

Bastian Kippelt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2015

Hi,

i dont know which String is wrong or unknown.

 

@Override
public String execute(Map<String, String> parameters, String bodyContent, ConversionContext conversionContext) throws MacroExecutionException
{
    if (bodyContent == null)
    {
        bodyContent = "";
    }

    String headlineTop = parameters.get("headline-top");
    String headlineMain = parameters.get("headline-main");
    String bodyText = bodyContent;
    String buttonText = parameters.get("button-text");
    String buttonLink = parameters.get("button-link");
    String backgroundImage = parameters.get("background-image");
    String css = parameters.get("custom-css-class") + " " + parameters.get("body-align");
    String height = parameters.get("height"); // default="600"

    // Set Map
    Map<String, Object> data = MacroUtils.defaultVelocityContext();
    data.put("headlineTop", headlineTop);
    data.put("headlineMain", headlineMain);
    data.put("bodyText", bodyText);
    data.put("buttonText", buttonText);
    data.put("buttonLink", buttonLink);
    data.put("backgroundImage", "");
    data.put("css", css);
    data.put("height", height);

    try
    {
        return VelocityUtils.getRenderedTemplate(MACRO_BODY_TEMPLATE, data);
    }
    catch (Exception e)
    {
        e.printStackTrace();
        return null;
    }
}
<xhtml-macro name='teaserbox' class='com.xxx.macro.TeaserMacro' key='xhtmlLayoutMacro-TeaserBox'
             icon="/download/resources/${project.groupId}.${project.artifactId}/images/logo_grey.png">
    <description key="layoutmacro.create-link.description"/>
    <category name="formatting"/>
    <parameters>
        <parameter name="headline-top" type="string" />
        <parameter name="headline-main" type="string" />
        <parameter name="button-text" type="String" />
        <parameter name="button-link" type="confluence-content"/>
        <parameter name="background-image" type="attachment" />
        <parameter name="body-align" type="enum">
            <value name="left"/>
            <value name="right"/>
            <value name="center"/>
        </parameter>
        <parameter name="custom-css-class" type="string" />
        <parameter name="height" type="string" default="600" />
    </parameters>
</xhtml-macro>

 

Can anyone help me? Maybe it is very simple.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Bastian Kippelt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 4, 2015
type="string" != type="String"
type="string" is correct
TAGS
AUG Leaders

Atlassian Community Events