示例#1
0
def removeKSS(context):
    # remove KSS-related skin layers from all skins
    skinstool = getToolByName(context, 'portal_skins')
    selections = skinstool._getSelections()
    for skin_name in selections.keys():
        layers = selections[skin_name].split(',')
        if 'plone_kss' in layers:
            layers.remove('plone_kss')
        # XXX remove this once achetypes inline editing is implemented
        #if 'archetypes_kss' in layers:
        #    layers.remove('archetypes_kss')
        skinstool.addSkinSelection(skin_name, ','.join(layers))

    # remove portal_kss tool
    portal = getToolByName(context, 'portal_url').getPortalObject()
    if 'portal_kss' in portal:
        portal.manage_delObjects(['portal_kss'])

    # make sure portal_kss is no longer listed as a required tool
    cleanUpToolRegistry(context)

    # make sure plone.app.kss is not activated in the quick installer
    qi = getToolByName(context, 'portal_quickinstaller')
    if qi.isProductInstalled('plone.app.kss'):
        qi.uninstallProduct('plone.app.kss')
示例#2
0
def to50alpha1(context):
    """4.3 -> 5.0alpha1"""
    loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to50alpha1')
    portal = getToolByName(context, 'portal_url').getPortalObject()

    # remove obsolete tools
    tools = [t for t in TOOLS_TO_REMOVE if t in portal]
    portal.manage_delObjects(tools)

    cleanUpToolRegistry(context)

    # migrate properties to portal_registry
    migrate_registry_settings(portal)

    # install plone.app.event
    qi = getToolByName(portal, 'portal_quickinstaller')
    if not qi.isProductInstalled('plone.app.event'):
        qi.installProduct('plone.app.event')

    # update the default view of the Members folder
    migrate_members_default_view(portal)

    # install the Barceloneta theme
    if portal.portal_skins.getDefaultSkin() == 'Sunburst Theme':
        if not qi.isProductInstalled('plonetheme.barceloneta'):
            qi.installProduct('plonetheme.barceloneta')

    upgrade_keyring(context)
示例#3
0
def to50alpha1(context):
    """4.3 -> 5.0alpha1"""
    loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to50alpha1')
    portal = getToolByName(context, 'portal_url').getPortalObject()

    # remove obsolete tools
    tools = [t for t in TOOLS_TO_REMOVE if t in portal]
    portal.manage_delObjects(tools)

    cleanUpToolRegistry(context)

    # migrate properties to portal_registry
    migrate_registry_settings(portal)

    # install plone.app.event
    qi = getToolByName(portal, 'portal_quickinstaller')
    if not qi.isProductInstalled('plone.app.event'):
        qi.installProduct('plone.app.event')

    # update the default view of the Members folder
    migrate_members_default_view(portal)

    # install the Barceloneta theme
    if portal.portal_skins.getDefaultSkin() == 'Sunburst Theme':
        if not qi.isProductInstalled('plonetheme.barceloneta'):
            qi.installProduct('plonetheme.barceloneta')

    upgrade_keyring(context)
示例#4
0
def remove_legacy_resource_registries(context):
    """Remove portal_css and portal_javascripts."""
    portal_url = getToolByName(context, 'portal_url')
    portal = portal_url.getPortalObject()

    tools_to_remove = [
        'portal_css',
        'portal_javascripts',
    ]

    # remove obsolete tools
    for tool in tools_to_remove:
        if tool not in portal:
            continue
        portal._delObject(tool)

    cleanUpToolRegistry(context)
示例#5
0
def remove_legacy_resource_registries(context):
    """Remove portal_css and portal_javascripts."""
    portal_url = getToolByName(context, 'portal_url')
    portal = portal_url.getPortalObject()

    tools_to_remove = [
        'portal_css',
        'portal_javascripts',
    ]

    # remove obsolete tools
    for tool in tools_to_remove:
        if tool not in portal:
            continue
        portal._delObject(tool)

    cleanUpToolRegistry(context)
