Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
bbc95d18
Commit
bbc95d18
authored
Jul 31, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up top-level
parent
42f70ca2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
117 deletions
+10
-117
src/Products/PluginIndexes/README.txt
src/Products/PluginIndexes/README.txt
+0
-104
src/Products/PluginIndexes/__init__.py
src/Products/PluginIndexes/__init__.py
+6
-6
src/Products/PluginIndexes/interfaces.py
src/Products/PluginIndexes/interfaces.py
+4
-7
No files found.
src/Products/PluginIndexes/README.txt
deleted
100644 → 0
View file @
42f70ca2
Zope 2.4 introduces a new way to register customized indexes
(see PluggableIndex interface).
Changes to Indexes:
New package structure
- The indexes (TextIndex, FieldIndex, KeywordIndex, PathIndex) shipped
with the Zope 2.4 distribution now live in 'lib/python/Products/PluginIndexes'.
Every index type has now its own package containing all dependent
modules, DTML management files...
- modules used by all index types reside in the 'common' directory
- all dependencies from the 'lib/python/SearchIndex' directory were removed
- 'lib/python/SearchIndex' is deprecated and should no longer be used.
It is kept for backward compatibility.
Changes to all indexes:
- every index type implements the PluggableIndex interface
- 'common/util.py' provides functionality for handling the 'request'
parameter of the _apply_index() function. _apply_index()
now handles old-style ZCatalog parameters, passing of Record
instances and dictionary-like parameters. See common/util.py
for details.
Changes to KeywordIndex:
- default search operator 'or' may be overridden by specifying a new one as
'operator' (see below)
- internal changes
Changes to FieldIndex:
- internal changes
Changes for PathIndex:
- new index type
Changes to ZCatalog
- added ZCatalogIndexes.py to provide access to indexes with pluggable
index interface
Parameter passing to the ZCatalog
Parameter passing to the ZCatalog/Catalog has been enhanced and unified
and is now much more logical.
- Method 1: The old way to pass a query including parameters to an index XXX
was to specify the query as value in the request dictionary. Additional
parameters were passed XXX_parameter : <value> in the request dictionary.
(This method is deprecated).
- Method 2: The query and all parameters to be passed to an index XXX are
passed as dictionary inside the request dictionary. Example:
old: <dtml-in myCatalog(myindex='xx yy')
new: <dtml-in myCatalog(myindex={'query':'xx yy','XXXXX':'blabla')
Please check the indexes documentation for informations about additional
parameters.
- Method 3: Inside a formular you can use Record as types for parameter passing.
Example:
<form action=...>
<input type=text name="person.query:record" value="">
<input type=hidden name="person.operator:record" value="and">
..</form>
and in the DTML method:
<dtml-in myCatalog(person=person)>
This example will pass both parameters as a Record instance to the index
'person'.
All index types of Zope support all three methods. On the DTML level only
method 3 type parameter should be used.
Backward compatibility:
- any existing pre-2.4 ZCatalog should work under 2.4
- pre-2.4 indexes of a ZCatalog are marked as 'pre-2.4 Index' in the Index view of the
ZCatalog
- '# objects' is set to 'not available' for pre-2.4 indexes
src/Products/PluginIndexes/__init__.py
View file @
bbc95d18
...
@@ -19,7 +19,7 @@ def initialize(context):
...
@@ -19,7 +19,7 @@ def initialize(context):
from
Products.PluginIndexes.FieldIndex.FieldIndex
\
from
Products.PluginIndexes.FieldIndex.FieldIndex
\
import
manage_addFieldIndexForm
import
manage_addFieldIndexForm
context
.
registerClass
(
FieldIndex
,
context
.
registerClass
(
FieldIndex
,
permission
=
'Add Pluggable Index'
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addFieldIndexForm
,
constructors
=
(
manage_addFieldIndexForm
,
manage_addFieldIndex
),
manage_addFieldIndex
),
icon
=
'www/index.gif'
,
icon
=
'www/index.gif'
,
...
@@ -32,7 +32,7 @@ def initialize(context):
...
@@ -32,7 +32,7 @@ def initialize(context):
from
Products.PluginIndexes.KeywordIndex.KeywordIndex
\
from
Products.PluginIndexes.KeywordIndex.KeywordIndex
\
import
manage_addKeywordIndexForm
import
manage_addKeywordIndexForm
context
.
registerClass
(
KeywordIndex
,
context
.
registerClass
(
KeywordIndex
,
permission
=
'Add Pluggable Index'
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addKeywordIndexForm
,
constructors
=
(
manage_addKeywordIndexForm
,
manage_addKeywordIndex
),
manage_addKeywordIndex
),
icon
=
'www/index.gif'
,
icon
=
'www/index.gif'
,
...
@@ -45,7 +45,7 @@ def initialize(context):
...
@@ -45,7 +45,7 @@ def initialize(context):
from
Products.PluginIndexes.TopicIndex.TopicIndex
\
from
Products.PluginIndexes.TopicIndex.TopicIndex
\
import
manage_addTopicIndexForm
import
manage_addTopicIndexForm
context
.
registerClass
(
TopicIndex
,
context
.
registerClass
(
TopicIndex
,
permission
=
'Add Pluggable Index'
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addTopicIndexForm
,
constructors
=
(
manage_addTopicIndexForm
,
manage_addTopicIndex
),
manage_addTopicIndex
),
icon
=
'www/index.gif'
,
icon
=
'www/index.gif'
,
...
@@ -58,7 +58,7 @@ def initialize(context):
...
@@ -58,7 +58,7 @@ def initialize(context):
from
Products.PluginIndexes.DateIndex.DateIndex
\
from
Products.PluginIndexes.DateIndex.DateIndex
\
import
manage_addDateIndexForm
import
manage_addDateIndexForm
context
.
registerClass
(
DateIndex
,
context
.
registerClass
(
DateIndex
,
permission
=
'Add Pluggable Index'
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addDateIndexForm
,
constructors
=
(
manage_addDateIndexForm
,
manage_addDateIndex
),
manage_addDateIndex
),
icon
=
'www/index.gif'
,
icon
=
'www/index.gif'
,
...
@@ -72,7 +72,7 @@ def initialize(context):
...
@@ -72,7 +72,7 @@ def initialize(context):
from
Products.PluginIndexes.DateRangeIndex.DateRangeIndex
\
from
Products.PluginIndexes.DateRangeIndex.DateRangeIndex
\
import
manage_addDateRangeIndexForm
import
manage_addDateRangeIndexForm
context
.
registerClass
(
DateRangeIndex
,
context
.
registerClass
(
DateRangeIndex
,
permission
=
'Add Pluggable Index'
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addDateRangeIndexForm
,
constructors
=
(
manage_addDateRangeIndexForm
,
manage_addDateRangeIndex
),
manage_addDateRangeIndex
),
icon
=
'www/index.gif'
,
icon
=
'www/index.gif'
,
...
@@ -85,7 +85,7 @@ def initialize(context):
...
@@ -85,7 +85,7 @@ def initialize(context):
from
Products.PluginIndexes.PathIndex.PathIndex
\
from
Products.PluginIndexes.PathIndex.PathIndex
\
import
manage_addPathIndexForm
import
manage_addPathIndexForm
context
.
registerClass
(
PathIndex
,
context
.
registerClass
(
PathIndex
,
permission
=
'Add Pluggable Index'
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addPathIndexForm
,
constructors
=
(
manage_addPathIndexForm
,
manage_addPathIndex
),
manage_addPathIndex
),
icon
=
'www/index.gif'
,
icon
=
'www/index.gif'
,
...
...
src/Products/PluginIndexes/interfaces.py
View file @
bbc95d18
...
@@ -10,9 +10,7 @@
...
@@ -10,9 +10,7 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""PluginIndexes z3 interfaces.
"""PluginIndexes interfaces.
$Id$
"""
"""
from
zope.interface
import
Interface
from
zope.interface
import
Interface
...
@@ -117,8 +115,8 @@ class ISortIndex(IPluggableIndex):
...
@@ -117,8 +115,8 @@ class ISortIndex(IPluggableIndex):
compatibility."""
compatibility."""
def
documentToKeyMap
():
def
documentToKeyMap
():
"""Return an object that supports __getitem__ and may be used to
quickly
"""Return an object that supports __getitem__ and may be used to
lookup the sort key given a document id"""
quickly
lookup the sort key given a document id"""
class
IDateIndex
(
Interface
):
class
IDateIndex
(
Interface
):
...
@@ -235,7 +233,6 @@ class IIndexConfiguration(Interface):
...
@@ -235,7 +233,6 @@ class IIndexConfiguration(Interface):
def
getSettings
(
self
):
def
getSettings
(
self
):
""" Returns an mapping with index specific settings.
""" Returns an mapping with index specific settings.
E.g. {'indexed_attrs' : ('SearchableText', )}.
E.g. {'indexed_attrs' : ('SearchableText', )}.
The interface does not define any specifc mapping keys.
The interface does not define any specifc mapping keys.
"""
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment