Commit bbe910a0 authored by 's avatar

- removed more PluginIndexes.TextIndex dependencies

- added more XXX comments to the regression tests (don't know how to run and fix them)
parent 65147737
<dtml-var manage_page_header>
<dtml-var "manage_form_title(this(), _,
form_title='Add Vocabulary',
)">
<FORM ACTION="manage_addVocabulary" METHOD="POST">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
Id
</div>
</td>
<td align="left" valign="top">
<input type="text" name="id" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-optional">
Title
</div>
</td>
<td align="left" valign="top">
<input type="text" name="title" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Globbing?
</td>
<td align="left" valign="top">
<input type="checkbox" name="globbing" />
</td>
</tr>
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
value=" Add " />
</div>
</td>
</tr>
</table>
</form>
<dtml-var manage_page_footer>
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<dtml-if words>
<p class="form-text">
&dtml-id; contains <em><dtml-var words fmt=collection-length thousands_commas></em>
word(s).
</p>
<dtml-in words previous size=20 start=query_start >
<span class="list-nav">
<a href="&dtml-URL;?query_start=&dtml-previous-sequence-start-number;">
[Previous <dtml-var previous-sequence-size> entries]
</a>
</span>
</dtml-in>
<dtml-in words next size=20 start=query_start >
<span class="list-nav">
<a href="&dtml-URL;?query_start=&dtml-next-sequence-start-number;">
[Next <dtml-var next-sequence-size> entries]
</a>
</span>
</dtml-in>
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<dtml-in words size=20 start=query_start >
<dtml-if name="sequence-start">
<tr class="list-header">
<td width="80%" align="left" valign="top">
<div class="list-item">Word</div></td>
<td width="20%" align="left" valign="top">
<div class="list-item">Word ID</div></td>
</tr>
</dtml-if>
<dtml-if name="sequence-odd"><tr class="row-normal">
<dtml-else><tr class="row-hilite"></dtml-if>
<td valign="top" align="left">
<div class="form-text">&dtml-sequence-key;</div>
</td>
<td valign="top" align="left">
<div class="form-text">&dtml-sequence-item;</div>
</td>
</tr>
</dtml-in>
</table>
<dtml-in words previous size=20 start=query_start >
<div class="list-nav">
<a href="&dtml-URL;?query_start=&dtml-previous-sequence-start-number;">
[Previous <dtml-var previous-sequence-size> entries]
</a>
</div>
</dtml-in>
<dtml-in words next size=20 start=query_start >
<div class="list-nav">
<a href="&dtml-URL;?query_start=&dtml-next-sequence-start-number;">
[Next <dtml-var next-sequence-size> entries]
</a>
</div>
</dtml-in>
<dtml-else>
<p class="form-text">
There are no words in the Vocabulary.
</p>
</dtml-if>
<dtml-var manage_page_footer>
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<h2>Edit &dtml-id;</h2>
<!--
<form action="manage_edit" method="POST">
<table cellspacing="2">
<tr>
<th align="left" valign="top"><em>Base</em></th>
<td align="left" valign="top">
<input type="text" name="base" size="40" value="<dtml-if base>&dtml-base;</dtml-if>">
</td>
</tr>
<tr>
<th align="left" valign="top"><em>Path - Not Implemented</em></th>
<td align="left" valign="top">
<input type="text" name="path" size="40" value="<dtml-if path>&dtml-path;</dtml-if>">
</td>
</tr>
<tr><td></td>
<td align="left" valign="top">
<input type="submit" name="submit" value=" Change ">
</td>
</tr>
</table>
</form>
-->
<dtml-var manage_page_footer>
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<form action="query" method=POST>
<input type="text" name="pattern" size="20">
<div class="form-element">
<input class="form-element" type="submit" name="submit" value="Query">
</div>
</form>
<dtml-var manage_page_footer>
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
def manage_addVocabulary(id, title, globbing=None, REQUEST=None):
"""
Add a Vocabulary object to an ObjectManager.
"""
class Vocabulary:
"""
A Vocabulary manages words and language rules for text indexing.
Text indexing is done by the ZCatalog and other third party
Products.
"""
__constructor__=manage_addVocabulary
def query(pattern):
"""
Query Vocabulary for words matching pattern.
"""
def insert(word):
"""
Insert a word in the Vocabulary.
"""
def words():
"""
Return list of words.
"""
Vocabulary
Description
Vocabularies display a list of all the unique words that are
indexed by a Catalog or Catalogs that use this Vocabulary object.
This view allows you to browse all of the words in the Vocabulary.
Currently, Vocabularies are only used by TextIndexes.
Vocabulary - Query: Query Vocabulary
Description
This form lets you query the Vocabulary for words that match a
certain pattern.
Vocabulary - Vocabulary: Description here
Description
Vocabularies display a list of all the unique words that are
indexed by a Catalog or Catalogs that use this Vocabulary object.
This view allows you to browse all of the words in the Vocabulary.
Currently, Vocabularies are only used by TextIndexes.
...@@ -21,7 +21,7 @@ ZCatalog - Indexes: Manage Catalog Indexes ...@@ -21,7 +21,7 @@ ZCatalog - Indexes: Manage Catalog Indexes
index. index.
'[Type of Index]' -- You have the choice between four types of '[Type of Index]' -- You have the choice between four types of
Indexes, called 'TextIndex', 'FieldIndex', 'KeywordIndex' and Indexes, called 'ZCTextIndex', 'FieldIndex', 'KeywordIndex' and
'PathIndex'. Please refer to the table below to see a 'PathIndex'. Please refer to the table below to see a
description of each Index. description of each Index.
...@@ -30,7 +30,7 @@ ZCatalog - Indexes: Manage Catalog Indexes ...@@ -30,7 +30,7 @@ ZCatalog - Indexes: Manage Catalog Indexes
This table lists the different Index types and describes their This table lists the different Index types and describes their
purpose. purpose.
'TextIndex' -- TextIndexes break content up into individual 'ZCTextIndex' -- Text indexes break content up into individual
words. These indexes are often refered to as *full-text words. These indexes are often refered to as *full-text
indexes*. Text indexes sort results by score, meaning they indexes*. Text indexes sort results by score, meaning they
return 'hits' in order from the most relevant to the lest return 'hits' in order from the most relevant to the lest
......
#!/usr/bin/env python #!/usr/bin/env python
# XXX: Products.PluginIndexes.TextIndex and Vocabulary no longer exist
# Regression test for ZCatalog # Regression test for ZCatalog
...@@ -20,7 +21,7 @@ import Zope2 ...@@ -20,7 +21,7 @@ import Zope2
import ZODB, ZODB.FileStorage import ZODB, ZODB.FileStorage
import transaction import transaction
from Products.ZCatalog import ZCatalog,Vocabulary from Products.ZCatalog import ZCatalog #,Vocabulary
from Products.ZCatalog.Catalog import CatalogError from Products.ZCatalog.Catalog import CatalogError
import Persistence import Persistence
import ExtensionClass import ExtensionClass
...@@ -91,8 +92,8 @@ class testCatalog(Persistence.Persistent,unittest.TestCase): ...@@ -91,8 +92,8 @@ class testCatalog(Persistence.Persistent,unittest.TestCase):
self.keywords = [] self.keywords = []
self.maxfiles = maxfiles self.maxfiles = maxfiles
self._vocabulary = Vocabulary.Vocabulary('Vocabulary', # self._vocabulary = Vocabulary.Vocabulary('Vocabulary',
'Vocabulary', globbing=1) # 'Vocabulary', globbing=1)
self._catalog = ZCatalog.ZCatalog("zcatalog") self._catalog = ZCatalog.ZCatalog("zcatalog")
self._catalog.addIndex('to', 'TextIndex') self._catalog.addIndex('to', 'TextIndex')
self._catalog.addIndex('sender', 'TextIndex') self._catalog.addIndex('sender', 'TextIndex')
......
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