[Erp5-report] r36814 ivan - /erp5/trunk/products/ERP5/Document/Document.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jul 2 16:06:32 CEST 2010
Author: ivan
Date: Fri Jul 2 16:06:30 2010
New Revision: 36814
URL: http://svn.erp5.org?rev=36814&view=rev
Log:
Move to abstract class abstract methods from OOoDocument.
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=36814&r1=36813&r2=36814&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Fri Jul 2 16:06:30 2010
@@ -1277,3 +1277,28 @@ class Document(PermanentURLMixIn, XMLObj
method = self._getTypeBasedMethod('getTargetFormatItemList',
fallback_script_id='Base_getTargetFormatItemList')
return method()
+
+ security.declareProtected(Permissions.AccessContentsInformation,
+ 'getTargetFormatTitleList')
+ def getTargetFormatTitleList(self):
+ """
+ Returns a list of acceptable formats for conversion
+ """
+ return map(lambda x: x[0], self.getTargetFormatItemList())
+
+ security.declareProtected(Permissions.AccessContentsInformation,
+ 'getTargetFormatList')
+ def getTargetFormatList(self):
+ """
+ Returns a list of acceptable formats for conversion
+ """
+ return map(lambda x: x[1], self.getTargetFormatItemList())
+
+ security.declareProtected(Permissions.ModifyPortalContent,
+ 'isTargetFormatAllowed')
+ def isTargetFormatAllowed(self, format):
+ """
+ Checks if the current document can be converted
+ into the specified target format.
+ """
+ return format in self.getTargetFormatList()
More information about the Erp5-report
mailing list