// mix:versionable
// we have to be sure that any versionable node somewhere in repository
// doesn't refers to a VH of the node being deleted.
for (String wsName : repository.getWorkspaceNames())
{
SessionImpl wsSession = repository.getSystemSession(wsName);
try
{
for (PropertyData sref : wsSession.getTransientNodesManager().getReferencesData(vhID, false))
{
// Check if this VH isn't referenced from somewhere in workspace
// or isn't contained in another one as a child history.
// Ask ALL references incl. properties from version storage.
if (sref.getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH))
{
if (!sref.getQPath().isDescendantOf(vhnode.getQPath())
&& (containingHistory != null ? !sref.getQPath().isDescendantOf(containingHistory) : true))
// has a reference to the VH in version storage,
// it's a REFERENCE property jcr:childVersionHistory of
// nt:versionedChild
// i.e. this VH is a child history in an another history.
// We can't remove this VH now.
return;
}
else if (!currentWorkspaceName.equals(wsName))
{
// has a reference to the VH in traversed workspace,
// it's not a version storage, i.e. it's a property of versionable
// node somewhere in ws.
// We can't remove this VH now.
return;
} // else -- if we has a references in workspace where the VH is being
// deleted we can remove VH now.
}
}
finally
{
wsSession.logout();
}
}
// remove child versions from VH (if found)
// ChildVersionRemoveVisitor cvremover = new