Commit fd327ab4 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Filesystem bt5 Extension are stored as strings in bt5 (backward compatibility).

parent cb9d762a
......@@ -3792,20 +3792,26 @@ class ExtensionTemplateItem(FilesystemToZodbTemplateItem):
obj.text_content = f.read()
def export(self, context, bta, **kw):
path = self.__class__.__name__
path = self.__class__.__name__ + '/'
for key, obj in self._objects.iteritems():
obj = obj._getCopy(context)
# Back compatibility with filesystem Extensions
if isinstance(obj, str):
if not key.startswith(path):
key = path + key
bta.addObject(obj, name=key, ext='.py')
else:
obj = obj._getCopy(context)
f = StringIO(obj.text_content)
bta.addObject(f, key, path=path, ext='.py')
f = StringIO(obj.text_content)
bta.addObject(f, key, path=path, ext='.py')
del obj.text_content
transaction.commit()
del obj.text_content
transaction.commit()
# export object in xml
f = StringIO()
XMLExportImport.exportXML(obj._p_jar, obj._p_oid, f)
bta.addObject(f, key, path=path)
# export object in xml
f = StringIO()
XMLExportImport.exportXML(obj._p_jar, obj._p_oid, f)
bta.addObject(f, key, path=path)
@staticmethod
def _getZodbObjectId(id):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment