Confluence Plugin (Grails)

Installation

Download Current Version 0.2

or just use the command

grails install-plugin confluence

Description

The Confluence Plugin uses a remote installation of Atlassian's Corporate Wiki Confluence to bring static content management to your Grails application.

While I was working on my Project Kaperfahrt.org I thought quite a lot about how to handle static content. All this Terms and Conditions stuff, the content of system mails must be stored somehow.

First (most straightforward) option was, to put each piece of content right in that place where it's needed. (1) No good design - in fact no design at all. For a prototype this approach seems okay but it turned out to be a configuration nightmare. The reason's pretty clear: each content change lead to a redeploy of the application.

Second option: Create domain classes and controller to handle the static content (2). Thanks to Grails's scaffolding abilities the effort is reasonable but it still has a bad smell putting content like T&C's together with domain objects.

Thanks to Atlassian's Starter offer I was able to get a full featured license for Confluence. That lead to another idea:

Third option: Misuse Confluence's ability to handle content and get all that for free for a grails project:

The Confluence Plugin provides a GSP tag that works looks like this (referring to this very page):

<cnf:page space="PUB" page="Confluence Plugin (Grails)">
This is the default text. You see it when the connection to Confluence isn't available
</cnf:page>

This tag, provided by the plugin, uses the XML-RPC interface of a Confluence installation you have access to. It gets the rendered HTML content from there and puts it into your view. All you have to take care of is, provide the credentials in your Config.groovy.

de.kabtain.confluence.url = 'http://my.confluence'
de.kabtain.confluence.login = 'user'
de.kabtain.confluence.password = 'password'

For frequently used applications it's inappropriate to make an XML-RPC call each time the page is viewed. So the Confluence Plugin depends on the Springcache plugin version 1.1.2 to cache the static content. To use caching only a few configurations are necessary, again in your Config.groovy:

springcache {
	cachingModels {
		confluenceCachePlain {
			cacheName = "CONFLUENCE_CACHE_PLAIN"
		}
        confluenceCacheHtml {
			cacheName = "CONFLUENCE_CACHE_HTML"
		}

	}
}

For more detailed configuration questions, just visit the Springcache plugin page.


Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced
- Activity

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

 

Other Features

Add Content


Karsten's Blog