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

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...

0 vote
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.

 

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

370 views 20 10
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