* @param relationship
* @param relatedContentlets
* @throws DotDataException
*/
public static void deleteRelationships(Contentlet contentlet, Relationship relationship, List<Contentlet> relatedContentlets) throws DotDataException{
Tree t = new Tree();
for (Contentlet con : relatedContentlets) {
t= TreeFactory.getTree(contentlet.getIdentifier(), con.getIdentifier(), relationship.getRelationTypeValue());
if(InodeUtils.isSet(t.getChild()) & InodeUtils.isSet(t.getParent())){
TreeFactory.deleteTree(t);
}else{
t= TreeFactory.getTree(con.getIdentifier(),contentlet.getIdentifier(), relationship.getRelationTypeValue());
if(InodeUtils.isSet(t.getChild()) & InodeUtils.isSet(t.getParent())){
TreeFactory.deleteTree(t);
}
}
}
}