* recursively delete the structure starting from the catalog entry.
*
* @param ce
*/
private void deleteCatalogSubtree(CatalogEntry ce, List secGroupsToBeDeleted) {
DB db = DBFactory.getInstance();
List children = getChildrenOf(ce);
Iterator iter = children.iterator();
while (iter.hasNext()) {
CatalogEntry nextCe = (CatalogEntry) iter.next();
deleteCatalogSubtree(nextCe,secGroupsToBeDeleted);
}
ce = (CatalogEntry) db.loadObject(ce);
//mark owner group for deletion.
SecurityGroup owner = ce.getOwnerGroup();
if (owner != null) secGroupsToBeDeleted.add(owner);
// delete user bookmarks
OLATResourceable ores = createOLATResouceableFor(ce);
BookmarkManager.getInstance().deleteAllBookmarksFor(ores);
// delete catalog entry itself
db.deleteObject(ce);
}