Hi everyone,
I have a strange problem and I don't know how to fix it.
I added a web panel on the right context of the issue and a velocity view resource.
When I open the project address (i.e. .../jira/projects/TEST/issues/TEST-1) everything is fine with the page and the web panel context as expected.
But, if I open the issue directly (i.e. .../jira/browse/TEST-1) only my web panel context content is loaded on a grey background, all the rest of the issue page is missing.
Do I need to add any decorator to my velocity file?
Kind regards,
Dennis
Hi again,
I still did not found a solution for this problem.
I created a small 'webpanel' example to reproduce this behavior.
'webpanel'-section in the atlassian-plugin.xml:
<web-panel name="issuewebpanel" i18n-name-key="issuewebpanel.name" key="issuewebpanel" location="atl.jira.view.issue.right.context" weight="1000">
<description key="issuewebpanel.description">The issuewebpanel Plugin</description>
<context-provider class="com.it.dev.webpanelexample.WebPanelContextProvider"/>
<resource name="view" type="velocity" location="/templates/view.html"/>
</web-panel>
The simple context provider class:
package com.it.dev.webpanelexample;
import com.atlassian.jira.plugin.webfragment.contextproviders.AbstractJiraContextProvider;
import com.atlassian.jira.plugin.webfragment.model.JiraHelper;
import com.atlassian.jira.user.ApplicationUser;
import java.util.TreeMap;
import java.util.Map;
public class WebPanelContextProvider extends AbstractJiraContextProvider
{
@@Override
public Map getContextMap(ApplicationUser user, JiraHelper jiraHelper)
{
Map contextMap = new TreeMap();
contextMap.put("entry", "Hello World!");
return contextMap;
}
}
The view template file:
<html>
<head>
</head>
<body>
<p>Say 'hallo': $entry</p>
</body>
</html>
Now I made two screenshots to show what is happening:
The following screenshot shows the jira page when opening the whole project. So everything is as expected :). Here .../jira/projects/TEST/issues/TEST-1.
But the next screenshot shows my problem when opening an issue page, here .../jira/browse/TEST-1. Only the content of the webpanel view template is loaded with the standard nav bar on top.
All the rest of the jira page for this issue is missing! :/
Can anyone please help me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is fixed! :)
It is only allowed to fill the "body"-part of the html in the velocity file.
So:
<html>
<head>
</head>
<body>
<p>Say 'hallo': $entry</p>
</body>
</html>
has to be only:
<p>Say 'hallo': $entry</p>
The extra <html>, <head> and <body> tags seem to confuse the site constructor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
which <location>?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.