[Erp5-report] r14318 - /erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widg...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu May 3 11:04:47 CEST 2007
Author: ivan
Date: Thu May 3 11:04:47 2007
New Revision: 14318
URL: http://svn.erp5.org?rev=14318&view=rev
Log:
Code refactoring. Meta data discover is done in an activity and errors can not be detected in this script.
Modified:
erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml
Modified: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml?rev=14318&r1=14317&r2=14318&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml (original)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSite_contributeContent.xml Thu May 3 11:04:47 2007
@@ -87,31 +87,14 @@
if contribute_file is not None:\n
kw[\'file\'] = contribute_file\n
\n
-kw[\'discover_metadata\'] = 0 # We want to discover metadata synchronously\n
+# We want to discover metadata synchronously \n
+kw[\'discover_metadata\'] = 0 \n
\n
-#try:\n
-if 1:\n
- new_content = context.portal_contributions.newContent(**kw)\n
- if hasattr(contribute_file, \'filename\'):\n
- file_name = contribute_file.filename\n
- else:\n
- file_name = None\n
- merged_content = new_content.discoverMetadata(file_name=file_name) # Consider putting an exception handler\n
- if merged_content is not new_content:\n
- msg = context.Base_translateString(\'Document successfully updated\')\n
- target = merged_content\n
- else:\n
- msg = context.Base_translateString(\'Document successfully created\')\n
- target = new_content\n
- editable_mode = 1\n
-else:\n
-#except Exception, e:\n
- msg = \'There was a problem: ${exception}\'\n
- msg = context.Base_translateString(msg, mapping=dict(exception=str(e)))\n
- target = context\n
- editable_mode = 0\n
+new_content = context.portal_contributions.newContent(**kw)\n
+msg = context.Base_translateString(\'Document successfully created\')\n
\n
-return target.Base_redirect(\'view\', keep_items=dict(portal_status_message=msg, editable_mode=editable_mode))\n
+return new_content.Base_redirect(\'view\', \n
+ keep_items=dict(portal_status_message=msg, editable_mode=1))\n
</string> </value>
</item>
<item>
@@ -122,12 +105,6 @@
</item>
<item>
<key> <string>_filepath</string> </key>
- <value>
- <none/>
- </value>
- </item>
- <item>
- <key> <string>_owner</string> </key>
<value>
<none/>
</value>
@@ -171,15 +148,8 @@
<string>_getattr_</string>
<string>context</string>
<string>new_content</string>
- <string>hasattr</string>
- <string>file_name</string>
- <string>merged_content</string>
<string>msg</string>
- <string>target</string>
- <string>editable_mode</string>
<string>dict</string>
- <string>str</string>
- <string>e</string>
</tuple>
</value>
</item>
More information about the Erp5-report
mailing list