2016-02-05 01:39:53 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2013-10-10 15:36:18 +02:00
|
|
|
from Products.CMFCore.utils import getToolByName
|
|
|
|
|
2013-12-15 12:02:32 +01:00
|
|
|
|
2013-10-10 15:36:18 +02:00
|
|
|
def index_object(obj, event):
|
|
|
|
"""Index the object when it is added to the conversation.
|
|
|
|
"""
|
|
|
|
catalog = getToolByName(obj, 'portal_catalog')
|
|
|
|
return catalog.reindexObject(obj)
|
|
|
|
|
2013-12-15 12:02:32 +01:00
|
|
|
|
2013-10-10 15:36:18 +02:00
|
|
|
def unindex_object(obj, event):
|
|
|
|
"""Unindex the object when it is removed from the conversation.
|
|
|
|
"""
|
|
|
|
catalog = getToolByName(obj, 'portal_catalog')
|
|
|
|
return catalog.unindexObject(obj)
|