How to create a new "project config" page?

Dear community, I am trying to create a new webwork which is located in project / config area. I already created a new web-item which appears as wanted and also when i click it, the wanted webwork appears, but, the webwork “opens” a completly new page instead of beeing located “inside” the project config navigators. The two sidebares “project” and “project config” dissapear. I’ve readed that is important to set the right meta tags inside my velocity template, but whatever I do, it won’t work. That’s my current velocity:

<html>
<head>
<title>Projekt abschliessen</title>
<meta name=“decorator” content=“atl.admin”/>
<meta name=“projectKey” content=“BEIS2”/> <!-- ensure this is on view context server side via servlet and BrowseContext -->
<meta name=“projectId” content=“10100”/> <!-- ensure this is on view context server side via servlet and BrowseContext -->
<meta name=“admin.active.section” content=“alt.jira.proj.config”/>
</head>

Don’t worry about projectKey and projectId. Both are fix for my test but will be replaced with a variable one later. Is there anything I do wrong or is there anything i missed? Within my plugin.xml or by regarded Java class is no special code because it should work by only edit the velocity file, right?

My current Jira Version is 7.12.0.

Thanks for your help. :slight_smile:

Hi I didn’t look at this in detail, but based on a quick scan (in the last 20min :slight_smile: ) trying to give you a starting point, there is a servlet that is responsible for rendering the configuration tab panels:

/**
 * Servlet used to render the project configuration panels. It matches URLs of the form
 * "/project-config/(projectkey)/(pannel)/(other)" and tries to render the {@link ProjectConfigTab} with id "pannel"
 * for the project with key "projectkey". The "other" is passed to the pannel when rendering as the path info.
 *
 * @since v4.4
 */
public class PanelServlet extends HttpServlet {

It seems to be getting tabs of type ProjectConfigTab.class

package com.atlassian.jira.projectconfig.tab;

/**
 * Repesents a tab on the project configuration page.
 *
 * @since v4.4
 */
public interface ProjectConfigTab {
    /**
     * Get the ID for the panel.
     *
     * @return the ID of the panel.
     */
    public String getId();

Which has this implementation that other existing tabs seem to extend:

/**
 * A tab panel on the project configuration page that is rendered using a webpanel.
 * <p/>
 * It will construct the tab contents from two web panels:
 * <ul>
 * <li>A header web-panel, assumed to be common for all inheriting tabs, located under 'tabs.admin.projectconfig.header'</li>
 * <li>A body web-panel, specific to a given tab, located under 'tabs.admin.projectconfig.{tab ID}'</li>
 * </ul>
 *
 * @since v4.4
 */
public abstract class WebPanelTab implements ProjectConfigTab {

It looks like the trick is to define your own ProjectConfigTab and get the existing serlvlet in Jira to render it for you.

Best regards

2 Likes

    <meta name="decorator" content="atl.admin"/>
    <meta name="admin.active.section" content="atl.jira.proj.config"/>
    <meta name="admin.active.tab" content="item_tracker_project_admin_link"/>
    <meta name="project" content="${projectKey}"/>
    <meta name="projectKey" content="${projectKey}"/>
    <meta name="ajs-projectKey" content="${projectKey}"/>
1 Like

Thanks a lot Sir. This is the solution. :smiley:

1 Like

Happy to help! Looking more closely, it appears that the issue was that you also needed <meta name="ajs-projectKey" content="${projectKey}"/> meta tag. Additionally, you should use the <meta name="admin.active.tab" content="item_tracker_project_admin_link"/> to highlight which Web Item is in-use.

Please note that the content attribute on the meta name="admin.active.tab" is the LINK ID, not the Web Item Key. The documentation confuses this a lot.

2 Likes

Yes, you are right. “ajs-projectKey” was missing. I don’t really understand why it is necessary to provide the project key three times and I am also not sure, where in Atlassian SDK documentation is this mentioned.

“admin.active.tab” is set and my web item is highlighted correctly. :slight_smile:

Now i am trying to add a new project centric view, but it looks like, that it is a completly different way than to add a project config view. Do you have experience with project centric view?

Yes, it’s quite different (Project Admin is using the ‘old tech’ and Project Centric View is using the ‘new tech’). To be a little more specific, it is implemented using a Web Panel.

You should be reading the following two links, in order:

If you need additional help: I would appreciate if you’d create a New Question with your details and @mention me on it if you’d like.