Confluence Trick: Tiny Links for Robustness

By Andrew Petro
September 20, 2007

In which I discuss the unexpected virtues of Tiny Links in Confluence. What they lack in size they make up in sheer resilience.

This is the first of a new series of blog posts on tips and tricks to effectively use Atlassian's popular and well-regarded Confluence enterprise wiki software, which JA-SIG and the Sakai project both use extensively.

In this blog post, I show how to access the Tiny Links for pages in Confluence and the advantages in using them rather than naive full-length page URLs when linking into Confluence from outside the wiki.

Human-readable URLs in Confluence

One of the features of Confluence is its eminently reasonable and human-readable approach to page URLs.

For instance, here's the link to the Winter 2007 JA-SIG Unconference wiki page:

http://www.ja-sig.org/wiki/display/JCON/Winter+2007

Pretty readable. "Oh wiki at ja-sig.org, please show me the Winter 2007 page in the Ja-sig CONferences wiki space."

It's a handsome little hyperlink, aesthetically speaking one I can be proud to include in my email correspondence.

Some pages have longer names.

For instance, here's a link to a page about a database-recording statistics listener implementation for uPortal 2.6:

http://www.ja-sig.org/wiki/display/JSG/DatabaseStatsEventHandler+-+Stati...

That URL is so long Drupal, the content management system Unicon uses to host these blogs, abbreviates the text label you see, though the underlying link remains intact.

Sometimes email clients will feel the need to wrap this sort of URL across lines, maybe even breaking it at that dash.

http://www.ja-sig.org/wiki/display/JSG/DatabaseStatsEventHandler+
-+Statistics+Recording+for+uP2.6

Most email clients will then only auto-detect the first bit as a URL and leave the second bit hanging as unlinked text, much like Drupal has done above.

Confluence implements a neat feature in trying to guess at completions of URLs. If you click the hyperlinked first line of the line-broken URL above (go ahead, try it), you'll see something like this:

Confluence has guessed at what was meant by the partial URL. Very cool.

Accessing Tiny Links in Confluence

I find a page's Tiny Link by examining the page's Info tab:

Use Tiny Links to avoid unwanted link linebreaking in email

I can avoid that long URL and instead replace it with a Tiny Link implemented by Confluence. The Tiny Link for this long-titled page is

http://www.ja-sig.org/wiki/x/igRz

which even the most persnickety email clients are unlikely to wrap, unlike the full version of the URL.

Tiny Links for robustness against page name changes

The full length URL and the Tiny Link

Suppose I create a page in my home space in JA-SIG's Confluence called

http://www.ja-sig.org/wiki/display/~awp9/Peripatetic+Example+Page .

Oooh! A page that moves to and fro. This is exciting. Suppose I now email all my friends about my new peripatetic page. What URL should I use in the email I send them? I could use either of these:

Again, I get at that Tiny Link via the Info tab of the page:

Renaming the page

Part of the advantage of a wiki is that pages are easy to edit. One of the easy to edit aspects of pages is their name.

Now that I've sent out email to all my friends about my new page, I get to thinking more about it.

"Peripatetic" is one of my favorite words, but really, this page isn't "moving to and fro" in a peripatetic manner. It's staying right put. So I'm going to need to change its name. Since I'm changing the page's name, I'll name it to reflect that it's a page with a changing name. Page, I name you "Name Changing Example Page".

I feel much better now that this object has a name that accurately reflects its nature. Object oriented developers get hung up on these things, I guess.

My page's new more precisely descriptive URL is:

http://www.ja-sig.org/wiki/display/~awp9/Name+Changing+Example+Page

Do the previously sent links still work?

Uh-oh. How about those links I sent out to all my friends?

Well, the full URL leads to a similar broken link disambiguation UI experience to that discussed above:

But the Tiny Link:

http://www.ja-sig.org/wiki/x/nARz

takes me directly to the Name Changing Example Page:

That's because that Tiny Link references the page itself, not its name. Tiny Links are not confused by page name changes.

Does it help to use an external tinyurl?

Instead of using Confluence's Tiny Link, I could instead use tinyurl.com:

http://tinyurl.com/yvlw72

Using tinyurl.com produces links that expand out on a redirect. So if I tinyurlified the full length URL, I avoid the linebreaking in email issue, but I still have a link that won't go directly to the page if the page name changes.

Take home lesson

Using the Tiny Link feature in Confluence to generate URLs for inclusion in email messages and other links into Confluence from outside has two primary advantages. One is to discourage programs from line-breaking in the middle of the link when presenting the link. The second is to make the link robust across page renames, such that even if the name of a page is tweaked in the future, the link will still direct users to the page it originally linked.

Your Blogmaster:

apetro's picture

Andrew Petro

After graduating with a B.S. in Computer Science from Yale University in 2004, Andrew stayed on to serve his alma mater as a casual systems programmer with the Technology & Planning group. His interests include automated software testing, application frameworks, and electronic security. Projects in which Andrew has been involved include the Central Authentication Service, YaleInfo Portal (Yale's uPortal implementation). and the Jasig uPortal project. Andrew currently serves on the Jasig CAS steering committee, has been the release engineer for uPortal, and has been published in the Communications of the Association for Computing Machinery on the topic of electronic voting. In spring 2006 Andrew joined Unicon full time, serving roles since then including technical lead and Cooperative Support developer.