Commit 0d24c12d authored by Bartek Górny's avatar Bartek Górny

after conversion, trigger also a post-conversion script

validate conditionally, fail silently if not valid

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11675 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fc6e9b7c
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<value> <string># this script does not save file data in a document\n <value> <string># this script does not save file data in a document\n
# it can be run any time\n # it can be run any time\n
# is meant to extract metadata from file name and contents\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 data is None:\n
if hasattr(context,\'oo_data\'):\n if hasattr(context,\'oo_data\'):\n
data=context.oo_data\n data=context.oo_data\n
...@@ -96,9 +96,12 @@ if fname is not None:\n ...@@ -96,9 +96,12 @@ if fname is not None:\n
if hasattr(context,\'convert\') and hasattr(context,\'hasFile\') and hasattr(context,\'hasOOFile\'):\n if hasattr(context,\'convert\') and hasattr(context,\'hasFile\') and hasattr(context,\'hasOOFile\'):\n
context.reset()\n context.reset()\n
if context.hasFile() and not context.hasOOFile():\n if context.hasFile() and not context.hasOOFile():\n
context.activate( activity = \'SQLQueue\').OOoDocument_convertAfter()\n context.activate().OOoDocument_convertAfter()\n
else:\n context.activate(after_method_id=\'OOoDocument_convertAfter\').OOoDocument_postConversion()\n
try:\n
context.portal_workflow.doActionFor(context,\'validate_action\')\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> </string> </value>
</item> </item>
<item> <item>
...@@ -149,6 +152,8 @@ if fname is not None:\n ...@@ -149,6 +152,8 @@ if fname is not None:\n
<tuple> <tuple>
<string>fname</string> <string>fname</string>
<string>data</string> <string>data</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>None</string> <string>None</string>
<string>hasattr</string> <string>hasattr</string>
<string>context</string> <string>context</string>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment