From 5679e595624125c61145c1eb97b87fe0e90a53bd Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Fri, 2 Jul 2010 13:20:02 +0000
Subject: [PATCH] Add to abstract class default implementation of
 getTargetFormatItemList API. This API is responsible for getting list of
 formats a doocument can be converted to.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36809 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Document.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py
index 5e9ce2a738..d4178c636b 100644
--- a/product/ERP5/Document/Document.py
+++ b/product/ERP5/Document/Document.py
@@ -1263,3 +1263,17 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, CachedConvertableMixin,
         # but not in http://www.some.site/at
         base_url = '/'.join(base_url_list[:-1])
     return base_url
+
+  security.declareProtected(Permissions.AccessContentsInformation,
+                            'getTargetFormatItemList')
+  def getTargetFormatItemList(self):
+    """
+      Returns a list of acceptable formats for conversion
+      in the form of tuples (for listfield in ERP5Form)
+
+      NOTE: it is the responsability of the respecive type based script
+      to provide an extensive list of conversion formats.
+    """
+    method = self._getTypeBasedMethod('getTargetFormatItemList',
+              fallback_script_id='Base_getTargetFormatItemList')
+    return method()
-- 
2.30.9