[Zope-CMF] Re: <genericsetup:upgradeRerunImportStep> (was Re: Multiple GS profiles per product)

Maurits van Rees m.van.rees at zestsoftware.nl
Tue May 20 05:39:41 EDT 2008


Rob Miller, on 2008-05-20:
> it's maybe worth mentioning here that i _have_ recently started
> using GS's upgrade machinery, and have been quite happy with it.
> the one thing that i've missed, which i'd like to add to the GS core
> if there's no strong objection, is the ability to easily register
> re-running a particular import step as a part of an upgrade path.
>
> i propose introducing <genericsetup:upgradeRerunImportStep>, which
> could be used as a standalone tag or nested within the grouping
> defined by a <genericsetup:upgradeSteps> tag.  it would function
> similarly to a regular upgrade step, except instead of running an
> arbitrary callable handler, it would rerun a registered import step
> within the context of the profile with which the step is registered.
>
> it would also support an optional boolean purge attribute, which would be 
> passed in to the import step execution as the purge argument.
>
> a sample usage might look like this:
>
>
><configure xmlns="http://namespaces.zope.org/zope"
>             xmlns:genericsetup="http://namespaces.zope.org/genericsetup">
>
>    <genericsetup:upgradeSteps
>       profile="PACKAGE_NAME:default"
>       source="1.0"
>       destination="1.1"
>       sortkey="10">
>
>      <genericsetup:upgradeRerunImportStep
>         stepid="typeinfo" />
>
>      <genericsetup:upgradeRerunImportStep
>         stepid="workflow"
>         purge="True" />
>
>      <genericsetup:upgradeStep
>         title="Do something special"
>         description="Does something special"
>         handler=".upgrades.do_something_special"
>         />
>
>    </genericsetup:upgradeSteps>
>
></configure>

And where are the original typeinfo and workflow upgrade steps
defined?  Are they in some other zcml file of your product?  Or would
they be general upgradesteps defined by GenericSetup, available for
any products?

I *could* imagine for example a general workflow upgrade step that
reapplies the security settings based on some new workflow settings
that your product has just defined.  Although really that could be
done like this, without needing to define a new zcml directive:

    <genericsetup:upgradeStep
       title="Workflow upgrade for my product"
       description="Same here"
       handler="Products.GenericSetup.upgrades.apply_security_settings"
       />

So GenericSetup would then define some default upgrade handlers, just
like it defines some export/import handlers.

Would that suit your use case or are you thinking of something else?

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]



More information about the Zope-CMF mailing list