From 2550f78692e57d530503043825cc9778471a6274 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Fri, 14 May 2010 12:49:48 +0000 Subject: [PATCH] Move generateCacheId method from IDocument interface to ICachedConvertable then remove all duplicated method declared in other interfaces git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35341 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/interfaces/cached_convertable.py | 5 +++ product/ERP5/interfaces/document.py | 42 ------------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/product/ERP5/interfaces/cached_convertable.py b/product/ERP5/interfaces/cached_convertable.py index 5a8ae61fa2a..d31b18d5162 100644 --- a/product/ERP5/interfaces/cached_convertable.py +++ b/product/ERP5/interfaces/cached_convertable.py @@ -37,6 +37,11 @@ class ICachedConvertable(Interface): interface can be cached efficiently and querried. """ + def generateCacheId(**kw): + """Return string to identify Document in cache pool with + all arguments used to convert the document + """ + def hasConversion(**kw): """ Return True if the conversion is already cache, False else. diff --git a/product/ERP5/interfaces/document.py b/product/ERP5/interfaces/document.py index 4685377249b..83e2e767190 100644 --- a/product/ERP5/interfaces/document.py +++ b/product/ERP5/interfaces/document.py @@ -194,48 +194,6 @@ class IDocument(Interface): **kw can be various things - e.g. resolution """ - def generateCacheId(**kw): - """Return string to identify Document in cache pool with - all arguments used to convert the document - """ - - def convertToBaseFormat(**kw): - """Converts the content of the document to a base format - which is later used for all conversions. This method - is common to all kinds of documents and handles - exceptions in a unified way. - - Implementation is delegated to _convertToBaseFormat which - must be overloaded by subclasses of Document which - need a base format. - - convertToBaseFormat is called upon file upload, document - ingestion by the processing_status_workflow. - - NOTE: the data of the base format conversion should be stored - using the base_data property. Refer to Document.py propertysheet. - Use accessors (getBaseData, setBaseData, hasBaseData, etc.) - """ - - def hasConversion(**kw): - """Return a boolean if conversion is cached - """ - - def setConversion(data, mime=None, calculation_time=None, **kw): - """Saves a version of the document in a given format; records mime type - and conversion time (which is right now). - """ - - def getConversion(**kw): - """Returns version of the document in a given format, if it has it; otherwise - returns empty string (the caller should check hasConversion before calling - this function. - """ - - def getConversionSize(**kw): - """Returns the size of the converted document. - """ - def isSupportBaseDataConversion(): """This is a public interface to check a document that is support conversion to base format and can be overridden in subclasses. -- 2.30.9