From aabd4633439e0fb20e609aed39005efbac6b61da Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Mon, 27 Aug 2007 12:51:31 +0000
Subject: [PATCH] Extend newContent API to support ZPublisher based calls for
 email ingestion (so that we no longer need ZMailIn or CMFMailIn).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15829 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Tool/ContributionTool.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/Tool/ContributionTool.py b/product/ERP5/Tool/ContributionTool.py
index f13b3503c5..cbb39b9171 100644
--- a/product/ERP5/Tool/ContributionTool.py
+++ b/product/ERP5/Tool/ContributionTool.py
@@ -199,7 +199,7 @@ class ContributionTool(BaseTool):
   def newContent(self, id=None, portal_type=None, url=None, container=None,
                        container_path=None,
                        discover_metadata=1, temp_object=0,
-                       user_login=None, **kw):
+                       user_login=None, data=None, file_name=None, **kw):
     """
       The newContent method is overriden to implement smart content
       creation by detecting the portal type based on whatever information
@@ -223,6 +223,10 @@ class ContributionTool(BaseTool):
         We always generate ID. So, we must prevent using the one
         which we were provided.
     """
+    if file_name is not None: kw['file_name'] = file_name
+    if data is not None: kw['data'] = data # This is only used to make sure
+                                           # we can pass file as parameter to ZPublisher
+                                           # whenever we ingest email
     # Temp objects use the standard newContent from Folder
     if temp_object:
       # For temp_object creation, use the standard method
-- 
2.30.9