[Zope-dev] Extending Zope's ZConfig Schema in a Product?

Sidnei da Silva sidnei at enfoldsystems.com
Fri Jul 1 10:08:08 EDT 2005


On Thu, Jun 30, 2005 at 11:58:08PM -0400, Fred Drake wrote:
| On 6/30/05, Sidnei da Silva <sidnei at enfoldsystems.com> wrote:
| > Gosh, that looks too nice to be true. I will try that out tomorrow and
| > write out a how-to on zope.org if it works out.
| 
| It is too good to be true; sorry.
| 
| Well, it is true, but it's not what you're looking for.  You can't use
| it to extend the schema for Zope.  You can use it to add new concrete
| implementations for things that are allowed; the original use-case was
| to allow things like new kinds of storage for the database.

Yeah, I can see two things of doing it by *abusing* zope.conf, one is
abuse the 'server' abstract type and the other is to use the
'environment' directive, but then you can't specify the datatype. Oh,
well.

| I've spent a little time thinking about this issue, and have come up
| with at least one way to deal with it (and %import would be used, in
| part), but I've never been completely happy with the approaches.

I would like to suggest something like what's done for Zope 3 with
'package-includes'. Then '<package-name>-schema.xml' would be included
from 'zopeschema.xml' and '<product-name>-zope.conf' would be included
from 'zope.conf'.

Actually, maybe not even a special directory, but looking inside the
Products directories for those files. But then there would be a
chicken-and-egg problem because of the 'products' directive in
zope.conf. Maybe a special directory is the best in this case.

| Since using an additional configuration file is possible (and quite
| easy in Zope 2, since the location of the instance is so easy to
| discern, I'm not convinced it's actually important to support
| embedding the configuration for 3rd-party components into zope.conf. 
| If you want something you can use now, using a product-specific
| configuration file, with an appropriate schema, will do quite well. 
| It also doesn't require hacking (or monkey-patching) Zope or ZConfig,
| so it would be easy to deploy in a variety of situations.

Right, seems that's my only choice for the time being.

-- 
Sidnei da Silva
Enfold Systems, LLC.


More information about the Zope-Dev mailing list