How to make SOLID list of spaces instead some lists of spaces ?

hi) help to solve the problem...How to make SOLID list of spaces instead some lists of spaces ?

4 answers

This widget could not be displayed.

The space directory is a plugin called Confluence Space Directory with a key called com.atlassian.confluence.plugins.confluence-space-directory. The only thing, can do is overwrting this plugin, this will probably be a must do for each update you are doing...

This widget could not be displayed.
David Simpson Community Champion Feb 09, 2014

Take a look at the network on your browser developer tools...

The directory listing is populated by REST/AJAX using the following REST API:

/rest/spacedirectory/1/search?query=&type=global&status=current&pageSize=24&startIndex=72&_=1392028346532

Looking at the Javascript in the plugin, you could break open the jar file and increase the size of the pageSize variable.

Check line 99 here: https://gist.github.com/dvdsmpsn/f7000489c5fac689648d#file-space-directory-js-L99

//pageSize: +AJS.params.pageSize,
        pageSize: 10000000000000, // a big number

Edit: I've tried repackaging the plugin, with the pageSize replaced. It doesn't seem to work.

Write a Servlet Filter

Another approach would be to write a servlet filter that acts on the URL /rest/spacedirectory/1/search/* and replaces the pageSize parameter with a larger number before redirecting. This would have the advantage of not being quite such a hack and could handle upgrades to the base installation much more effectively.

 
This widget could not be displayed.

To point up Davids idea, you can write a Javascript like

if (AJS.$('#space-directory-wrapper')) { AJS.params.pageSize = 1000000000000000;}

and set its context to dashboard, that would do it

David Simpson Community Champion Feb 10, 2014

That's not going to work. Yoiu somehow need to change AJS.params.pageSize or the value of the content attribute in <meta name="ajs-page-size" ...> before the rest of the JavaScript loads.

Thinking a little bit more about it, you will need to modify the page before the init event is fired...

Changing the meta-tag will be more appropriate then doing the JS, but take care, in earlier versions of confluence this is not a meta tag but a hidden input field. But after all the solution in Javascript to fix this will not be "nice" and I'm not sure, if it will work properly. This might be some work, so I would consider the first option of modifiing the plugin.

This widget could not be displayed.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

463 views 6 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you