Back to index

plone3  3.1.7
Functions | Variables
migrateToCMF21 Namespace Reference

Functions

def _log
def migrate_site

Variables

tuple logger = getLogger('event.migrateToCMF21')
dictionary AFFECTED_EXTENSIONS
list BAD_UTILITIES
tuple sites = app.ZopeFind(app, obj_metatypes=['CMF Site'], search_sub=1)

Function Documentation

def migrateToCMF21._log (   msg) [private]

Definition at line 54 of file migrateToCMF21.py.

00054 
00055 def _log(msg):
00056     logger.info(msg)
00057     print msg
00058 

Here is the caller graph for this function:

Migrate a single site

Definition at line 59 of file migrateToCMF21.py.

00059 
00060 def migrate_site(site):
00061     """ Migrate a single site
00062     """
00063 
00064     site_path = '/'.join(site.getPhysicalPath())
00065     _log(' - converting site at %s' % site_path)
00066     ps = site.portal_setup
00067 
00068     # We have to call setSite to make sure we have a site with a proper
00069     # acquisition context.
00070     setSite(site)
00071 
00072     # First we remove utility registrations that are no longer
00073     # needed.
00074     sm = getSiteManager(site)
00075     for util in BAD_UTILITIES:
00076         iface = resolve(util)
00077         if sm.queryUtility(iface) is not None:
00078             sm.unregisterUtility(provided=iface)
00079 
00080     # Next we need to run items from the default CMF Site profile
00081 
00082     # Check if we have new-style action providers, if not we need to
00083     # run the action provider step from CMFDefault:default as well
00084     if not site.portal_actions.objectIds(['CMF Action Category']):
00085         steps = ('actions',) # Runs componentregistry as dependency
00086     else:
00087         steps = ('componentregistry',)
00088 
00089     for step in steps:
00090         ps.runImportStepFromProfile('profile-Products.CMFDefault:default',
00091                 step, run_dependencies=True)
00092 
00093     # Now we go through the extensions that may need to be run
00094     for extension_id, object_id in AFFECTED_EXTENSIONS.items():
00095         if object_id in site.objectIds():
00096             ps.runImportStepFromProfile('profile-' + extension_id,
00097                     'componentregistry', run_dependencies=True)
00098 
00099     _log(' - finished converting site at %s' % site_path)
00100 

Here is the call graph for this function:


Variable Documentation

Initial value:
00001 { 
00002       'Products.CMFCalendar:default' : 'portal_calendar'
00003     , 'Products.CMFUid:default' : 'portal_uidhandler'
00004     , 'Products.CMFActionIcons:actionicons' : 'portal_actionicons'
00005     }

Definition at line 32 of file migrateToCMF21.py.

Initial value:
00001 [
00002     'Products.CMFCalendar.interfaces.ICalendarTool',
00003     'Products.CMFCore.interfaces.IActionsTool',
00004     'Products.CMFCore.interfaces.ICatalogTool',
00005     'Products.CMFCore.interfaces.IContentTypeRegistry',
00006     'Products.CMFCore.interfaces.ISkinsTool',
00007     'Products.CMFCore.interfaces.ITypesTool',
00008     'Products.CMFCore.interfaces.IURLTool',
00009     'Products.CMFCore.interfaces.IConfigurableWorkflowTool',
00010     'Products.CMFCore.interfaces.IMembershipTool',
00011     'Products.CMFCore.interfaces.IMetadataTool',
00012     'Products.CMFCore.interfaces.IRegistrationTool',
00013     ]

Definition at line 40 of file migrateToCMF21.py.

tuple migrateToCMF21.logger = getLogger('event.migrateToCMF21')

Definition at line 27 of file migrateToCMF21.py.

tuple migrateToCMF21.sites = app.ZopeFind(app, obj_metatypes=['CMF Site'], search_sub=1)

Definition at line 106 of file migrateToCMF21.py.