diff --git a/imio/dms/mail/adapters.py b/imio/dms/mail/adapters.py index e9844f61..a398890d 100644 --- a/imio/dms/mail/adapters.py +++ b/imio/dms/mail/adapters.py @@ -3,6 +3,7 @@ from AccessControl import getSecurityManager from collective.classification.folder.interfaces import IServiceInCharge from collective.classification.folder.interfaces import IServiceInCopy +from collective.collabora.adapters import DXStoredFile from collective.collabora.interfaces import IStoredFile from collective.contact.core.content.held_position import IHeldPosition from collective.contact.core.content.organization import IOrganization @@ -1050,26 +1051,11 @@ def get(self): @adapter(IPODTemplate) @implementer(IStoredFile) -class StoredPodTemplate(object): +class StoredPodTemplate(DXStoredFile): """Access the file storage on a PODTemplate content object. - i.e. the file attribute on the content object. + i.e. the ``odt_file`` attribute on the content object. """ - - def __init__(self, context): - self.context = context - self.filename = context.odt_file.filename - self.contentType = context.odt_file.contentType - - @property - def data(self): - return self.context.odt_file.data - - @data.setter - def data(self, data): - self.context.odt_file = NamedBlobFile( - data=data, filename=self.filename, contentType=self.contentType - ) - - def getSize(self): - return self.context.odt_file.getSize() + # this re-uses the collective.collabora adapter, with only a different + # file_field_name + file_field_name = "odt_file" diff --git a/setup.py b/setup.py index 1b09dcfd..a67527da 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#! -*- coding: utf8 -*- +#! -*- coding: utf-8 -*- from setuptools import find_packages from setuptools import setup @@ -48,6 +48,7 @@ "collective.ckeditor", "collective.ckeditortemplates", "collective.classification.folder", + "collective.collabora>=1.1.0", "collective.contact.core", "collective.contact.contactlist", "collective.contact.duplicated",