This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

Tagcloud Macro

Name Tag Cloud Plugin
Version 1.0.2
Status Release
Confluence Versions 2.2.5 (if you have tested with a different version, please drop me a mail)
Does not work properly with 2.4 onwards!
Author Chris Cohen (chrisc (NOSPAM) at oncampusuk dot co dot uk)
Homepage http://www.oncampusuk.co.uk
Price free!
License BSD
JavaDocs No
  Name Size Creator (Last Modifier) Creation Date Last Mod Date Comment  
Java Source tagcloud-1.0.1.jar 5 kB Chris Cohen Feb 18, 2007 Feb 18, 2007  
JPEG File tagcloud-sort.jpg 72 kB Chris Cohen Feb 18, 2007 Feb 18, 2007  
JPEG File tagcloud-nosort.jpg 77 kB Chris Cohen Feb 18, 2007 Feb 18, 2007  
Java Source tagcloud-1.0.1-jvm1.4.jar 5 kB Chris Cohen Jun 19, 2007 Jun 19, 2007 Version for JVM 1.4.2
Java Source tagcloud-1.0.2.jar 6 kB Ingo Goldbeck Apr 04, 2007 Apr 04, 2007  
Java Source tagcloud-1.0.1-jvm1.4-confluence.jar 5 kB Ricardo Sueiras Jun 26, 2007 Jun 26, 2007  

Description/Features

Displays a visual representation of the tags (labels) within a space, size representing frequency, and allows the user to click on each to access related pages.

Screenshots


An example of the cloud in action.

The same cloud, but with alphabetical sorting turned on.

Installation

  • Download the most recent .jar file. Unless specified, they are compiled for the JVM 5.0 (1.5 - confusing naming scheme!), but there is a special versions for JVM 1.4.2 (see above).
  • Go to the plugins section of the administration console and upload the .jar file there.

Parameters

  • space - controls which space to get the most popular tags from. If this space does not exist, you will receive an error. If this parameter is left blank, the default is the current space.
  • results - the number of results to get, between 1 and 100. The default is 70.
  • width - the width of the table that gets generated by the macro. May be an absolute figure or a percentage. Default is automatic width.
  • type - may be popular or recent. The default is popular.
  • caps - if true, each tag's first letter is capitalized.
  • sizing - if false, disables the sizing of tags according to their frequency. The default value is true. Please note that this only affects popular mode. In recent mode, sizing does not work.
  • scaling - allows the size difference between largest and smallest tags to be changed. Default value is 1.1. Values less than this will cause the tags to have less size difference, and vice versa. Maximum value is 2.
  • sort - you can disable the alphabetical sorting of the tags by setting this to false. This will leave the tags in whichever order they were retrieved (might have unexpected order). Otherwise, it defaults to true.
  • title - set this to false if you want to hide the title at the top of the tagcloud. It defaults to true.
  • appName (since version 1.0.2) - set the name of your wiki-application (e.g. "wiki" or "confluence") to get the correct links behind the tags rendered.

Examples

{tagcloud}
{tagcloud:space=foo|results=60}
{tagcloud|results=50|caps=true|scaling=0.8|sort=false|title=false}

Appearance and styling

If you are familiar with CSS2 (cascading style sheets) you can style the cloud and its box the way you want it, by adding a definition for the .tagcloud class above the tagcloud itself on the page. Example:

{style}
.tagcloud {
  border:1px solid #00498f;
  background-color:#e0e0ff;
}
.tagcloud a, .tagcloud a:link, .tagcloud a:visited {
  text-decoration:none;
}
.tagcloud a:hover {
  color:#990000;
}
{style}

Version History

Ver. Date Notes
1.0.1 26-Jun-07 Recompiled this version for JVM 1.4.2. but with context root set to /confluence
1.0.1 19-Jun-07 Recompiled this version for JVM 1.4.2.
1.0.2 04-Apr-07 Added 'appName' parameter to render proper links.
1.0.1 24-Jan-07 Fixed a bug caused by having no labels in the specified space. Added the 'title' parameter.
1.0 24-Jan-07 First release version, with alphabetical sorting.
0.4.1 03-Jan-06 Tag scaling and spacing improved.
0.4 19-Dec-06 Tag sizing is now functional, with the new scaling parameter.
0.3.2 19-Dec-06 Introduced sizing parameter.
0.3.1 19-Dec-06 Fixed bug in caps parameter.
0.3 19-Dec-06 Introduced caps parameter.
0.2.1 19-Dec-06 Fixed output bug.
0.2 19-Dec-06 Added further parameters and output.
0.1.5 18-Dec-06 Fixed NumberFormatException in results parameter.
0.1.4 18-Dec-06 Table width fix.
0.1.3 18-Dec-06 Internal code optimization, added class to containing table.
0.1.2 18-Dec-06 Added space and results parameters.
0.1.1 18-Dec-06 Simply lists the 100 most common tags.
0.1 18-Dec-06 Basic version with a cast error. Broken.

