Hi out there,
is there an easy way to find all pages without a label? I know there is a macro for content by label and it is possible to exclude labels but right now we have nearly 160 labels and I do not want to add them all to the macro.
Thanks,
Bruce
This is possible by writing a usermacro that iterates over all spaces and its pages searching for pages without a label. But such a usermacro will slow down your system dependent on how big your confluence instance is. Such a macro should only be shortly used by an administrator.
Here is the usermacro code.
## @noparams ## DO NOT USE THIS MACRO ON A LOT OF PAGES BECAUSE OF PERFORMANCE ISSUES. IT DEFINITELY WILL SLOW DOWN YOU SYSTEM!!!!! #set($containerManagerClass=$action.class.forName('com.atlassian.spring.container.ContainerManager')) #set($getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null)) #set($containerManager=$getInstanceMethod.invoke(null,null)) #set($containerContext=$containerManager.containerContext) ## the pageManager gives you access to the pages #set($pageManager =$containerContext.getComponent('pageManager')) ## the spaceManager gives you access to the spaces #set($spaceManager =$containerContext.getComponent('spaceManager')) ##over all spaces (WARNING THIS COULD TAKE SOME TIME ON BIG CF INSTANCES ) #foreach( $space in $spaceManager.getAllSpaces() ) <b>Unlabeled pages in space $space.name<b> <ul> ##over each page in the current space ( WARNING THIS COULD TAKE SOME TIME ON BIG CF INSTANCES) #foreach( $page in $pageManager.getPages( $space, true) ) #if( $page.labels.size() == 0 ) <li><a href="$req.contextPath$page.urlPath">$page.title</a></li> #end #end </ul> #end
Testet with my Confluence 4.0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.