AnsweredAssumed Answered

Copying nodes without copying its associations

Question asked by alr on Nov 6, 2008
Hello all,

I am in the need of copying nodes and all their properties and aspects, but not their associations, as this would break some one-to-many relationships. I have taken a quick peek at the CopyServiceImpl class and all I found out was, that it is not really extensible - its variables and the needed-to-modify methods are private and it is not really extensible designed for my special need.

What is the right way to achieve this? First I thought, it would be cool to have an additional parameter in the CopyService to specify, whether you want to copy the associations or not. This does not work, as I would have to change the CopyService interface from Alfresco (resulting as a no go option). So all I could to is to copy and paste the CopyServiceImpl and change that one line. So I could use this class via Spring Injection. What is pretty uncool, as I can only copy via one CopyService and so I have to know from the beginning, which service is needed. Always having a choice would be definately cooler to me and having the Alfresco Default Behaviour as my default also sounds more useful.

So, is there anything I have not paid attention to which might help in my case? I'm searching for the most unobtrusive solution. I somewhat feel that the one I search for is not the one I just implemented.

Thanks and a nice week!