What page decorators are available in Stash?

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
Seb Ruiz Atlassian Team Apr 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

Oh cool, thanks for this!

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

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?

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?

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

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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

682 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot