Warning

This document hasn't been checked for compatibility with current versions of Plone. Use at your own risk.

Configuration management

by Joel Burton last modified May 11, 2010 07:32 PM
Managing different configurations across Plone sites is important. Too many people stick configuration in the ZMI, and have no setup scripts.

Throw out your database. It's liberating. —Kapil Thangavelu

Everyone that's worked with Zope for more than a few months has encountered "ZODB Dread": that awful, sinking feeling that you've sunk a chunk of your very life into a single, binary-format object database, with no hope you'll ever be able to remember all the scripts, skins, properties, and settings you've put into it. You konw that if this puppy ever gets badly corrupted, you're going to be in a world of hurt. This is what we want to avoid, and that's why we create setup code on the file system.

Writing Setup Code

General advice:

  • Each setup function is method that you can call independently.
  • Registry of functions.
  • Can either prevent calling twice, or delete and re-create, as appropriate.

How I Learned To Stop Worrying and Love the API

DocFinderTab
DocFinderTab gives you instant, through-the-web access to the API for any object you can get to in the ZMI. In many ways, it's nicer than looking through the source code, since you see all the methods of the base classes, and nicer that looking in the debugger, because you get things arranged by base class. This product is dead simple to install and use. There's no excuse for not trying it out today. This really should get shipped as part of Zope.
Epydoc
Epydoc is a smarter and more featureful version of the pydoc module that ships with Zope. It builds handsome, indexed API documentation for your product, or even for Zope and Plone itself. It can even generate this as a PDF, which impresses clients and saves you time in creating this kind of documentation. Plus, actually seeing your docstrings typeset is a good incentive to write better ones.
Other products' Install.py files
A great way to see how to configure things is to see how other products do it, of course. Look at the Install.py for your favorite product. For example, to learn how to install new workflows from disk, see how we do this in PloneHelpCenter (in the collective.)

CMF 1.5

Includes a XML dumper for many (but not yet all) CMFCore/Default tools
So, you can make the changes in the ZMI, quickly and intuitively, then get a snapshot of these chages. These snapshots can be checked into your version control system, diff'ed, etc. And you can restore from a snapshot, makig it easier to step back to a different setup.
Won't need to make API calls
For most things, at least.

CMF 1.5-compatibility and dumpers for our tools might land for Plone 2.1.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.