[Zope3-Users] Re: RFC 4122 UUIDs
Stephan Richter wrote: On Wednesday 04 April 2007 14:34, Derek Richardson wrote: I believe that that will not guarantee a *universally* unique id, but only an id unique within that ZODB. Am I wrong? Well, intid guarantees to be unique for this Zope instance, even accross multiple databases conencted to this Zope instance. All you have to do is to id the Zope instance, for example, ip+port should suffice. One problem we see in Plone (which has similar types of extrinsic ids) is that if you export/import into a new site, ids are not stable (unless you exported the entire site, including the id). When used for e.g. references between objects, these break. If UUIDs were essentially hashes that'd make this problem managable. I'm not sure if this particular approach solves that though. Martin ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: RFC 4122 UUIDs
On Wednesday 04 April 2007 14:34, Derek Richardson wrote: > I believe that that will not guarantee a *universally* unique id, but > only an id unique within that ZODB. Am I wrong? Well, intid guarantees to be unique for this Zope instance, even accross multiple databases conencted to this Zope instance. All you have to do is to id the Zope instance, for example, ip+port should suffice. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: RFC 4122 UUIDs
Derek Richardson wrote: I believe that that will not guarantee a *universally* unique id, but only an id unique within that ZODB. Am I wrong? The RFC prescribes a specific algorithm for generating universally unique IDs. Of course, they are only "universally unique" in a probabilistic way. It wouldn't be difficult to salt the integer IDs such that they generate UUIDs that are as likely as any other to be unique. Something like this would work: import uuid int_id = 42 salt = 0x32352352353243263235235235324326 print uuid.UUID('%X' % (int_id ^ salt)) Another option would be to create an IOBtree to map each object's intid to a randomly generated UUID (generated by the uuid.uuid1 method from the earlier referenced module). -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] RFC 4122 UUIDs
On Wed, 4 Apr 2007, Benji York wrote: 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. I would use the standard intid utility and simply encode the generated integer as a UUID. But is that really globally unique? I would assume that's only guaranteed to be unique per zodb. Paul ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: RFC 4122 UUIDs
I believe that that will not guarantee a *universally* unique id, but only an id unique within that ZODB. Am I wrong? The RFC prescribes a specific algorithm for generating universally unique IDs. Derek Benji York wrote: 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. I would use the standard intid utility and simply encode the generated integer as a UUID. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] RFC 4122 UUIDs
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. I would use the standard intid utility and simply encode the generated integer as a UUID. -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: RFC 4122 UUIDs
Derek Richardson and I were just discussing this matter on freenode #vice ... I have no idea at this point if the suggested event model is better, but it seems like an implementation that safely handles the missing annotation on request, would be simpler and more efficient. In other words, rather than listening for the creation event, why not provide an interface that can be adapted to any object - where the implementation assumes objects may not yet have a UUID stored as an annotation. When the first request comes in, if none is found, you generate it and annotate and persist the object then. I would think as long as this implementation catches the potential write conflict error, and handles by re-requesting the UUID annotation, the race case should also be eliminated. Flaws with this line of thinking? Cheers, Paul 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) ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] RFC 4122 UUIDs
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
[Zope3-Users] Re: RFC 4122 UUIDs
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) Derek ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] RFC 4122 UUIDs
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 -- View this message in context: http://www.nabble.com/RFC-4122-UUIDs-tf3527097.html#a9841735 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
Re: [Zope3-Users] RFC 4122 UUIDs
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. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] RFC 4122 UUIDs
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. 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. I googled (of course) but was unable to draw any definite conclusions from my results. Thanks, Derek [1] http://www.atomenabled.org/developers/syndication/atom-format-spec.php#element.id The "atom:id" element conveys a permanent, universally unique identifier for an entry or feed. atomId = element atom:id { atomCommonAttributes, (atomUri) } Its content MUST be an IRI, as defined by [RFC3987]. Note that the definition of "IRI" excludes relative references. Though the IRI might use a dereferencable scheme, Atom Processors MUST NOT assume it can be dereferenced. When an Atom Document is relocated, migrated, syndicated, republished, exported, or imported, the content of its atom:id element MUST NOT change. Put another way, an atom:id element pertains to all instantiations of a particular Atom entry or feed; revisions retain the same content in their atom:id elements. It is suggested that the atom:id element be stored along with the associated resource. The content of an atom:id element MUST be created in a way that assures uniqueness. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] still filter in addmenuitem
ok I've understood. The Add menu is empty while the Add entry is still there in the zmi_actions menu. The Add menu entry is there but is unuseful, because it doesn't allow you to choose the type of the objet to add, then it fails with an error. Try to see if you can add a ZCML security declaration on something like IAdding or Adding. But you're trying to build something on top of the ZMI (Rotterdam skin), although you should consider to build your own skin, with your own menus. You would then have a total control on you menus. Christophe Ivan Horvath a écrit : sorry for attaching files, but in this way may be it will be more clear. on the Type object.gif you can see that Article can be added to Type objects. on the Article object.gif you can see that nothing can be added to an Article object (manually). that's why i use the filter, but the Add menu point is still visible (rounded with read drawing). and if you click on it you can see on the article add.gif the screen. to complete the whole story Article can contain other Article objects, only the manual adding needs to be disabled. On 4/4/07, Christophe Combelles <[EMAIL PROTECTED]> wrote: I don't really understand, do you want to hide the full Add menu, or just the menu entry for your content object? Remember you can also filter the menu entry by interface and not only with the filter. (btw I've never used this filter yet) Christophe Ivan Horvath a écrit : > Dear All, > > as i wrote in one of my previous e-mail i use filter property in > addMenuItem directive. > filter = context/context/isNeedtoDisplay | nothing > > the add menu (below the navigation tree) is not displaying for the > certain object, but there is an Add menu in zmi_actions menu bar. > when i click on it it displays an empty textbox to create an object. > how can i disappear it? or is it a bug? > > Ivan > ___ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users > > ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] still filter in addmenuitem
I don't really understand, do you want to hide the full Add menu, or just the menu entry for your content object? Remember you can also filter the menu entry by interface and not only with the filter. (btw I've never used this filter yet) Christophe Ivan Horvath a écrit : Dear All, as i wrote in one of my previous e-mail i use filter property in addMenuItem directive. filter = context/context/isNeedtoDisplay | nothing the add menu (below the navigation tree) is not displaying for the certain object, but there is an Add menu in zmi_actions menu bar. when i click on it it displays an empty textbox to create an object. how can i disappear it? or is it a bug? Ivan ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] still filter in addmenuitem
Dear All, as i wrote in one of my previous e-mail i use filter property in addMenuItem directive. filter = context/context/isNeedtoDisplay | nothing the add menu (below the navigation tree) is not displaying for the certain object, but there is an Add menu in zmi_actions menu bar. when i click on it it displays an empty textbox to create an object. how can i disappear it? or is it a bug? Ivan ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: lovely.remotetask question
> Or use zopectl start/stop. > Right, this works. Problem is when using zopectl fg I can't stop zope via ZMI or ctrl+c without stopping RemoteTask first or killing zope process. -- Maciej Wisniowski ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: lovely.remotetask question
Maciej Wisniowski wrote: For startup do this : @component.adapter(IDatabaseOpenedEvent) def startRemoteTask(event): """Start the amazon remotetask on startup.""" db = event.database connection = db.open() root = connection.root() root_folder = root.get(ZopePublication.root_name, None) for site in root_folder.values(): service = component.queryUtility( ITaskService, context=site) if service is not None: if not service.isProcessing(): service.startProcessing() I assume here that the remote tasks are located in one of the site directly contained in root. Works for me now :) For shutdown : I have no solution for this right now. So seems that now it is best to manually click on stop processing button via ZMI before shutting Zope down. Or use zopectl start/stop. Jürgen ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users