It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 Sign up to answer
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

7,071 views 6 6
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you