Skip to content

Instantly share code, notes, and snippets.

@avasyukov
Last active December 22, 2015 02:08
Show Gist options
  • Save avasyukov/6400986 to your computer and use it in GitHub Desktop.
Save avasyukov/6400986 to your computer and use it in GitHub Desktop.
// model.data will contain the data to be used for our report
model.data = [];
// Get managees of current user
var managees = orgchart.getPerson( person.properties.userName ).managees;
// Loop through all managees
for each(var user in managees)
{
// Find how many nodes in repository each managee has created
var nodes = search.luceneSearch("-TYPE:\"cm:folder\" AND @modifier:" + user.getUserName() + "");
// Add one more item into report - 'x' is the object reported, 'y' is the value for this object
model.data.push( { "x": user.getUserName(), "y": nodes.length } );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment