Copy folder issue / understanding

Hi everyone, I'am actually implementing a Listener wich wait the event: CreatedByCopy, then I add the relations I wanted in the destination document. It's working well when using it on a simple document, but when a copy a entire folder wich contain some documents I can't see how the documents are added into the copyed folder. I was believed that the CreatedByCopy w'll be recurcisvly call in order to copy the documents. I believe I was wrong since my listener only see 1 CreatedByCopy event when I copy a folder.

If someone could give me some tips on how the folder copy is working, I got trouble to figure this out with the code. I actualy saw a method wich copy a List of document but I can't see where it's used.

I hope my english is understandable, thanks for reading.

LR

0 votes

2 answers

1600 views

ANSWER



The event documentCreatedByCopy is sent only for the root of the copy. It cannot be sent for each of the copied documents as it could mean thousands of events for big hierarchies.

So in your code you have to take the copied document and recurse in its (newly created) children to do whatever you need.

0 votes



Thanks for your time, it's what I had actualy implements this morning.

0 votes