Back to index

plone3  3.1.7
Classes | Functions | Variables
CMFPlone.migrations.v3_0.alphas Namespace Reference

Classes

class  installKss

Functions

def three0_alpha1
def alpha1_alpha2
def alpha2_beta1
def enableZope3Site
def migrateOldActions
def addNewCSSFiles
def addDefaultAndForbiddenContentTypesProperties
def addMarkupConfiglet
def addIconForMarkupConfiglet
def addTypesConfiglet
def addIconForTypesConfiglet
def _check_ascii
def updateActionsI18NDomain
def updateFTII18NDomain
def addPortletManagers
def convertLegacyPortlets
def installProduct
def addIconForCalendarSettingsConfiglet
def addCalendarConfiglet
def updateSearchAndMailHostConfiglet
def removeGeneratedCSS
def addFormTabbingJS
def addFormInputLabelJS
def registerToolsAsUtilities
def installRedirectorUtility
def addContentRulesAction
def installContentRulesUtility
def addReaderAndEditorRoles
def migrateLocalroleForm
def reorderUserActions
def updateRtlCSSexpression
def installS5
def addIconForMaintenanceConfiglet
def addMaintenanceConfiglet
def addMaintenanceProperty
def addWebstatsJSProperty
def addLinkIntegritySwitch
def addWebstatsJSFile
def addTableContents
def updateMemberSecurity
def updatePASPlugins
def updateSkinsAndSiteConfiglet
def updateConfigletTitles
def addIconsForFilterAndSecurityConfiglets
def addFilterAndSecurityConfiglets
def addSitemapProperty
def updateKukitJS
def addCacheForResourceRegistry
def removeTablelessSkin
def updateCssQueryJS
def removeHideAddItemsJS
def addContentRulesConfiglet
def addIconForContentRulesConfiglet
def addObjectProvidesIndex
def removeMyStuffAction
def addExternalLinksOpenNewWindowProperty
def addMissingWorkflows
def addManyGroupsProperty
def restorePloneTool
def updateImportStepsFromBaseProfile
def installI18NUtilities
def addEmailCharsetProperty

Variables

tuple registration
tuple invalid_regs

Function Documentation

Definition at line 567 of file alphas.py.

00567 
00568 def _check_ascii(text):
00569     try:
00570         unicode(text, 'ascii')
00571     except UnicodeDecodeError:
00572         return False
00573     return True
00574 

Here is the caller graph for this function:

Definition at line 1169 of file alphas.py.

01169 
01170 def addCacheForResourceRegistry(portal, out):
01171     ram_cache_id = 'ResourceRegistryCache'
01172     if not ram_cache_id in portal.objectIds():
01173         RAMCacheManager.manage_addRAMCacheManager(portal, ram_cache_id)
01174         cache = getattr(portal, ram_cache_id)
01175         settings = cache.getSettings()
01176         settings['max_age'] = 24*3600 # keep for up to 24 hours
01177         settings['request_vars'] = ('URL',)
01178         cache.manage_editProps('Cache for saved ResourceRegistry files', settings)
01179         out.append('Created RAMCache %s for ResourceRegistry output' % ram_cache_id)
01180     reg = getToolByName(portal, 'portal_css', None)
01181     if reg is not None and getattr(aq_base(reg), 'ZCacheable_setManagerId', None) is not None:
01182         reg.ZCacheable_setManagerId(ram_cache_id)
01183         reg.ZCacheable_setEnabled(1)
01184         out.append('Associated portal_css with %s' % ram_cache_id)
01185     reg = getToolByName(portal, 'portal_javascripts', None)
01186     if reg is not None and getattr(aq_base(reg), 'ZCacheable_setManagerId', None) is not None:
01187         reg.ZCacheable_setManagerId(ram_cache_id)
01188         reg.ZCacheable_setEnabled(1)
01189         out.append('Associated portal_javascripts with %s' % ram_cache_id)
01190 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the configlet for the calendar settings

Definition at line 646 of file alphas.py.

00646 
00647 def addCalendarConfiglet(portal, out):
00648     """Add the configlet for the calendar settings"""
00649     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
00650     if controlPanel is not None:
00651         haveCalendar = False
00652         for configlet in controlPanel.listActions():
00653             if configlet.getId() == 'CalendarSettings':
00654                 haveCalendar = True
00655         if not haveCalendar:
00656             controlPanel.registerConfiglet(id         = 'CalendarSettings',
00657                                            appId      = 'Plone',
00658                                            name       = 'Calendar',
00659                                            action     = 'string:${portal_url}/@@calendar-controlpanel',
00660                                            category   = 'Plone',
00661                                            permission = ManagePortal,)
00662             out.append("Added calendar settings to the control panel")
00663 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 783 of file alphas.py.

00783 
00784 def addContentRulesAction(portal, out):
00785     portal_actions = getToolByName(portal, 'portal_actions', None)
00786     if portal_actions is not None:
00787         object_category = getattr(portal_actions, 'object', None)
00788         if object_category is not None:
00789             if 'contentrules' not in object_category.objectIds():
00790                 new_action = Action('contentrules',
00791                                     title='Rules',
00792                                     description='',
00793                                     url_expr='string:${plone_context_state/canonical_object_url}/@@manage-content-rules',
00794                                     available_expr="python:plone_context_state.canonical_object().restrictedTraverse('@@plone_interface_info').provides('plone.contentrules.engine.interfaces.IRuleAssignable')",
00795                                     permissions='Content rules: Manage rules',
00796                                     visible=True)
00797                 object_category._setObject('contentrules', new_action)
00798                 out.append("Added content rules action to object category")
00799 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the configlet for the contentrules settings

Definition at line 1224 of file alphas.py.

01224 
01225 def addContentRulesConfiglet(portal, out):
01226     """Add the configlet for the contentrules settings"""
01227     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
01228     if controlPanel is not None:
01229         haveContentRules = False
01230         for configlet in controlPanel.listActions():
01231             if configlet.getId() == 'ContentRulesSettings':
01232                 haveContentRules = True
01233         if not haveContentRules:
01234             controlPanel.registerConfiglet(id         = 'ContentRules',
01235                                            appId      = 'Plone',
01236                                            name       = 'Content Rules',
01237                                            action     = 'string:${portal_url}/@@rules-controlpanel',
01238                                            category   = 'Plone',
01239                                            permission = 'Content rules: Manage rules',)
01240             out.append("Added 'Content Rules Settings' to the control panel")
01241 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds sitewide config for default and forbidden content types for AT textfields.

Definition at line 471 of file alphas.py.

00471 
00472 def addDefaultAndForbiddenContentTypesProperties(portal, out):
00473     """Adds sitewide config for default and forbidden content types for AT textfields."""
00474     propTool = getToolByName(portal, 'portal_properties', None)
00475     if propTool is not None:
00476         propSheet = getattr(aq_base(propTool), 'site_properties', None)
00477         if propSheet is not None:
00478             if not propSheet.hasProperty('default_contenttype'):
00479                 propSheet.manage_addProperty('default_contenttype', 'text/html', 'string')
00480             out.append("Added 'default_contenttype' property to site_properties.")
00481             if not propSheet.hasProperty('forbidden_contenttypes'):
00482                 propSheet.manage_addProperty('forbidden_contenttypes', [], 'lines')
00483                 propSheet.forbidden_contenttypes = (
00484                     'text/structured',
00485                     'text/x-rst',
00486                     'text/plain-pre',
00487                     'text/x-python',
00488                     'text/x-web-markdown',
00489                     'text/x-web-textile',
00490                     'text/x-web-intelligent')
00491             out.append("Added 'forbidden_contenttypes' property to site_properties.")
00492 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1395 of file alphas.py.

