ZCML Wadda ? Want a live ZCML doc ?

4

20/04/2011 by Gilles Lenfant

Abstract

ZCML is a great feature in Zope 2 since the first Five years. Exploring a well designed Python package starts with its ZCML files and its main “interfaces.py” module.

But newbies as I have been and others have pain to remember the various ZCML directives available, as well as the detailed attributes of them.

Of course there are some documentations in printed books or in various blogs or docs about most directives. But there’s no central point (unless I didn’t search correctly) where you can read the documentation for all ZCML directives available in your Zope 2 instance with third party components that could add new ZCML vocabulary.

Of course, you may grep all “meta.zcml” files in your instance, search for the appropriate namespace, then the appropriate directive. And finally open the Python file that defines the schema of the mysterious ZCML, just as I explained in another ZCML related blog post.

Grepping the “zope.configuration”, I hopefully found a magic function that provides a structured tree of all the registered ZCML directives well suited to provide a live documentation.

After some hours of work and exploration, I’m proud to give to the Zope 2 community “aws.zope2zcmldoc” that provides a live documentation on all ZCML namespaces, directives and subdirectives installed in your Zope 2 instance.

Some screenshots

Available from the standard Zope control panel

Available from the standard Zope control panel

All namespaces

All ZCML namespaces

The "browser" namespace

All directives from the "browser" namespace

The "pages" directive

The "pages" directive in details

You can notice that the description text are translated in your favorite language when the translation is available.

aws.zope2zcmldoc is the new companion of Products.DocFinderTab, plone.reload, Products.Clouseau and zope2.zodbbrowser (and perhaps others I forgot, sorry) to your development instances.

Any feedback, is welcome.  Enjoy !

Ah yes, and many thanks to my actual employer Alter Way for sponsoring this piece of software.

Advertisements

4 thoughts on “ZCML Wadda ? Want a live ZCML doc ?

  1. encolpe says:

    Hello Gilles,

    Does it work without adding ‘enable-products-installation = on’ in Zope 2.12 and Zope 2.13 ?

  2. Gilles Lenfant says:

    Hello Encolpe,

    Yes it works on Zope 2.12 whatever’s ‘enable-products-installation’ setting as it is not registered as old Zope 2 style product. I didn’t test anything in Zope 2.13. Your test report / contributions for Zope 2.13 support are welcome ;).

    Ah ! Something that is not really emphasized in the doc : I could not add an automatic installation of the control panel entry that works transparently on all Zope versions. You need to go as manager to http://your-zope-root/@@install-aws-zope2zcmldoc to perform the control panel entry installation.

  3. yboussard says:

    looks great !!!
    thanks gilles

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives

%d bloggers like this: