[Erp5-report] r9934 - in /erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/docu...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Sep 14 19:05:14 CEST 2006
Author: bartek
Date: Thu Sep 14 19:05:12 2006
New Revision: 9934
URL: http://svn.erp5.org?rev=9934&view=rev
Log:
Verify uniqueness of doc identifier upon submission
Added:
erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml
Modified:
erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/submit_action.xml
Added: erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml?rev=9934&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml (added)
+++ erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml Thu Sep 14 19:05:12 2006
@@ -1,0 +1,177 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <tuple>
+ <string>Products.PythonScripts.PythonScript</string>
+ <string>PythonScript</string>
+ </tuple>
+ <none/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Python_magic</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
+\n
+err=\'\'\n
+o=state_change.object\n
+for req in (\'reference\', \'language\', \'version\'):\n
+ if o.getProperty(req) is None or o.getProperty(req)==\'\':\n
+ err+=\'E: %s is None \' % req\n
+if err:\n
+ raise ValidationFailed(err)\n
+res=context.portal_catalog(reference=o.getReference())\n
+res=[r.getObject() for r in res]\n
+res=filter(lambda r:r.getLanguage()==o.getLanguage() and r.getVersion()==o.getVersion(),res)\n
+if len(res)==2: # this and the other one\n
+ raise ValidationFailed(\'E: another object %s - %s - %s exists\' % (o.getReference(),o.getLanguage(),o.getVersion()))\n
+if len(res)>2:\n
+ raise Exception(\'Fatal error: multiple objects %s - %s - %s exist\' % (o.getReference(),o.getLanguage(),o.getVersion()))\n
+
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>state_change</string> </value>
+ </item>
+ <item>
+ <key> <string>errors</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_code</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>co_argcount</string> </key>
+ <value> <int>1</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>state_change</string>
+ <string>Products.DCWorkflow.DCWorkflow</string>
+ <string>ValidationFailed</string>
+ <string>err</string>
+ <string>_getattr_</string>
+ <string>o</string>
+ <string>_getiter_</string>
+ <string>req</string>
+ <string>None</string>
+ <string>context</string>
+ <string>res</string>
+ <string>append</string>
+ <string>$append0</string>
+ <string>r</string>
+ <string>filter</string>
+ <string>len</string>
+ <string>Exception</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>checkUniqueCoordinates</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/submit_action.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/submit_action.xml?rev=9934&r1=9933&r2=9934&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/submit_action.xml (original)
+++ erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/transitions/submit_action.xml Thu Sep 14 19:05:12 2006
@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
- <value> <string></string> </value>
+ <value> <string>checkUniqueCoordinates</string> </value>
</item>
<item>
<key> <string>title</string> </key>
More information about the Erp5-report
mailing list