Log message for revision 101449: - improved index creation in ProductHelp - removed special PluginIndexes handling in Product initialization code
Changed: U Zope/branches/2.12/doc/CHANGES.rst U Zope/branches/2.12/src/App/Product.py UU Zope/branches/2.12/src/HelpSys/HelpSys.py U Zope/branches/2.12/src/OFS/Application.py -=- Modified: Zope/branches/2.12/doc/CHANGES.rst =================================================================== --- Zope/branches/2.12/doc/CHANGES.rst 2009-07-03 15:07:07 UTC (rev 101448) +++ Zope/branches/2.12/doc/CHANGES.rst 2009-07-03 15:10:07 UTC (rev 101449) @@ -16,9 +16,18 @@ * ZODB 3.9.0b2 +Restructuring ++++++++++++++ + +- HelpSys now uses ZCTextIndex instead of the deprecated TextIndex. Please + update your Zope databases by deleting the Product registrations in the + Control Panel and restarting Zope. + Bugs Fixed ++++++++++ +- HelpSys: ProductHelp no longer depends on PluginIndexes initialization. + - App.Product: ProductHelp was broken since Zope 2.12.0a1. - ObjectManagerNameChooser now also works with BTreeFolder2. Modified: Zope/branches/2.12/src/App/Product.py =================================================================== --- Zope/branches/2.12/src/App/Product.py 2009-07-03 15:07:07 UTC (rev 101448) +++ Zope/branches/2.12/src/App/Product.py 2009-07-03 15:10:07 UTC (rev 101449) @@ -101,17 +101,10 @@ def __init__(self, id, title): from HelpSys.HelpSys import ProductHelp - self.id=id - self.title=title + self.id = id + self.title = title + self._setObject('Help', ProductHelp('Help', id)) - # Workaround for unknown problem with help system and PluginIndexes product - # NEEDS to be fixed for 2.4 ! (ajung) - - try: - self._setObject('Help', ProductHelp('Help', id)) - except: - pass - security.declarePublic('Destination') def Destination(self): "Return the destination for factory output" Modified: Zope/branches/2.12/src/HelpSys/HelpSys.py =================================================================== --- Zope/branches/2.12/src/HelpSys/HelpSys.py 2009-07-03 15:07:07 UTC (rev 101448) +++ Zope/branches/2.12/src/HelpSys/HelpSys.py 2009-07-03 15:10:07 UTC (rev 101449) @@ -23,9 +23,17 @@ from OFS.ObjectManager import ObjectManager from OFS.SimpleItem import Item from Persistence import Persistent +from Products.PluginIndexes.KeywordIndex.KeywordIndex import KeywordIndex from Products.ZCatalog.ZCatalog import ZCatalog from Products.ZCatalog.Lazy import LazyCat +from Products.ZCTextIndex.OkapiIndex import OkapiIndex +from Products.ZCTextIndex.Lexicon import CaseNormalizer +from Products.ZCTextIndex.HTMLSplitter import HTMLWordSplitter +from Products.ZCTextIndex.Lexicon import StopWordRemover +from Products.ZCTextIndex.ZCTextIndex import PLexicon +from Products.ZCTextIndex.ZCTextIndex import ZCTextIndex + class HelpSys(Implicit, ObjectManager, Item, Persistent): """ Zope Help System @@ -221,17 +229,19 @@ ) def __init__(self, id='Help', title=''): - self.id=id - self.title=title - c=self.catalog=ZCatalog('catalog') - # clear catalog - for index in c.indexes(): - c.delIndex(index) - for col in c.schema(): - c.delColumn(col) - c.addIndex('SearchableText', 'TextIndex') - c.addIndex('categories', 'KeywordIndex') - c.addIndex('permissions', 'KeywordIndex') + self.id = id + self.title = title + c = self.catalog = ZCatalog('catalog') + + l = PLexicon('lexicon', '', HTMLWordSplitter(), CaseNormalizer(), + StopWordRemover()) + c._setObject('lexicon', l) + i = ZCTextIndex('SearchableText', caller=c, index_factory=OkapiIndex, + lexicon_id=l.id) + # not using c.addIndex because it depends on Product initialization + c._catalog.addIndex('SearchableText', i) + c._catalog.addIndex('categories', KeywordIndex('categories')) + c._catalog.addIndex('permissions', KeywordIndex('permissions')) c.addColumn('categories') c.addColumn('permissions') c.addColumn('title_or_id') Property changes on: Zope/branches/2.12/src/HelpSys/HelpSys.py ___________________________________________________________________ Deleted: cvs2svn:cvs-rev - 1.26 Added: svn:keywords + Id Modified: Zope/branches/2.12/src/OFS/Application.py =================================================================== --- Zope/branches/2.12/src/OFS/Application.py 2009-07-03 15:07:07 UTC (rev 101448) +++ Zope/branches/2.12/src/OFS/Application.py 2009-07-03 15:10:07 UTC (rev 101449) @@ -547,12 +547,10 @@ if ( os.path.exists(os.path.join(fullpath, '__init__.py')) or os.path.exists(os.path.join(fullpath, '__init__.pyo')) or os.path.exists(os.path.join(fullpath, '__init__.pyc')) ): - # import PluginIndexes 1st (why?) - priority = (name != 'PluginIndexes') # i is used as sort ordering in case a conflict exists # between Product names. Products will be found as # per the ordering of Products.__path__ - products.append((priority, name, i, product_dir)) + products.append((0, name, i, product_dir)) i = i + 1 products.sort() return products _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins