1 Dec 2010 09:48
Archetypes configuration using ZCML
Proposal for inclusion into Products.Archetypes. Otherwise I might
release separately, or drop it altogether.
Now,
I have an implementation that allows you to configure your Archetypes
content using e.g.:
<five:registerPackage package="." />
<permission id="type.Add" title="Type: Add type" />
<at:register
class=".content.Type"
permission="type.Add"
/>
Note that with ``at:register``, it's optional to provide a product
name (using ``product`` argument). It defaults to the module name of
the configuration context. This works well.
What happens then is that:
1) The content class is passed to ``atapi.registerType`` on ZCML load.
2) On Zope 2 "initialization", the content class is initialized
automatically (as usual).
Benefits:
1) Avoids cargo-culting
(Continue reading)
--
Dorneles Treméa
Enfold Systems
RSS Feed