exportGroup(fExportFile, confGroups, group);
saveGroupConfiguration(fExportFile, root);
}
private void exportGroup(File fExportFile, MutableConfiguration confGroups, BusinessGroup group) {
MutableConfiguration newGroup = confGroups.addChild(EXPORT_KEY_GROUP);
newGroup.addAttribute(EXPORT_ATTR_NAME, group.getName());
if (group.getMinParticipants() != null) newGroup.addAttribute(EXPORT_ATTR_MIN_PARTICIPATS, group.getMinParticipants());
if (group.getMaxParticipants() != null) newGroup.addAttribute(EXPORT_ATTR_MAX_PARTICIPATS, group.getMaxParticipants());
if (group.getWaitingListEnabled() != null) newGroup.addAttribute(EXPORT_ATTR_WAITING_LIST, group.getWaitingListEnabled());
if (group.getAutoCloseRanksEnabled() != null) newGroup.addAttribute(EXPORT_ATTR_AUTO_CLOSE_RANKS, group.getAutoCloseRanksEnabled());
newGroup.addChild(EXPORT_KEY_DESCRIPTION, group.getDescription());
// collab tools
MutableConfiguration toolsConfig = newGroup.addChild(EXPORT_KEY_COLLABTOOLS);
CollaborationTools ct = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(group);
for (int i = 0; i < CollaborationTools.TOOLS.length; i++) {
toolsConfig.addAttribute(CollaborationTools.TOOLS[i], ct.isToolEnabled(CollaborationTools.TOOLS[i]) ? "true" : "false");
}
Long calendarAccess = ct.lookupCalendarAccess();
if (calendarAccess != null) {
newGroup.addAttribute(EXPORT_KEY_CALENDAR_ACCESS,calendarAccess);
}
String info = ct.lookupNews();
if(info!=null && !info.trim().equals("")) {
newGroup.addAttribute(EXPORT_KEY_NEWS,info.trim());
}
Tracing.logDebug("fExportFile.getParent()=" + fExportFile.getParent(), this.getClass());
ct.archive(fExportFile.getParent());
// export membership
List bgAreas = BGAreaManagerImpl.getInstance().findBGAreasOfBusinessGroup(group);
for (Iterator iterator = bgAreas.iterator(); iterator.hasNext();) {
BGArea areaRelation = (BGArea) iterator.next();
MutableConfiguration newGroupAreaRel = newGroup.addChild(EXPORT_KEY_AREA_RELATION);
newGroupAreaRel.setValue(areaRelation.getName());
}
//export properties
BusinessGroupPropertyManager bgPropertyManager = new BusinessGroupPropertyManager(group);
boolean showOwners = bgPropertyManager.showOwners();
boolean showParticipants = bgPropertyManager.showPartips();