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

What page decorators are available in Stash?

Annie April 20, 2013

I think I've looked everywhere and still can't find an answer, where can I get a list of decorators to use in my Stash Servlet plugin? I want to define the decorator in my velocity file, like this: <meta name="decorator" content="something.here">

Can anyone tell me where I can find a list of decorators that can be used?

2 answers

1 accepted

2 votes
Answer accepted
seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2013

Hi Annie,

As Charles mentioned above, we have the following pages available to decorate in Stash 2.3:

  • atl.general
  • atl.admin
  • atl.userprofile
  • atl.popup
  • stash.repository.general
  • stash.repository.settings
  • stash.form

However, I would like to note that they are all public APIs. The stash.form decorator is going to be deprecated in Stash 2.4.

As you've noticed, there's currently no published documentation for the decorators so I have made written some that will be published with Stash 2.4 next week. I've also implemented a project level decorator which will be available in Stash 2.4 as well.

I've created an example plugin which demonstrates decorating various pages in Stash 2.4 - you can find the sources here: https://bitbucket.org/atlassian/stash-example-plugin

Annie April 21, 2013

Oh cool, thanks for this!

1 vote
cofarrell
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.
April 20, 2013

Hi Annie,

I'm afraid the the only list we currently have of our public decorators are the four cross-product ones listed here:

https://developer.atlassian.com/display/DOCS/Web+Resource+Plugin+Module

  • atl.general
  • atl.admin
  • atl.userprofile
  • atl.popup

In addition we have the following Stash specific decorators, which aren't technically public (and might conceivably change between releases):

  • stash.repository.general
  • stash.repository.settings
  • stash.form (an example is on the SSH add key page)

And that's it actually. I will follow-up with my colleagues tomorrow and see which of these would be appropriate to document and make sure that happens.

Cheers,

Charles

Annie April 20, 2013

Hmm, in that case, what would you suggest is the best way for me to add another tab to the Project view page: (my local URL:http://localhost:7990/stash/projects/PROJECT_1) ? I want to add it after the Settings 'tab'. So far I have something like this defined:

1
2
3
4
5
6
7
8
<web-item name="Plugin Project Admin" key="plugin-project-admin" section="atl.project.nav" weight="10000">
<condition class="com.atlassian.stash.web.conditions.HasProjectPermissionCondition">
<param name="permission">PROJECT_ADMIN</param>
</condition>
<description key="plugin-admin.description">Configure plugin for project</description>
<label key="plugin-admin.label">Plugin Config</label>
<link absolute="true" linkId="project-config-tab">#plugin-project-config</link>
</web-item>

This adds a link to the same level as the other tabs, but I don't know how to make it so that when I click the tab/link it takes me to a page that is decorated in the same way as the other 'tabs' on that page. Any ideas?

Annie April 20, 2013

Hmm, in that case, what would you suggest is the best way for me to add another tab to the Project view page: (my local URL: http://localhost:7990/stash/projects/PROJECT_1) ? I want to add it after the Settings 'tab'. So far I have something like this defined:

&lt;web-item name="Plugin Project Admin" key="plugin-project-admin" section="atl.project.nav" weight="10000"&gt;
  	&lt;condition class="com.atlassian.stash.web.conditions.HasProjectPermissionCondition"&gt;
    	&lt;param name="permission"&gt;PROJECT_ADMIN&lt;/param&gt;
    &lt;/condition&gt;
    &lt;description key="plugin-admin.description"&gt;Configure plugin for project&lt;/description&gt;
    &lt;label key="plugin-admin.label"&gt;Plugin Config&lt;/label&gt;
    &lt;link absolute="true" linkId="project-config-tab"&gt;#plugin-project-config&lt;/link&gt;
  &lt;/web-item&gt;

This adds a link to the same level as the other tabs, but I don't know how to make it so that when I click the tab/link it takes me to a page that is decorated in the same way as the other 'tabs' on that page. Any ideas?

cofarrell
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.
April 21, 2013

Hi Annie,

I'm afraid this isn't a (supported) way of doing that at the moment. :(

I've raised an issue for adding the decorator, which should really be there.

https://jira.atlassian.com/browse/STASH-3351

Cheers,

Charles

Annie April 21, 2013

Hmm, that's a shame, can you suggest any other way of adding a section for administering my plugin specific settings at a project level instead of repo level?

Basically what I want to do is allow a project admin to set some config up for my plugin and have it apply to all repositories within a project (instead of them having to go into every repo and set the config there).

Thanks for your replies!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events