The initial requirements for the userinfo plugin are that I need to:
In this part of the tutorial, I'm going to cover the first step. But in order to do so, I need to decide how I'm going to gather this information.
The traditional wiki way to do this would be through "magic markup". We would define some special Confluence markup (in Confluence that would be a macro) that users could insert into a page to set their contact information, and have the macro save that somewhere for later retrieval. This approach makes the programmatic interface very simple (you're only ever writing macros), but it doesn't make life particularly easy for users who have to remember, or continually look up, some obscure wiki syntax.
|
The Metadata Plugin is an excellent Confluence plugin that does just this. It allows arbitrary metadata to be added to any page through a macro, and then allows you to collate, tabulate and aggregate that data in some pretty cool ways. If we wanted to go the "magic markup" route, I could just stop the tutorial now and say "use the Metadata Plugin instead". The Metadata Plugin was written by the Pantero Corporation, and won an honourable mention in our first ever plugin development competition. |
Confluence has powerful plugin module types that allow you to modify not only the content of wiki pages, but the functionality of the Confluence application itself. It's those modules that we will be using to gather our users' contact information:
In this second part of the tutorial, we will concentrate on using an XWork plugin to display a form to the user, and store and retrieve the information they submit.
Compiling and uploading the plugin I've written so far gives me the ability to set and edit my user information:

It's a bit ugly, though:
/users/userinfo/edituserinfo.action – there's no link from the Confluence UI.I'll fix those problems in the part three of the tutorial.