From e345aaa3c0fbae38dedbc248fe7a9d5f28ae42c4 Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Tue, 1 Feb 2011 03:22:34 +0000
Subject: [PATCH] 2011-02-01 nicolas.dumazet * Changes to
 dynamic_class_generation_interaction_workflow: * use
 resetDynamicDocumentsOnceAtTransactionBoundary so that several changes to
 portal types during the same transaction are cheaper. * change trigger to
 happen after action since it's always queued at end of transaction anyway *
 add ERP5TypeInformation._setBaseCategoryList to triggers as well so that
 accessors are regenerated when base categories are changed.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42861 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../interactions/BaseType_resetDynamicClasses.xml     | 11 ++++++-----
 .../ChangeProperty_resetDynamicClasses.xml            |  8 ++++----
 .../PropertySheet_resetDynamicClasses.xml             |  8 ++++----
 .../DynamicClassGeneration_resetDynamicDocuments.xml  |  2 +-
 product/ERP5/bootstrap/erp5_core/bt/change_log        |  6 ++++++
 product/ERP5/bootstrap/erp5_core/bt/revision          |  2 +-
 6 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/BaseType_resetDynamicClasses.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/BaseType_resetDynamicClasses.xml
index 89995c250c..64764ea7df 100644
--- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/BaseType_resetDynamicClasses.xml
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/BaseType_resetDynamicClasses.xml
@@ -27,15 +27,15 @@
         <item>
             <key> <string>after_script_name</string> </key>
             <value>
-              <tuple/>
+              <list>
+                <string>DynamicClassGeneration_resetDynamicDocuments</string>
+              </list>
             </value>
         </item>
         <item>
             <key> <string>before_commit_script_name</string> </key>
             <value>
-              <list>
-                <string>DynamicClassGeneration_resetDynamicDocuments</string>
-              </list>
+              <tuple/>
             </value>
         </item>
         <item>
@@ -56,10 +56,11 @@
             <key> <string>method_id</string> </key>
             <value>
               <list>
-                <string>_setTypeClass.*</string>
+                <string>_setTypeClass</string>
                 <string>_setTypeMixin.*</string>
                 <string>_setTypeInterface.*</string>
                 <string>_setTypePropertySheet.*</string>
+                <string>_setBaseCategory.*</string>
               </list>
             </value>
         </item>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/ChangeProperty_resetDynamicClasses.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/ChangeProperty_resetDynamicClasses.xml
index 8627409033..46da6259ec 100644
--- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/ChangeProperty_resetDynamicClasses.xml
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/ChangeProperty_resetDynamicClasses.xml
@@ -27,15 +27,15 @@
         <item>
             <key> <string>after_script_name</string> </key>
             <value>
-              <tuple/>
+              <list>
+                <string>DynamicClassGeneration_resetDynamicDocuments</string>
+              </list>
             </value>
         </item>
         <item>
             <key> <string>before_commit_script_name</string> </key>
             <value>
-              <list>
-                <string>DynamicClassGeneration_resetDynamicDocuments</string>
-              </list>
+              <tuple/>
             </value>
         </item>
         <item>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/PropertySheet_resetDynamicClasses.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/PropertySheet_resetDynamicClasses.xml
index b8fa77a085..5ea1057992 100644
--- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/PropertySheet_resetDynamicClasses.xml
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/interactions/PropertySheet_resetDynamicClasses.xml
@@ -27,15 +27,15 @@
         <item>
             <key> <string>after_script_name</string> </key>
             <value>
-              <tuple/>
+              <list>
+                <string>DynamicClassGeneration_resetDynamicDocuments</string>
+              </list>
             </value>
         </item>
         <item>
             <key> <string>before_commit_script_name</string> </key>
             <value>
-              <list>
-                <string>DynamicClassGeneration_resetDynamicDocuments</string>
-              </list>
+              <tuple/>
             </value>
         </item>
         <item>
diff --git a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/scripts/DynamicClassGeneration_resetDynamicDocuments.xml b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/scripts/DynamicClassGeneration_resetDynamicDocuments.xml
index 94e89e3396..2a2747a31f 100644
--- a/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/scripts/DynamicClassGeneration_resetDynamicDocuments.xml
+++ b/product/ERP5/bootstrap/erp5_core/WorkflowTemplateItem/portal_workflow/dynamic_class_generation_interaction_workflow/scripts/DynamicClassGeneration_resetDynamicDocuments.xml
@@ -50,7 +50,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>getattr(state_change[\'object\'].getPortalObject().portal_types, \'Types Tool\').resetDynamicDocuments()\n
+            <value> <string>state_change[\'object\'].getPortalObject().portal_types.resetDynamicDocumentsOnceAtTransactionBoundary()\n
 </string> </value>
         </item>
         <item>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/change_log b/product/ERP5/bootstrap/erp5_core/bt/change_log
index 013fb869d5..0688e724df 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/change_log
+++ b/product/ERP5/bootstrap/erp5_core/bt/change_log
@@ -1,3 +1,9 @@
+2011-02-01 nicolas.dumazet
+* Changes to dynamic_class_generation_interaction_workflow:
+* use resetDynamicDocumentsOnceAtTransactionBoundary so that several changes to portal types during the same transaction are cheaper.
+* change trigger to happen after action since it's always queued at end of transaction anyway
+* add ERP5TypeInformation._setBaseCategoryList to triggers as well so that accessors are regenerated when base categories are changed.
+
 2011-01-28 Kazuhiko
 * support 'Paths of objects whose workflow history should be kept' and 'Paths of objects that should be kept' in Business Template definition.
 * support more 'Removed but ...' and 'Modified but ...' cases in business template installation dialogue.
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index 60a550fe3a..fae6c48b94 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-40859
\ No newline at end of file
+40862
\ No newline at end of file
-- 
2.30.9