@Override
public void removeCollection(Context context, Community community, Collection collection)
throws SQLException, AuthorizeException, IOException {
authorizeService.authorizeAction(context, community, Constants.REMOVE);
ArrayList<String> removedIdentifiers = collectionService.getIdentifiers(context, collection);
String removedHandle = collection.getHandle();
UUID removedId = collection.getID();
if (collection.getCommunities().size() == 1) {
collectionService.delete(context, collection);
} else {
community.removeCollection(collection);
collection.removeCommunity(community);
}
log.info(LogManager.getHeader(context, "remove_collection",
"community_id=" + community.getID() + ",collection_id=" + collection.getID()));
context.addEvent(new Event(Event.REMOVE, Constants.COMMUNITY, community.getID(),
Constants.COLLECTION, removedId, removedHandle, removedIdentifiers));
}