source: products/vendor/Products.CacheSetup/current/Products/CacheSetup/content/nocatalog.py @ 3296

Last change on this file since 3296 was 3296, checked in by fenix, 12 years ago

Load Products.CacheSetup?-1.2.1 into vendor/Products.CacheSetup?/current.

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1from Products.CMFCore.utils import getToolByName
2
3class NoCatalog:
4    """Mixin for content that is neither referenceable nor in the catalog.
5    Based on ATContentTypes/criteria/base.py
6    """
7    # leave unindex/uncatalog methods in so that older versions will
8    # uninstall properly
9
10    isReferenceable = None
11
12    # reference register / unregister methods
13    def _register(self, *args, **kwargs): pass
14    #def _unregister(self, *args, **kwargs): pass
15    def _updateCatalog(self, *args, **kwargs): pass
16    def _referenceApply(self, *args, **kwargs): pass
17    #def _uncatalogUID(self, *args, **kwargs): pass
18    #def _uncatalogRefs(self, *args, **kwargs): pass
19
20    # catalog methods
21    def indexObject(self, *args, **kwargs): 
22        pcs = getToolByName(self, 'portal_cache_settings', None)
23        if pcs is None:
24            return
25        pcs.incrementCatalogCount()
26       
27    #def unindexObject(self, *args, **kwargs): pass
28    def reindexObject(self, *args, **kwargs):
29        pcs = getToolByName(self, 'portal_cache_settings', None)
30        if pcs is None:
31            return
32        pcs.incrementCatalogCount()
Note: See TracBrowser for help on using the repository browser.