Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence Support Non-http/ftp Hyperlinks?

Phillip Ponzer [Cprime]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2012

Does Confluence support hyperlinks to pages that don't have a "http" or "ftp" in front of it?

For instance, svn or starteam links?

2 answers

1 accepted

0 votes
Answer accepted
Phillip Ponzer [Cprime]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 2, 2012

Alright, after a good day of work I've managed to come up with a three-part solution:

Since this is as a result of the UWC working its conversion magic (thank goodness we have UWC!), "illegal" characters were getting removed. The problem with this is that colons, semi-colons, and forward-slashes are all part of the standard Starteam link. This was overcame by "escaping" those illegal characters. Like so:

[settings.illegalcharmap.properties]
# : (colon)
illegalchar.colon.replacement=\:

# ; (semi-colon)
illegalchar.semicolon.replacement=\;

# / (forward slash)
illegalchar.forwardslash.replacement=\/

# @ (at)
illegalchar.at.replacement=\@

Why the ampersand (@)? We'll get to that later...

This got us as far as getting the UWC to convert the Starteam links into something that's copy/pastable into Starteam. Although it did chop off the prefixed "starteam://" from the link itself, it was still somewhat "followable."

Here's the next bit of UWC regular expression magic:

[converter.mediawiki.properties]
Mediawiki.0411.starteam.java-regex=\[starteam://(\S+)+\s*(.*)\]{replace-with}$2: [$1@starteam]

This regular expression will take all bracketed links prefixed with "starteam://" and throw it into a Starteam shortcut link.

A shortcut link, you say? Why yes, a shortcut link!

You can get to this as a Confluence Admin by going to Browse->Confluence Admin, and click on "Shortcut Links" under "Configuration." In effect, this is why we needed the ampersand to be escaped back in the [settings.illegalcharmap.properties] file.

So, what does this do? Well, the help text just above the shortcut link table explains it pretty well. But pretty much what it does is it takes your Starteam link, prefixes it with "starteam://" and wraps the link tag around the text "Starteam Link".

So, typing in [starteam://my.starteam.link/a:12345;b:67890 Software Plans Summary] in a WikiMedia page will give you the hyperlinked text "Software Plans Summary".

When shoved through the UWC (with the options from above), you get the following:

Software Plans Summary: [my.starteam.link/a:12345;b:67890@starteam]

Which simply ends up looking like this on a Confluence page:

Software Plans Summary: Starteam Link 
Phillip Ponzer [Cprime]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2012

I've raised a ticket for this issue here:

https://jira.atlassian.com/browse/CONF-24700

1 vote
Andrew Frayling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2012

Hi Phillip,

It might be worth raising a ticket at support@atlassian.com to ask which links Confluence strips out. I've done a quick test using the $wgUrlProtocols for MediaWiki as documented at http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols and Confluence 4.1.2 (the version I tested on) strips out:

  • gopher
  • telnet
  • worldwind
  • mms

but did leave svn, ftp, irc, nntp, etc. alone. I also tried a link using starteam:// and this got stripped out as well.

As mentioned above it might be worth contacting support@atlassian.com for a definitive list as I can't find anything in the documentation about which links Confluence strips out and which it leaves alone.

Hope that helps,

Andrew.

Phillip Ponzer [Cprime]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 2, 2012

This is another one of those questions where I probably should have indicated that I'm using the UWC to convert our MediaWiki into Confluence. starteam links have a few of those illegal characters in them and so right now I'm exploring encoding the URL so that no actual damage is done to the link. I'll post back if I figure anything out.

Phillip Ponzer [Cprime]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 2, 2012

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events