[Zope-CMF] Re: modifying TypeInformation's properties

Florent Guillaume fg at nuxeo.com
Mon Sep 6 12:28:11 EDT 2004


> >> How are these flags configured, e.g. if I want to write a content type 
> >> that should work with CPS? Can I set the properties as part of the fti 
> >> data in my product?
> > 
> > 
> > Yes, as TI's __init__ calls manage_changeProperties
> 
> No. manage_changeProperties changes only existing properties.

You're right. Actually the ZMI-modifiability of the properties was a red
herring, even if it's nice to have. Properties of instances have always
been addable through python code.

What I really want is the possibility to have some of the items defined
in the standard factory_type_information dict be added as properties to
the TI. This could be done by TypeInformation's constructor.

But to do that we'd have to specify somewhere what properties are
allowable (and their type), and this begins to look really the same as
_properties.

Hm... Maybe monkeypatching TypeInformation._properties isn't that bad.
Or just add those properties when needed from the installer.

I'll have to think about all that...

> >> Or does a CPS tool set them, using properties like annotations?
> > 
> > No there's no additional tool, it's just set at the fti level or inside 
> > an installer when creating the TI "by hand".
> 
> AFAICS the only way to create them is "by hand" from installer code or 
> TTW. CMFSetup is broken if you use custom properties.

Yes. I'll fix CMFSetup too then, along Tres's proposal.

> BTW: Is there any good reason why TI still subclasses 
> SimpleItemWithProperties? AFAICS the sole purpose of 
> SimpleItemWithProperties is to provide fixed schema support.

Only the Label stuff is useful, and we can easily add the method to
TypeInformation.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 71 59  http://nuxeo.com  mailto:fg at nuxeo.com


More information about the Zope-CMF mailing list