jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Assigning unique identifiers with JackRabbit
Date Mon, 26 Feb 2007 09:39:29 GMT
Shaun Barriball wrote:
>  1) How best to trigger the assignment of the "custom_id" prior to save - I
> presume using an EventListener NODE_ADDED is best? 

This will not work because events are triggered after changes are saved.

I guess you just have to assign them manually.

>  2) Any comments on how best to handle this where items are imported?

A custom ContentHandler implementation that filters the XML stream and adds 
appropriate custom_ids should do the trick.

> Do we
> need to wrap the import in a custom utility to re-assign the 'custom_id'?
> E.g. items could be imported with conflicting custom_id values.

Well, this depends on what you want to achieve. preserve the custom_ids? assign 
new a new custom_id? what should happen in case of a conflict?

Maybe you can also leverage the repository to maintain your node identities. If 
an imported node has a custom_id that already exists in the workspace, does the 
imported node have the same UUID like the already existing node?

See: 
http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/ImportUUIDBehavior.html

regards
  marcel

Mime
View raw message