Backup Manager
This script lists all the user groups in Confluence...
Requirements
None at present.
Script: groupLister
This script iterates through all groups and outputs them in an unordered list.
Name: [groupLister|^export-groupLister.xml]
Author(s): Dan Hardiker
Scriptix Version: 1.0 or above
Scripting Engine: Mozilla Rhino
Components: groupManager
Vectors: Wiki Macro
View source...
var output = '';
// Iterate through each group
var groupIter = scriptix.groupManager.getGroups().iterator();
while (groupIter.hasNext()) {
output += '* '+groupIter.next().name+'\n';
}
// Render the output
output = scriptix.subRenderer.render(output, macro.renderContext);
To display the list of groups, just add this to a page in your wiki:
{scriptix:id=groupLister}{scriptix}
Known issues
None at present.
To-Do
Maybe extend the list so it also lists out the users in each group?
Just as a reference: here's the same thing in PHP, it does work. Scriptix FTW!
{scriptix} <?php $output = ""; // Iterate through each group $groupIter = $scriptix->groupManager->getGroups()->iterator(); while ($groupIter->hasNext()) { $output .= " * " . $groupIter->next()->name . "\n"; } // Render the output $scriptix->subRenderer->render($output, $macro->renderContext); ?> {scriptix}