Derek Richardson-2 wrote:
> 
> Martin Aspeli wrote:
>> 
>> 
>> Stephan Richter-2 wrote:
>>> On Wednesday 04 April 2007 13:06, Derek Richardson wrote:
>>>> I am hoping that Zope 3 assigns an RFC 4122 UUID to each content item.
>>>> If not, I am hoping there is a third-party product to do this.
>>> No there is neither. We have an intid utility that guarantees
>>> System-wide 
>>> unique ids. This utility is used at several places most notably the
>>> catalog.
>>>
>>>> I would like RFC 4122 UUIDs to provide standard Atom feeds of Zope
>>>> content [1].
>>>>
>>>> It will be better if Zope itself assigns UUIDs, so that there is a
>>>> single source and not a possibility of multiple packages assigning
>>>> different UUIDs to the same content item.
>>> You have to write your own utility to generate the UUID. I checked the
>>> RFC 
>>> quickly and our IntIds are certainly not of the format requested by RFC
>>> 4122.
>>>
>> 
>> Presumably, the intid implementation would be a useful reference for such
>> a
>> utility, and this would a good canidate for a general, re-usable package.
>> 
>> Martin
> 
> Good. I would like to write it as a general, re-usable package.
> 
> Generating RFC 4122 UUIDs is easy - there's a routine for it in the 
> python 2.5 standard libraries and a python 2.3+ version here:
> 
> http://zesty.ca/python/uuid.html
> 
> What seems more difficult is how to plug the routine in so that all 
> content items receive one and only one UUID upon creation. Maybe listen 
> for IObjectCreatedEvent and annotate then? Or is there a potential race 
> condition that means events are not the way to go?
> 
> (Unsure of the depths of Zope 3's architecture)
> 

Look at zope.intid; it should be IObjectCreatedEvent or IObjectAddedEvent.

Martin

-- 
View this message in context: 
http://www.nabble.com/RFC-4122-UUIDs-tf3527097.html#a9842467
Sent from the Zope3 - users mailing list archive at Nabble.com.

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to