[Checkins] SVN: Products.CMFDefault/branches/2.2/Products/CMFDefault/ - added actions upgrade from older CMFCore migration script
Jens Vagelpohl
jens at dataflake.org
Thu Dec 10 03:48:28 EST 2009
Log message for revision 106363:
- added actions upgrade from older CMFCore migration script
Changed:
U Products.CMFDefault/branches/2.2/Products/CMFDefault/CHANGES.txt
U Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/configure.zcml
U Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/to21.py
-=-
Modified: Products.CMFDefault/branches/2.2/Products/CMFDefault/CHANGES.txt
===================================================================
--- Products.CMFDefault/branches/2.2/Products/CMFDefault/CHANGES.txt 2009-12-10 01:14:04 UTC (rev 106362)
+++ Products.CMFDefault/branches/2.2/Products/CMFDefault/CHANGES.txt 2009-12-10 08:48:28 UTC (rev 106363)
@@ -4,9 +4,10 @@
2.2.0 (unreleased)
------------------
-- Upgrade steps: Merged faulty utility registration fixup script
- and tool utility registration from Products.CMFCore for
- pre-2.1.0 instances into a GenericSetup upgrade step
+- Upgrade steps: Merged faulty utility registration fixup script,
+ tool utility registration and new-style actions upgrade from
+ an older migration script in Products.CMFCore for pre-2.1.0
+ instances into GenericSetup upgrade steps
- WorkflowTool/DiscussionItem: Create a set of GenericSetup
upgrade steps to instantiate the new single-state workflow
Modified: Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/configure.zcml
===================================================================
--- Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/configure.zcml 2009-12-10 01:14:04 UTC (rev 106362)
+++ Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/configure.zcml 2009-12-10 08:48:28 UTC (rev 106363)
@@ -68,6 +68,12 @@
checker=".to21.check_tool_utility_registrations"
/>
+ <genericsetup:upgradeStep
+ title="Instantiate new-style actions"
+ handler=".to21.upgrade_to_newstyle_actions"
+ checker=".to21.check_newstyle_actions"
+ />
+
</genericsetup:upgradeSteps>
<genericsetup:upgradeStep
Modified: Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/to21.py
===================================================================
--- Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/to21.py 2009-12-10 01:14:04 UTC (rev 106362)
+++ Products.CMFDefault/branches/2.2/Products/CMFDefault/upgrade/to21.py 2009-12-10 08:48:28 UTC (rev 106363)
@@ -254,3 +254,23 @@
logger.info('Registered %s for interface %s' % (
tool_id, tool_interface))
+def check_newstyle_actions(tool):
+ """2.1.0-alpha to 2.1.0 upgrade step checker
+ """
+ portal = aq_parent(aq_inner(tool))
+ if not portal.portal_actions.objectIds(['CMF Action Category']):
+ return True
+
+ return False
+
+def upgrade_to_newstyle_actions(tool):
+ """2.1.0-alpha to 2.1.0 upgrade step handler
+ """
+ logger = logging.getLogger('GenericSetup.upgrade')
+ portal = aq_parent(aq_inner(tool))
+ if not portal.portal_actions.objectIds(['CMF Action Category']):
+ tool.runImportStepFromProfile( 'profile-Products.CMFDefault:default'
+ , 'actions'
+ )
+ logger.info('Instantiated new-style actions in portal_actions')
+
More information about the checkins
mailing list