Personal tools
You are here: Home Documentation Tutorials Understanding and Using GenericSetup in Plone The Setup Tool
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

The Setup Tool

Continuation of the high level GenericSetup overview, wherein we learn about the portal_setup tool and how to use it to apply profiles.

Rob Miller

A detailed look at GenericSetup, wherein we will learn what it is and how it can be used within Plone.
Page 3 of 10.

Now that you know what profiles are, and what they look like, you're probably starting to get a little bit curious about how you'd actually APPLY these profiles to your sites.  This is understandable.  Profiles aren't really much use all by themselves.  You have to be able to USE them before they become useful.  That's why they call it USEful, after all, isn't it.  Ahem.

Anyway, the next thing you need to know about is the setup tool, which in Plone 2.5 and beyond should always exist as portal_setup at the root of your Plone site.  The tool encapsulates all of the behaviour and (for now) all of the interface related to site configuration profile management.  At the time of writing this, the interface is still a bit raw, but it is quite powerful and easy to use once you get the hang of it.

The first thing to know about the setup tool is that it is stateful.  Specifically, I mean that at any given time, the setup tool is working in relation to an "active" profile.  You can see which profile is currently active, as well as set the active profile from any of the available profiles, on the portal_setup properties tab in the ZMI:




The "Plone Site" profile that is currently active in the example above is the default Plone base profile, the one that is used whenever you add a Plone site using the ZMI.  Once you know what profile is active, you can click on the Import tab to see the import steps that are currently registered:



As you might guess, these import steps are directly related to the contents of the "import_steps.xml" file that is in the profile definition.  Also, although you can't see it in the screenshot above, at the bottom of the import page are the following two buttons:

If you click the button on the right, then all of the import steps listed on the page will be run against your site, and all of the configuration defined in the active profile will be applied.  If you click the button on the left, then only the import steps for which you have checked the corresponding box will be applied to your site.  Groovy?  You bet!


Important: Look in your list of steps for an item called "Content" (NOT "Content Type Registry").  If you import this step, anything that you have in your site that was not part of the setup process will be overwritten.


The Gotcha

And now, my friends, we've come to an important moment.  We have now come to the point where I describe to you, the gentle reader, the first and perhaps most striking GenericSetup "gotcha".  You might imagine that when you select a new profile to be the active profile, and then you browse back to the import tab, that you would ONLY see the import steps that were related to the active profile.  This is NOT the case, however.  Nope, it's not.  Listen: the import steps that a profile registers are additive.  That means that whenever you select a new profile as the active configuration, any new import steps are ADDed (get it, ADDitive... oh, never mind) to the set of already registered import steps.  Therefore, whenever you select a new profile as the active profile, you will never see fewer import steps, you will only (possibly) see more.

I know how that makes you feel... you're currently crying an anguished, mournful banshee wail, a long drawn out "Why oh why!  Why did they have to make this behavior so unintuitive?  Why did they not simply list the import steps for the currently active profile?  Oh, woe is me!"

To which I reply, "Wow, you really should take this stuff less seriously."

All that aside, I'll admit that this behaviour seems a bit odd, at first.  There's a method to the madness, however.  Please read on...

 
by Rob Miller last modified March 15, 2007 - 20:15 All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by