From 3dd22991fc843e5b83816993bc5a43ba0910c2c6 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Mon, 4 Feb 2008 13:31:47 +0000
Subject: [PATCH] Add getMetadataMappingDict, in order to make metadata update
 more flexible.

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

diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py
index ad99e62669..598bd49520 100644
--- a/product/ERP5/Document/Document.py
+++ b/product/ERP5/Document/Document.py
@@ -1211,6 +1211,22 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
     """
   convertFile = WorkflowMethod(convertFile)
 
+  security.declareProtected(Permissions.AccessContentsInformation,
+                            'getMetadataMappingDict')
+  def getMetadataMappingDict(self):
+    """
+    Return a dict of metadata mapping used to update base metadata of the
+    document
+    """
+    try:
+      method = self._getTypeBasedMethod('getMetadataMappingDict')
+    except KeyError, AttributeError:
+      method = None
+    if method is not None: 
+      return method()
+    else:
+      return {}
+
   security.declareProtected(Permissions.ModifyPortalContent, 'updateBaseMetadata')
   def updateBaseMetadata(self, **kw):
     """
-- 
2.30.9