01395 
01396 def addEmailCharsetProperty(portal, out):
01397     # Add email_charset property
01398     if not portal.hasProperty('email_charset'):
01399         portal.manage_addProperty('email_charset', 'utf-8', 'string')
01400     out.append("Added 'email_charset' property to the portal.")

Here is the caller graph for this function:

adds a site property to portal_properties

Definition at line 1279 of file alphas.py.

01279 
01280 def addExternalLinksOpenNewWindowProperty(portal, out):
01281     """ adds a site property to portal_properties"""
01282     tool = getToolByName(portal, 'portal_properties')
01283     sheet = tool.site_properties
01284     if not sheet.hasProperty('external_links_open_new_window'):
01285         sheet.manage_addProperty('external_links_open_new_window','false','string')
01286         out.append("Added 'external_links_open_new_window' property to site properties")
01287 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the configlets for the filter and security settings

Definition at line 1111 of file alphas.py.

01111 
01112 def addFilterAndSecurityConfiglets(portal, out):
01113     """Add the configlets for the filter and security settings"""
01114     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
01115     if controlPanel is not None:
01116         haveFilter = False
01117         haveSecurity = False
01118         for configlet in controlPanel.listActions():
01119             if configlet.getId() == 'HtmlFilter':
01120                 haveFilter = True
01121             if configlet.getId() == 'SecuritySettings':
01122                 haveSecurity = True
01123         if not haveFilter:
01124             controlPanel.registerConfiglet(id         = 'HtmlFilter',
01125                                            appId      = 'Plone',
01126                                            name       = 'HTML Filtering',
01127                                            action     = 'string:${portal_url}/@@filter-controlpanel',
01128                                            category   = 'Plone',
01129                                            permission = ManagePortal,)
01130             out.append("Added html filter settings to the control panel")
01131         if not haveSecurity:
01132             controlPanel.registerConfiglet(id         = 'SecuritySettings',
01133                                            appId      = 'SecuritySettings',
01134                                            name       = 'Security',
01135                                            action     = 'string:${portal_url}/@@security-controlpanel',
01136                                            category   = 'Plone',
01137                                            permission = ManagePortal,)
01138             out.append("Added security settings to the control panel")
01139 

Here is the call graph for this function:

Here is the caller graph for this function:

Add input-label.js to ResourceRegistries.

Definition at line 706 of file alphas.py.

00706 
00707 def addFormInputLabelJS(portal, out):
00708     """Add input-label.js to ResourceRegistries.
00709     """
00710     jsreg = getToolByName(portal, 'portal_javascripts', None)
00711     script = 'input-label.js'
00712     if jsreg is not None:
00713         script_ids = jsreg.getResourceIds()
00714         # Failsafe: first make sure the stylesheet doesn't exist in the list
00715         if script not in script_ids:
00716             jsreg.registerScript(script)
00717             out.append("Added " + script + " to portal_javascipt")
00718 

Here is the call graph for this function:

Here is the caller graph for this function:

Add form_tabbing.js to ResourceRegistries.

Definition at line 688 of file alphas.py.

00688 
00689 def addFormTabbingJS(portal, out):
00690     """Add form_tabbing.js to ResourceRegistries.
00691     """
00692     jsreg = getToolByName(portal, 'portal_javascripts', None)
00693     script = 'form_tabbing.js'
00694     if jsreg is not None:
00695         script_ids = jsreg.getResourceIds()
00696         # Failsafe: first make sure the stylesheet doesn't exist in the list
00697         if script not in script_ids:
00698             jsreg.registerScript(script)
00699             try:
00700                 jsreg.moveResourceAfter(script, 'collapsiblesections.js')
00701             except ValueError:
00702                 # put it at the bottom of the stack
00703                 jsreg.moveResourceToBottom(script)
00704             out.append("Added " + script + " to portal_javascipt")
00705 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds an icon for the calendar settings configlet. 

Definition at line 629 of file alphas.py.

00629 
00630 def addIconForCalendarSettingsConfiglet(portal, out):
00631     """Adds an icon for the calendar settings configlet. """
00632     iconsTool = getToolByName(portal, 'portal_actionicons', None)
00633     if iconsTool is not None:
00634         for icon in iconsTool.listActionIcons():
00635             if icon.getActionId() == 'CalendarSettings':
00636                 break # We already have the icon
00637         else:
00638             iconsTool.addActionIcon(
00639                 category='controlpanel',
00640                 action_id='CalendarSettings',
00641                 icon_expr='event_icon.gif',
00642                 title='Calendar Settings',
00643                 )
00644         out.append("Added 'calendar' icon to actionicons tool.")
00645 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds an icon for the maintenance settings configlet. 

Definition at line 1242 of file alphas.py.

01242 
01243 def addIconForContentRulesConfiglet(portal, out):
01244     """Adds an icon for the maintenance settings configlet. """
01245     iconsTool = getToolByName(portal, 'portal_actionicons', None)
01246     if iconsTool is not None:
01247         for icon in iconsTool.listActionIcons():
01248             if icon.getActionId() == 'ContentRules':
01249                 break # We already have the icon
01250         else:
01251             iconsTool.addActionIcon(
01252                 category='controlpanel',
01253                 action_id='ContentRules',
01254                 icon_expr='contentrules_icon.gif',
01255                 title='Content Rules',
01256                 )
01257         out.append("Added 'Content Rules Settings' icon to actionicons tool.")
01258 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds an icon for the maintenance settings configlet. 

Definition at line 913 of file alphas.py.

00913 
00914 def addIconForMaintenanceConfiglet(portal, out):
00915     """Adds an icon for the maintenance settings configlet. """
00916     iconsTool = getToolByName(portal, 'portal_actionicons', None)
00917     if iconsTool is not None:
00918         for icon in iconsTool.listActionIcons():
00919             if icon.getActionId() == 'Maintenance':
00920                 break # We already have the icon
00921         else:
00922             iconsTool.addActionIcon(
00923                 category='controlpanel',
00924                 action_id='Maintenance',
00925                 icon_expr='maintenance_icon.gif',
00926                 title='Maintenance',
00927                 )
00928         out.append("Added 'maintenance' icon to actionicons tool.")
00929 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds an icon for the markup settings configlet. 

Definition at line 513 of file alphas.py.

00513 
00514 def addIconForMarkupConfiglet(portal, out):
00515     """Adds an icon for the markup settings configlet. """
00516     iconsTool = getToolByName(portal, 'portal_actionicons', None)
00517     if iconsTool is not None:
00518         for icon in iconsTool.listActionIcons():
00519             if icon.getActionId() == 'MarkupSettings':
00520                 break # We already have the icon
00521         else:
00522             iconsTool.addActionIcon(
00523                 category='controlpanel',
00524                 action_id='MarkupSettings',
00525                 icon_expr='edit.gif',
00526                 title='Markup',
00527                 )
00528         out.append("Added markup configlet icon to actionicons tool.")     
00529 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds an icon for the types settings configlet. 

Definition at line 550 of file alphas.py.

00550 
00551 def addIconForTypesConfiglet(portal, out):
00552     """Adds an icon for the types settings configlet. """
00553     iconsTool = getToolByName(portal, 'portal_actionicons', None)
00554     if iconsTool is not None:
00555         for icon in iconsTool.listActionIcons():
00556             if icon.getActionId() == 'TypesSettings':
00557                 break # We already have the icon
00558         else:
00559             iconsTool.addActionIcon(
00560                 category='controlpanel',
00561                 action_id='TypesSettings',
00562                 icon_expr='document_icon.gif',
00563                 title='Types',
00564                 )
00565         out.append("Added types configlet icon to actionicons tool.")            
00566 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds icons for the filter and security configlets.

Definition at line 1082 of file alphas.py.

01082 
01083 def addIconsForFilterAndSecurityConfiglets(portal, out):
01084     """Adds icons for the filter and security configlets."""
01085     iconsTool = getToolByName(portal, 'portal_actionicons', None)
01086     filterIcon = False
01087     securityIcon = False
01088     if iconsTool is not None:
01089         for icon in iconsTool.listActionIcons():
01090             if icon.getActionId() == 'HtmlFilter':
01091                 filterIcon = True
01092             if icon.getActionId() == 'SecuritySettings':
01093                 securityIcon = True
01094         if not filterIcon:
01095             iconsTool.addActionIcon(
01096                 category='controlpanel',
01097                 action_id='HtmlFilter',
01098                 icon_expr='htmlfilter_icon.gif',
01099                 title='Html Filter Settings',
01100                 )
01101             out.append("Added 'filter' icon to actionicons tool.")
01102         if not securityIcon:
01103             iconsTool.addActionIcon(
01104                 category='controlpanel',
01105                 action_id='SecuritySettings',
01106                 icon_expr='lock_icon.gif',
01107                 title='Security Settings',
01108                 )
01109             out.append("Added 'security' icon to actionicons tool.")
01110 

Here is the call graph for this function:

Here is the caller graph for this function:

adds a site property to portal_properties 

Definition at line 968 of file alphas.py.

00968 
00969 def addLinkIntegritySwitch(portal, out):
00970     """ adds a site property to portal_properties """
00971     tool = getToolByName(portal, 'portal_properties', None)
00972     if tool is not None:
00973         sheet = getattr(tool, 'site_properties', None)
00974         if sheet is not None:
00975             if not sheet.hasProperty('enable_link_integrity_checks'):
00976                 sheet.manage_addProperty('enable_link_integrity_checks', True, 'boolean')
00977                 out.append("Added 'enable_link_integrity_checks' property to site properties")
00978 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the configlet for the calendar settings

Definition at line 930 of file alphas.py.

00930 
00931 def addMaintenanceConfiglet(portal, out):
00932     """Add the configlet for the calendar settings"""
00933     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
00934     if controlPanel is not None:
00935         havePanel = False
00936         for configlet in controlPanel.listActions():
00937             if configlet.getId() == 'Maintenance':
00938                 havePanel = True
00939         if not havePanel:
00940             controlPanel.registerConfiglet(id         = 'Maintenance',
00941                                            appId      = 'Plone',
00942                                            name       = 'Maintenance',
00943                                            action     = 'string:${portal_url}/@@maintenance-controlpanel',
00944                                            category   = 'Plone',
00945                                            permission = ManagePortal,)
00946             out.append("Added 'Maintenance' to the control panel")
00947 

Here is the call graph for this function:

Here is the caller graph for this function:

adds a site property to portal_properties

Definition at line 948 of file alphas.py.

00948 
00949 def addMaintenanceProperty(portal, out):
00950     """ adds a site property to portal_properties"""
00951     tool = getToolByName(portal, 'portal_properties', None)
00952     if tool is not None:
00953         sheet = getattr(tool, 'site_properties', None)
00954         if sheet is not None:
00955             if not sheet.hasProperty('number_of_days_to_keep'):
00956                 sheet.manage_addProperty('number_of_days_to_keep', 7, 'int')
00957                 out.append("Added 'number_of_days_to_keep' property to site properties")
00958 

Here is the call graph for this function:

Here is the caller graph for this function:

adds a site property to portal_properties

Definition at line 1344 of file alphas.py.

01344 
01345 def addManyGroupsProperty(portal, out):
01346     """ adds a site property to portal_properties"""
01347     tool = getToolByName(portal, 'portal_properties')
01348     sheet = tool.site_properties
01349     if not sheet.hasProperty('many_groups'):
01350         sheet.manage_addProperty('many_groups',
01351                 getattr(sheet, 'many_users', False) ,'boolean')
01352         out.append("Added 'many_groups' property to site properties")
01353 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the markup configlet.

Definition at line 493 of file alphas.py.

00493 
00494 def addMarkupConfiglet(portal, out):
00495     """Add the markup configlet."""
00496     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
00497     if controlPanel is not None:
00498         gotMarkup = False
00499         for configlet in controlPanel.listActions():
00500             if configlet.getId() == 'MarkupSettings':
00501                 gotMarkup = True
00502         if not gotMarkup:
00503             controlPanel.registerConfiglet(
00504                 id         = 'MarkupSettings',
00505                 appId      = 'Plone',
00506                 name       = 'Markup',
00507                 action     = 'string:${portal_url}/@@markup-controlpanel',
00508                 category   = 'Plone',
00509                 permission = ManagePortal,
00510             )
00511             out.append("Added Markup Settings to the control panel")
00512 

Here is the call graph for this function:

Here is the caller graph for this function:

Add new Plone 3.0 workflows

Definition at line 1288 of file alphas.py.

01288 
01289 def addMissingWorkflows(portal, out):
01290     """Add new Plone 3.0 workflows
01291     """
01292     wft = getToolByName(portal, 'portal_workflow', None)
01293     if wft is None:
01294         return
01295 
01296     new_workflow_ids = [ 'intranet_workflow', 'intranet_folder_workflow',
01297                         'one_state_workflow', 'simple_publication_workflow']
01298     encoding = 'utf-8'
01299     path_prefix = os.path.join(package_home(cmfplone_globals), 'profiles',
01300             'default', 'workflows')
01301     
01302     for wf_id in new_workflow_ids:
01303         if wf_id in wft.objectIds():
01304             out.append("Workflow %s already installed; doing nothing" % wf_id)
01305             continue
01306 
01307         path = os.path.join(path_prefix, wf_id, 'definition.xml')
01308         body = open(path,'r').read()
01309 
01310         wft._setObject(wf_id, DCWorkflowDefinition(wf_id))
01311         wf = wft[wf_id]
01312         wfdc = WorkflowDefinitionConfigurator(wf)
01313 
01314         ( workflow_id
01315         , title
01316         , state_variable
01317         , initial_state
01318         , states
01319         , transitions
01320         , variables
01321         , worklists
01322         , permissions
01323         , scripts
01324         , description
01325         ) = wfdc.parseWorkflowXML(body, encoding)
01326 
01327         _initDCWorkflow( wf
01328                        , title
01329                        , description
01330                        , state_variable
01331                        , initial_state
01332                        , states
01333                        , transitions
01334                        , variables
01335                        , worklists
01336                        , permissions
01337                        , scripts
01338                        , portal     # not sure what to pass here
01339                                     # the site or the wft?
01340                                     # (does it matter at all?)
01341                       )
01342         out.append("Added workflow %s" % wf_id)
01343 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 453 of file alphas.py.

