For my ShipIt V project, the first challenge was simply committing myself to a single idea. Eventually (after a few single class prototypes) I settled on the challenge of trying to integrate chatrooms into Confluence.
After a few trade offs, I think this actually ended up turning out brilliantly – far better than I had expected up front!
h3. How it works
So how do you put a chatroom into a wiki page? Well, that is very hard and plagued with ugly Javascript quagmires. Jabber has a facility to build chatrooms already (MUCs or Multi User Chats) so it was an obvious communication backend. Knowing this, I decided to do an elegant little sidestep!
Confluence simply creates and logs the multi user chat, while each user uses their desktop clients to chat. They can either join the chat directly or you can invite them via the Confluence web interface (which makes their chat client bounce).
Turns out this works very nicely!
The workflow is basically as follows:
* Inside Confluence, you can *”Add a Chatroom”* to any page (well, any content entity really) and you then get a “Chatroom” tab.
* You can now *”start”* the chatroom. A chatroom is either “started” or “stopped” indicating whether or not the Confluence server is logging the room at present.
* Next from within Confluence, you can *invite users* into the chat by Jabber ID or by Confluence username (each user has a “Jabber preference screen”: which allows them to set their Jabber ID)
* Their desktop client (in my case Adium) gets a chat invite. After accepting, users can then *chat* with all the other invitees.
* This chat is then *logged* in real time to the page (which has a neat little seamless Ajax update).
* Chat logs are indexed so that you can find them via standard Confluence *search* and the log is also written as an attachment which you can then *browse* via the inbuilt (nifty!) log viewer.
h3. Screenshots
Here’s a nifty little “Slide”: slideshow showing some screenshots of the chatroom plugin in action:

h3. Future Directions
There are a few things I didn’t get time to add, namely:
* I got very close (ie it blew up right before demo time!) to making various “commands” available within the chatroom to which the server’s bot would respond. For example “page:url” replies with the page URL and “search:foo” prints the first 10 matches for a search for “foo” into the chatroom.
* An ability to specify your complete Jabber credentials, so that you can use your roster to invite people (or whole groups of people) into a chatroom.
* An ability to send files to the chatroom, which become page attachments (this would be really neat).
I’ll clean up the code and release it on the “Confluence Extensions”: space as soon as I get a spare hour.

ShipIt V – Chatrooms in Confluence...