Changeset 1519 in products for quintagroup.seoptimizer
- Timestamp:
- Jan 5, 2010 12:20:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/setuphandlers.py
r1516 r1519 1 1 import logging 2 2 from Products.CMFCore.utils import getToolByName 3 from Products.CMFCore.Expression import Expression 3 4 4 5 logger = logging.getLogger('quintagroup.seoptimizer') 5 6 6 7 7 def migrationActions(site): 8 8 old = 'qseo_properties_edit_form' 9 9 new = '@@seo-context-properties' 10 condition = "python:exists('portal/@@seo-context-properties')" 11 seo_props = site.portal_properties.seo_properties 12 content_types_seoprops_enabled = list(seo_props.getProperty('content_types_seoprops_enabled')) 10 13 for ptype in site.portal_types.objectValues(): 11 acts = filter(lambda x: x.id == 'seo_properties' and old in x.getActionExpression(), ptype.listActions())14 acts = filter(lambda x: x.id == 'seo_properties' , ptype.listActions()) 12 15 for act in acts: 16 log = 0 17 if ptype.id not in content_types_seoprops_enabled: 18 content_types_seoprops_enabled.append(ptype.id) 19 if not act.condition: 20 act.condition = Expression(condition) 21 log = 1 13 22 ac_exp = act.getActionExpression() 14 23 if old in ac_exp: 15 24 act.setActionExpression(ac_exp.replace(old, new)) 16 logger.log(logging.INFO, "For %s type changed URL Expression \"SEO Properties\" action's from %s to %s." % (ptype.id, old, new)) 25 log = 1 26 if log: 27 logger.log(logging.INFO, "Updated \"SEO Properties\" action in %s type." % ptype.id) 28 seo_props.manage_changeProperties(content_types_seoprops_enabled=tuple(content_types_seoprops_enabled)) 29 17 30 18 31 def importVarious(context):
Note: See TracChangeset
for help on using the changeset viewer.