Commit 72f3c092 authored by Sebastien Robin's avatar Sebastien Robin

- store the last activity uid and activity_queue uid when clearing

  the catalog
- the current way of unindexing objects does not work if the uid
  is not provided, so make sure the uid is given


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17289 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d2790877
......@@ -598,6 +598,17 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
__call__ = searchResults
security.declarePrivate('clear')
def beforeCatalogClear(self):
"""
Clears the catalog by calling a list of methods
"""
id_tool = self.getPortalObject().portal_ids
# Call generate new id in order to store the last id into
# the zodb
id_tool.generateNewLengthId(id_group='portal_activity')
id_tool.generateNewLengthId(id_group='portal_activity_queue')
security.declarePrivate('unrestrictedSearchResults')
def unrestrictedSearchResults(self, REQUEST=None, **kw):
"""Calls ZSQLCatalog.searchResults directly without restrictions.
......@@ -746,6 +757,9 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
if object is None:
raise TypeError, 'One of uid, path and object parameters must not be None'
path = self.__url(object)
if uid is None:
raise TypeError, "unindexObject supports only uid now"
self.uncatalog_object(path=path,uid=uid, sql_catalog_id=sql_catalog_id)
self.uncatalog_object(path=path, uid=uid, sql_catalog_id=sql_catalog_id)
security.declarePrivate('beforeUnindexObject')
......
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