Useful Links

Labels

tag tag Delete
cloud cloud Delete
tagcloud tagcloud Delete
macro macro Delete
heat heat Delete
map map Delete
heatmap heatmap Delete
popular popular Delete
recent recent Delete
tags tags Delete
labels labels Delete
non-repository non-repository Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 20, 2007

    Collin Summers says:

    Nice plugin and it works for under v2.3.3

    Nice plugin and it works for under v2.3.3

  2. Feb 27, 2007

    Charles Hill says:

    Doesn't currently support "user" spaces though (personal spaces - e.g. ~hil...

    Doesn't currently support "user" spaces though (personal spaces - e.g. ~hill.ck):

  3. Mar 05, 2007

    Pavel Drantsev says:

    Tag links are not working if Confluence is set up in a non-root web server direc...

    Tag links are not working if Confluence is set up in a non-root web server directory. For example, my Confluence is set up in "https://some.server.url/wiki" directory, but all the tag links look like "/label/<space name>/<label name>" which leads to URLs like "https://some.server.url/label/...", and obviously it leads to Error 404.

    1. Mar 10, 2007

      Chris Cohen says:

      Thank you for pointing out these bugs! Unfortunately I have provided this plugin...

      Thank you for pointing out these bugs! Unfortunately I have provided this plugin "as-is" and my company assigned me limited time to get it to the state it's in now, so I have even more limited time to take it further. If anybody would like to implement the changes necessary to fix those bugs, you're more than welcome to have the source if you get in touch - in fact I'd really appreciate the help.

    2. Mar 10, 2007

      Guy Fraser says:

      You could use this macro: {popular-labels:style=heatmap|count=15} I thin...

      You could use this macro:

      {popular-labels:style=heatmap|count=15}
      

      I think it quietly appeared in Conf 2.3.3...

    3. Apr 04, 2007

      Ingo Goldbeck says:

      Your path will work now with the "appName" parameter

      Your path will work now with the "appName" parameter

      1. Jun 20, 2007

        Mark Page says:

        How do you use the appName parameter? I have an installation https://www.xxxx.c...

        How do you use the appName parameter?

        I have an installation https://www.xxxx.com and without the appName set to a value the tagcloud links goto http://label/blah and if I set the appName, say to www.xxxx.com then they goto https://www.xxxx.com/www.xxxx.com/label/blah

        Browsing to https://www.xxxx.com/label/blah works fine! 

        Am I doing something dumb? Appreciate any help.

        1. Jun 25, 2007

          Egon Kuster says:

          I also have the same problem with this plugin as I run Confluence as the ROOT co...

          I also have the same problem with this plugin as I run Confluence as the ROOT context and therefore there is no J2EE application name. Any ideas?

  4. Apr 18, 2007

    Private Name says:

    Some problem with my JVM (1.4.2) bucket.core.InfrastructureException: java.l...

    Some problem with my JVM (1.4.2)

    bucket.core.InfrastructureException: java.lang.UnsupportedClassVersionError: uk/co/oncampusuk/confluence/macros/Tagcloud (Unsupported major.minor version 49.0)
     at com.atlassian.confluence.util.XWorkTransactionInterceptor.intercept(XWorkTransactionInterceptor.java(Compiled Code))
  5. Apr 20, 2007

    Chris Cohen says:

    This usually happens when you attempt to install a plugin on an older version of...

    This usually happens when you attempt to install a plugin on an older version of Java. It could be that Ingo's latest version has been compiled with 1.5 - you could try installing a newer JVM.

    1. Jun 19, 2007

      Eric Bardoux says:

      same issue. Would it be possible to have it compiled with an 1.4.2jvm? I can't...

      same issue.

      Would it be possible to have it compiled with an 1.4.2jvm?

      I can't modify like that the jvm on a server where several applications are running

  6. Jun 19, 2007

    Chris Cohen says:

    Hello Eric. I have recompiled the code under 1.4.2 and uploaded the result to th...

    Hello Eric. I have recompiled the code under 1.4.2 and uploaded the result to this page, so you are welcome to try it, but I have not been able to test it out on a 1.4.2 virtual machine. Also, the code is version 1.0.1 instead of 1.0.2 (1.0.1 has no support for a Confluence custom application name) because unfortunately I don't have the source for 1.0.2. I hope this will work out ok for you!

    1. Jun 19, 2007

      Eric Bardoux says:

      It works PERFECTLY. Thank you very much. Eric

      It works PERFECTLY.

      Thank you very much.

      Eric

  7. Jun 26, 2007

    Ricardo Sueiras says:

    Added a 1.4.2 compiled version of 1.0.1 with the context root set to /confluence...

    Added a 1.4.2 compiled version of 1.0.1 with the context root set to /confluence so that they label links work.

    1. Jun 27, 2007

      Egon Kuster says:

      But was also need a version where there is no context as it runs as the ROOT con...

      But was also need a version where there is no context as it runs as the ROOT context. I have Java 1.5. What features are you using which are specific to the Java Versions and therefore sensitive?

  8. Aug 17, 2007

    Mathew Lam says:

    Hi Chris! Will this be upgraded to support confluence 2.5.x and above? ...

    Hi Chris!

    Will this be upgraded to support confluence 2.5.x and above?  We would very much like to use this plugin.

    Thanks,
    Mahtew 

    1. Aug 18, 2007

      Chris Cohen says:

      Sorry to say that I won't be upgrading this plugin at all. The source code is av...

      Sorry to say that I won't be upgrading this plugin at all. The source code is available if you email me though, so you can upgrade yourself, or find someone who can do that for you!

      1. Mar 08, 2008

        Arne Schirmacher says:

        I have asked Chris for the source code to get this working for more recent Confl...

        I have asked Chris for the source code to get this working for more recent Confluence versions.

        In the mean time, you may want to check out http://www.schirmacher.de/pages/viewpage.action?pageId=3801089, which is actually a hack to the original popular-labels macro.

  9. Dec 04, 2007

    Private Name says:

    The context root setted to /confluence is pretty annoying (sorry to say that) Ca...

    The context root setted to /confluence is pretty annoying (sorry to say that)
    Can you change your code ?

    Replace :

     private String buildTagCloud(LabelSearchResult lsr)
        {
            String s = lsr.getLabel().getName();
            int c = lsr.getCount();
            int dSize = sizing ? calcSize(c) : 100;
            String v = getCaps(s);
            return "<span>&nbsp;<a style='font-size:" + dSize + "%;'" + " href='/confluence/label/" + space + "/" + s + "' title='" + c + " items labelled with " + s + "'>" + v + "</a></span> ";
        }
    

    with

     private String buildTagCloud(LabelSearchResult lsr, String baseURL) {String s = lsr.getLabel().getName();
    int c = lsr.getCount();int dSize = sizing ? calcSize(c) : 100;String v = getCaps(s);
    
    return "<span>&nbsp;<a style='font-size:" + dSize + "%;'"
    +
    " href='"+baseURL+"/label/" + space + "/" + s + "' title='"
    + c + " items labelled with " + s + "'>" + v + "</a></span> ";}
    

    and

     private String buildTagCloud(Label l)
        {
            String s = l.getName();
            String v = getCaps(s);
            return "<a href='/confluence/label/" + space + "/" + s + "'>" + v + "</a> ";
        }
    

    with

    {color:#7f0055}{*}private{*}{color} String buildTagCloud(Label l, String baseURL) {
    String s = l.getName();
    
    String v = getCaps(s);{color:#7f0055}{*}return{*}{color} {color:#2a00ff}"<a href='"{color}\+baseURL\+{color:#2a00ff}"/label/"{color} + {color:#0000c0}space{color} + {color:#2a00ff}"/"{color} + s + {color:#2a00ff}"'>"{color} + v
    + {color:#2a00ff}"</a> "{color};
    } 
    

    and the way those method are called

     for (ListIterator li = temp.listIterator(); li.hasNext();){String baseURL = rc.getSiteRoot();
    if (type.equals("most recent"))output = output + buildTagCloud((Label) li.next(),baseURL);
    else output = output
    + buildTagCloud((LabelSearchResult) li.next(),baseURL);
    }
    

    Thanks !!!!





  10. May 21, 2008

    Christoph Rauhut says:

    Has anybody ever thought about tagcloud or label consolidation? It seems to be n...

    Has anybody ever thought about tagcloud or label consolidation? It seems to be necessary to consolidate the labels of a tagcloud.

  11. May 22, 2008

    Brian Sloane says:

    Is it possible to make this work for all spaces?  I would like to put this ...

    Is it possible to make this work for all spaces?  I would like to put this on the dashboard and it appears that it requires specifying a space.

  12. yesterday at 09:58:13

    MartinMitry says:

    is it possible to get the source of the macro...want o customize it for our need...

    is it possible to get the source of the macro...want o customize it for our needs
    thank you