示例#6
0
def to50alpha1(context):
    """4.3 -> 5.0alpha1"""
    loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to50alpha1')
    portal = getToolByName(context, 'portal_url').getPortalObject()

    # remove obsolete tools
    tools = [t for t in TOOLS_TO_REMOVE if t in portal]
    if tools:
        portal.manage_delObjects(tools)

    cleanUpToolRegistry(context)

    # migrate properties to portal_registry
    migrate_registry_settings(portal)

    # install plone.app.event
    try:
        from Products.CMFPlone.utils import get_installer
    except ImportError:
        # BBB For Plone 5.0 and lower.
        qi = getToolByName(portal, 'portal_quickinstaller')
    else:
        qi = get_installer(portal)
    if not qi.isProductInstalled('plone.resource'):
        qi.installProduct('plone.resource')
    if not qi.isProductInstalled('plone.app.event'):
        qi.installProduct('plone.app.event')

    # update the default view of the Members folder
    migrate_members_default_view(portal)

    # install the Barceloneta theme
    if portal.portal_skins.getDefaultSkin() == 'Sunburst Theme':
        if not qi.isProductInstalled('plonetheme.barceloneta'):
            qi.installProduct('plonetheme.barceloneta')

    upgrade_keyring(context)
    installOrUpgradePloneAppTheming(context)
    installOrUpgradePloneAppCaching(context)
示例#7
0
def to50alpha1(context):
    """4.3 -> 5.0alpha1"""
    loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to50alpha1')
    portal = getToolByName(context, 'portal_url').getPortalObject()

    # remove obsolete tools
    tools = [t for t in TOOLS_TO_REMOVE if t in portal]
    if tools:
        portal.manage_delObjects(tools)

    cleanUpToolRegistry(context)

    # migrate properties to portal_registry
    migrate_registry_settings(portal)

    # install plone.app.event
    try:
        from Products.CMFPlone.utils import get_installer
    except ImportError:
        # BBB For Plone 5.0 and lower.
        qi = getToolByName(portal, 'portal_quickinstaller')
    else:
        qi = get_installer(portal)
    if not qi.isProductInstalled('plone.resource'):
        qi.installProduct('plone.resource')
    if not qi.isProductInstalled('plone.app.event'):
        qi.installProduct('plone.app.event')

    # update the default view of the Members folder
    migrate_members_default_view(portal)

    # install the Barceloneta theme
    if portal.portal_skins.getDefaultSkin() == 'Sunburst Theme':
        if not qi.isProductInstalled('plonetheme.barceloneta'):
            qi.installProduct('plonetheme.barceloneta')

    upgrade_keyring(context)
    installOrUpgradePloneAppTheming(context)
    installOrUpgradePloneAppCaching(context)
示例#8
0
def removeKSS(context):
    # remove KSS-related skin layers from all skins
    skinstool = getToolByName(context, 'portal_skins')
    selections = skinstool._getSelections()
    for skin_name in selections.keys():
        layers = selections[skin_name].split(',')
        if 'plone_kss' in layers:
            layers.remove('plone_kss')
        if 'archetypes_kss' in layers:
            layers.remove('archetypes_kss')
        skinstool.addSkinSelection(skin_name, ','.join(layers))

    # remove portal_kss tool
    portal = getToolByName(context, 'portal_url').getPortalObject()
    if 'portal_kss' in portal:
        portal.manage_delObjects(['portal_kss'])

    # make sure portal_kss is no longer listed as a required tool
    cleanUpToolRegistry(context)

    # make sure plone.app.kss is not activated in the quick installer
    qi = getToolByName(context, 'portal_quickinstaller', None)
    if qi is not None and qi.isProductInstalled('plone.app.kss'):
        qi.uninstallProduct('plone.app.kss')
示例#9
0
def removeKSS(context):
    # remove KSS-related skin layers from all skins
    skinstool = getToolByName(context, "portal_skins")
    selections = skinstool._getSelections()
    for skin_name in selections.keys():
        layers = selections[skin_name].split(",")
        if "plone_kss" in layers:
            layers.remove("plone_kss")
        if "archetypes_kss" in layers:
            layers.remove("archetypes_kss")
        skinstool.addSkinSelection(skin_name, ",".join(layers))

    # remove portal_kss tool
    portal = getToolByName(context, "portal_url").getPortalObject()
    if "portal_kss" in portal:
        portal.manage_delObjects(["portal_kss"])

    # make sure portal_kss is no longer listed as a required tool
    cleanUpToolRegistry(context)

    # make sure plone.app.kss is not activated in the quick installer
    qi = getToolByName(context, "portal_quickinstaller")
    if qi.isProductInstalled("plone.app.kss"):
        qi.uninstallProduct("plone.app.kss")