示例#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())
示例#2
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())
     # cleanup
     del foo.schema['image']
示例#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.")
示例#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.")
示例#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()))
示例#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']
示例#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")
示例#9
0
 def migrations(self):
     out = ''
     for walker in self.walkers():
         out += migrate(self, walker=lambda x: walker)
     return out
示例#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)
示例#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.")
示例#13
0
def migrateLxarquivo(context):
    return migrate(context, 'Lxarquivo')
示例#14
0
def migrateRTInternalVideo(context):
    from plone.app.blob.migrations import migrate
    return migrate(context, 'RTInternalVideo')
示例#15
0
def migrateChamada(self):
    return migrate(self, walker=getChamadaMigrationWalker)
示例#16
0
def migrateRTInternalVideo(context):
    from plone.app.blob.migrations import migrate
    return migrate(context, 'RTInternalVideo')
示例#17
0
def migrateArtista(self):
    return migrate(self, walker=getArtistaMigrationWalker)
示例#18
0
def migrateRed5Streams(context):
    return migrate(context, walker=getRed5StreamsMigrationWalker)
示例#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()
示例#20
0
def migrateVwBlob(context):
    return migrate(context, 'VwireLens')
示例#21
0
def migrateSuperFile(self):
    return migrate(self, walker=getSuperFileMigrationWalker)
示例#22
0
 def migration(self):
     return migrate(self, walker=ArticleTeaserMigrationView.walker)
示例#23
0
def migrateNewsItem(self):
    return migrate(self, walker=getNewsItemMigrationWalker)