00453 
00454 def addNewCSSFiles(portal, out):
00455     # add new css files to the portal_css registries
00456     cssreg = getToolByName(portal, 'portal_css', None)
00457     stylesheet_ids = cssreg.getResourceIds()
00458     if 'navtree.css' not in stylesheet_ids:
00459         cssreg.registerStylesheet('navtree.css', media='screen')
00460         cssreg.moveResourceAfter('navtree.css', 'deprecated.css')
00461         out.append("Added navtree.css to the registry")
00462     if 'invisibles.css' not in stylesheet_ids:
00463         cssreg.registerStylesheet('invisibles.css', media='screen')
00464         cssreg.moveResourceAfter('invisibles.css', 'navtree.css')
00465         out.append("Added invisibles.css to the registry")
00466     if 'forms.css' not in stylesheet_ids:
00467         cssreg.registerStylesheet('forms.css', media='screen')
00468         cssreg.moveResourceAfter('forms.css', 'invisibles.css')
00469         out.append("Added forms.css to the registry")
00470 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the object_provides index to the portal_catalog.

Definition at line 1259 of file alphas.py.

01259 
01260 def addObjectProvidesIndex(portal, out):
01261     """Add the object_provides index to the portal_catalog.
01262     """
01263     catalog = getToolByName(portal, 'portal_catalog')
01264     if 'object_provides' not in catalog.indexes():
01265         catalog.addIndex('object_provides', 'KeywordIndex')
01266         out.append("Added object_provides index to portal_catalog")
01267 

Here is the call graph for this function:

Here is the caller graph for this function:

Add new portlets managers.

Definition at line 593 of file alphas.py.

00593 
00594 def addPortletManagers(portal, out):
00595     """Add new portlets managers."""
00596     loadMigrationProfile(portal, 'profile-Products.CMFPlone.migrations:2.5-3.0a1',
00597             steps=['portlets'])
00598     

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 811 of file alphas.py.

00811 
00812 def addReaderAndEditorRoles(portal, out):
00813     if 'Reader' not in portal.valid_roles():
00814         portal._addRole('Reader')
00815     if 'Editor' not in portal.valid_roles():
00816         portal._addRole('Editor')
00817     if 'Reader' not in portal.acl_users.portal_role_manager.listRoleIds():
00818         portal.acl_users.portal_role_manager.addRole('Reader')
00819     if 'Editor' not in portal.acl_users.portal_role_manager.listRoleIds():
00820         portal.acl_users.portal_role_manager.addRole('Editor')
00821     
00822     viewRoles = [r['name'] for r in portal.rolesOfPermission('View') if r['selected']]
00823     modifyRoles = [r['name'] for r in portal.rolesOfPermission('Modify portal content') if r['selected']]
00824     
00825     if 'Reader' not in viewRoles:
00826         viewRoles.append('Reader')
00827         portal.manage_permission('View', viewRoles, True)
00828         
00829     if 'Editor' not in modifyRoles:
00830         modifyRoles.append('Editor')
00831         portal.manage_permission('Modify portal content', modifyRoles, True)
00832 
00833     out.append('Added reader and editor roles')
00834 

Here is the caller graph for this function:

Definition at line 1140 of file alphas.py.

01140 
01141 def addSitemapProperty(portal, out):
01142     tool = getToolByName(portal, 'portal_properties', None)
01143     if tool is not None:
01144         sheet = getattr(tool, 'site_properties', None)
01145         if sheet is not None:
01146             if not sheet.hasProperty('enable_sitemap'):
01147                 sheet.manage_addProperty('enable_sitemap', False, 'boolean')
01148                 out.append("Added 'enable_sitemap' property to site properties")
01149 

Here is the call graph for this function:

Here is the caller graph for this function:

Adds in table of contents 

Definition at line 1000 of file alphas.py.

01000 
01001 def addTableContents(portal, out):
01002     """ Adds in table of contents """
01003     csstool = getToolByName(portal, "portal_css", None)
01004     if csstool is not None:
01005         if 'toc.css' not in csstool.getResourceIds():
01006             csstool.manage_addStylesheet(id="toc.css",rel="stylesheet", enabled=True)
01007     jstool = getToolByName(portal, "portal_javascripts", None)
01008     if jstool is not None:
01009         if 'toc.js' not in jstool.getResourceIds():
01010             jstool.registerScript(id="toc.js", enabled=True)
01011     out.append("Added in css and js for table of contents")
01012 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the types configlet.

Definition at line 530 of file alphas.py.

00530 
00531 def addTypesConfiglet(portal, out):
00532     """Add the types configlet."""
00533     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
00534     if controlPanel is not None:
00535         gotTypes = False
00536         for configlet in controlPanel.listActions():
00537             if configlet.getId() == 'TypesSettings':
00538                 gotTypes = True
00539         if not gotTypes:
00540             controlPanel.registerConfiglet(
00541                 id         = 'TypesSettings',
00542                 appId      = 'Plone',
00543                 name       = 'Types',
00544                 action     = 'string:${portal_url}/@@types-controlpanel',
00545                 category   = 'Plone',
00546                 permission = ManagePortal,
00547             )
00548             out.append("Added Types Settings to the control panel")
00549 

Here is the call graph for this function:

Here is the caller graph for this function:

Add webstats.js for Google Analytics and other trackers support.

Definition at line 979 of file alphas.py.

00979 
00980 def addWebstatsJSFile(portal, out):
00981     """Add webstats.js for Google Analytics and other trackers support.
00982     """
00983     jsreg = getToolByName(portal, 'portal_javascripts', None)
00984     script = 'webstats.js'
00985     if jsreg is not None:
00986         script_ids = jsreg.getResourceIds()
00987         # Failsafe: first make sure the stylesheet doesn't exist in the list
00988         if script not in script_ids:
00989             jsreg.registerScript(script,
00990                     enabled = True,
00991                     cookable = True,
00992                     compression = False)
00993             try:
00994                 jsreg.moveResourceAfter(script, 'toc.js')
00995             except ValueError:
00996                 # put it at the bottom of the stack
00997                 jsreg.moveResourceToBottom(script)
00998             out.append("Added " + script + " to portal_javascipts")
00999 

Here is the call graph for this function:

Here is the caller graph for this function:

adds a site property to portal_properties

Definition at line 959 of file alphas.py.

00959 
00960 def addWebstatsJSProperty(portal, out):
00961     """ adds a site property to portal_properties"""
00962     tool = getToolByName(portal, 'portal_properties')
00963     sheet = tool.site_properties
00964     if not sheet.hasProperty('webstats_js'):
00965         sheet.manage_addProperty('webstats_js','','string')
00966         out.append("Added 'webstats_js' property to site properties")
00967 

Here is the call graph for this function:

Here is the caller graph for this function:

3.0-alpha1 -> 3.0-alpha2

Definition at line 143 of file alphas.py.

