Applying Policies at Site Creation Time
Those of you who have been doing Plone product development for a while are probably familiar with customization policies. Customization policies are site configuration bundles, defined in the older python-based semantics, that can be applied to a Plone site. One of the more handy features of customization policies is that they could be made to show up as an option when the Plone site was first created. If you didn't select one, you would get a default Plone site, but if you did, your site would get a bunch of extra configuration applied.
Unfortunately, customization policies are currently not supported in Plone 2.5. There has been some justified grumbling about this; they were not given a suitable deprecation period. The good news is that GenericSetup provides the same ability, and that it is quite easy to convert existing customization policies to GenericSetup profiles (although these profiles will consist of just a single handler that calls all of the pre-existing customization policy code).
First let's look at how GenericSetup profiles are defined. This is done using a profile_registry mechanism provided by GenericSetup, which can be imported into your product as so:
from Products.GenericSetup import profile_registry
Also defined are some constants for specifying the type of profile you are registering:
from Products.GenericSetup import BASE, EXTENSION
Once you have done these imports, a simple call to the profile_registry will register your profile. (Duh.) Here is what this call looks like for the membrane product:
profile_registry.registerProfile('default',
'membrane',
'Extension profile for membrane',
'profiles/default',
'membrane',
EXTENSION,
for_=IPloneSiteRoot)
I'm not going to go into a detailed description of all of the arguments (you can see the IProfileRegistry interface for that), but I will draw your attention to the final "for_" argument. This allows you to specify an interface that denotes the type of portal that the profile is meant to be used with. If you use the IPloneSiteRoot interface, defined for this purpose, then when you add a new Plone site, your profile will automatically show up as available to be applied when the site is created. Here is a screen shot of the Plone add form when a number of extension profiles have been registered:

In order to create an Extension Profile from a Customization Policy, then, you would perform the following steps:
- Register an extension profile with the GenericSetup profile registry (don't forget 'for_ = IPloneSiteRoot').
- Add a single import step in import_steps.xml, which calls a 'runPolicy' handler.
- Write the runPolicy function, which should accept a 'context' argument, but which simply calls the same code that the customization policy calls.