Commit 241b19d0 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Rename reindexObject and getUrl methods 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 getUrl and reindexObject from the Base and the one
  from the BaseTool.

- Rename reindexObject in CMFCatalogAware to be compatible to use in CatalogTool
  as we have renamed the reindexObject in CatalogTool
parent 5e0d8861
...@@ -895,8 +895,8 @@ class CatalogTool (BaseTool, ZCatalog, CMFCoreCatalogTool): ...@@ -895,8 +895,8 @@ class CatalogTool (BaseTool, ZCatalog, CMFCoreCatalogTool):
return ImplicitAcquisitionWrapper(w, aq_parent(document_object)) return ImplicitAcquisitionWrapper(w, aq_parent(document_object))
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).
...@@ -954,8 +954,8 @@ class CatalogTool (BaseTool, ZCatalog, CMFCoreCatalogTool): ...@@ -954,8 +954,8 @@ class CatalogTool (BaseTool, ZCatalog, CMFCoreCatalogTool):
path = self.__url(object) path = self.__url(object)
self.beforeUncatalogObject(path=path,uid=uid, sql_catalog_id=sql_catalog_id) self.beforeUncatalogObject(path=path,uid=uid, sql_catalog_id=sql_catalog_id)
security.declarePrivate('getUrl') security.declarePrivate('getCatalogUrl')
def getUrl(self, object): def getCatalogUrl(self, object):
return self.__url(object) return self.__url(object)
security.declarePrivate('moveObject') security.declarePrivate('moveObject')
......
...@@ -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.
...@@ -33,6 +33,6 @@ def reindexObject(self, idxs=[], *args, **kw): ...@@ -33,6 +33,6 @@ def reindexObject(self, idxs=[], *args, **kw):
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