Back to index

plone3  3.1.7
Functions
CMFPlone.migrations.v2_1.two11_two12 Namespace Reference

Functions

def two11_two12rc1
def two12rc2_two12
def removeCMFTopicSkinLayer
def addRenameObjectButton
def addSEHighLightJS
def removeDiscussionItemWorkflow
def addMemberData
def reinstallPortalTransforms

Function Documentation

Add the must_change_password property to member data

Definition at line 131 of file two11_two12.py.

00131 
00132 def addMemberData(portal, out):
00133     """Add the must_change_password property to member data"""
00134     mt = safeGetMemberDataTool(portal)
00135     if mt is not None:
00136         safeEditProperty(mt, 'must_change_password', 0, 'boolean')
00137         out.append('Added must_change_password property to member data')
00138 

Here is the call graph for this function:

Here is the caller graph for this function:

Add the missing rename action for renaming single content items.

Definition at line 78 of file two11_two12.py.

00078 
00079 def addRenameObjectButton(portal,out):
00080     """Add the missing rename action for renaming single content items.
00081     """
00082     actionsTool = getToolByName(portal, 'portal_actions', None)
00083     if actionsTool is not None:
00084         category = actionsTool.object_buttons
00085         for action in category.objectIds():
00086             # if action exists, remove and re-add
00087             if action == 'rename':
00088                 category._delObject('rename')
00089                 out.append("Removed rename contentmenu action from actions tool.")
00090                 break
00091 
00092         rename = Action('rename',
00093             title='Rename',
00094             i18n_domain='plone',
00095             url_expr='python:"%s/object_rename"%(object.isDefaultPageInFolder() and object.getParentNode().absolute_url() or object_url)',
00096             available_expr='python:portal.portal_membership.checkPermission("Delete objects", object.aq_inner.getParentNode()) and portal.portal_membership.checkPermission("Copy or Move", object) and portal.portal_membership.checkPermission("Add portal content", object) and object is not portal and not (object.isDefaultPageInFolder() and object.getParentNode() is portal)',
00097             permissions=(AddPortalContent,),
00098             visible=True)
00099 
00100         category['rename'] = rename
00101         out.append("Added rename contentmenu action to actions tool.")
00102 

Here is the call graph for this function:

Here is the caller graph for this function:

Add se-highlight.js (plone_3rdParty) to ResourceRegistries.

Definition at line 103 of file two11_two12.py.

00103 
00104 def addSEHighLightJS(portal, out):
00105     """Add se-highlight.js (plone_3rdParty) to ResourceRegistries.
00106     """
00107     jsreg = getToolByName(portal, 'portal_javascripts', None)
00108     script = 'se-highlight.js'
00109     if jsreg is not None:
00110         script_ids = jsreg.getResourceIds()
00111         # Failsafe: first make sure the stylesheet doesn't exist in the list
00112         if script not in script_ids:
00113             jsreg.registerScript(script)
00114             try:
00115                 jsreg.moveResourceAfter(script, 'highlightsearchterms.js')
00116             except ValueError:
00117                 # put it at the bottom of the stack
00118                 jsreg.moveResourceToBottom(script)
00119             out.append("Added " + script + " to portal_javascipt")
00120 

Here is the call graph for this function:

Here is the caller graph for this function:

Reinstalls PortalTransforms.

Definition at line 139 of file two11_two12.py.

00139 
00140 def reinstallPortalTransforms(portal, out):
00141     """Reinstalls PortalTransforms."""
00142     reinstall = False
00143     if 'portal_transforms' not in portal.keys():
00144         reinstall = True
00145     if 'portal_transforms' in portal.keys():
00146         transforms = portal.portal_transforms
00147         try:
00148             transforms.safe_html.get_parameter_value('disable_transform')
00149         except (AttributeError, KeyError):
00150             reinstall = True
00151     if reinstall:
00152         qi = getToolByName(portal, 'portal_quickinstaller', None)
00153         if qi is not None:
00154             qi.reinstallProducts(['PortalTransforms'])
00155             out.append('Reinstalled PortalTransforms.')

Here is the call graph for this function:

Here is the caller graph for this function:

Removes plone_3rdParty\CMFTopic layer from all skins.

Definition at line 62 of file two11_two12.py.

00062 
00063 def removeCMFTopicSkinLayer(portal, out):
00064     """Removes plone_3rdParty\CMFTopic layer from all skins."""
00065 
00066     st = getToolByName(portal, 'portal_skins', None)
00067     if st is not None:
00068         old = 'plone_3rdParty/CMFTopic'
00069         skins = st.getSkinSelections()
00070         for skin in skins:
00071             path = st.getSkinPath(skin)
00072             path = map(string.strip, string.split(path,','))
00073             if old in path:
00074                 path.remove(old)
00075             st.addSkinSelection(skin, ','.join(path))
00076         out.append("Removed plone_3rdParty\CMFTopic layer from all skins.")
00077 

Here is the call graph for this function:

Here is the caller graph for this function:

Discussion Item should not have a workflow associated with it, since
it may then have permissions out-of-sync with the parent.

Definition at line 121 of file two11_two12.py.

00121 
00122 def removeDiscussionItemWorkflow(portal, out):
00123     """Discussion Item should not have a workflow associated with it, since
00124     it may then have permissions out-of-sync with the parent.
00125     """
00126     wftool = getToolByName(portal, 'portal_workflow', None)
00127     if wftool is not None:
00128         wftool.setChainForPortalTypes(('Discussion Item',), ())
00129         out.append("Removing workflow from Discussion Item")
00130 

Here is the call graph for this function:

Here is the caller graph for this function:

2.1.1 -> 2.1.2-rc1

Definition at line 12 of file two11_two12.py.

00012 
00013 def two11_two12rc1(portal):
00014     """2.1.1 -> 2.1.2-rc1
00015     """
00016     out = []
00017 
00018     # Make the portal a Zope3 site
00019     enableZope3Site(portal, out)
00020 
00021     # register some tools as utilities
00022     registerToolsAsUtilities(portal, out)
00023 
00024     # Remove plone_3rdParty\CMFTopic from skin layers
00025     removeCMFTopicSkinLayer(portal, out)
00026 
00027 
00028     # We need to migrate all existing actions to new-style actions first
00029     migrateOldActions(portal, out)
00030     # Add rename object action
00031     addRenameObjectButton(portal, out)
00032 
00033     # add se-highlight.js (plone_3rdParty) to ResourceRegistries
00034     addSEHighLightJS(portal, out)
00035     
00036     # Don't let Discussion item have a workflow
00037     removeDiscussionItemWorkflow(portal, out)
00038 
00039     # Add new member data item
00040     addMemberData(portal, out)
00041 
00042     return out
00043 

Here is the call graph for this function:

2.1.2-rc2 -> 2.1.2

Definition at line 44 of file two11_two12.py.

00044 
00045 def two12rc2_two12(portal):
00046     """2.1.2-rc2 -> 2.1.2
00047     """
00048     out = []
00049 
00050     # Make the portal a Zope3 site
00051     enableZope3Site(portal, out)
00052 
00053     # register some tools as utilities
00054     registerToolsAsUtilities(portal, out)
00055 
00056     # Reinstall PortalTransforms to activate the
00057     # configurable safe_html transformation.
00058     reinstallPortalTransforms(portal, out)
00059 
00060     return out
00061 

Here is the call graph for this function: