Changeset 2376 in products


Ignore:
Timestamp:
May 25, 2010 2:34:32 PM (11 years ago)
Author:
mylan
Message:

Added upgrade steps from 1.0 to 1.1 and from 1.1 to 1.2 versions

Location:
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/Extensions/Install.py

    r1593 r2376  
    11from Products.CMFCore.utils import getToolByName 
     2from Products.GenericSetup.upgrade import _upgrade_registry 
    23 
    34PROFILE = "profile-quintagroup.plonegooglesitemaps:default" 
     
    910    mtool = getToolByName(self, 'portal_migration') 
    1011    plone_version = mtool.getFileSystemVersion() 
     12    isPlone3 = plone_version.startswith('3') 
     13    isPlone4 = plone_version.startswith('4') 
    1114 
    12     if plone_version.startswith('3'): 
     15    if reinstall and (isPlone3 or isPlone4): 
     16        step = None 
     17        profile_id = 'quintagroup.plonegooglesitemaps:default' 
     18        steps_to_run = [s['id'] for s in setup_tool.listUpgrades(profile_id, show_old=False)] 
     19        for step_id in steps_to_run: 
     20            step = _upgrade_registry.getUpgradeStep(profile_id, step_id) 
     21            step.doStep(setup_tool) 
     22            msg = "Ran upgrade step %s for profile %s" % (step.title, profile_id) 
     23            logger.log(logging.INFO, msg) 
     24        # We update the profile version to the last one we have reached 
     25        # with running an upgrade step. 
     26        if step and step.dest is not None and step.checker is None: 
     27           setup_tool.setLastVersionForProfile(profile_id, step.dest) 
     28        return "Ran all reinstall steps." 
     29 
     30    if (isPlone3 or isPlone4): 
    1331        # if this is plone 3.x 
    1432        (ps.aq_base).__of__(self).runAllImportStepsFromProfile(PROFILE) 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/configure.zcml

    r1724 r2376  
    2626      /> 
    2727 
     28  <genericsetup:upgradeStep 
     29      title="Upgrade Plone Google Sitemaps" 
     30      description="Upgrade quintagroup.plonegooglesitemaps 1.0 to 1.1" 
     31      source="*" 
     32      destination="1.1" 
     33      handler=".upgrades.upgrade_1_0_to_1_1" 
     34      sortkey="1" 
     35      profile="quintagroup.seoptimizer:default" /> 
     36 
     37  <genericsetup:upgradeStep 
     38      title="Upgrade Plone Google Sitemaps" 
     39      description="Upgrade quintagroup.plonegooglesitemaps 1.1 to 1.2" 
     40      source="*" 
     41      destination="1.2" 
     42      handler=".upgrades.upgrade_1_1_to_1_2" 
     43      sortkey="2" 
     44      profile="quintagroup.seoptimizer:default" /> 
     45 
    2846    <!-- -*- extra stuff goes here -*- --> 
    2947 
Note: See TracChangeset for help on using the changeset viewer.