def upgrade8to9(setupTool): _logger.info('Upgrading EDRN Public Portal from profile version 8 to profile version 9') portal = _getPortal(setupTool) request = portal.REQUEST catalog = getToolByName(portal, 'portal_catalog') _logger.info("Disabling schema extender's cache") from archetypes.schemaextender.extender import disableCache disableCache(request) qi = getToolByName(portal, 'portal_quickinstaller') propTool = getToolByName(portal, 'portal_properties') propTool.site_properties.getProperty('enable_link_integrity_checks', True) contentRuleStorage = getUtility(IRuleStorage) _logger.info('Disabling link integrity checks') propTool.site_properties.manage_changeProperties(enable_link_integrity_checks=False) _logger.info('Disabling content rules') contentRuleStorage.active = False qi.upgradeProduct('eke.publications') qi.upgradeProduct('eke.biomarker') disablePublicationsPortlets(portal) _logger.info('Ingesting everything fully') portal.unrestrictedTraverse('@@ingestEverythingFully')() _logger.info('Clearing ingest paths to prevent automatic ingest') if portal.hasProperty('edrnIngestPaths'): portal.manage_delProperties(['edrnIngestPaths']) _logger.info('Resetting portal "from" email address') portal.manage_changeProperties(email_from_address='*****@*****.**') _logger.info('Clearing, finding, and re-building the catalog') catalog.clearFindAndRebuild() uidCatalog = getToolByName(portal, 'uid_catalog') _logger.info('Rebuilding the UID catalog') uidCatalog.manage_rebuildCatalog() transaction.commit() _logger.info('Upgrade 8-to-9 complete')
def upgrade9to10(setupTool): _logger.info('Upgrading EDRN Public Portal from profile version 9 to profile version 10') portal = _getPortal(setupTool) request = portal.REQUEST catalog, setup = getToolByName(portal, 'portal_catalog'), getToolByName(portal, 'portal_setup') _logger.info("Disabling schema extender's cache") from archetypes.schemaextender.extender import disableCache disableCache(request) qi = getToolByName(portal, 'portal_quickinstaller') propTool = getToolByName(portal, 'portal_properties') propTool.site_properties.getProperty('enable_link_integrity_checks', True) contentRuleStorage = getUtility(IRuleStorage) _logger.info('Disabling link integrity checks') propTool.site_properties.manage_changeProperties(enable_link_integrity_checks=False) _logger.info('Disabling content rules') contentRuleStorage.active = False # No, decided not to write secretome with Plone: # qi.installProduct('eke.secretome') # setup.runAllImportStepsFromProfile('profile-eke.secretome:default') disablePublicationsPortlets(portal) # Set the new bmuDataSource on biomarkers, but not on testing (this is ugly) if 'biomarkers' in portal.keys(): import socket if not socket.gethostname().startswith('tumor'): b = portal['biomarkers'] b.bmuDataSource = 'http://edrn.jpl.nasa.gov/cancerdataexpo/rdf-data/biomuta/@@rdf' _logger.info('Ingesting everything fully') portal.unrestrictedTraverse('@@ingestEverythingFully')() _logger.info('Clearing ingest paths to prevent automatic ingest') if portal.hasProperty('edrnIngestPaths'): portal.manage_delProperties(['edrnIngestPaths']) _logger.info('Resetting portal "from" email address') portal.manage_changeProperties(email_from_address='*****@*****.**') _logger.info('Clearing, finding, and re-building the catalog') catalog.clearFindAndRebuild() uidCatalog = getToolByName(portal, 'uid_catalog') _logger.info('Rebuilding the UID catalog') uidCatalog.manage_rebuildCatalog() transaction.commit() _logger.info('Upgrade 9-to-10 complete')