[Erp5-report] r11675 - /erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Dec 11 18:43:40 CET 2006


Author: bartek
Date: Mon Dec 11 18:43:38 2006
New Revision: 11675

URL: http://svn.erp5.org?rev=11675&view=rev
Log:
after conversion, trigger also a post-conversion script
validate conditionally, fail silently if not valid

Modified:
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml?rev=11675&r1=11674&r2=11675&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_ingestFile.xml Mon Dec 11 18:43:38 2006
@@ -71,7 +71,7 @@
             <value> <string># this script does not save file data in a document\n
 # it can be run any time\n
 # is meant to extract metadata from file name and contents\n
-\n
+from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
 if data is None:\n
   if hasattr(context,\'oo_data\'):\n
     data=context.oo_data\n
@@ -96,9 +96,12 @@
   if hasattr(context,\'convert\') and hasattr(context,\'hasFile\') and hasattr(context,\'hasOOFile\'):\n
     context.reset()\n
     if context.hasFile() and not context.hasOOFile():\n
-      context.activate( activity  = \'SQLQueue\').OOoDocument_convertAfter()\n
-  else:\n
+      context.activate().OOoDocument_convertAfter()\n
+      context.activate(after_method_id=\'OOoDocument_convertAfter\').OOoDocument_postConversion()\n
+  try:\n
     context.portal_workflow.doActionFor(context,\'validate_action\')\n
+  except ValidationFailed:\n
+    pass # we do not want to throw exception, just leave the document not validated\n
 </string> </value>
         </item>
         <item>
@@ -149,6 +152,8 @@
                           <tuple>
                             <string>fname</string>
                             <string>data</string>
+                            <string>Products.DCWorkflow.DCWorkflow</string>
+                            <string>ValidationFailed</string>
                             <string>None</string>
                             <string>hasattr</string>
                             <string>context</string>




More information about the Erp5-report mailing list