Introduction

by Rob Miller last modified Feb 04, 2009 02:34 AM

An introduction, wherein we learn what GenericSetup is and why we even care.

What is GenericSetup?  I'm glad you've asked... of course, since I'm the one writing this tutorial, you really didn't have much choice but to ask, did you?  But even though I put the words into your mouth, I think that in the end you will also be glad you asked.  GenericSetup is a major step forward in managing Plone site configuration, and GenericSetup is a core part of how Plone handles its own site creation process.

Okay, that's all well and good.  But what is it?  Simply put, GenericSetup is a Zope-based toolkit for managing site configuration.  Not much clearer?  Maybe this would work better as a story:

Meet Guy Ablaze.  Guy is a Plone site developer, who manages websites built with Plone, and even develops add-on products for Plone using Python.  Guy never uses Plone just out of the box.  Instead, he does a lot of customization for every site he deploys.  All of his sites have custom skins, where the CSS and template modifications live.  A lot of his sites use custom content types.  Rarely does he find that the default site tabs are to his liking; he often replaces those with custom tabs.  And there are a myriad of little tweaks and adjustments that he makes to each site, to get it working just so, to satisfy his demanding customers' diverse requirements.

Guy knows that it is a good idea to be able to recreate a customer's site without having to do a lot of twiddling in the ZMI, so he creates install methods for each of the sites that he manages.  These install methods are written in Python.  Each one is comprised of a bunch of steps.  One step is to install custom skins, containing the site's look and feel.  Another step might be to install some custom types, while a third customizes the site tabs.  And of course there are a bunch of little steps that correspond to all of the miscellaneous tweaks that he's made.

Guy is reasonably happy with this arrangement, but, you know, there are some ways that it could be better.  First, he finds that he has to write a lot of repetitive boilerplate code in his various install methods.  Also, using Python instructions to describe how his site should be configured doesn't really fit his brain.  He'd much rather just be able to make a list of the types he wants and have them automatically get installed.  Also, it would be great if he could not only import site configuration, but export site configuration.  As in, he wants to make some changes to the site, maybe using the Plone interface, maybe using the ZMI, and then be able to spit that out to be loaded somewhere else.  And, wow, the mind boggles... wouldn't it be great to be able to compare site configurations?  To be able to ask "What has been manually changed in my site since I did the original installation?" and get a meaningful answer?

Luckily, Guy CAN do all of these things, and more, using GenericSetup!

I know, I know... It's tremendously exciting!  I'll give you a minute to pick your jaw up off the floor, to fully react to and conquer your disbelief before going on.

.... time passes ....

Recovered yet?  Good, then let's learn more...