[Erp5-report] r35744 nicolas - /erp5/trunk/products/ERP5/Document/Document.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 28 17:36:50 CEST 2010


Author: nicolas
Date: Fri May 28 17:36:49 2010
New Revision: 35744

URL: http://svn.erp5.org?rev=35744&view=rev
Log:
Inherit from DocumentMixin and clean up duplicated method

Modified:
    erp5/trunk/products/ERP5/Document/Document.py

Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=35744&r1=35743&r2=35744&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Fri May 28 17:36:49 2010
@@ -58,6 +58,7 @@
 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 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 @@
     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):
     """
@@ -1217,13 +1199,6 @@
     return message
 
   security.declareProtected(Permissions.AccessContentsInformation,
-                            'isSupportBaseDataConversion')
-  def isSupportBaseDataConversion(self):
-    """
-    """
-    return False
-
-  security.declareProtected(Permissions.AccessContentsInformation,
                             'getMetadataMappingDict')
   def getMetadataMappingDict(self):
     """




More information about the Erp5-report mailing list