Florent Guillaume wrote:
Jens Vagelpohl wrote:

Unless someone fixes that CMFDynamicsomethingFTI thing (or the CMF 1.6 branch) people cannot even attempt to run Plone 2.1 or 2.2 against CMF 1.6. This is like a stalemate. Can you suggest how to add a new kind of factory information class similar to appending it to that typeClasses structure so Martin can fix the Plone code for whatever release they want to make CMF 1.6-compatible then?

The "new way" (exemplified by the way CMFCore itself registers 'Factory-based' type information) is:

- make the class provide ITypeInformation (either directly or through ZCML),

- five:registerClass the class (this makes it available in Products.meta_types and for IFAwareObjectManager, which the portal_types ZMI add menu uses),

- register an IAdding for it, usually coded in browser/. Using the base class provided by CMFCore it's only a few lines.

Using registerClass in __init__.py should also work. (In Zope 2.8 you have to register the class explicitly for ITypeInformation using the 'interfaces' argument, Zope 2.9 looks itself for z3 interfaces.)

In that case you can use a Zope 2 style add form instead of an add view.

BTW: Custom catalog indexes and custom workflow definitions are registered the same way. They have to implement IPluggableIndex or IWorkflowDefinition.

Cheers, Yuppie

Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to