Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

#6805: added migrator to make almost all the tests set up in r19070 p…

…ass; strictly the migrator isn't really necessary, but now it's probably even possible to migrate a 2.1 site to 2.5.x using blobs as file replacement...

svn path=/plone.app.blob/branches/plone-2.5-support/; revision=19071
  • Loading branch information...
commit 2ea1e2838a9e07680e3206ed42784f1f2855327e 1 parent 8987309
@witsch witsch authored
View
1  plone/app/blob/__init__.py
@@ -1,4 +1,5 @@
from plone.app.blob.config import packageName, permissions
+from plone.app.blob import migration25
def initialize(context):
View
2  plone/app/blob/content.py
@@ -46,8 +46,10 @@ class ATBlob(ATCTFileContent):
__implements__ = ATCTFileContent.__implements__, IATFile
+ meta_type = 'ATBlob'
portal_type = 'Blob'
_at_rename_after_creation = True
+ _atct_newTypeFor = {'portal_type' : 'CMF File', 'meta_type' : 'Portal File'}
schema = ATBlobSchema
security = ClassSecurityInfo()
View
17 plone/app/blob/migration25.py
@@ -0,0 +1,17 @@
+from Products.ATContentTypes.migration.common import registerATCTMigrator
+from Products.ATContentTypes.migration.walker import CatalogWalker
+from Products.ATContentTypes.migration.migrator import CMFItemMigrator
+from plone.app.blob.content import ATBlob
+
+
+class FileMigrator(CMFItemMigrator):
+ walkerClass = CatalogWalker
+
+ def custom(self):
+ ctype = self.old.getContentType()
+ file = str(self.old)
+ self.new.setFile(file, mimetype = ctype)
+
+
+registerATCTMigrator(FileMigrator, ATBlob)
+
Please sign in to comment.
Something went wrong with that request. Please try again.