@Override
public void addSubcommunity(Context context, Community parentCommunity, Community childCommunity)
throws SQLException, AuthorizeException {
authorizeService.authorizeAction(context, parentCommunity, Constants.ADD);
log.info(LogManager.getHeader(context, "add_subcommunity",
"parent_comm_id=" + parentCommunity.getID() + ",child_comm_id=" + childCommunity
.getID()));
if (!parentCommunity.getSubcommunities().contains(childCommunity)) {
parentCommunity.addSubCommunity(childCommunity);
childCommunity.addParentCommunity(parentCommunity);
}
context.addEvent(new Event(Event.ADD, Constants.COMMUNITY, parentCommunity.getID(), Constants.COMMUNITY,
childCommunity.getID(), parentCommunity.getHandle(),
getIdentifiers(context, parentCommunity)));
}