[Erp5-report] r10339 - in /erp5/trunk/bt5/erp5_dms: WorkflowTemplateItem/portal_workflow/do...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 26 18:40:40 CEST 2006


Author: bartek
Date: Tue Sep 26 18:40:29 2006
New Revision: 10339

URL: http://svn.erp5.org?rev=10339&view=rev
Log:
triplet uniqueness check using Constraint (#20)

Modified:
    erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml
    erp5/trunk/bt5/erp5_dms/bt/revision

Modified: 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=10339&r1=10338&r2=10339&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml (original)
+++ erp5/trunk/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/document_publication_workflow/scripts/checkUniqueCoordinates.xml Tue Sep 26 18:40:29 2006
@@ -74,17 +74,11 @@
 \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(),language=o.getLanguage(),version=o.getVersion(),portal_type=context.getPortalDocumentTypeList())\n
-res=list(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
+res=o.checkConsistency()\n
+res=[c for c in res if c[1]==\'DocumentCoordinatesConstraint inconsistency\']\n
+if len(res)>0:\n
+  msg=\'<br/>\'.join(str(c[3]) for c in res)\n
+  raise ValidationFailed(msg)\n
 
 
 ]]></string> </value>
@@ -135,14 +129,14 @@
                             <string>err</string>
                             <string>_getattr_</string>
                             <string>o</string>
+                            <string>res</string>
+                            <string>append</string>
+                            <string>$append0</string>
                             <string>_getiter_</string>
-                            <string>req</string>
-                            <string>None</string>
-                            <string>context</string>
-                            <string>res</string>
-                            <string>list</string>
+                            <string>c</string>
+                            <string>_getitem_</string>
                             <string>len</string>
-                            <string>Exception</string>
+                            <string>msg</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_dms/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/bt/revision?rev=10339&r1=10338&r2=10339&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/bt/revision (original)
+++ erp5/trunk/bt5/erp5_dms/bt/revision Tue Sep 26 18:40:29 2006
@@ -1,1 +1,1 @@
-194
+196




More information about the Erp5-report mailing list