Required Plone 4 smarter updates

The core of the problem is that GenericSetup profiles are additive. Sometimes products cannot be upgraded by simply applying profiles, and the entire chain of profiles must be applied in a specific order.

For example, let's say that we have many independent site policies (only one of them applies to the plone instance): S1, S2, ...., SN. And several products, for example A and B. For example, all those S1-SN, A and B have metadata dependencies that look like this: Sn → A → B

Suppose they are dealing with registry.xml and overriding something along the way. (The same could be the case with the info type and some other profile steps). If something changes in product A, which may or may not be redefined in S1, we cannot just perform the update step for A, because when we click on the button on site S1, its own policy redefinitions will be lost. However, it is very important to write update steps for the entire S1-SN just because the change is in A.

Is there any smart way to make updates, at least for the case described above, when the whole problem will be solved by applying the registry update in a certain order, namely: B, A, Sn. (even then there may be some difficult cases)?

Since package A has no idea about S1 (or S2 or any site policy), one of the solutions is to create some kind of "superpack", which may have explicit information about these chains of updates. But are there other solutions besides always putting the resulting profile in politics?

(For simplicity, forget that some changes can be made over the Internet)

+3
source share
2 answers

It was decided to go with a custom solution, with auxiliary functions to simplify the general update task. Does not solve all problems, but helps to deploy.

0
source

GS, , , . GS upgradeStep.

, 1 2. zcml :

  <genericsetup:upgradeStep
      title="Upgrade myproduct from revision 1 to 2"
      description=""
      source="1"
      destination="2"
      handler="myproduct.one_to_two.upgrade"
      sortkey="1"
      profile="myproduct:default"
      />

one_to_two.py

def upgrade(context):
    registry = getUtility(IRegistry)
    if 'foo' in registry:
        do_stuff()

, :

context.runImportStepFromProfile('profile-myproduct:default','actions')

, , , , .

.

+1

All Articles