Friday 8 October 2010

Tungle + Confluence

A few days ago IBM announced support for integrating LotusLive with the excellent Tungle.me service for scheduling appointments with external parties.  Not being one to let IBM have all the fun I created a User Macro to embed Tungle.me in Atlassian's Confluence wiki.

Register a Tungle.me account
Visit Tungle.me and follow the on-screen instructions.

Create a User Macro
  1. Login to Confluence as a user with admin privileges
  2. Select Browse -> Confluence Admin -> User Macros
  3. Create a new User Macro with the following details:
Macro name: tungle
Macro body: unchecked
Output: Macro generates HTML markup
Template:

#set ($user = ($paramuser))
#if ($user)
  <img src="https://www.tungle.me/public/${user}/busyicon" class="tungle-me" teml="${user}"/>
  <script src="https://www.tungle.me/portal/js/plugins/tungle.mwmWidget.js" type="text/javascript"></script>
#else
  <div class="errorBox">You must specify a <strong>user</strong> parameter.</div>
#end

Add the Macro to a Page
Edit any Confluence page in the normal way and add the following code:

{tungle:user=<username>}

where <username> is your Tungle.me username, e.g.

{tungle:user=sphericaln}

This will give you the following on your wiki page:







and when you click "schedule a meeting" you will see:























If you don't specify a "user" parameter then you will get:





Tungle.me has a number of synchronisation integrations with calendar services - LotusLive, Lotus Notes, Google Calendar, Outlook, Entourage, Exchange - and embedding the widget in your website is a great way of making it easy for people outside your organisation to schedule appointments.

Saturday 2 October 2010

Google Moderator + Confluence Take 2

A while ago I posted how to integrate Google Moderator with Confluence , but it was a hard-coded solution which would only embed one Moderator series.  After (finally) getting off my backside I've now got an improved User Macro which allows you to enter the URL of any Moderator series as a parameter to the macro.

Most of the steps are the same as the previous blog post , but the template for the macro has been changed from:

<div id="moderator-embed-target"></div>
<script type="text/javascript">
var mod = new MODERATOR("http://www.google.com/moderator/[ID of your Moderator series]);
mod.hl = "en";
mod.width = 1000;
mod.height = 500;
mod.embed("moderator-embed-target");
</script>

to:

#set ($url = ($paramurl))

#if ($url)
  <div id="moderator-embed-target"></div>
  <script type="text/javascript">
    var mod = new MODERATOR("${url}");
    mod.hl = "en";
    mod.width = 1000;
    mod.height = 500;
    mod.embed("moderator-embed-target");
  </script>
#else
  <div class="errorBox">You must specify a <strong>url<strong> parameter.<div>
#end

This small change now allows you to enter something similar to:

{google-moderator:url=http://www.google.com/moderator/#16/e=22571}

into the body of a Confluence page, where the URL is just copied and pasted from the home page of your Google Moderator series.  This results in:




















If you forget to enter a URL parameter by just entering:

{google-moderator}

you will be presented with:





















I still need to work on turning this into a "proper" plugin or Open Social gadget, but it's more flexible than the old macro.

FOOTNOTE:  I didn't use $generalUtil.urlEncode($paramurl) in the macro as when the URL is encoded the macro fails to render.