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/HEAD/root@126484 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-05-10 11:09:48 +00:00
parent 6e2fbe27e3
commit 06fa651c38
4 changed files with 63 additions and 14 deletions

View File

@@ -137,6 +137,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";
@@ -1127,9 +1128,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);
}