Commit a252382a authored by Ivan Tyagov's avatar Ivan Tyagov

Move to abstract class abstract methods from OOoDocument.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36814 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 79fedfeb
......@@ -1277,3 +1277,28 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin,
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()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment