You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Benjamin Brown <be...@thisisnumero.com> on 2009/06/01 16:43:02 UTC
RE: Auditing required - JCR hack added
> -----Original Message-----
> From: Benjamin Brown [mailto:benjamin.brown@thisisnumero.com]
> Sent: 29 May 2009 10:48
> To: users@jackrabbit.apache.org
> Subject: RE: Auditing required - JCR hack added
>
> That looks ideal - I wonder why I missed that...!
>
> Thanks,
>
> Benjamin
>
> > -----Original Message-----
> > From: Jukka Zitting [mailto:jukka.zitting@gmail.com]
> > Sent: 29 May 2009 10:50
> > To: users@jackrabbit.apache.org
> > Subject: Re: Auditing required - JCR hack added
> >
> > Hi,
> >
> > On Fri, May 29, 2009 at 11:25 AM, Benjamin Brown
> > <be...@thisisnumero.com> wrote:
> > > To do this I've implemented a NodeStateListener class - which seems to
> > do
> > > everything that I need such as watching for added/removed nodes etc
> etc.
> >
> > Couldn't you use the standard observation mechanism in JCR? That way
> > you wouldn't need to depend on Jackrabbit internals.
> >
> > BR,
> >
> > Jukka Zitting
Hi,
I'm now using this interface but for a NODE_REMOVED event I need to find the node id of the now removed node (so I can audit that id as deleted).
The javax.jcr.observation.Event interface only provides jcr path, event type and user id information, and the EventImpl implementation provides parent and child ids (but again no id of the node affected).
I've noticed the internal org.apache.jackrabbit.core.state.NodeState class has a getId (for my first approach mentioned above), as does the interface org.apache.jackrabbit.spi.Event (getItemId()).
How can I get the node id when using javax.jcr.observation.Event or org.apache.jackrabbit.core.observation.EventImpl classes?
Thanks again,
Benjamin
Re: Auditing required - JCR hack added
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On Mon, Jun 1, 2009 at 4:43 PM, Benjamin Brown
<be...@thisisnumero.com> wrote:
> I'm now using this interface but for a NODE_REMOVED event I need to find the node id
> of the now removed node (so I can audit that id as deleted).
> [...]
> How can I get the node id when using javax.jcr.observation.Event or
> org.apache.jackrabbit.core.observation.EventImpl classes?
Can you target your application to the upcoming JCR 2.0 standard? The
JCR 2.0 version of javax.jcr.observation.Event interface contains a
getIdentifier() method that's pretty much what you're looking for.
See the Jackrabbit dev@ list for current status of the JCR 2.0
implementation efforts.
BR,
Jukka Zitting