[Zope-CMF] Re: Bug with CMFUid content when copied indirectly and
some confusion.
Tim Hoffman
timh at zute.net
Thu Aug 26 04:55:14 EDT 2004
Hi
As opposed to understanding I was in fact just summarising how it is
currently implemented, to make sure I
did understand what was going on.
CMF 1.5Beta and CMFUid "advertises" that all your favoutite content
types automatically
get a UID. And the mechanism they have used is register being called in
main template.
(This probably should be documented - it took my quite a while to find
it - cause I wouldn't have looked for it there ;-)
>Writing that, I wonder why you have to use 'register' to make sure you
get an UID. Wouldn't it be better if 'getUid' registers >objects if
necessary?
I suppose you could, - my presonal preference would in fact be to create
a UID in every object at creation time
and some how hook that in through the Type Tool content creation factory.
See ya
Tim
yuppie wrote:
> Hi Tim!
>
>
> Tim Hoffman wrote:
>
>> As I understand it, a call to uidtool.register(object) is in main
>> template. This gets called and if the object doesn't have a uid a new
>> uid
>> (UniqueIdAnnotion instance) is created and stored as an attribute if
>> the content object (currently named cmf_uid). (UniqueIdAnnotation has
>> manage_afterAdd and manage_afterClone methods etc). So far so good.
>
>
> Reading your later mails, I think this is the basic misunderstanding.
> The call to uidtool.register(object) in main_template is no general
> mechanism to assign UIDs. It's just a part of the permalinks
> implementation.
>
> UIDs are not assigned by default. If your application needs UIDs for
> folders, it has to register them.
>
>
> Writing that, I wonder why you have to use 'register' to make sure you
> get an UID. Wouldn't it be better if 'getUid' registers objects if
> necessary?
>
>
> Cheers,
> Yuppie
>
More information about the Zope-CMF
mailing list