00143 
00144 def alpha1_alpha2(portal):
00145     """ 3.0-alpha1 -> 3.0-alpha2
00146     """
00147     out = []
00148 
00149     # register some tools as utilities
00150     enableZope3Site(portal, out)
00151     registerToolsAsUtilities(portal, out)
00152 
00153     # Update search and mailhost control panels to new formlib based ones
00154     updateSearchAndMailHostConfiglet(portal, out)
00155 
00156     # remove generated.css from ResourceRegistries
00157     removeGeneratedCSS(portal, out)
00158 
00159     # add form_tabbing.js
00160     addFormTabbingJS(portal, out)
00161 
00162     # install the kss bits
00163     installKss(portal, out)
00164 
00165     # install plone.app.redirector
00166     installRedirectorUtility(portal, out)
00167 
00168     # Add action for plone.app.contentrules
00169     addContentRulesAction(portal, out)
00170 
00171     # Add reader and editor roles
00172     addReaderAndEditorRoles(portal, out)
00173 
00174     # Change folder_localrole_form to @@sharing
00175     migrateLocalroleForm(portal, out)
00176 
00177     # Reorder the user actions in a way that makes the getOrderedUserActions
00178     # script obsolete
00179     reorderUserActions(portal, out)
00180 
00181     # Update expression on RTL.css
00182     updateRtlCSSexpression(portal, out)
00183 
00184     return out
00185 

Here is the call graph for this function:

3.0-alpha2 -> 3.0-beta1

Definition at line 186 of file alphas.py.

00186 
00187 def alpha2_beta1(portal):
00188     """ 3.0-alpha2 -> 3.0-beta1
00189     """
00190     out = []
00191 
00192     # register some tools as utilities
00193     enableZope3Site(portal, out)
00194     registerToolsAsUtilities(portal, out)
00195 
00196     # Add control panel action 
00197     addMaintenanceConfiglet(portal, out)
00198     
00199     # Add action icon
00200     addIconForMaintenanceConfiglet(portal, out)
00201 
00202     # Add number_of_days_to_keep property
00203     addMaintenanceProperty(portal, out)
00204 
00205     installS5(portal, out)
00206     
00207     addTableContents(portal, out)
00208 
00209     # add input-label.js
00210     addFormInputLabelJS(portal, out)
00211     
00212     #modify member security settings to match new default policies
00213     updateMemberSecurity(portal, out)
00214 
00215     updatePASPlugins(portal, out)
00216     
00217     # Update control panel actions
00218     updateSkinsAndSiteConfiglet(portal, out)
00219 
00220     # Rename some control panel titles
00221     updateConfigletTitles(portal, out)
00222 
00223     # Add icon for filter and security configlets
00224     addIconsForFilterAndSecurityConfiglets(portal, out)
00225 
00226     # add content rules configlet
00227     installContentRulesUtility(portal, out)
00228     addContentRulesConfiglet(portal, out)
00229     addIconForContentRulesConfiglet(portal, out)
00230 
00231     # Install the filter and security control panels
00232     addFilterAndSecurityConfiglets(portal, out)
00233 
00234     # Add the sitemap enabled property
00235     addSitemapProperty(portal, out)
00236 
00237     # Use the unpacked kukit-src.js and pack it ourself
00238     updateKukitJS(portal, out)
00239 
00240     # Add a RAMCache for ResourceRegistries
00241     addCacheForResourceRegistry(portal, out)
00242 
00243     # Compress cssQuery with full-encode like it's supposed to.
00244     updateCssQueryJS(portal, out)
00245 
00246     # Remove very old javascript
00247     removeHideAddItemsJS(portal, out)
00248 
00249     # Add webstats.js for Google Analytics
00250     addWebstatsJSFile(portal,out)
00251     
00252     # Add webstats_js property to site properties
00253     addWebstatsJSProperty(portal,out)
00254 
00255     # Add the object_provides catalog index
00256     addObjectProvidesIndex(portal, out)
00257 
00258     # Remove the mystuff user action
00259     removeMyStuffAction(portal, out)
00260 
00261     # Add external_links_open_new_window property to site properties
00262     addExternalLinksOpenNewWindowProperty(portal, out)
00263 
00264     # Add the types configlet
00265     addTypesConfiglet(portal, out)
00266     addIconForTypesConfiglet(portal, out)
00267     
00268     # Add workflows that people may be missing
00269     addMissingWorkflows(portal, out)
00270 
00271     # Add many_groups property to site properties
00272     addManyGroupsProperty(portal, out)
00273 
00274     # Replace obsolete PlonePAS version of plone tool
00275     restorePloneTool(portal, out)
00276 
00277     # install plone.app.i18n
00278     installI18NUtilities(portal, out)
00279 
00280     # Install PloneLanguageTool
00281     installProduct('PloneLanguageTool', portal, out, hidden=True)
00282 
00283     # Add email_charset property
00284     addEmailCharsetProperty(portal, out)
00285 
00286     return out
00287 
00288 # --
00289 # KSS registration
00290 # --

Here is the call graph for this function:

Convert portlets defined in left_slots and right_slots at the portal
root to use plone.portlets. Also block portlets in the Members folder.

Note - there may be other portlets defined elsewhere. These will require
manual migration from the @@manage-portlets view. This is to avoid a 
full walk of the portal (i.e. waking up every single object) looking for
potential left_slots/right_slots! 

Definition at line 599 of file alphas.py.

00599 
00600 def convertLegacyPortlets(portal, out):
00601     """Convert portlets defined in left_slots and right_slots at the portal
00602     root to use plone.portlets. Also block portlets in the Members folder.
00603     
00604     Note - there may be other portlets defined elsewhere. These will require
00605     manual migration from the @@manage-portlets view. This is to avoid a 
00606     full walk of the portal (i.e. waking up every single object) looking for
00607     potential left_slots/right_slots! 
00608     """
00609     convert_legacy_portlets(portal)
00610     out.append('Converted legacy portlets at the portal root')
00611     out.append('NOTE: You may need to convert other portlets manually.')
00612     out.append(' - to do so, click "manage portlets" in the relevant folder.')
00613     
00614     members = getattr(portal, 'Members', None)
00615     if members is not None:
00616         membersRightSlots = getattr(aq_base(members), 'right_slots', None)
00617         if membersRightSlots == []:
00618             rightColumn = getUtility(IPortletManager, name=u'plone.rightcolumn', context=portal)
00619             portletAssignments = getMultiAdapter((members, rightColumn,), ILocalPortletAssignmentManager)
00620             portletAssignments.setBlacklistStatus(CONTEXT_PORTLETS, True)
00621             out.append('Blacklisted contextual portlets in the Members folder')
00622 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 396 of file alphas.py.

00396 
00397 def enableZope3Site(portal, out):
00398     if not ISite.providedBy(portal):
00399         make_objectmanager_site(portal)
00400         out.append('Made the portal a Zope3 site.')
00401     else:
00402         sm = portal.getSiteManager()
00403         if sm.utilities.LookupClass  != FiveVerifyingAdapterLookup:
00404             sm.utilities.LookupClass = FiveVerifyingAdapterLookup
00405             sm.utilities._createLookup()
00406             sm.utilities.__parent__ = aq_base(sm)
00407             sm.__parent__ = aq_base(portal)
00408 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 800 of file alphas.py.

00800 
00801 def installContentRulesUtility(portal, out):
00802     from plone.contentrules.engine.interfaces import IRuleStorage
00803     from plone.contentrules.engine.storage import RuleStorage
00804     
00805     sm = getSiteManager(portal)
00806     if sm.queryUtility(IRuleStorage) is None:
00807         sm.registerUtility(RuleStorage(), IRuleStorage)
00808 
00809     out.append("Registered content rules storage utility")
00810 

Here is the caller graph for this function:

Definition at line 1374 of file alphas.py.

