* @see org.olat.group.BusinessGroupManager#exportGroups(org.olat.group.context.BGContext,
* java.io.File)
*/
public void exportGroups(BGContext context, File fExportFile) {
if (context == null) return; // nothing to do... says Florian.
Dom4jConfiguration root = new Dom4jConfiguration(EXPORT_KEY_ROOT);
// export areas
MutableConfiguration confAreas = root.addChild(EXPORT_KEY_AREA_COLLECTION);
BGAreaManager am = BGAreaManagerImpl.getInstance();
List areas = am.findBGAreasOfBGContext(context);
for (Iterator iter = areas.iterator(); iter.hasNext();) {
BGArea area = (BGArea) iter.next();
MutableConfiguration newArea = confAreas.addChild(EXPORT_KEY_AREA);
newArea.addAttribute(EXPORT_ATTR_NAME, area.getName());
newArea.addChild(EXPORT_KEY_DESCRIPTION, area.getDescription());
}
// TODO fg: export group rights
// export groups
MutableConfiguration confGroups = root.addChild(EXPORT_KEY_GROUP_COLLECTION);
BGContextManager cm = BGContextManagerImpl.getInstance();
List groups = cm.getGroupsOfBGContext(context);
for (Iterator iter = groups.iterator(); iter.hasNext();) {
BusinessGroup group = (BusinessGroup) iter.next();
exportGroup(fExportFile, confGroups, group);