From c97ba56977d082ea917cc395dc3079c6dfe2fb1a Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Fri, 28 May 2010 15:36:49 +0000 Subject: [PATCH] Inherit from DocumentMixin and clean up duplicated method git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35744 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Document.py | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py index ff0991f7ad..30c830c350 100644 --- a/product/ERP5/Document/Document.py +++ b/product/ERP5/Document/Document.py @@ -58,6 +58,7 @@ from subprocess import Popen, PIPE from Products.ERP5.mixin.cached_convertable import CachedConvertableMixin from Products.ERP5.mixin.text_convertable import TextConvertableMixin from Products.ERP5.mixin.downloadable import DownloadableMixin +from Products.ERP5.mixin.document import DocumentMixin _MARKER = [] VALID_ORDER_KEY_LIST = ('user_login', 'content', 'file_name', 'input') @@ -318,7 +319,7 @@ class UpdateMixIn: class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, SnapshotMixin, UpdateMixIn, TextConvertableMixin, - DownloadableMixin): + DownloadableMixin, DocumentMixin): """Document is an abstract class with all methods related to document management in ERP5. This includes searchable text, explicit relations, implicit relations, metadata, versions, languages, etc. @@ -1057,25 +1058,6 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, method = self._getTypeBasedMethod('finishIngestion', fallback_script_id='Document_finishIngestion') return method() - # Conversion methods - security.declareProtected(Permissions.AccessContentsInformation, 'convert') - def convert(self, format, **kw): - """ - Main content conversion function, returns result which should - be returned and stored in cache. - format - the format specied in the form of an extension - string (ex. jpeg, html, text, txt, etc.) - **kw can be various things - e.g. resolution - - Default implementation returns an empty string (html, text) - or raises an error. - - TODO: - - implement guards API so that conversion to certain - formats require certain permission - """ - raise NotImplementedError - security.declareProtected(Permissions.View, 'asSubjectText') def asSubjectText(self, **kw): """ @@ -1216,13 +1198,6 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin, message = '' return message - security.declareProtected(Permissions.AccessContentsInformation, - 'isSupportBaseDataConversion') - def isSupportBaseDataConversion(self): - """ - """ - return False - security.declareProtected(Permissions.AccessContentsInformation, 'getMetadataMappingDict') def getMetadataMappingDict(self): -- 2.30.9