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

Create custom Dashboard as XWork Action with Confluence Layout

Philipp Steinwender
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.
May 21, 2013

Hello,

we develop a plugin for a customer that needs a dashboard that behaves like an own webapp. It has a search on it and some widgets.

To implement this as a macro and include it on a defined space seems not like the right choice.

I would prefer to implement an separate action that integrates into confluence.

What I need is the same layout/container like the initial dashboard has. Header, Controls, Footer. And I would use the body-content section to render our application.

One way to possibly do this may be to add a new action that overrides

com.atlassian.confluence.dashboard.actions.DashboardAction

and supply a custom velocity template copied from confluence/webapp/dashboard/dashboard.vm

My action is bound to host/confluence/plugins/pluginname/actionname.action

But this way I get a page that has a similar content as the Dashboard but without any javascript or css loaded.

Is there a proper way to get this done?

Is there a way to onherit the default confluence layout?

This is the default dashboard:

This is what I need:

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Philipp Steinwender
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 25, 2015

our solution:

 

Create an action class, inherit from ConfluenceActionSupport.

Use this as template in your atlassian-plugin.xml:

<xwork key="xwork-actions" name="XWork Actions">
    <description>XWork actions</description>

    <!-- dashboard action -->
    <package name="myPackage" extends="default" namespace="/myaction">
        <default-interceptor-ref name="defaultStack"/>

        <global-results>
            <result name="loginrequired" type="redirect">/login.action</result>
            <result name="notpermitted" type="dispatcher">/notpermitted.action</result>
            <result name="notfound" type="dispatcher">/fourohfour.action</result>
        </global-results>

        <action name="sonr-dashboard" class="com.company.MyAction"
                method="method">
            <result name="success" type="velocity">/templates/dashboard-action.vm</result>
        </action>
    </package>
</xwork>

Create your dashboard-action.vm template.

I think it has to include html>head>title and html>body elements.

 

I cannot say this is the minimal example. I just copied it from a working plugin.

Hope this helps!

Aviram Gabay
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 25, 2015

Will give it a shot, thanks for the fast response!!

shiran kfir March 25, 2015

Hi, I'm having the same problem. Can you please explain what you did to override the main dashboard? Thank you very much.

Aviram Gabay
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 25, 2015

Hi Phillip, Sadly that solution didnt work for me.... Im probably doind something wrong, could you please give me a more detailed explanation on the different parts of the solution? Or a reference where this solution was taken? Any other parts to this code that I am missing? Thanks!!!

Philipp Steinwender
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 25, 2015

Sorry not enough time for a detailed explanation. It may be not complete. See the docs on how exactly xwork actions work. See the docs how the templates in confluence are used. Get the confluence code and check the templates that are included. Also there should be a DashboardAction class. Or find a plugin that uses a separate dashboard, download it, and inspect their atlassian-plugin.xml. I know it is a pain to find out how this works. We went through this too. But i cannot take the time to explain it in detail. Sorry, and good luck ;) (there is a way to ask atlassian developers: https://developer.atlassian.com/help#contact-us )

Aviram Gabay
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 25, 2015

I will give it a shot! Thank for everything!

0 votes
Philipp Steinwender
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 25, 2015

yes, see answer below

0 votes
Aviram Gabay
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 25, 2015

Hi, Im having the same issue, were you able to solve it?

TAGS
AUG Leaders

Atlassian Community Events