01374 
01375 def installI18NUtilities(portal, out):
01376     from plone.app.i18n.locales.interfaces import ICountries
01377     from plone.app.i18n.locales.countries import Countries
01378 
01379     from plone.app.i18n.locales.interfaces import IContentLanguages
01380     from plone.app.i18n.locales.languages import ContentLanguages
01381 
01382     from plone.app.i18n.locales.interfaces import IMetadataLanguages
01383     from plone.app.i18n.locales.languages import MetadataLanguages
01384 
01385     sm = getSiteManager(portal)
01386     if sm.queryUtility(ICountries) is None:
01387         sm.registerUtility(Countries(), ICountries)
01388     if sm.queryUtility(IContentLanguages) is None:
01389         sm.registerUtility(ContentLanguages(), IContentLanguages)
01390     if sm.queryUtility(IMetadataLanguages) is None:
01391         sm.registerUtility(MetadataLanguages(), IMetadataLanguages)
01392 
01393     out.append("Registered plone.app.i18n utilities.")
01394 

Here is the caller graph for this function:

def CMFPlone.migrations.v3_0.alphas.installProduct (   product,
  portal,
  out,
  hidden = False 
)
Quickinstalls a product if it is not installed yet.

Definition at line 623 of file alphas.py.

00623 
00624 def installProduct(product, portal, out, hidden=False):
00625     """Quickinstalls a product if it is not installed yet."""
00626     if product in portal.Control_Panel.Products.objectIds():
00627         installOrReinstallProduct(portal, product, out, hidden=hidden)
00628 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 772 of file alphas.py.

00772 
00773 def installRedirectorUtility(portal, out):
00774     from plone.app.redirector.interfaces import IRedirectionStorage
00775     from plone.app.redirector.storage import RedirectionStorage
00776     
00777     sm = getSiteManager(portal)
00778     if sm.queryUtility(IRedirectionStorage) is None:
00779         sm.registerUtility(RedirectionStorage(), IRedirectionStorage)
00780 
00781     out.append("Registered redirector utility")
00782 

Here is the caller graph for this function:

def CMFPlone.migrations.v3_0.alphas.installS5 (   portal,
  out 
)

Definition at line 879 of file alphas.py.

00879 
00880 def installS5(portal, out):
00881     portalTypes = getToolByName(portal, 'portal_types', None)
00882     if portalTypes is not None:
00883         document = portalTypes.restrictedTraverse('Document', None)
00884         if document:
00885             for action in document.listActions():
00886                 if action.getId() == 's5_presentation':
00887                     break # We already have the action
00888             else:
00889                 document.addAction('s5_presentation',
00890                     name='View as presentation',
00891                     action="string:${object/absolute_url}/document_s5_presentation",
00892                     condition='python:object.document_s5_alter(test=True)',
00893                     permission='View',
00894                     category='document_actions',
00895                     visible=1,
00896                     )
00897             out.append("Added 's5_presentation' action to actions tool.")
00898 
00899     iconsTool = getToolByName(portal, 'portal_actionicons', None)
00900     if iconsTool is not None:
00901         for icon in iconsTool.listActionIcons():
00902             if icon.getActionId() == 's5_presentation':
00903                 break # We already have the icon
00904         else:
00905             iconsTool.addActionIcon(
00906                 category='plone',
00907                 action_id='s5_presentation',
00908                 icon_expr='fullscreenexpand_icon.gif',
00909                 title='View as presentation',
00910                 )
00911         out.append("Added 's5_presentation' icon to actionicons tool.")
00912 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 835 of file alphas.py.

00835 
00836 def migrateLocalroleForm(portal, out):
00837     portal_types = getToolByName(portal, 'portal_types', None)
00838     if portal_types is not None:
00839         for fti in portal_types.objectValues():
00840             if not hasattr(fti, '_aliases'):
00841                 fti._aliases={}
00842             
00843             aliases = fti.getMethodAliases()
00844             new_aliases = aliases.copy()
00845             for k, v in aliases.items():
00846                 if 'folder_localrole_form' in v:
00847                     new_aliases[k] = v.replace('folder_localrole_form', '@@sharing')
00848             fti.setMethodAliases(new_aliases)
00849             
00850             for a in fti.listActions():
00851                 expr = a.getActionExpression()
00852                 if 'folder_localrole_form' in expr:
00853                     a.setActionExpression(expr.replace('folder_localrole_form', '@@sharing'))
00854     out.append('Ensured references to folder_localrole_form point to @@sharing now')
00855 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 409 of file alphas.py.

00409 
00410 def migrateOldActions(portal, out):
00411     special_providers = ['portal_controlpanel',
00412                          'portal_types',
00413                          'portal_workflow']
00414     # We don't need to operate on the providers that are still valid and
00415     # should ignore the control panel as well
00416     providers = [obj for obj in portal.objectValues()
00417                      if hasattr(obj, '_actions') and
00418                      obj.getId() not in special_providers]
00419     non_empty_providers = [p for p in providers if len(p._actions) > 0]
00420     for provider in non_empty_providers:
00421         for action in provider._actions:
00422             category = action.category
00423             # check if the category already exists, otherwise create it
00424             new_category = getattr(aq_base(portal.portal_actions), category, None)
00425             if new_category is None:
00426                 portal.portal_actions._setObject(category, ActionCategory(id=category))
00427                 new_category = portal.portal_actions[category]
00428 
00429             # Special handling for Expressions
00430             url_expr = ''
00431             if action.action:
00432                 url_expr = action.action.text
00433             available_expr = ''
00434             if action.condition:
00435                 available_expr = action.condition.text
00436 
00437             new_action = Action(action.id,
00438                 title=action.title,
00439                 description=action.description,
00440                 url_expr=url_expr,
00441                 available_expr=available_expr,
00442                 permissions=action.permissions,
00443                 visible = action.visible)
00444                 
00445             # Only add an action if there isn't one with that name already
00446             if getattr(aq_base(new_category), action.id, None) is None:
00447                 new_category._setObject(action.id, new_action)
00448 
00449         # Remove old actions from migrated providers
00450         provider._actions = ()
00451     out.append('Migrated old actions to new actions stored in portal_actions.')
00452 

Here is the caller graph for this function:

Definition at line 749 of file alphas.py.

00749 
00750 def registerToolsAsUtilities(portal, out):
00751     sm = getSiteManager(portal)
00752 
00753     portalregistration = ((portal, ISiteRoot),
00754                           (portal, IPloneSiteRoot),)
00755 
00756     for reg in portalregistration:
00757         if sm.queryUtility(reg[1]) is None:
00758             sm.registerUtility(aq_base(reg[0]), reg[1])
00759 
00760     for reg in registration:
00761         if sm.queryUtility(reg[1]) is None:
00762             if reg[0] in portal.keys():
00763                 tool = aq_base(portal[reg[0]])
00764                 sm.registerUtility(tool, reg[1])
00765 
00766     for reg in invalid_regs:
00767         if sm.queryUtility(reg) is not None:
00768             sm.unregisterUtility(provided=reg)
00769 
00770     out.append("Registered tools as utilities.")
00771 

Here is the caller graph for this function:

Definition at line 679 of file alphas.py.

00679 
00680 def removeGeneratedCSS(portal, out):
00681     # remove generated.css from the portal_css registries
00682     cssreg = getToolByName(portal, 'portal_css', None)
00683     stylesheet_ids = cssreg.getResourceIds()
00684     if 'generated.css' in stylesheet_ids:
00685         cssreg.unregisterResource('generated.css')
00686         out.append("Removed generated.css from the registry")
00687 

Here is the call graph for this function:

Here is the caller graph for this function:

Remove very old javascript.

