try {
ArrayList<Community> topLevelCommunities = communityManager
.getTopLevelCommunities(projectHandle);
if (topLevelCommunities != null) {
for (Community topLevelCommunity : topLevelCommunities) {
rootNodes.add(new VBOTreeNode(topLevelCommunity,
getSubcommunitiesForCommunity(topLevelCommunity),
getCollectionsForCommunity(topLevelCommunity),
getBundlesForCommunity(topLevelCommunity),
getItemsForCommunity(topLevelCommunity)));
Collections.sort(rootNodes);
}
}
ArrayList<Collection> topLevelCollections = collectionManager
.getTopLevelCollections(projectHandle);
if (topLevelCollections != null) {
for (Collection topLevelCollection : topLevelCollections) {
rootNodes.add(new VBOTreeNode(topLevelCollection, null,
getSubcollectionsForCollection(topLevelCollection),
getBundlesForCollection(topLevelCollection),
getItemsForCollection(topLevelCollection)));
Collections.sort(rootNodes);
}