Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why main menu disappear from page in Crowd plugin?

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="${project.name}" plugins-version="2">
    <plugin-info>
        <description>${project.description}</description>
        <version>${project.version}</version>
        <vendor name="${project.organization.name}" url="${project.organization.url}" />
    </plugin-info>
    
    <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>
    </web-item>
    
    <!-- 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>
        </condition>
    </web-section>
    
    <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>
            </action>
        </package>
    </xwork>
    
    <resource type="i18n" name="i18n" location="messages.i18n" />
    
</atlassian-plugin>

and view.ftl is:

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

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

2 answers

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.

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

<decorators>
    <decorator name="error" page="/console/decorator/simple.jsp">
        <pattern>/console/error/*</pattern>
    </decorator>
    <decorator name="license" page="/console/decorator/simple.jsp">
        <pattern>/console/license*</pattern>
    </decorator>
    <decorator name="none" page="/console/decorator/none.jsp">
        <pattern>/console/plugin/secure/saml/*</pattern>
        <pattern>/console/secure/pickers/*</pattern>
    </decorator>
    <decorator name="main" page="/console/decorator/default.jsp">
        <pattern>/*</pattern>
    </decorator>

    <!-- 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"/>
</decorators>

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?

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

&lt;dependency&gt;
            &lt;groupId&gt;com.atlassian.crowd&lt;/groupId&gt;
            &lt;artifactId&gt;crowd-server&lt;/artifactId&gt;
            &lt;version&gt;2.3.4&lt;/version&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
        &lt;/dependency&gt;

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

&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;meta name="section" content="administration" /&gt;
    &lt;meta name="pagename" content="systeminfo" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div class="crowdForm"&gt;
    
        &lt;div class="formTitle"&gt;
            &lt;h3&gt;Title&lt;/h3&gt;
        &lt;/div&gt;
   
    
    &lt;/div&gt;
  
    Hello ${action.firstName} ${action.lastName}
  &lt;/body&gt;
&lt;/html&gt;

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...

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

307 views 9 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you