Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
UIDs with dexterity content types
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pingviini  
View profile  
 More options Nov 25 2009, 6:47 am
From: pingviini <jukka.ojani...@gmail.com>
Date: Wed, 25 Nov 2009 03:47:52 -0800 (PST)
Local: Wed, Nov 25 2009 6:47 am
Subject: UIDs with dexterity content types
We've been developing a video sharing product for Plone 3 / 4 which
uses dexterity, but we've had few problems related with dexteritys
missing support for UIDs. We're implementing oEmbed interface for our
package (http://www.oembed.com) and we need to have unique URL what
oembed provider can use to provide data to clients. We could use the
contents original URL, but then we have problems with broken links if
content is moved to other location so using something like UIDs is
preferred option.

I googled around for solutions and found lengthy discussions about
using IntIds with dexterity to create UIDs and I tried to take that
approach, but found myself being amazed how things were not working in
the way I thought they would. On package reinstalls sometimes
generated UIDs disappeared and IntId utility disappeared regularily
from site root. As I ran into trouble with IntId approach I developed
my own UID generator and created new index to portal_catalog for it.
This solution is working just fine, but I still think this behaviour
should be provided by the framework and I'd like to know if I've just
been staring same code too long and can't see how it is really
supposed to be done?

I'd appreciate any opinions for this subject.

- pingviini


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Aspeli  
View profile  
 More options Nov 25 2009, 8:11 pm
From: Martin Aspeli <optil...@gmail.com>
Date: Thu, 26 Nov 2009 09:11:02 +0800
Local: Wed, Nov 25 2009 8:11 pm
Subject: Re: UIDs with dexterity content types
2009/11/25 pingviini <jukka.ojani...@gmail.com>:

> We've been developing a video sharing product for Plone 3 / 4 which
> uses dexterity, but we've had few problems related with dexteritys
> missing support for UIDs.

Dexterity objects have UIDs via zope.intid. They just don't have a
UID() method that returns an Archetypes UID string.

> We're implementing oEmbed interface for our
> package (http://www.oembed.com) and we need to have unique URL what
> oembed provider can use to provide data to clients. We could use the
> contents original URL, but then we have problems with broken links if
> content is moved to other location so using something like UIDs is
> preferred option.

> I googled around for solutions and found lengthy discussions about
> using IntIds with dexterity to create UIDs and I tried to take that
> approach, but found myself being amazed how things were not working in
> the way I thought they would. On package reinstalls sometimes
> generated UIDs disappeared and IntId utility disappeared regularily
> from site root.

That shouldn't happen. If it does, it's a bug, which I'd ask that you
file. The above is too vague to diagnose, unfortunately.

> As I ran into trouble with IntId approach I developed
> my own UID generator and created new index to portal_catalog for it.
> This solution is working just fine, but I still think this behaviour
> should be provided by the framework and I'd like to know if I've just
> been staring same code too long and can't see how it is really
> supposed to be done?

It's supposed to be done by intids. They're not catalogued by default,
though perhaps they should be?

Note that intids (like AT UIDs) are not stable across sites, i.e. if
you export/import you are liable to get a different UID. For that,
you'd need hash based GUIDS, which is different. I'm sure there's a
Zope/Python package for that somewhere already.

Martin


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alberto Berti  
View profile  
 More options Nov 25 2009, 8:36 pm
From: Alberto Berti <albe...@metapensiero.it>
Date: Thu, 26 Nov 2009 02:36:00 +0100
Subject: Re: UIDs with dexterity content types
>>>>> "Martin" == Martin Aspeli <optil...@gmail.com> writes:

    Martin> Note that intids (like AT UIDs) are not stable across sites,
    Martin> i.e. if you export/import you are liable to get a different
    Martin> UID. For that, you'd need hash based GUIDS, which is
    Martin> different. I'm sure there's a Zope/Python package for that
    Martin> somewhere already.

the uuid module in python standard lib allows for various kind of GUIDS,
both "stable" and "random", created using some kind of entropy generator.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google