Definition at line 1214 of file alphas.py.

01214 
01215 def removeHideAddItemsJS(portal, out):
01216     """Remove very old javascript.
01217     """
01218     jsreg = getToolByName(portal, 'portal_javascripts', None)
01219     script_id = 'folder_contents_hideAddItems.js'
01220     if jsreg is not None:
01221         jsreg.unregisterResource(script_id)
01222         out.append('Removed %s from portal_javascripts.' % script_id)
01223 

Here is the call graph for this function:

Here is the caller graph for this function:

The mystuff action is now covered by the dashboard

Definition at line 1268 of file alphas.py.

01268 
01269 def removeMyStuffAction(portal, out):
01270     """The mystuff action is now covered by the dashboard"""
01271     actions = getToolByName(portal, 'portal_actions')
01272     if not hasattr(actions, 'user'):
01273         return
01274     category=actions.user
01275     if 'mystuff' in category.objectIds():
01276         category.manage_delObjects(ids=['mystuff'])
01277         out.append("Removed the mystuff user action")
01278 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1191 of file alphas.py.

01191 
01192 def removeTablelessSkin(portal, out):
01193     st = getToolByName(portal, 'portal_skins')
01194     if 'Plone Tableless' in st.getSkinSelections():
01195         st.manage_skinLayers(['Plone Tableless'], del_skin=True)
01196         out.append("Removed the Plone Tableless skin")
01197     if st.default_skin=='Plone Tableless':
01198         st.default_skin='Plone Default'
01199         out.append("Changed the default skin to 'Plone Default'")
01200 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 856 of file alphas.py.

00856 
00857 def reorderUserActions(portal, out):
00858     portal_actions = getToolByName(portal, 'portal_actions', None)
00859     if portal_actions is not None:
00860         user_category = getattr(portal_actions, 'user', None)
00861         if user_category is not None:        
00862             new_actions = ['login', 'join', 'mystuff', 'preferences', 'undo', 'logout']
00863             new_actions.reverse()
00864             for action in new_actions:
00865                 if action in user_category.objectIds():
00866                     user_category.moveObjectsToTop([action])
00867 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1354 of file alphas.py.

01354 
01355 def restorePloneTool(portal, out):
01356     tool = getToolByName(portal, "plone_utils")
01357     if tool.meta_type == 'PlonePAS Utilities Tool':
01358         from Products.CMFPlone.PloneTool import PloneTool
01359         from Products.CMFDefault.Portal import CMFSite
01360 
01361         # PloneSite has its own security check for manage_delObjects which
01362         # breaks in the test runner. So we bypass this check.
01363         CMFSite.manage_delObjects(portal, ['plone_utils'])
01364         portal._setObject(PloneTool.id, PloneTool())
01365         out.append("Replaced obsolete PlonePAS version of plone tool with the normal one.")
01366 

Here is the call graph for this function:

Here is the caller graph for this function:

2.5.x -> 3.0-alpha1

Definition at line 84 of file alphas.py.

00084 
00085 def three0_alpha1(portal):
00086     """2.5.x -> 3.0-alpha1
00087     """
00088     out = []
00089 
00090     # Make the portal a Zope3 site
00091     enableZope3Site(portal, out)
00092 
00093     # register some tools as utilities
00094     registerToolsAsUtilities(portal, out)
00095 
00096     # Updates the available import steps, so the componentregistry step is
00097     # available for add-on product installation
00098     updateImportStepsFromBaseProfile(portal, out)
00099 
00100     # Migrate old ActionInformation to Actions and move them to the actions tool
00101     migrateOldActions(portal, out)
00102 
00103     # Add new css files to RR
00104     addNewCSSFiles(portal, out)
00105 
00106     # Add new properties for default- and forbidden content types
00107     addDefaultAndForbiddenContentTypesProperties(portal, out)
00108     addMarkupConfiglet(portal, out)
00109     addIconForMarkupConfiglet(portal, out)
00110 
00111     # Actions should gain a i18n_domain now, so their title and description are
00112     # returned as Messages
00113     updateActionsI18NDomain(portal, out)
00114 
00115     # Type information should gain a i18n_domain now, so their title and
00116     # description are returned as Messages
00117     updateFTII18NDomain(portal, out)
00118 
00119     # The ATCT tool has lost all type migration functionality and quite some
00120     # metadata and index information stored on it needs to be updated.
00121     upgradeATCTTool(portal, out)
00122 
00123     # Install CMFEditions and 
00124     installProduct('CMFDiffTool', portal, out, hidden=True)
00125     installProduct('CMFEditions', portal, out, hidden=True)
00126 
00127     # Migrate legacy portlets
00128     addPortletManagers(portal, out)
00129 
00130     # Migrate legacy portlets
00131     convertLegacyPortlets(portal, out)
00132 
00133     # Add icon for calendar settings configlet
00134     addIconForCalendarSettingsConfiglet(portal, out)
00135 
00136     # Install the calendar settings control panel
00137     addCalendarConfiglet(portal, out)
00138 
00139     # Deal with the tableless skin disappearing
00140     removeTablelessSkin(portal, out)
00141 
00142     return out

Here is the call graph for this function:

Definition at line 575 of file alphas.py.

00575 
00576 def updateActionsI18NDomain(portal, out):
00577     actions = portal.portal_actions.listActions()
00578     domainless_actions = [a for a in actions if not a.i18n_domain]
00579     for action in domainless_actions:
00580         if _check_ascii(action.title) and _check_ascii(action.description):
00581             action.i18n_domain = 'plone'
00582     out.append('Updated actions i18n domain attribute.')
00583 

Here is the call graph for this function:

Here is the caller graph for this function:

Update titles of some configlets

Definition at line 1057 of file alphas.py.

01057 
01058 def updateConfigletTitles(portal, out):
01059     """Update titles of some configlets"""
01060     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
01061     if controlPanel is not None:
01062         collection = controlPanel.getActionObject('Plone/portal_atct')
01063         language = controlPanel.getActionObject('Plone/PloneLanguageTool')
01064         navigation = controlPanel.getActionObject('Plone/NavigationSettings')
01065         types = controlPanel.getActionObject('Plone/TypesSettings')
01066         users = controlPanel.getActionObject('Plone/UsersGroups')
01067         users2 = controlPanel.getActionObject('Plone/UsersGroups2')
01068 
01069         if collection is not None:
01070             collection.title = "Collection"
01071         if language is not None:
01072             language.title = "Language"
01073         if navigation is not None:
01074             navigation.title = "Navigation"
01075         if types is not None:
01076             types.title = "Types"
01077         if users is not None:
01078             users.title = "Users and Groups"
01079         if users2 is not None:
01080             users2.title = "Users and Groups"
01081 

Here is the call graph for this function:

Here is the caller graph for this function:

Compress cssQuery with full-encode like it's supposed to.

Definition at line 1201 of file alphas.py.

01201 
01202 def updateCssQueryJS(portal, out):
01203     """Compress cssQuery with full-encode like it's supposed to.
01204     """
01205     jsreg = getToolByName(portal, 'portal_javascripts', None)
01206     script_id = 'cssQuery.js'
01207     if jsreg is not None:
01208         script_ids = jsreg.getResourceIds()
01209         resource = jsreg.getResource(script_id)
01210         if resource is not None:
01211             resource.setCompression('full-encode')
01212             out.append("Set 'full-encode' compression on %s" % script_id)
01213 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 584 of file alphas.py.

