06-22-2017 04:47 PM
var docNodeId = <argument from api>
var docNode = search.findNode("workspace://SpaceStore/"+docNodeId);
.....
docNode.copy(objDestNode);
This code works if <argument from api> is node id of a file
.
This code doesn't work if <argument from api> is node id of a folder. It just creates an empty folder with the same name as that of <argument from api>
How do I copy a folder with all its content to a destination node?
06-23-2017 01:50 AM
You can try deep copy.
pass true in second parameter.
06-23-2017 01:50 AM
You can try deep copy.
pass true in second parameter.
06-24-2017 04:01 AM
...But be careful. I think the copy will be excuted in a single transaction - so you will be creating large transaction when copying a big folder structure and such transactions are not good for Solr performance. You could use a tool like batch-executer to split this up in smaller parts.
Explore our Alfresco products with the links below. Use labels to filter content by product module.