Adding a 'configure' page to my Add-On in confluence.

I have written a Confluence Macro that needs the admin to setup a default value that will be system wide. My macro will then need to pull this default value and use it. At the moment I have simply hard coded it in my Macro. Obviously this is not desirable as I would have to modify the Macro for every system that uses it.

I believe that this should be done using the 'configure' button from the Add-Ons page for my Macro.

I have been looking for some sample code of a Macro that has this in it but can't find any and am at a loss as to how to find out how to do this.

Can anyone give me some tips/hints/ideas where I might find out how to do this?

1 answer

0 vote
David Simpson Community Champion Jun 08, 2014

Hi Stephen

Take a look at the Markdown for Confluence add-on, particularly the ConfigurationServlet and the soy template



In the plugin xml file look at the following (I've stripped out the bits that aren't for the config page):

<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${}" plugins-version="2">
    <param name="configure.url">/plugins/servlet/markdown-for-confluence/configure</param><-- the link in the UPM -->

  <!-- the servelet -->
  <servlet name="Configuration Servlet" i18n-name-key="" key="configuration-servlet" class="me.davidsimpson.confluence.addon.markdown.servlet.ConfigurationServlet">
    <description key="configuration-servlet.description">The Configuration Servlet Plugin</description>
    <condition class="com.atlassian.confluence.plugin.descriptor.web.conditions.ConfluenceAdministratorCondition" />

  <!-- soy template for the servlet -->
  <web-resource key="configure-soy">
    <transformation extension="soy">
      <transformer key="soyTransformer"/>
    <resource type="download" name="md-configure.js" location="soy/"/>

  <!-- link in the left hand navigation of the confluence admin section -->
  <web-item key="markdown-for-confluence.configure" name="Markdown Configure Link" weight="10000" section="system.admin/configuration">
    <description>Link to configure action</description>
    <label key="me.davidsimpson.confluence.addon.markdown-for-confluence.configure.web-item"/>
    <condition class="com.atlassian.confluence.plugin.descriptor.web.conditions.ConfluenceAdministratorCondition" />

  <!-- Some plumbing to help out -->
  <component-import key="loginUriProvider" interface="com.atlassian.sal.api.auth.LoginUriProvider"/>
  <component-import key="pluginSettingsFactory" interface="com.atlassian.sal.api.pluginsettings.PluginSettingsFactory"/>
  <component-import key="soyTemplateRenderer" interface=""/>
  <component-import key="templateRenderer" interface="com.atlassian.templaterenderer.TemplateRenderer"/>


Traditionally people used velocity for configuration screens, but servlets + Soy means that you can use the same kind of code in Confluence, JIRA and other add-ons, so it's quite nice.

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted yesterday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

157 views 12 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot