[Zope3-dev] ZCML alternative

Shane Hathaway shane@zope.com
Tue, 04 Jun 2002 17:46:08 -0400


Steve Alexander wrote:
> Namespaces are important for making the configuration system extensible.

Jeffrey's example was *a lot* easier to read.  Site managers are a lot 
more familiar with that kind of XML than namespace-loaded XML.

We can have extensibility without namespaces.  The extensibility would 
be more limited, but in fact, it currently seems too inviting for 
developers to create their own directives.

Here's your example rewritten in more conventional XML.  If we're using 
XML to make ZCML familiar, we'll gain the most mileage by using a 
familiar style of XML.


<permission id="Zope.Manage">Manage Contacts</permission>

<content class="Zope.Contact.">
  <require permission="Zope.View">
   <attribute>name</attribute>
   <attribute>first</attribute>
   <attribute>last</attribute>
   <attribute>email</attribute>
   <attribute>address</attribute>
   <attribute>postal_code</attribute>
  </require>
  <require permission="Zope.Manage">
   <zmi-factory id="Zope.Contact">
    <title>Contact</title>
   </zmi-factory>
  </require>
</content>


One thing I experimented with in the example above is the notion that 
you can't do anything with a content class unless permission is granted 
in some way, so the "require" element is reused to declare the ZMI factory.

Shane