[Product-Developers] When to use <five:registerClass /> ?

Martin Aspeli optilude+lists at gmail.com
Tue Apr 5 19:41:12 UTC 2011


On 5 April 2011 19:25, Noe Misael Nieto Arroyo <noe at iservices.com.mx> wrote:
> I'm doing some work with content-types and I see that the ZCML used to
> declare classes sometimes use <five:registerClass /> and sometimes it
> doesn't.
>
> After looking at Martin Aspelli's "Professional Plone Development"
> book's examples, chapter 10, I find that the optilus.cinemacontent
> package does not use it.
>
> So Iam a bit confused.
>
> When shoud I use the <five:registerClass />  directive?

It does the same thing as InitializeClass(), i.e. add security
declarations, a meta type etc to classes.

For Archetypes, it's taken care of you by registerType(), so you don't
need it. Dexterity does it for you as well. You may need it in some
cases, like when building PAS plugins or persistent tools.

Martin



More information about the Product-Developers mailing list