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

129175 mmuller: Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
      128597 jvonka: REPO-900: Fix "autoRename not working if using a relativePath (with create/add node via json request)"


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129349 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 14:13:47 +00:00
parent 472785f0bd
commit 4498ab0a4a
2 changed files with 29 additions and 10 deletions

View File

@@ -1589,6 +1589,10 @@ public class NodesImpl implements Nodes
props = mapToNodeProperties(nodeInfo.getProperties());
}
// Optionally, lookup by relative path
String relativePath = nodeInfo.getRelativePath();
parentNodeRef = getOrCreatePath(parentNodeRef, relativePath);
// Existing file/folder name handling
boolean autoRename = Boolean.valueOf(parameters.getParameter(PARAM_AUTO_RENAME));
if (autoRename && (isContent || isSubClass(nodeTypeQName, ContentModel.TYPE_FOLDER)))
@@ -1601,9 +1605,6 @@ public class NodesImpl implements Nodes
}
}
String relativePath = nodeInfo.getRelativePath();
parentNodeRef = getOrCreatePath(parentNodeRef, relativePath);
QName assocTypeQName = ContentModel.ASSOC_CONTAINS;
if ((nodeInfo.getAssociation() != null) && (nodeInfo.getAssociation().getAssocType() != null))
{