For those of you who like to live on the bleeding edge, or who just like
to see what is going to show up in the future this may be interesting.

In the last week I merged three GenericSetup branches I've been working
on for a while into trunk: zcml based step registration, z3 events and
dependency support.

ZCML step registration allows you to register GenericSetup import and
export steps using zcml instead of import_steps.xml and export_steps.xml
files in GenericSetup profiles. This has two clear advantages: whenever
you install a product in your instance all its import and exports steps
are immediately available - you no longer have to load a profile which
registers them first. This makes the step registration a lot more
predictable. The other advantage is that removing your product will also
mean its steps are no longer available. So no more broken old steps
that keep collecting in your portal_setup. The zcml is quite simple and
looks like this:

<configure
    xmlns:genericsetup="http://namespaces.zope.org/genericsetup";
    i18n_domain="genericsetup">
  <genericsetup:importStep
      name="name"
      title="title"
      description="description"
      handler="Products.GenericSetup.tests.test_zcml.dummy_importstep_handler">
    <depends name="something.else"/>
  </genericsetup:importStep>
</configure>

one thing that you may notice is that there no longer is a version
parameter for import steps. Since this was never used that has been
deprecated and support for it will eventually be removed.

The other change is support for dependencies in a profile. A
GenericSetup profile can include a metadata.xml file which contains some
useful information about that profile. It looks like this:

<metadata>
  <description>This is the profile description</description>
  <version>1.0</version>
  <dependencies>
    <dependency>profile-Products.foo:default</dependency>
    <dependency>profile-Products.bar:default</dependency>
  </dependencies>
</metadata>

the version number is used when handling GenericSetup upgrade steps and
has been around for a while (it ships with Plone 3). (On a side note:
the fallback logic that will use the version.txt of your product has
been marked as deprecated as well - mixing configuration versions with
product release versions was a bad idea.) The dependency elements are
new: you can use those to tell GenericSetup that when it imports that
profile it should first do an import on those two contexts. This will
work recursively, with a simple check to seen it will not run into
dependency loops. This feature basically allows you to declare
dependencies between different products - GenericSetup will take care of
handling your dependencies.

To top this off I made a branch of CMFQuickInstallerTool
(wichert-gs-events) which uses the new set of events from GenericSetup to
detect succesfull full profile imports and automatically mark products
as installed if their profile has been imported. If you use this you
will see all dependencies of your product automatically being installed,
including all the usual snapshotting of context CMFQuickInstallerTool
does which allows it to easily do an uninstall.

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to