Want Confluence or JIRA for $5 for 5 users?

I usually don’t blog about work stuff but this is pretty cool - for this week only we (Atlassian) are selling Confluence and JIRA licenses for $5 a pop (for a five user license valid for 1 year) with the proceeds going to Room to Read.

This is a really easy way to score some awesome Confluence and JIRA licenses on the cheap and help a good cause. If your a contractor or work as part of a small team then checking this out is definitely worth your time.

April 20, 2009 • Posted in: My Brain • No Comments

Mac OS X Tip: Blacktree Secrets

One of the most useful tools I’ve found for Mac OS X is Secrets, by Blacktree - the guys who brought us QuickSilver.

Secrets is a database of hidden settings for Mac OS X that provides a Preference pane to easily enable or disable them with a single click. On Mac OS X, perferences can be written to using the defaults utility from the Terminal but Secrets makes its use redundant for those of us who like stuffing around with undocumented parts of Mac OS X.

Secrets Preference Pane

One of my favorite preferences (but useless) is the “Suck” minimize effect for the Dock that is not available through the Dock preference pane.

To enable:

Check it out:

March 16, 2009 • Posted in: My Brain • One Comment

Mac OS X Tip: Preventing accidently launching FrontRow when cycling windows

Fellow Atlassian, Nick Pellow, tweeted today about how annoying it is when your finger slips to the escape key when cycling through windows and subsequently have FrontRow launch in the middle of your business.

Did you know its this easy to turn off?

March 15, 2009 • Posted in: My Brain • One Comment

OZYMANDIAS

I met a traveller from an antique land
Who said: Two vast and trunkless legs of stone
Stand in the desert. Near them on the sand,
Half sunk, a shatter’d visage lies, whose frown
And wrinkled lip and sneer of cold command
Tell that its sculptor well those passions read
Which yet survive, stamp’d on these lifeless things,
The hand that mock’d them and the heart that fed.
And on the pedestal these words appear:
“My name is Ozymandias, king of kings:
Look on my works, ye Mighty, and despair!”
Nothing beside remains: round the decay
Of that colossal wreck, boundless and bare,
The lone and level sands stretch far away.

- Percy Bysshe Shelley, 1818

March 14, 2009 • Posted in: My Brain • No Comments

Hardcopy Books: fast, cheap and interesting

Michael, Lindsay and I have been toiling away on a new startup called Hardcopy Books that hopes to provide technology book lovers a cheap and fast way to buy books online in Australia.

No Dummies!We have been working on it for about three months now and plan to launch really soon. We don’t have lofty plans (being the “next Amazon”, etc) or a lot of resources so our initial catalogue will be quite small - so we have launched the Hardcopy Books 2009 launch survey to get a better grasp on the topics you are interested in.

So why are we doing this?
Local booksellers range usually stop at titles like “Excel 97 for Dummies” and with the price of the Australian dollar, buying from overseas booksellers can get expensive quick (not to mention waiting a few weeks for your books to be delivered).

We want to build a bookstore we would buy from - the range should interesting, relevant, cheap and quick to ship - and we hope you will buy from us too.

If you want to know more or influence our range please fill out the survey and follow us on Twitter for real time updates.

Taking Javadoc offline with Google Gears and Greasemonkey

When I’m traveling with my laptop there are always advantages to taking a bit of Javadoc with me for whatever I’m hacking on. Almost as soon as I don’t have an internet connection I realise I haven’t downloaded a projects docs.

I spent some time hacking around with Google Gears and GreaseMonkey today and I produced a script called Javadoc Offline. Visit any Javadoc frames page and the script will cache all the Javadocs to your system.

Download the Gears and GreaseMonkey plugins for Firefox and click this link to install the user script.

Once your all setup browse over to the Servlet 2.3 API docs. You should get a dialog like the following:

Once you have clicked Allow the script should download the entire Javadoc site to your hard disk.

When its done disconnect from the internet and enjoy your docs offline.

February 15, 2009 • Posted in: My Brain • 6 Comments

Consuming XML-RPC services with POJOs

For an internal project I needed my application to connect to an XML-RPC service, so I started playing around with the Apache WS XML-RPC client.

Since the application consumed many remote XML-RPC services, the client was used rather extensively, and I ended up with a bunch of wrapper classes that would manipulate the HashMaps and value types into POJO’s. It got real ugly real fast. Vector for representing lists? Lack of type safety? Well, like many I had moved on to Java 5 and I’d come to expect a bit more out of libraries. And the library should do as much as possible for me.

