Commit 962042e6 authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

erp5_catalog: Rename reindexObject method to use them as new methods for CatalogTool.

- This step is needed due to the use of BaseTool as Base class for CatalogTool
  due to which there were conflict between reindexObject from the Base and the one
  from the BaseTool.
parent 0f1870bc
...@@ -837,8 +837,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -837,8 +837,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
wrapped_object_list.append(ImplicitAcquisitionWrapper(w, aq_parent(document_object))) wrapped_object_list.append(ImplicitAcquisitionWrapper(w, aq_parent(document_object)))
return wrapped_object_list return wrapped_object_list
security.declarePrivate('reindexObject') security.declarePrivate('reindexCatalogObject')
def reindexObject(self, object, idxs=None, sql_catalog_id=None,**kw): def reindexCatalogObject(self, object, idxs=None, sql_catalog_id=None,**kw):
'''Update catalog after object data has changed. '''Update catalog after object data has changed.
The optional idxs argument is a list of specific indexes The optional idxs argument is a list of specific indexes
to update (all of them by default). to update (all of them by default).
...@@ -847,6 +847,10 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -847,6 +847,10 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
url = self.__url(object) url = self.__url(object)
self.catalog_object(object, url, idxs=idxs, sql_catalog_id=sql_catalog_id,**kw) self.catalog_object(object, url, idxs=idxs, sql_catalog_id=sql_catalog_id,**kw)
# Required for compatibilty with ERP5CatalogTool
security.declarePrivate('reindexObject')
reindexObject = reindexCatalogObject
def catalogObjectList(self, object_list, *args, **kw): def catalogObjectList(self, object_list, *args, **kw):
"""Catalog a list of objects""" """Catalog a list of objects"""
......
...@@ -18,7 +18,7 @@ from Products.CMFCore.CMFCatalogAware import CMFCatalogAware ...@@ -18,7 +18,7 @@ from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from Acquisition import aq_base from Acquisition import aq_base
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
def reindexObject(self, idxs=[], *args, **kw): def reindexCatalogObject(self, idxs=[], *args, **kw):
""" """
Reindex the object in the portal catalog. Reindex the object in the portal catalog.
If idxs is present, only those indexes are reindexed. If idxs is present, only those indexes are reindexed.
...@@ -32,7 +32,7 @@ def reindexObject(self, idxs=[], *args, **kw): ...@@ -32,7 +32,7 @@ def reindexObject(self, idxs=[], *args, **kw):
if getattr(aq_base(self), 'notifyModified', None) is not None: if getattr(aq_base(self), 'notifyModified', None) is not None:
self.notifyModified() self.notifyModified()
catalog = getToolByName(self, 'portal_catalog', None) catalog = getToolByName(self, 'portal_catalog', None)
if catalog is not None: if catalog is not None :
catalog.reindexObject(self, idxs=idxs, *args, **kw) catalog.reindexCatalogObject(self, idxs=idxs, *args, **kw)
CMFCatalogAware.reindexObject = reindexObject CMFCatalogAware.reindexObject = reindexCatalogObject
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment