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