source: trunk/LeMillCatalogTool.py @ 2417

Revision 2416, 1.2 KB checked in by anonymous, 11 years ago (diff)

Fixed issue where checks for good title used catalog fields which aren't there and returned all catalog objects in deletion list.

Line 
1#
2# Plone CatalogTool simplified -- does not use ExtensibleIndexableObjectWrapper, workflows or permissions. Basically just ZCatalog posing as Plone Tool, allowing but ignoring plonish commands.
3#
4
5from Products.CMFPlone import ToolNames
6from AccessControl import ClassSecurityInfo
7from Globals import InitializeClass
8from Globals import DTMLFile
9
10from Products.ZCatalog.ZCatalog import ZCatalog
11from Products.CMFPlone.CatalogTool import CatalogTool as PloneCatalogTool
12
13from zope.interface import implements
14
15
16class CatalogTool(PloneCatalogTool):
17
18    meta_type = 'LeMill Catalog Tool'
19    security = ClassSecurityInfo()
20    toolicon = 'skins/lemill/tool.gif'
21
22    __implements__ = PloneCatalogTool.__implements__
23   
24
25    def catalog_object(self, object, uid, idxs=[],
26                       update_metadata=1, pghandler=None):
27        if object.portal_type!='CollectionsFolder':
28            ZCatalog.catalog_object(self, object, uid, idxs, update_metadata, pghandler=pghandler)
29
30    def searchResults(self, REQUEST=None, **kw):
31        """Calls ZCatalog.searchResults """
32        return ZCatalog.searchResults(self, REQUEST, **kw)
33
34    __call__ = searchResults
35
36
37CatalogTool.__doc__ = PloneCatalogTool.__doc__
38
39InitializeClass(CatalogTool)
Note: See TracBrowser for help on using the repository browser.