mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added removeChildAssociation method to NodeService
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4706 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -885,6 +885,41 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Check implementation
|
||||
*/
|
||||
public boolean removeChildAssociation(ChildAssociationRef childAssocRef)
|
||||
{
|
||||
NodeRef parentRef = childAssocRef.getParentRef();
|
||||
NodeRef childRef = childAssocRef.getChildRef();
|
||||
Pair<Integer, String> parentVersionPath = AVMNodeConverter.ToAVMVersionPath(parentRef);
|
||||
if (parentVersionPath.getFirst() >= 0)
|
||||
{
|
||||
throw new InvalidNodeRefException("Read only store.", parentRef);
|
||||
}
|
||||
Pair<Integer, String> childVersionPath = AVMNodeConverter.ToAVMVersionPath(childRef);
|
||||
if (childVersionPath.getFirst() >= 0)
|
||||
{
|
||||
throw new InvalidNodeRefException("Read only store.", childRef);
|
||||
}
|
||||
String parentPath = parentVersionPath.getSecond();
|
||||
String childPath = childVersionPath.getSecond();
|
||||
String [] childPathBase = AVMNodeConverter.SplitBase(childPath);
|
||||
if (childPathBase[0] == null || !childPathBase[0].equals(parentPath))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
fAVMService.removeNode(childPathBase[0], childPathBase[1]);
|
||||
return true;
|
||||
}
|
||||
catch (AVMNotFoundException e)
|
||||
{
|
||||
throw new InvalidNodeRefException("Not found.", childRef);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeRef
|
||||
* @return Returns all properties keyed by their qualified name
|
||||
|
Reference in New Issue
Block a user