@Override
protected void updateContentMetadata()
{
ContentModification mod = getRepositoryContentModification();
RepositoryItemMetadata modItem = mod.getItem();
if (modItem.isRemoved())
{
// Just record it
super.updateContentMetadata();
}
else if (mod.getType() == Type.REMOVE_FROM_CLUSTER)
{
// An addition has been rejected. We don't record the item as
// removed in the metadata, we just remove it.
RepositoryContentMetadata contentMetadata = getContext().getInProgressMetadata();
RepositoryRootMetadata rmd = contentMetadata.getRepositoryRootMetadata(mod.getRootName());
rmd.removeItemMetadata(modItem.getRelativePathElements());
}
else
{
// Add a record of the item, marked as removed
RepositoryItemMetadata markedRemoved = getMarkedRemovedItem(mod);
RepositoryContentMetadata contentMetadata = getContext().getInProgressMetadata();
RepositoryRootMetadata rmd = contentMetadata.getRepositoryRootMetadata(mod.getRootName());
rmd.addItemMetadata(markedRemoved);
}
}