1 | from Products.CMFCore.utils import getToolByName |
---|
2 | |
---|
3 | class 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() |
---|