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