[Zope-CMF] Re: CMFSetup types import/export

Florent Guillaume fg at nuxeo.com
Fri Jun 10 11:12:07 EDT 2005


Hi Yuppie,

On 10 Jun 2005, at 17:02, yuppie wrote:
> I have to modify CMFSetup's type information import/export   
> (typeinfo.py).
>> Currently, to discriminate on ti types on export, it does:
>>         if isinstance( ti, FactoryTypeInformation ):
>>             ...
>>         elif isinstance( ti, ScriptableTypeInformation ):
>>             ...
>> Because I have other TypeInformation classes, with different   
>> properties, I'll have to use some kind of registry. Anyone has   
>> special needs here, before I commit an implementation? I think  
>> I'll  do a registry that discriminates on ti.meta_type.
>> Note that my ti class is a subclass of FactoryTypeInformation, so  
>> the  isinstance test above is not enough in any case.
>
> In the long run we might need a registry for meta_type or interface  
> specific import/export handlers.
>
> But if you just need support for different PropertyManager  
> properties, I'd propose an other solution:
>
> utils.ConfiguratorBase has some methods for generic property  
> support. The typeinfo handlers could use that code in a similar way  
> as the site properties handlers or the handlers for the newstyle  
> Actions on HEAD.
>
> The property support works with any set of properties, so there  
> would be no need to write new handlers for customized typeinfo  
> classes.

Ok that's another option that suits me too.

But it will change a bit the XML format. I don't have a problem with  
that, but I hope people are OK with a backport to the 1.5 branch of  
such changes.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com




More information about the Zope-CMF mailing list