def migrateToFSS(self, REQUEST): """Let's migrate all relevant site content fields""" really_migrate = REQUEST.get('imsure', None) if not really_migrate: message = _( u'report_no_migration', default=u"You didn't check \"I'm sure\", migration canceled") IStatusMessage(REQUEST).addStatusMessage(message, type='info') REQUEST.RESPONSE.redirect(REQUEST.URL1) return # We do it really... do_log = bool(REQUEST.get('logtomigration', False)) commit_every = REQUEST.get('transactioncount') migrator = Migrator(getSite(), do_log, commit_every) count = migrator.migrateToFSS() results = { u'count': count} message = _( u'report_migration_to_fss', default=u"${count} content items migrated to FSS", mapping=results) IStatusMessage(REQUEST).addStatusMessage(message, type='info') REQUEST.RESPONSE.redirect(REQUEST.URL1) return
def test_migrations(self): """Testing migrations from natural ATCT storage (Annotation ?) """ from iw.fss.zcml import patchedTypesRegistry self.loginAsPortalOwner() # Install content from zexp zexp_path = os.path.join(self.getDataPath(), 'migration-in.zexp') self.portal._importObjectFromFile(zexp_path) self._checkImportedContent() # We apply FSS settings to ATCT zcml.load_config('atct.zcml', iw.fss) # We process the migration migrator = Migrator(self.portal) migrator.migrateToFSS() # We check we have the same content (AT API pov) self._checkImportedContent(1) # Deleting imported stuff self.portal._delObject('migration-in') patchedTypesRegistry = {} return
def migrateToFSS(self, REQUEST): """Let's migrate all relevant site content fields""" really_migrate = REQUEST.get('imsure', None) if not really_migrate: message = _( u'report_no_migration', default=u"You didn't check \"I'm sure\", migration canceled") IStatusMessage(REQUEST).addStatusMessage(message, type='info') REQUEST.RESPONSE.redirect(REQUEST.URL1) return # We do it really... do_log = bool(REQUEST.get('logtomigration', False)) commit_every = REQUEST.get('transactioncount') migrator = Migrator(getSite(), do_log, commit_every) count = migrator.migrateToFSS() results = {u'count': count} message = _(u'report_migration_to_fss', default=u"${count} content items migrated to FSS", mapping=results) IStatusMessage(REQUEST).addStatusMessage(message, type='info') REQUEST.RESPONSE.redirect(REQUEST.URL1) return