// Remove mixin nt definition node/properties from this node
QPath ancestorToSave = nodeData().getQPath();
for (PropertyDefinitionData pd : ntmanager.getAllPropertyDefinitions(removedName))
{
ItemData p = dataManager.getItemData(nodeData(), new QPathEntry(pd.getName(), 1), ItemType.PROPERTY);
if (p != null && !p.isNode())
// remove it
dataManager.delete(p, ancestorToSave);
}
for (NodeDefinitionData nd : ntmanager.getAllChildNodeDefinitions(removedName))
{
ItemData n = dataManager.getItemData(nodeData(), new QPathEntry(nd.getName(), 1), ItemType.NODE);
if (n != null && n.isNode())
{
// remove node with subtree
ItemDataRemoveVisitor remover = new ItemDataRemoveVisitor(dataManager, ancestorToSave);
n.accept(remover);
for (ItemState deleted : remover.getRemovedStates())
{
dataManager.delete(deleted.getData(), ancestorToSave);
}
}