问题
I created a web-item and a webwork action. My web-item displays a new tab in the administration section of projects. The link of the tab points to my actions.
The only problem is that my webwork action is displayed completely in another page. I would like my custom project tab to stay highlighted and my webwork action form to be displayed inside my projects "frame".
Here's my atlassian-plugin.xml :
<web-item name="info - Project Information" i18n-name-key="info-jira-module.name" key="info-jira-module" section="atl.jira.proj.config/projectgroup1" weight="1000">
<description key="info-jira-module.description">The info Jira Module Plugin</description>
<label key="info-jira-module.label"/>
<link linkId="info-jira-module-link">/secure/MyActionClass.jspa?projectId=${project.id}</link>
</web-item>
<webwork1 key="info-project-webwork" name="info Project Webwork" i18n-name-key="info-project-webwork.name">
<description key="info-project-webwork.description">The info Project Webwork Plugin</description>
<actions>
<action name="ca.info.jira.jira.webwork.MyActionClass" alias="MyActionClass">
<view name="success">/templates/templates/info-project-webwork/myactionclass/success.vm</view>
</action>
</actions>
</webwork1>
回答1:
You need to add a web-section for your web-item:
<!-- A new Plugins section in the Admin menu -->
<web-section key="info-jira-section"
name="info - Project Information Section"
location="admin_plugins_menu"
weight="110">
<label key="info-jira-section.name"/>
</web-section>
<!-- A item in the Plugins section -->
<web-item name="info - Project Information" i18n-name-key="info-jira-module.name" key="info-jira-module" section="admin_plugins_menu/info-jira-section" weight="10">
<description key="info-jira-module.description">The info Jira Module Plugin</description>
<label key="info-jira-module.label"/>
<link linkId="info-jira-module-link">/secure/MyActionClass.jspa?projectId=${project.id}</link>
And as I recall, all the web-items are servlets. And be sure your project.id is available in your template.
来源:https://stackoverflow.com/questions/20669708/how-to-add-a-webwork1-action-linked-to-a-project-admin-tab-in-jira