00584 
00585 def updateFTII18NDomain(portal, out):
00586     types = portal.portal_types.listTypeInfo()
00587     domainless_types = [fti for fti in types if not fti.i18n_domain]
00588     for fti in domainless_types:
00589         if _check_ascii(fti.title) and _check_ascii(fti.description):
00590             fti.i18n_domain = 'plone'
00591     out.append('Updated type informations i18n domain attribute.')
00592 

Here is the call graph for this function:

Here is the caller graph for this function:

Updates the available import steps for existing sites.

Definition at line 1367 of file alphas.py.

01367 
01368 def updateImportStepsFromBaseProfile(portal, out):
01369     """Updates the available import steps for existing sites."""
01370 
01371     tool = getToolByName(portal, "portal_setup")
01372     tool.setBaselineContext("profile-Products.CMFPlone:plone")
01373 

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.migrations.v3_0.alphas.updateKukitJS (   portal,
  out 
)
Use the unpacked kukit-src.js and pack it ourself.

Definition at line 1150 of file alphas.py.

01150 
01151 def updateKukitJS(portal, out):
01152     """Use the unpacked kukit-src.js and pack it ourself.
01153     """
01154     jsreg = getToolByName(portal, 'portal_javascripts', None)
01155     old_id = '++resource++kukit.js'
01156     new_id = '++resource++kukit-src.js'
01157     if jsreg is not None:
01158         script_ids = jsreg.getResourceIds()
01159         if old_id in script_ids and new_id in script_ids:
01160             jsreg.unregisterResource(old_id)
01161         elif old_id in script_ids:
01162             jsreg.renameResource(old_id, new_id)
01163             out.append("Use %s instead of %s" % (new_id, old_id))
01164         resource = jsreg.getResource(new_id)
01165         if resource is not None:
01166             resource.setCompression('full')
01167             out.append("Set 'full' compression on %s" % new_id)
01168 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1013 of file alphas.py.

01013 
01014 def updateMemberSecurity(portal, out):
01015     pprop = getToolByName(portal, 'portal_properties')
01016     portal.manage_permission('Add portal member', roles=['Manager','Owner'], acquire=0)
01017     pprop.site_properties.manage_changeProperties(allowAnonymousViewAbout=False)
01018 
01019     portal.manage_changeProperties(validate_email=True)
01020 
01021     pmembership = getToolByName(portal, 'portal_membership')
01022     pmembership.memberareaCreationFlag = 0
01023     out.append("Updated member management security")
01024 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1025 of file alphas.py.

01025 
01026 def updatePASPlugins(portal, out):
01027     from Products.PlonePAS.Extensions.Install import activatePluginInterfaces
01028     from StringIO import StringIO
01029 
01030     sout=StringIO()
01031 
01032     activatePluginInterfaces(portal, 'mutable_properties', sout)
01033     activatePluginInterfaces(portal, 'source_users', sout)
01034     activatePluginInterfaces(portal, 'credentials_cookie_auth', sout,
01035             disable=['ICredentialsResetPlugin', 'ICredentialsUpdatePlugin'])
01036     if not portal.acl_users.objectIds(['Plone Session Plugin']):
01037         from plone.session.plugins.session import manage_addSessionPlugin
01038         manage_addSessionPlugin(portal.acl_users, 'session')
01039         activatePluginInterfaces(portal, "session", sout)
01040         out.append("Added Plone Session Plugin.")
01041 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 868 of file alphas.py.

00868 
00869 def updateRtlCSSexpression(portal, out):
00870     # update expression on rtl css file
00871     cssreg = getToolByName(portal, 'portal_css', None)
00872     if cssreg is not None:
00873         stylesheet_ids = cssreg.getResourceIds()
00874         if 'RTL.css' in stylesheet_ids:
00875             rtl = cssreg.getResource('RTL.css')
00876             rtl.setExpression("python:portal.restrictedTraverse('@@plone_portal_state').is_rtl()")
00877             out.append("Updated RTL.css expression.")
00878 

Here is the call graph for this function:

Here is the caller graph for this function:

Use new configlets for the search and mailhost settings

Definition at line 664 of file alphas.py.

00664 
00665 def updateSearchAndMailHostConfiglet(portal, out):
00666     """Use new configlets for the search and mailhost settings"""
00667     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
00668     if controlPanel is not None:
00669         search = controlPanel.getActionObject('Plone/SearchSettings')
00670         mail = controlPanel.getActionObject('Plone/MailHost')
00671 
00672         if search is not None:
00673             search.title = "Search"
00674             search.action = Expression('string:${portal_url}/@@search-controlpanel')
00675         if mail is not None:
00676             mail.title = "Mail"
00677             mail.action = Expression('string:${portal_url}/@@mail-controlpanel')
00678 

Here is the call graph for this function:

Here is the caller graph for this function:

Use new configlets for the skins and site settings

Definition at line 1042 of file alphas.py.

01042 
01043 def updateSkinsAndSiteConfiglet(portal, out):
01044     """Use new configlets for the skins and site settings"""
01045     controlPanel = getToolByName(portal, 'portal_controlpanel', None)
01046     if controlPanel is not None:
01047         skins = controlPanel.getActionObject('Plone/PortalSkin')
01048         site = controlPanel.getActionObject('Plone/PloneReconfig')
01049 
01050         if skins is not None:
01051             skins.action = Expression('string:${portal_url}/@@skins-controlpanel')
01052             skins.title = "Themes"
01053         if site is not None:
01054             site.action = Expression('string:${portal_url}/@@site-controlpanel')
01055             site.title = "Site settings"
01056 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 (ILanguageTool, IArchivistTool, IPortalModifierTool,
00002                 IPurgePolicyTool, IRepositoryTool, IStorageTool,
00003                 IFormControllerTool, IReferenceCatalog, IUIDCatalog,
00004                 ICalendarTool, IActionsTool, ICatalogTool,
00005                 IContentTypeRegistry, ISkinsTool, ITypesTool, IURLTool,
00006                 IConfigurableWorkflowTool, IPloneTool, ICSSRegistry,
00007                 IJSRegistry, IUniqueIdHandler, IFactoryTool, IMembershipTool,
00008                 IGroupTool, IGroupDataTool, IMemberDataTool,
00009                 ICachingPolicyManager, IRegistrationTool, IArchetypeTool,
00010                 ITranslationServiceTool, IControlPanel, IQuickInstallerTool,
00011                 ISetupTool,
00012                )

Definition at line 736 of file alphas.py.

Initial value:
00001 (('mimetypes_registry', IMimetypesRegistryTool),
00002                 ('portal_transforms', IPortalTransformsTool),
00003                 ('portal_atct', IATCTTool),
00004                 ('portal_actionicons', IActionIconsTool),
00005                 ('portal_discussion', IDiscussionTool),
00006                 ('portal_metadata', IMetadataTool),
00007                 ('portal_properties', IPropertiesTool),
00008                 ('portal_syndication', ISyndicationTool),
00009                 ('portal_undo', IUndoTool),
00010                 ('portal_interface', IInterfaceTool),
00011                 ('portal_migration', IMigrationTool),
00012                 ('MailHost', IMailHost),
00013                 ('portal_diff', IDiffTool),
00014                 ('portal_uidannotation', IUniqueIdAnnotationManagement),
00015                 ('portal_uidgenerator', IUniqueIdGenerator),
00016                )

Definition at line 719 of file alphas.py.