mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
104250: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud) 104173: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2) 104090: Merged NESS/4.2.N-2015_04_30 (4.2.5) to V4.2-BUG-FIX (4.2.5) 104084: MNT-13366 : CMIS folder.deleteTree results in multiple entries in trashcan rather than one - Implemented fix and test. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@104392 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1688,40 +1688,15 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
||||
final NodeRef folderNodeRef = getOrCreateFolderInfo(folderId, "Folder").getNodeRef();
|
||||
final FailedToDeleteDataImpl result = new FailedToDeleteDataImpl();
|
||||
|
||||
result.setIds(deleteBranch(folderNodeRef, continueOnFailure));
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<String> deleteBranch(NodeRef nodeRef, boolean continueOnFailure)
|
||||
{
|
||||
List<String> result = new ArrayList<String>();
|
||||
|
||||
try
|
||||
{
|
||||
// remove children
|
||||
List<ChildAssociationRef> childrenList = connector.getNodeService().getChildAssocs(nodeRef);
|
||||
if (childrenList != null)
|
||||
{
|
||||
for (ChildAssociationRef child : childrenList)
|
||||
{
|
||||
List<String> ftod = deleteBranch(child.getChildRef(), continueOnFailure);
|
||||
if (!ftod.isEmpty())
|
||||
{
|
||||
result.addAll(ftod);
|
||||
if (!continueOnFailure)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// attempt to delete the node
|
||||
connector.deleteNode(nodeRef, true);
|
||||
connector.deleteNode(folderNodeRef, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result.add(nodeRef.getId());
|
||||
List<String> ids = new ArrayList<String>();
|
||||
ids.add(folderId);
|
||||
result.setIds(ids);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user