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

Web Item Plugin Module - Minimal Example - Don't get the plugin working

Andreas Borkenhagen February 18, 2014

I tried to get the the small Web Item Plugin Module

(https://developer.atlassian.com/display/DOCS/Web+Item+Plugin+Module#WebItemPluginModule-Singlewebitemintheadminsection)

example working in Stash 2.10.1 and failed. I don't get any visible web item for both examples (header bar and admin are).

Is this example compatible with Stash?

Is the atlassian-plugin.xml all i need for this web item?

Where does the text "Google" come from? Why is the label tag empty?

Don't see any further information on the page.

2 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
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.
February 21, 2014

Hi Andreas,

If you want web.items (as opposed to web.panels) you can add ?web.items to the URL. You've probably seen the Stash documentation? You might also be interested in this example plugin:

https://bitbucket.org/atlassian/stash-example-plugin/src/ee916cc40d7fa5157ebc424f4ca0283b45bb2323/src/main/resources/atlassian-plugin.xml?at=master

In relation to the header example it looks like Stash has headr.global.primary.logo, header.global.primary and header.global.secondary (but I suggest having a look yourself locally). There's no "system.header" if that's what you tried.

Does that help?

Charles

PS. Your example worked for me, I'm not quit sure what you mean about "without the contained text" - what would you expect?

Andreas Borkenhagen February 27, 2014

I was confused by the naming of "?web.items" but know i understand what they are for.

I had to place the label text between the label tags:

<label key="item.google.home.label">Test</label>

The google example was without any content in the label tag so i think, i maybe got the i18n wrong.

Does the google link example use i18n via the <pluginName>.properties or is my comprehension wrong for this usecase?


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.
February 27, 2014

The text of any i18n property is picked up across all of the i18n files. You can add your own if you like by including:

<resource type="i18n" name="My i18n" location="a.b.C" />

And Stash will look for "a/b/C.properties" and the corresponding language files (eg. "a/b/C_fr.properties").

If the key can't be found it should use the text in the body of the <label/> element.

Charles

Andreas Borkenhagen February 27, 2014

Thank you very much Charles :)

0 votes
Andreas Borkenhagen February 19, 2014

I managed to get one web item working:

&lt;atlassian-plugin name="Hello World Plugin" key="example.plugin.helloworld" plugins-version="2"&gt;
    &lt;plugin-info&gt;
        &lt;description&gt;A basic web item module test&lt;/description&gt;
        &lt;vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/&gt;
        &lt;version&gt;1.0&lt;/version&gt;
    &lt;/plugin-info&gt;
 
    &lt;web-item key="google_home" name="Google Home" section="stash.repository.nav" weight="1000"&gt;
        &lt;description key="item.google.home.desc"&gt;Simple link to google.com.&lt;/description&gt;
        &lt;label key="item.google.home.label"&gt;Test&lt;/label&gt;
        &lt;link linkId="google_home"&gt;http://google.com&lt;/link&gt;
    &lt;/web-item&gt;
&lt;/atlassian-plugin&gt;

The section is no context listed here: https://developer.atlassian.com/stash/docs/latest/reference/web-resource-contexts.htmlBut "

stash.repository.nav" is the only context I get a web item working with.


The label tags contain text. Without the contained text only blank space is displayed.

How do I get the possible locations for the web item's section attribute? I tried to find locations with the ?web.panels URL option and found the "stash.repository.nav.*" that I used for the code above.

What did I get wrong?

TAGS
AUG Leaders

Atlassian Community Events