Example #1
0
 def testModificationTimeDuringInlineImageMigration(self):
     foo = self.folder[self.folder.invokeFactory('Image', id='foo')]
     foo.schema['image'] = ImageField('image', storage=AnnotationStorage())
     foo.schema['image'].set(foo, getImage())
     # record the modification date before migration
     mod = foo.modified()
     # migrate using inline migrator
     migrate(self.portal, portal_type='Image', meta_type='ATBlob')
     # the modification date isn't changed by migration
     self.assertEqual(mod, foo.modified())
 def testModificationTimeDuringInlineImageMigration(self):
     foo = self.folder[self.folder.invokeFactory('Image', id='foo')]
     foo.schema['image'] = ImageField('image', storage=AnnotationStorage())
     foo.schema['image'].set(foo, getImage())
     # record the modification date before migration
     mod = foo.modified()
     # migrate using inline migrator
     migrate(self.portal, portal_type='Image', meta_type='ATBlob')
     # the modification date isn't changed by migration
     self.assertEqual(mod, foo.modified())
     # cleanup
     del foo.schema['image']
Example #3
0
def migrate_issue_attachments_to_blobstorage(context):
    from plone.app.blob.migrations import migrate
    logger.info('Migrating to blob attachments for issues. '
                'This can take a long time...')
    # Technically, the plone.app.blob migration says it is only for non blob
    # fields that are still in the schema but are overridden using
    # archetypes.schemaextender with a blob field with the same name.  But it
    # seems to go fine for Issues where we have simply changed the schema
    # directly.  The getters of a BlobFileField and normal FileField don't
    # differ that much.
    migrate(context, 'PoiIssue')
    logger.info("Done migrating to blob attachment for issues.")
Example #4
0
def migrate_issue_attachments_to_blobstorage(context):
    from plone.app.blob.migrations import migrate
    logger.info('Migrating to blob attachments for issues. '
                'This can take a long time...')
    # Technically, the plone.app.blob migration says it is only for non blob
    # fields that are still in the schema but are overridden using
    # archetypes.schemaextender with a blob field with the same name.  But it
    # seems to go fine for Issues where we have simply changed the schema
    # directly.  The getters of a BlobFileField and normal FileField don't
    # differ that much.
    migrate(context, 'PoiIssue')
    logger.info("Done migrating to blob attachment for issues.")
Example #5
0
 def testOldScalesRemovedDuringInlineImageMigration(self):
     gif = getImage()
     foo = self.folder[self.folder.invokeFactory('Image', id='foo',
         title='an image', image=gif)]
     # fake an old ImageField in the class schema,
     # and store scales in AnnotationStorage
     foo.schema['image'] = ImageField('image', storage=AnnotationStorage())
     foo.schema['image'].set(foo, gif)
     isimage = lambda i: isinstance(i, Image)
     self.failUnless(filter(isimage, IAnnotations(foo).values()))
     # migrate using inline migrator
     migrate(self.portal, portal_type='Image', meta_type='ATBlob')
     # make sure all scale annotations were removed
     self.failIf(filter(isimage, IAnnotations(foo).values()))
Example #6
0
 def testOldScalesRemovedDuringInlineImageMigration(self):
     gif = getImage()
     foo = self.folder[self.folder.invokeFactory('Image', id='foo',
         title='an image', image=gif)]
     # fake an old ImageField in the class schema,
     # and store scales in AnnotationStorage
     foo.schema['image'] = ImageField('image', storage=AnnotationStorage())
     foo.schema['image'].set(foo, gif)
     isimage = lambda i: isinstance(i, Image)
     self.assertTrue(filter(isimage, IAnnotations(foo).values()))
     # migrate using inline migrator
     migrate(self.portal, portal_type='Image', meta_type='ATBlob')
     # make sure all scale annotations were removed
     self.assertFalse(filter(isimage, IAnnotations(foo).values()))
     # cleanup
     del foo.schema['image']
Example #7
0
def migrateFtwFiles(context):

    portal = getToolByName(context, "portal_url").getPortalObject()
    out = ""
    try:
        catalog_class = applyCatalogPatch(portal)
        out = migrate(context, walker=getFtwFileMigrationWalker)
    finally:
        removeCatalogPatch(catalog_class)

    return out
def migrateImagedEvent(context):
    if migrate is None:
        raise RuntimeError('You need plone.app.blob installed')
    return migrate(context, "Event", meta_type="ATEvent")
 def migrations(self):
     out = ''
     for walker in self.walkers():
         out += migrate(self, walker=lambda x: walker)
     return out
Example #10
0
def migrateMonetEvent(context):
    if migrate is None:
        raise RuntimeError('You need plone.app.blob installed')
    return migrate(context, "Event", meta_type="ATEvent")
def migrateRed5Streams(context):
    return migrate(context, walker=getRed5StreamsMigrationWalker)
Example #12
0
def migrate_to_blob_fields(context):
    from plone.app.blob.migrations import migrate
    logger.info("Migrating to blob fields...")
    migrate(context, 'Project')
    logger.info("Done migrating to blob fields.")
Example #13
0
def migrateLxarquivo(context):
    return migrate(context, 'Lxarquivo')
Example #14
0
def migrateRTInternalVideo(context):
    from plone.app.blob.migrations import migrate
    return migrate(context, 'RTInternalVideo')
Example #15
0
def migrateChamada(self):
    return migrate(self, walker=getChamadaMigrationWalker)
Example #16
0
def migrateRTInternalVideo(context):
    from plone.app.blob.migrations import migrate
    return migrate(context, 'RTInternalVideo')
Example #17
0
def migrateArtista(self):
    return migrate(self, walker=getArtistaMigrationWalker)
Example #18
0
def migrateRed5Streams(context):
    return migrate(context, walker=getRed5StreamsMigrationWalker)
Example #19
0
def change_paragraph_image_storage_type_to_blobstorage(context):
    """Change the storagetype of the imagefield for paragraph"""

    print migrate(context, 'Paragraph')
    print migrate(context, 'News')
    transaction.commit()
Example #20
0
def migrateVwBlob(context):
    return migrate(context, 'VwireLens')
Example #21
0
def migrateSuperFile(self):
    return migrate(self, walker=getSuperFileMigrationWalker)
 def migration(self):
     return migrate(self, walker=ArticleTeaserMigrationView.walker)
Example #23
0
def migrateNewsItem(self):
    return migrate(self, walker=getNewsItemMigrationWalker)