Creating admin configuration page for plugin

Hi all,

I’m trying to create an admin config page for my plugin, and I’m referring to this guide:
https://developer.atlassian.com/docs/common-coding-tasks/creating-an-admin-configuration-form

I’ve tried going through this guide twice, and I keep getting the error “getStaticResourceLocale is deprecated and not used anymore”. I even downloaded the complete code and ran it, but getting the same error.

How can I get it to work? is there another guide on this?

Thanks!

2 Likes

@delacroix22 thanks for letting us know that there is a problem with this tutorial.

I’ll reach out to the team about this.

Unfortunately, the problem still exists :slight_smile:

Hey there,

I have an example for a Plugin Configuration Page.

Lets take a look into the atlassian-plugin.xml

<web-section key="admin_handler_config_section" location="admin_plugins_menu">
		<label key="Plugin - Admin Configuration" />
	</web-section>

First of all the new Web-Section. The location “admin_plugins_menu” is the sidebar when the administrator navigate to the “addons” page. I added a Screenshot, I marked my new web-section.

As you can see I have a link “Plugin Configuration” in my new web-section. Here is the XML definition of the link in my atlassian-plugin.xml

	<web-item key="plugin-admin-config-link"
		section="admin_plugins_menu/admin_handler_config_section">
		<label key="Plugin Configuration" />
		<link linkId="handler.plugin.configuration.link" key="plugin-configuration">/secure/admin/plugins/handler/PluginAdminConfigAction.jspa
		</link>
	</web-item>

The Link navigates to my PluginAdminConfigAction, which is just a simple webwork action:

<webwork1 key="admin-config" name="Administration Configuration"
		class="java.lang.Object">
		<actions>
			<action
				name="de.scag.jira.plugin.mailhandler.webwork.PluginAdminConfigAction"
				alias="PluginAdminConfigAction">
				<view name="input" type="velocity">/template/webwork/plugin-admin-config.vm</view>
			</action>
		</actions>
	</webwork1>

Once you have added the 3 Elements in your atlassian-plugin.xml (web-item, web-section & webwork), you need to add your velocity for the view (In my example plugin-admin-config.vm)

To make sure that this view will be rendered correctly in the administrator section, you have to add some meta-tags inside you velocity.

<html>
<head>
<title>Configuration</title>
<meta name="decorator" content="atl.admin" />
<meta name="admin.active.section" content="plugin-admin-config-link" />
</head>
<body>
	<h1>Plugin Configuration</h1>
</body>
</html>

The final result will be this:

so long…

5 Likes