[CMF-checkins] CVS: CMF/CMFCore - CMFCatalogAware.py:1.6 CatalogTool.py:1.28

Florent Guillaume fg@nuxeo.com
Mon, 1 Jul 2002 11:09:33 -0400


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv8171/CMFCore

Modified Files:
	CMFCatalogAware.py CatalogTool.py 
Log Message:
Added an optional idxs argument to reindexObject to ask it to only
update specific indexes. This will be helpful to only reindex
allowedRolesAndUsers when local roles change.


=== CMF/CMFCore/CMFCatalogAware.py 1.5 => 1.6 ===
 
     security.declareProtected(ModifyPortalContent, 'reindexObject')
-    def reindexObject(self):
+    def reindexObject(self, idxs=[]):
         catalog = getToolByName(self, 'portal_catalog', None)
         if catalog is not None:
-            catalog.reindexObject(self)
-        
+            catalog.reindexObject(self, idxs=idxs)
+
     def manage_afterAdd(self, item, container):
         """
             Add self to the workflow and catalog.


=== CMF/CMFCore/CatalogTool.py 1.27 => 1.28 ===
 
     security.declarePrivate('reindexObject')
-    def reindexObject(self, object):
+    def reindexObject(self, object, idxs=[]):
         '''Update catalog after object data has changed.
+        The optional idxs argument is a list of specific indexes
+        to update (all of them by default).
         '''
         url = self.__url(object)
         ## Zope 2.3 ZCatalog is supposed to work better if
         ## you don't uncatalog_object() when reindexing.
         # self.uncatalog_object(url)
-        self.catalog_object(object, url)
+        self.catalog_object(object, url, idxs=idxs)
 
 InitializeClass(CatalogTool)