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

Why main menu disappear from page in Crowd plugin?

Alexei Uvarov December 12, 2011

After clicking on my custom menu item I see this screen without main menu and messages:

As you can see therre is no menu. Why? My atlassian-plugin.xml is:

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${}" plugins-version="2">
        <vendor name="${}" url="${project.organization.url}" />
    <component-import key="webResourceManager" interface="com.atlassian.plugin.webresource.WebResourceManager" />
    <!-- Header Items -->
    <web-item key="tokens" name="Tokens Management" section="topnav" weight="10">
        <label key="Token management"/>
        <link linkId="topnavTokensManagement">/console/secure/plugins/cargosoft/managetokens.action</link>
    <!-- Application Components - Left-Hand Side -->
    <web-section key="tokensnav" name="Tokens Navigation" location="left" weight="90">
        <condition class="com.atlassian.crowd.plugin.web.conditions.SitemeshPropertiesCondition">
            <param name="propertyName">meta.section</param>
            <param name="propertyValues">tokens</param>
    <xwork name="Tokens Action" key="managetokens">
        <package name="managetokens" extends="default" namespace="/console/secure/plugins/cargosoft">
        	<default-interceptor-ref name="defaultStack"/>
            <action name="managetokens" class="com.cargosoft.crowd.plugin.TokensAction">
                <result name="success" type="freemarker">/templates/view.ftl</result>
                <result name="error" type="freemarker">/templates/view.ftl</result>
    <resource type="i18n" name="i18n" location="messages.i18n" />

and view.ftl is:

   	<meta name="decorator" content="atl.admin" />
    Hello ${action.firstName} ${action.lastName}

How can I resolve this problem? and return main menu like at this picture???

2 answers

0 votes
daviderickson December 29, 2011

I was able to get this to work by adding the following to my pom.xml:


And then making my Action extend com.atlassian.crowd.console.action.BaseAction and set my view.ftl to look like:

    <meta name="section" content="administration" />
    <meta name="pagename" content="systeminfo" />
    <div class="crowdForm">
        <div class="formTitle">
    Hello ${action.firstName} ${action.lastName}

Note I ripped some data from the systeminfo page, replace it with whatever you would normally use. I also changed the package I extended in atlassian-plugin.xml from default to admin to pick up on any customizations.

I still would like to know if there is any way to use JSP, it seems like there would have to be a special mechanism in place that takes the file out of the JAR and makes it appear like its on the file path for the webapp and I'm not sure if there is any existing support for that, although something of this nature is working for this FTL we are using.

I also couldn't manage to get the @ww.component tag to import a template I've created, I think it too is looking on the file path and not inside the classpath, which I also find weird considering the main template for the action works fine. I also couldn't get it to import the existing JSP templates, I get a NPE when it tries to retrieve the JSP PageContext object, I'm guessing JSP templates aren't intended to be rendered inside Freemarker templates?

Edit: Turns out you don't want to put Freemarker tags into your answers here as it will actually render their result...

0 votes
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.
December 12, 2011

I haven't developed for Crowd yet, but in other Atlassian Tools you need to call the right decorators for that. Just have a look at some built-in actions.

Alexei Uvarov December 14, 2011

I've found in folder webapp/WEB-IF/decorators.xml this code:

    <decorator name="error" page="/console/decorator/simple.jsp">
    <decorator name="license" page="/console/decorator/simple.jsp">
    <decorator name="none" page="/console/decorator/none.jsp">
    <decorator name="main" page="/console/decorator/default.jsp">

    <!-- cross-product decorators provided for plugins -->
    <decorator name="atl.general" page="default.jsp"/>
    <decorator name="atl.admin" page="default.jsp"/>
    <decorator name="atl.userprofile" page="default.jsp"/>
    <decorator name="atl.popup" page="popup.jsp"/>

In my template I use meta-tag <meta name="decorator" content="main" /> but main menu doesn't appear. What is a problem it can be??? Have I missed something? And as you can see on the picture all messages i18n are disappear too. May be it is a probleme of crowd?

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events