Esempio n. 1
0
def three01_three02(portal):
    
    out = []
    
    loadMigrationProfile(portal, 'profile-Products.CMFPlone.migrations:3.0.1-3.0.2')
    
    return out
Esempio n. 2
0
File: rcs.py Progetto: dtgit/dtedu
def rc2_final(portal):

    out = []

    loadMigrationProfile(portal, "profile-Products.CMFPlone.migrations:3.0rc2-3.0final")

    return out
Esempio n. 3
0
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent
    catalog = site.portal_catalog
    brains = catalog.searchResults({
        'portal_type' : MarsTypes,
    })
    objs = [b.getObject() for b in brains]

    for o in objs:
        schema = o.schema
        nfield = 'coordinatesOthers'
        if nfield in schema.keys():
            try:
                value = o.getCoordinatesOthers()
            except:
                value = o.getField(nfield).getStorage().get(nfield, o)
            nval  = '\n'.join(value) 
            if (isinstance(value, list) 
                or isinstance(value, tuple)):
                try:
                    o.setCoordinatesOthers(nval)
                except:
                    o.getField(nfield).getStorage().set(nfield, o, nval)
                o.reindexObject()


    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')

    migration_util.loadMigrationProfile( site, 'profile-mars.policy.migrations.v12:11-12') 
Esempio n. 4
0
def final_three01(portal):
    
    out = []
    
    loadMigrationProfile(portal, 'profile-Products.CMFPlone.migrations:3.0final-3.0.1')
    
    return out
Esempio n. 5
0
def upgrade(portal_setup):
    """
    """
    l = logging.getLogger('mars/policy/migrations/v14')
    site = portal_setup.aq_parent
    catalog = site.portal_catalog
    brains = catalog.searchResults({'portal_type': ['Site', 'Excavation', 'Stratigraphy']})
    objs = [o.getObject() for o in brains]
    for o in objs:
        ordering = o.getOrdering()
        order = ordering._order()
        for a in o.objectIds(ordered=False):
            if not a in order:
                l.error(
                    'Adding %s in %s.order' % (
                        a,
                        '/'.join(o.getPhysicalPath()),
                    )
                )
                o.getOrdering().notifyAdded(a)


    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')

    migration_util.loadMigrationProfile( site, 'profile-mars.policy.migrations.v14:13-14')
Esempio n. 6
0
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent
    catalog = site.portal_catalog
    brains = catalog.searchResults({
        'portal_type': MarsTypes,
    })
    objs = [b.getObject() for b in brains]

    for o in objs:
        schema = o.schema
        nfield = 'coordinatesOthers'
        if nfield in schema.keys():
            try:
                value = o.getCoordinatesOthers()
            except:
                value = o.getField(nfield).getStorage().get(nfield, o)
            nval = '\n'.join(value)
            if (isinstance(value, list) or isinstance(value, tuple)):
                try:
                    o.setCoordinatesOthers(nval)
                except:
                    o.getField(nfield).getStorage().set(nfield, o, nval)
                o.reindexObject()

    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')

    migration_util.loadMigrationProfile(
        site, 'profile-mars.policy.migrations.v12:11-12')
Esempio n. 7
0
def three03_three04(portal):
    
    out = []
    
    loadMigrationProfile(portal, 'profile-Products.CMFPlone.migrations:3.0.3-3.0.4')
    installNewModifiers(portal, out)

    return out
Esempio n. 8
0
def v1006(portal_setup):
    """
    """
    portal = site = portal_setup.aq_parent
    qi = site.portal_quickinstaller
    pm = portal.portal_migration
    catalog = getToolByName(portal, 'portal_catalog')
    portal_setup.runAllImportStepsFromProfile(
        'profile-Products.ATVocabularyManager:default',
        ignore_dependencies=True)
    migration_util.loadMigrationProfile(site,
                                        'profile-mars.policy.migrations:1006')
    portal_setup.runAllImportStepsFromProfile(
        'profile-plone.app.collection:default')

    for step in [
            'typeinfo',
            'factorytool',
            'propertiestool',
    ]:
        portal_setup.runImportStepFromProfile(PROFILEID,
                                              step,
                                              run_dependencies=False)
    for step in [
            'marscats',
    ]:
        portal_setup.runImportStepFromProfile(TPROFILEID,
                                              step,
                                              run_dependencies=False)
    oldmap = {
        'Collection': {
            'om': 'Collection',
            'op': 'Collection',
            'm': 'MarsCollection',
            'p': 'Mars Collection',
        },
        'Site': {
            'om': 'Site',
            'op': 'Site',
            'm': 'MarsSite',
            'p': 'Mars Site',
        },
    }
    constrain_mars(portal)
    brains = catalog.search({'portal_type': oldmap.keys()})
    for item in brains:
        obj = item.getObject()
        info = oldmap[obj.portal_type]
        changed = False
        if obj.portal_type == info['op']:
            obj.portal_type = info['p']
            changed = True
        if obj.meta_type == info['om']:
            obj.portal_type = info['m']
            changed = True
        if changed:
            obj.reindexObject()
    log('Upgrade v1006 runned.')
Esempio n. 9
0
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent

    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')

    migration_util.loadMigrationProfile( site, 'profile-mars.policy.migrations.v11:10-11') 