Consuming services with the XML-RPC Binder

So take the following example XML-RPC add service which takes two Integers returns their sum.

In the binder, the service is represented by a simple interface:

package com.atlassian.xmlrpc.examples;
import com.atlassian.xmlrpc.ServiceMethod;
import com.atlassian.xmlrpc.ServiceObject;

@ServiceObject("math")
public interface MathService
{
    @ServiceMethod("Add")
    public int add(int x, int y);
}

The ServiceObject annotation lets the Binder know what object on the XML-RPC service that the interface represents, while the ServiceMethod annotation specifies the remote calling method.

The ServiceMethod annotation also allows you to call your interface method whatever you want - the binder will simply translate the name before it hits the wire.

So how do you connect to the service? This part is easy:

package com.atlassian.xmlrpc.examples; import com.atlassian.xmlrpc.Binder; import com.atlassian.xmlrpc.DefaultBinder; import java.net.URL; public class App { public static void main( String[] args ) throws Exception { URL url = new URL("http://www.cookcomputing.com/xmlrpcsamples/math.rem"); Binder binder = new DefaultBinder(); MathService mathService = binder.bind(MathService.class, url); int result = mathService.add(2, 5); System.out.println("The result is "+ result); // Should be 7 } }

The DefaultBinder sets up a dynamic proxy that wraps the Apache XML-RPC client and coerces the result into the correct Java type.

Mapping XML-RPC objects back to a bean

One feature that makes the binder really useful is its ability to map a complex type back to a bean.

For example, you might have a XML-RPC method called “GetInvoiceSummary” that returns a complex type that contains two fields called “InvoiceTotal”, an integer and “InvoiceDescription”.

First define a simple bean called InvoiceSummary which contains our two fields:

package com.atlassian.xmlrpc.examples;
import com.atlassian.xmlrpc.ServiceBean;
import com.atlassian.xmlrpc.ServiceBeanField;

@ServiceBean
public class InvoiceSummary
{
    private float total;

    private String description;

    public String getDescription()
    {
        return description;
    }

    @ServiceBeanField("InvoiceDescription")
    public void setDescription(String description)
    {
        this.description = description;
    }

    public float getTotal()
    {
        return total;
    }

    @ServiceBeanField("InvoiceTotal")
    public void setTotal(float total)
    {
        this.total = total;
    }
}

The ServiceBeanField, like the ServiceMethod annotation, allows us to call our field names whatever we like in Java even though the remote names for these fields are completely different - so the service might have a ugly way of naming things but your application wont have to suffer the same fate.

Now lets quickly describe the service:

package com.atlassian.xmlrpc.examples;
import com.atlassian.xmlrpc.ServiceMethod;
import com.atlassian.xmlrpc.ServiceObject;

@ServiceObject("myErp")
public interface ErpSystem
{
    @ServiceMethod("GetInvoiceSummary")
    InvoiceSummary getInvoiceSummary(String invoiceNumber);
}

When we bind the ErpSystem interface to the remote service and call getInvoiceSummary the binder will map the returned complex type fields back to the return type.

Nice huh? :)

You can get the Apache 2 licensed XML-RPC Binder over at Atlassian Labs and from our public Maven repository. (Seems my Javadoc is a bit broken right now - Ill fix that up soon)

I’ll follow up soon on how to use the same library for testing and developing your own XML-RPC webservices.

EDIT: Forgot the ServiceMethod annotation on the last service interface example

How to tab to all controls in Mac OS X

Its Hammer time!

At our weekly hack night, I exclaimed rather loudly how I hated that in Mac OS X its impossible to tab to a checkbox in Firefox/Safari. Lindsay pointed out that this was false and showed me how to change my settings.

The secret is hidden away in in the Keyboard and Mouse pref pane:

February 13, 2009 • Posted in: My Brain • 7 Comments

Hello, Planet Apache!

I thought I would introduce myself - my name is James Dumay and I am the Build and Release dude at Atlassian.

I’m also a member of the Apache Archiva project and get to work with awesome hackers like Wendy, Brett and Deng.

Now that I have finally gotten my crap together and put myself on Planet Apache perhaps ill blog more regularly :)

February 10, 2009 • Posted in: My Brain • No Comments

iPhoto 09 face detection: Close, but no prize

lea

February 6, 2009 • Posted in: My Brain • 3 Comments