*/
protected NodeData getCorrespondingNodeData(SessionImpl corrSession) throws ItemNotFoundException,
AccessDeniedException, RepositoryException
{
final QPath myPath = nodeData().getQPath();
final SessionDataManager corrDataManager = corrSession.getTransientNodesManager();
if (this.isNodeType(Constants.MIX_REFERENCEABLE))
{
NodeData corrNode = (NodeData)corrDataManager.getItemData(getUUID());
if (corrNode != null)
{
return corrNode;
}
}
else
{
NodeData ancestor = (NodeData)dataManager.getItemData(Constants.ROOT_UUID);
for (int i = 1; i < myPath.getDepth(); i++)
{
ancestor = (NodeData)dataManager.getItemData(ancestor, myPath.getEntries()[i], ItemType.NODE);
if (corrSession.getWorkspace().getNodeTypesHolder().isNodeType(Constants.MIX_REFERENCEABLE,
ancestor.getPrimaryTypeName(), ancestor.getMixinTypeNames()))
{
NodeData corrAncestor = (NodeData)corrDataManager.getItemData(ancestor.getIdentifier());
if (corrAncestor == null)
{
throw new ItemNotFoundException("No corresponding path for ancestor "
+ ancestor.getQPath().getAsString() + " in " + corrSession.getWorkspace().getName());
}
NodeData corrNode =
(NodeData)corrDataManager.getItemData(corrAncestor, myPath.getRelPath(myPath.getDepth() - i),
ItemType.NODE);
if (corrNode != null)
{
return corrNode;
}