You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sudhan <s....@gmail.com> on 2007/08/15 01:00:50 UTC
Observation : How to figure out if there was a rename operation on
Node
Hello,
I have a application, which is exposed to users who can add, delete and
update any of the existing file or folder nodes. I am using custom node
types by extending nt:resouces for adding custom properties.
Also i am implementing javax.jcr.observation.EventListener for listening to
node added or deleted events.
Till now it was fine, because whenever some user performs CRUD
(Create/Update/Delete) operation it will trigger those events. But now when
i want to implement RENAME operation on these, I have some doubts
implementing these feature. Firstly when i rename any of the file node by
performing session.move(), i get two events one for addition and one for
deletion. So my problem is that how am I going to differentiate between
RENAME operation or CREATE and DELETE operation as individual operation.
Do we some mechanism where i can know that this is just a rename and not add
and delete.
thanks,
Sudhan
--
View this message in context: http://www.nabble.com/Observation-%3A-How-to-figure-out-if-there-was-a-rename-operation-on-Node-tf4270201.html#a12153821
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: Observation : How to figure out if there was a rename operation
on Node
Posted by Marcel Reutegger <ma...@gmx.net>.
Sudhan wrote:
> Do we some mechanism where i can know that this is just a rename and not add
> and delete.
it's kind of a hack, but if you don't see a property_added event for
jcr:primaryType for an added node you can infer that the node was moved.
regards
marcel