Commit 77f7f95c authored by Andreas Jung's avatar Andreas Jung

Interface cleanup:

Pluggable indexes no longer subclass PluggableIndex.PluggableIndex.
Instead PluggableIndex.py only contains the interface description.
parent a9880536
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"""Simple column indices""" """Simple column indices"""
__version__='$Revision: 1.6 $'[11:-2] __version__='$Revision: 1.7 $'[11:-2]
from Globals import Persistent from Globals import Persistent
from Acquisition import Implicit from Acquisition import Implicit
...@@ -38,8 +38,7 @@ from OFS.SimpleItem import SimpleItem ...@@ -38,8 +38,7 @@ from OFS.SimpleItem import SimpleItem
_marker = [] _marker = []
class FieldIndex(UnIndex,PluggableIndex.PluggableIndex, Persistent, class FieldIndex(UnIndex, Persistent, Implicit, SimpleItem):
Implicit, SimpleItem):
"""Field Indexes""" """Field Indexes"""
__implements__ = (PluggableIndex.PluggableIndexInterface,) __implements__ = (PluggableIndex.PluggableIndexInterface,)
......
...@@ -26,8 +26,7 @@ from Products.PluginIndexes.common.UnIndex import UnIndex ...@@ -26,8 +26,7 @@ from Products.PluginIndexes.common.UnIndex import UnIndex
_marker = [] _marker = []
class KeywordIndex(UnIndex,PluggableIndex.PluggableIndex,Persistent, class KeywordIndex(UnIndex,Persistent, Implicit,SimpleItem):
Implicit,SimpleItem):
__implements__ = (PluggableIndex.PluggableIndexInterface,) __implements__ = (PluggableIndex.PluggableIndexInterface,)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__ = '$Id: PathIndex.py,v 1.18 2002/04/11 19:26:40 andreasjung Exp $' __version__ = '$Id: PathIndex.py,v 1.19 2002/04/24 15:42:16 andreasjung Exp $'
from Products.PluginIndexes import PluggableIndex from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest from Products.PluginIndexes.common.util import parseIndexRequest
...@@ -30,8 +30,7 @@ import re,warnings ...@@ -30,8 +30,7 @@ import re,warnings
_marker = [] _marker = []
class PathIndex(PluggableIndex.PluggableIndex, Persistent, class PathIndex(Persistent, Implicit, SimpleItem):
Implicit, SimpleItem):
""" A path index stores all path components of the physical """ A path index stores all path components of the physical
path of an object: path of an object:
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"""Text Index """Text Index
""" """
__version__ = '$Revision: 1.27 $'[11:-2] __version__ = '$Revision: 1.28 $'[11:-2]
import re import re
...@@ -52,8 +52,7 @@ operator_dict = {'andnot': AndNot, 'and': And, 'or': Or, ...@@ -52,8 +52,7 @@ operator_dict = {'andnot': AndNot, 'and': And, 'or': Or,
'...': Near, 'near': Near, '...': Near, 'near': Near,
AndNot: AndNot, And: And, Or: Or, Near: Near} AndNot: AndNot, And: And, Or: Or, Near: Near}
class TextIndex(PluggableIndex.PluggableIndex, Persistent, class TextIndex(Persistent, Implicit, SimpleItem):
Implicit, SimpleItem):
"""Full-text index. """Full-text index.
There is a ZCatalog UML model that sheds some light on what is There is a ZCatalog UML model that sheds some light on what is
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__ = '$Id: TopicIndex.py,v 1.4 2002/04/15 19:00:45 andreasjung Exp $' __version__ = '$Id: TopicIndex.py,v 1.5 2002/04/24 15:42:16 andreasjung Exp $'
from Products.PluginIndexes import PluggableIndex from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest from Products.PluginIndexes.common.util import parseIndexRequest
...@@ -25,8 +25,7 @@ import FilteredSet ...@@ -25,8 +25,7 @@ import FilteredSet
_marker = [] _marker = []
class TopicIndex(PluggableIndex.PluggableIndex, Persistent, class TopicIndex(Persistent, Implicit, SimpleItem):
Implicit, SimpleItem):
""" A TopicIndex maintains a set of FilteredSet objects. """ A TopicIndex maintains a set of FilteredSet objects.
Every FilteredSet object consists of an expression and Every FilteredSet object consists of an expression and
......
...@@ -12,21 +12,22 @@ ...@@ -12,21 +12,22 @@
############################################################################## ##############################################################################
"""Pluggable Index Base Class """ """Pluggable Index Base Class """
__version__='$Revision: 1.3 $'[11:-2] __version__='$Revision: 1.4 $'[11:-2]
import Interface import Interface
class PluggableIndexInterface(Interface.Base):
class PluggableIndex: """interface for plugabble indexes"""
"""Base pluggable index class""" def getId():
""" return Id of index """
def getEntryForObject(documentId, default=None):
def getEntryForObject(self, documentId, default=None):
"""Get all information contained for a specific object by documentId""" """Get all information contained for a specific object by documentId"""
pass pass
def index_object(self, documentId, obj, threshold=None): def index_object(documentId, obj, threshold=None):
"""Index an object: """Index an object:
'documentId' is the integer ID of the document 'documentId' is the integer ID of the document
...@@ -38,12 +39,12 @@ class PluggableIndex: ...@@ -38,12 +39,12 @@ class PluggableIndex:
pass pass
def unindex_object(self, documentId): def unindex_object(documentId):
"""Remove the documentId from the index""" """Remove the documentId from the index"""
pass pass
def uniqueValues(self, name=None, withLengths=0): def uniqueValues(name=None, withLengths=0):
"""Returns the unique values for name. """Returns the unique values for name.
If 'withLengths' is true, returns a sequence of tuples of If 'withLengths' is true, returns a sequence of tuples of
...@@ -51,7 +52,7 @@ class PluggableIndex: ...@@ -51,7 +52,7 @@ class PluggableIndex:
pass pass
def _apply_index(self, request, cid=''): def _apply_index(request, cid=''):
"""Apply the index to query parameters given in the argument, request. """Apply the index to query parameters given in the argument, request.
The argument should be a mapping object. The argument should be a mapping object.
...@@ -69,6 +70,3 @@ class PluggableIndex: ...@@ -69,6 +70,3 @@ class PluggableIndex:
pass pass
PluggableIndexInterface = Interface.impliedInterface(PluggableIndex)
PluggableIndex.__implements__ = PluggableIndexInterface
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