[Erp5-report] r11779 - in /erp5/trunk/bt5/erp5_dms: SkinTemplateItem/portal_skins/erp5_dms/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Dec 20 23:53:16 CET 2006
Author: bartek
Date: Wed Dec 20 23:53:13 2006
New Revision: 11779
URL: http://svn.erp5.org?rev=11779&view=rev
Log:
fixed a problem which occurred in email ingestion because then the scripts are run as zope user, so they need to be passed user name explicitly
Modified:
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_handleMail.xml
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_setOtherProperties.xml
erp5/trunk/bt5/erp5_dms/bt/revision
Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml?rev=11779&r1=11778&r2=11779&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_createObjectFromFile.xml Wed Dec 20 23:53:13 2006
@@ -72,7 +72,7 @@
# first try from content\n
context.log(fname,doctype)\n
if doctype is None or doctype==\'\':\n
- props=context.Document_getPropertyListFromContent(context,data)\n
+ props=context.Document_getPropertyListFromContent(context,data,None)\n
doctype=props.get(\'doctype\')\n
# then from filename\n
if doctype is None or doctype==\'\':\n
@@ -103,7 +103,7 @@
# create and populate object\n
ob=mod.newContent(portal_type=doctype)\n
ob.manage_upload(data)\n
-ob.Document_setOtherProperties()\n
+ob.Document_setOtherProperties(uname)\n
ob.DMS_ingestFile(fname,data)\n
return ob\n
</string> </value>
@@ -122,7 +122,7 @@
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string>fname,data, doctype=None</string> </value>
+ <value> <string>fname,data, doctype=None,uname=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -142,7 +142,7 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>3</int> </value>
+ <value> <int>4</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
@@ -151,6 +151,7 @@
<string>fname</string>
<string>data</string>
<string>doctype</string>
+ <string>uname</string>
<string>_getattr_</string>
<string>context</string>
<string>None</string>
@@ -178,6 +179,7 @@
<value>
<tuple>
<none/>
+ <none/>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_handleMail.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_handleMail.xml?rev=11779&r1=11778&r2=11779&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_handleMail.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_handleMail.xml Wed Dec 20 23:53:13 2006
@@ -103,7 +103,7 @@
# create objects from attachments\n
try:\n
for fname,data in theMail[\'attachments\'].items():\n
- obj=context.DMS_createObjectFromFile(fname,data,mailprops.get(\'document_type\'))\n
+ obj=context.DMS_createObjectFromFile(fname,data,mailprops.get(\'document_type\'),uname=person.getReference())\n
# if some properties were in the mail, overwrite the content attrs\n
for k in mailprops:\n
atr=k\n
@@ -114,11 +114,13 @@
if gr is None:\n
print noSubordinationMsg\n
return printed\n
- obj.setGroup(person.getSubordinationValue().getGroup())\n
+ obj.setGroup(gr)\n
obj.manage_setLocalRoles(person.getReference(),[\'Owner\',])\n
context.DMS_notifyByEmail(address=senderemail,event=\'ingest\',object=obj)\n
except Exception,e:\n
- return str(e)\n
+ context.log_traceback(context)\n
+ raise\n
+ #return str(e)\n
return\n
@@ -192,7 +194,6 @@
<string>gr</string>
<string>Exception</string>
<string>e</string>
- <string>str</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_setOtherProperties.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_setOtherProperties.xml?rev=11779&r1=11778&r2=11779&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_setOtherProperties.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_setOtherProperties.xml Wed Dec 20 23:53:13 2006
@@ -92,7 +92,7 @@
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string></string> </value>
+ <value> <string>user=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -112,12 +112,14 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>0</int> </value>
+ <value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
- <tuple/>
+ <tuple>
+ <string>user</string>
+ </tuple>
</value>
</item>
</dictionary>
@@ -128,7 +130,9 @@
<item>
<key> <string>func_defaults</string> </key>
<value>
- <none/>
+ <tuple>
+ <none/>
+ </tuple>
</value>
</item>
<item>
Modified: erp5/trunk/bt5/erp5_dms/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/bt/revision?rev=11779&r1=11778&r2=11779&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/bt/revision (original)
+++ erp5/trunk/bt5/erp5_dms/bt/revision Wed Dec 20 23:53:13 2006
@@ -1,1 +1,1 @@
-420
+422
More information about the Erp5-report
mailing list