On Tue, Apr 23, 2019 at 4:54 AM Harold Putman <[email protected]> wrote:
>
> I want to copy a source node over a destination node that already exists.
> If I just do
>     workspace.copy(sourcePath, targetPath);
> I get an ItemExistsException.
> I was hoping to  create a new version by
>    VersionManager vm = workspace.getVersionManager();
>    vm.checkout(targetPath);
>    workspace.copy(sourcePath, targetPath);
>    vm.checkin(targetPath);
> but still I get a ItemExistsException.
>
> What is the right way to do this?

Iterating properties and child nodes of the source node and copy each
of those to the target node?
Copying properties is quite straightforward.
'Copying child nodes' is probably your requirement specific.
Sometimes, I removed child nodes first and add new ones. Or sometimes
I resolve the mapping child nodes somehow and copy the properties if
found, etc.

Regards,

Woonsan

>
>
> Harold Putman

Reply via email to