Merged HEAD (5.2) to 5.2.N (5.2.1)

126484 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      122595 jvonka: Nodes (FileFolder) API - add "permanent" option to delete node (to optionally bypass archive/trashcan)
      RA-837, RA-642


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126828 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 11:42:04 +00:00
parent c5dcb1659f
commit 8a9bbe855b
4 changed files with 63 additions and 14 deletions

View File

@@ -144,6 +144,7 @@ public class NodesImpl implements Nodes
private final static String PARAM_RELATIVE_PATH = "relativePath";
private final static String PARAM_AUTO_RENAME = "autoRename";
private final static String PARAM_PERMANENT = "permanent";
private final static String PARAM_SELECT_PROPERTIES = "properties";
private final static String PARAM_SELECT_PATH = "path";
@@ -1134,9 +1135,19 @@ public class NodesImpl implements Nodes
}
@Override
public void deleteNode(String nodeId)
public void deleteNode(String nodeId, Parameters parameters)
{
NodeRef nodeRef = validateNode(nodeId);
// default false (if not provided)
boolean permanentDelete = Boolean.valueOf(parameters.getParameter(PARAM_PERMANENT));
if (permanentDelete == true)
{
// Set as temporary to delete node instead of archiving.
nodeService.addAspect(nodeRef, ContentModel.ASPECT_TEMPORARY, null);
}
fileFolderService.delete(nodeRef);
}