Esempio n. 10
0
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent

    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')
    migration_util.loadMigrationProfile(
        site, 'profile-collective.bibliocustomviews.migrations.v11:1011')
Esempio n. 11
0
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent

    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')

    migration_util.loadMigrationProfile(
        site, 'profile-mars.policy.migrations.v11:10-11')
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent

    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')
    migration_util.loadMigrationProfile(
        site,
        'profile-collective.externalimageeditor.migrations.v11:1011')
Esempio n. 13
0
def v1006(portal_setup):
    """
    """
    portal = site = portal_setup.aq_parent
    qi = site.portal_quickinstaller
    pm = portal.portal_migration
    catalog = getToolByName(portal, 'portal_catalog')
    portal_setup.runAllImportStepsFromProfile(
        'profile-Products.ATVocabularyManager:default', ignore_dependencies=True)
    migration_util.loadMigrationProfile(
        site,
        'profile-mars.policy.migrations:1006')
    portal_setup.runAllImportStepsFromProfile(
        'profile-plone.app.collection:default')

    for step in [
        'typeinfo',
        'factorytool',
        'propertiestool',
    ]:
        portal_setup.runImportStepFromProfile(
            PROFILEID, step, run_dependencies=False)
    for step in [
        'marscats',
    ]:
        portal_setup.runImportStepFromProfile(
            TPROFILEID, step, run_dependencies=False)
    oldmap = {
        'Collection': {
            'om': 'Collection', 'op':'Collection',
            'm': 'MarsCollection', 'p':'Mars Collection',
        },
        'Site': {
            'om': 'Site', 'op':'Site',
            'm': 'MarsSite', 'p':'Mars Site',
        },
    }
    constrain_mars(portal)
    brains = catalog.search({'portal_type': oldmap.keys()})
    for item in brains:
        obj = item.getObject()
        info = oldmap[obj.portal_type]
        changed = False
        if obj.portal_type == info['op']:
            obj.portal_type = info ['p']
            changed = True
        if obj.meta_type == info['om']:
            obj.portal_type = info ['m']
            changed = True
        if changed:
            obj.reindexObject()
    log('Upgrade v1006 runned.')
Esempio n. 14
0
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent
    catalog = site.portal_catalog
    brains = catalog.searchResults({'portal_type': 'Collection'})
    objs = [o.getObject() for o in brains]
    for o in objs:
        [o.getOrdering().notifyAdded(a) for a in o.objectIds(ordered=False)]

    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')

    migration_util.loadMigrationProfile( site, 'profile-mars.policy.migrations.v13:12-13') 
Esempio n. 15
0
def upgrade(portal_setup):
    """
    """
    site = portal_setup.aq_parent
    catalog = site.portal_catalog
    brains = catalog.searchResults({'portal_type': 'Collection'})
    objs = [o.getObject() for o in brains]
    for o in objs:
        [o.getOrdering().notifyAdded(a) for a in o.objectIds(ordered=False)]

    # install Products.PloneSurvey and dependencies
    #migration_util.loadMigrationProfile(site,
    #                                    'profile-Products.PloneSurvey:default')

    migration_util.loadMigrationProfile(
        site, 'profile-mars.policy.migrations.v13:12-13')
Esempio n. 16
0
File: betas.py Progetto: dtgit/dtedu
def beta2_beta3(portal):
    """ 3.0-beta2 -> 3.0-beta3
    """

    out = []

    enableZope3Site(portal, out)
    registerToolsAsUtilities(portal, out)

    loadMigrationProfile(portal, "profile-Products.CMFPlone.migrations:3.0b2-3.0b3")

    removeSharingAction(portal, out)

    addEditorToSecondaryEditorPermissions(portal, out)

    return out
Esempio n. 17
0
File: betas.py Progetto: dtgit/dtedu
def beta3_rc1(portal):
    """ 3.0-beta3 -> 3.0-rc1
    """

    out = []

    enableZope3Site(portal, out)
    registerToolsAsUtilities(portal, out)

    loadMigrationProfile(portal, "profile-Products.CMFPlone.migrations:3.0b3-3.0b4")

    moveKupuAndCMFPWControlPanel(portal, out)

    updateLanguageControlPanel(portal, out)

    updateTopicTitle(portal, out)

    modifyKSSResourcesForDevelMode(portal, out)

    return out
Esempio n. 18
0
File: betas.py Progetto: dtgit/dtedu
def beta1_beta2(portal):
    """ 3.0-beta1 -> 3.0-beta2
    """

    out = []

    enableZope3Site(portal, out)
    registerToolsAsUtilities(portal, out)

    migrateHistoryTab(portal, out)

    changeOrderOfActionProviders(portal, out)
    updateEditActionConditionForLocking(portal, out)
    addOnFormUnloadJS(portal, out)

    # Add the action a second time, now to the correct action category
    addContentRulesAction(portal, out)

    cleanupOldActions(portal, out)

    cleanDefaultCharset(portal, out)

    loadMigrationProfile(portal, "profile-Products.CMFPlone.migrations:3.0b1-3.0b2")

    addAutoGroupToPAS(portal, out)

    removeS5Actions(portal, out)

    addCacheForKSSRegistry(portal, out)

    modifyKSSResources(portal, out)

    addContributorToCreationPermissions(portal, out)

    cleanupActionProviders(portal, out)

    hidePropertiesAction(portal, out)

    return out