Is there a way to show all labels from blog posts only?

Jorge
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.
May 13, 2014

I'm interesting in showing a tag cloud that shows all the labels from all the blogposts in my Confluence installation. I've tried the existing macros, but can't seem to get what i need.


Thanks for your help!

2 answers

1 accepted

1 vote
Answer accepted
discountrobot
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.
May 13, 2014

Not aware of a excisting macro that can do this.

I've made a pseudo code snippet you can use in a macro or API that fetches all labels of all blogposts across your instance

There should be doublicates so you can count those to get the "weight" of the labels, you will have to write the vm file and styling.

// will contain all our blog labels (there might be dublicates 
List<Label> allLabels = new ArrayList();
// get all the spaces
List<Space> allSpaces = this.spaceManager.getAllSpaces();

for (Space space : allSpaces) {
    // get all the blog posts of a space
    List<BlogPost> blogPosts = this.pm.getBlogPosts(space, true);

    for (BlogPost blogPost : posts) {
        // fetch the labels of a blogpost and add them to our stack.
        List<Label> labels = blogPost.getLabels();
        allLabels.addAll(labels);
    }                        

}

Jorge
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.
May 13, 2014

I guess i didn't know what to expect for an answer, but this will be hard for me since I don't even know what a vm file is :)

Thanks for your answer anyway.

discountrobot
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.
May 13, 2014

Hey Jorge, duty calls. i'll whip up a macro that does this for you when i get a few open moments.

Hopefully somebody will find an already exisiting macro for you in the mean time.

1 vote
Steve Gerstner [bridgingIT]
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.
May 13, 2014

Try this plugin.

The only problem will be, that there will be duplicates, but nothing you can't handle with some javascript ;)

discountrobot
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.
May 13, 2014

Thats a link to Web Resources :P

Steve Gerstner [bridgingIT]
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.
May 13, 2014

changed the link

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events