How to build a Confluence Macro Plugin

The goal is to build a small macro plugin deployable via the Confluence plugin API rendering some spaces. Please note that I am going to build the plugin using just Maven and not the Atlassian Maven Wrapper called the “Atlassian Plugin SDK” – more information about that is available at the Atlassian website. The macro output will be rendered using a Velocity template and all messages are stored for i18n in properties files bundled with the plugin. ...

April 13, 2010 · 7 min · 1431 words · Micha Kops

Confluence Developer Instance Quick Setup

This short tutorial shows how to set-up a developer instance of the popular Confluence Wiki from Atlassian in a few minutes. It’s a prerequisite for a few following tutorials regarding the Confluence API and plug-in development for this system. We want a quick install so we are going to run Confluence with the embedded servlet container and HSQL database. update Meanwhile it is way much easier to use Atlassian’s Plugin SDK using atlas-mvn run or atlas-mvn-run-standalone –product confluence –version x.x.x but if you need to setup an independant instance, this article still might be useful. ...

March 26, 2010 · 3 min · 431 words · Micha Kops

Atlassian Snippets

Disable YUI compressor <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-jira-plugin</artifactId> <version>${amps.version}</version> <extensions>true</extensions> <configuration> <compressResources>false</compressResources> [..] </configuration> </plugin> Confluence – Get favourites by user Using the label manager. List getFavouriteSpaces(String username) Confluence – Determine the base URL Using the SettingsManager: String baseUrl = settingsManager.getGlobalSettings().getBaseUrl(); Confluence – Get the context path Using the BootstrapManager: String contextPath = bootstrapManager.getWebAppContextPath(); Confluence – Using Velocity Template for a Macro final VelocityContext contextMap = new VelocityContext(MacroUtils.defaultVelocityContext()); contextMap.put("key", obj); // references obj as variable named $key in the velocity template VelocityUtils.getRenderedTemplate("path/to/template.vm", contextMap); ...

March 1, 2010 · 3 min · 544 words · Micha Kops