public class UserManagementServiceImpl extends AbstractWOJService implements UserManagementService {
private static Logger LOGGER = LoggingManager.getLogger(UserManagementServiceImpl.class.getName());
public void removeGroup(final Group[] grps) {
final GroupDao dao= WOJServer.getInstance().getDataService().getGroupDao();
final RightsDao rdao= WOJServer.getInstance().getDataService().getRightsDao();
TransactionTemplate tt = dao.getTransactionTemplate();
tt.execute(new TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(TransactionStatus status) {
for (int i = 0; i < grps.length; i++) {
Group group = dao.getGroup(""+grps[i].getId());
Long grpId = new Long(grps[i].getId());
if (group != null) {
dao.delete(group);
rdao.deleteForAccessor(grpId);
WOJServer.getInstance().getContentService().removeArea(grpId);
}
}
LOGGER.info(grps.length + "groups successfully removed.");
}