Commit 950e4adc authored by Jean-Paul Smets's avatar Jean-Paul Smets

better catalog_object method


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@53 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a22dae2f
......@@ -31,7 +31,7 @@ from Products.ZSQLCatalog.ZSQLCatalog import ZCatalog
from Products.CMFCore import CMFCorePermissions
from AccessControl import ClassSecurityInfo, getSecurityManager
from Products.CMFCore.CatalogTool import IndexableObjectWrapper as CMFCoreIndexableObjectWrapper
from Products.CMFCore.utils import UniqueObject, _checkPermission, _getAuthenticatedUser
from Products.CMFCore.utils import UniqueObject, _checkPermission, _getAuthenticatedUser, getToolByName
from Globals import InitializeClass, DTMLFile, PersistentMapping
from Acquisition import aq_base, aq_inner, aq_parent
from DateTime.DateTime import DateTime
......@@ -95,7 +95,6 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool):
_listAllowedRolesAndUsers = CMFCoreCatalogTool._listAllowedRolesAndUsers
__url = CMFCoreCatalogTool.__url
manage_catalogFind = CMFCoreCatalogTool.manage_catalogFind
catalog_object = CMFCoreCatalogTool.catalog_object
security.declareProtected( CMFCorePermissions.ManagePortal
, 'manage_filter' )
......@@ -293,16 +292,14 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool):
return apply(ZCatalog.countResults, (self, REQUEST), kw)
def catalog_object(self, object, uid, idxs=[]):
# Wraps the object with workflow and accessibility
# information just before cataloging.
wf = getattr(self, 'portal_workflow', None)
wf = getToolByName(self, 'portal_workflow')
if wf is not None:
vars = wf.getCatalogVariablesFor(object)
else:
vars = {}
w = IndexableObjectWrapper(vars, object)
#try:
ZCatalog.catalog_object(self, w, uid)
ZCatalog.catalog_object(self, w, uid, idxs)
#except:
# When we import data into Zope
# the ZSQLCatalog does not work currently
......
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