[Erp5-report] r19529 - in /erp5/trunk/products/ERP5Type: Base.py Core/Folder.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 26 18:08:12 CET 2008


Author: vincent
Date: Tue Feb 26 18:08:12 2008
New Revision: 19529

URL: http://svn.erp5.org?rev=19529&view=rev
Log:
Previous use of serialization_tag was not enough to prevent indexation concurency problems. Apply the original code. Though it does not use a clean way to check document level, it works.

Modified:
    erp5/trunk/products/ERP5Type/Base.py
    erp5/trunk/products/ERP5Type/Core/Folder.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=19529&r1=19528&r2=19529&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Tue Feb 26 18:08:12 2008
@@ -2713,11 +2713,30 @@
       self.activate(group_method_id='portal_catalog/catalogObjectList', 
                     alternate_method_id='alternateReindexObject',
                     group_id=group_id,
-                    serialization_tag=self.getPath() + '%',
+                    serialization_tag=self.getRootDocument(),
                     **activate_kw).immediateReindexObject(**kw)
 
   security.declarePublic('recursiveReindexObject')
   recursiveReindexObject = reindexObject
+
+  def getRootDocument(self):
+    result = self.getRootDocumentValue()
+    if result is not None:
+      result = result.getPath()
+    return result
+    
+  def getRootDocumentValue(self):
+    result = None
+    parent_value = self.getParentValue()
+    if parent_value is not None:
+      parent_id = parent_value.getId()
+      if parent_id.endswith('_module') or parent_id.startswith('portal_'):
+        result = self
+      else:
+        getRootDocumentValue = getattr(parent_value, 'getRootDocumentValue', None)
+        if getRootDocumentValue is not None:
+          result = getRootDocumentValue()
+    return result
 
   security.declareProtected( Permissions.AccessContentsInformation, 'getIndexableChildValueList' )
   def getIndexableChildValueList(self):

Modified: erp5/trunk/products/ERP5Type/Core/Folder.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Core/Folder.py?rev=19529&r1=19528&r2=19529&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Core/Folder.py (original)
+++ erp5/trunk/products/ERP5Type/Core/Folder.py Tue Feb 26 18:08:12 2008
@@ -1101,7 +1101,7 @@
                     expand_method_id='getIndexableChildValueList',
                     alternate_method_id='alternateReindexObject',
                     group_id=group_id,
-                    serialization_tag=self.getPath() + '%',
+                    serialization_tag=self.getRootDocument(),
                     **activate_kw).recursiveImmediateReindexObject(**kw)
 
   security.declareProtected( Permissions.AccessContentsInformation,




More information about the Erp5-report mailing list