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?
Solved! Go to Solution.
You can try deep copy.
pass true in second parameter.
You can try deep copy.
pass true in second parameter.
...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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.