Commit 43aa5946 authored by Hanno Schlichting's avatar Hanno Schlichting

Made Helpsys.HelpSys internal ZCatalog creation lazy, so it isn't created unless first accessed.

parent 81cca4b7
...@@ -9,6 +9,9 @@ Zope Changes ...@@ -9,6 +9,9 @@ Zope Changes
Restructuring Restructuring
- Made Helpsys.HelpSys internal ZCatalog creation lazy, so it isn't
created unless first accessed.
- Turned deprecation warnings for manage_afterAdd, manage_beforeDelete - Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
and manage_afterClone methods into discouraged warnings. These methods and manage_afterClone methods into discouraged warnings. These methods
will not be removed in Zope 2.11, but stay for the foreseeable future. will not be removed in Zope 2.11, but stay for the foreseeable future.
......
...@@ -219,20 +219,26 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent): ...@@ -219,20 +219,26 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent):
def __init__(self, id='Help', title=''): def __init__(self, id='Help', title=''):
self.id=id self.id=id
self.title=title self.title=title
c=self.catalog=ZCatalog('catalog') self._catalog = None
# clear catalog
for index in c.indexes(): @property
c.delIndex(index) def catalog(self):
for col in c.schema(): if self._catalog is None:
c.delColumn(col) c=self._catalog=ZCatalog('catalog')
c.addIndex('SearchableText', 'TextIndex') # clear catalog
c.addIndex('categories', 'KeywordIndex') for index in c.indexes():
c.addIndex('permissions', 'KeywordIndex') c.delIndex(index)
c.addColumn('categories') for col in c.schema():
c.addColumn('permissions') c.delColumn(col)
c.addColumn('title_or_id') c.addIndex('SearchableText', 'TextIndex')
c.addColumn('url') c.addIndex('categories', 'KeywordIndex')
c.addColumn('id') c.addIndex('permissions', 'KeywordIndex')
c.addColumn('categories')
c.addColumn('permissions')
c.addColumn('title_or_id')
c.addColumn('url')
c.addColumn('id')
return self._catalog
security.declareProtected(add_documents_images_and_files, 'addTopicForm') security.declareProtected(add_documents_images_and_files, 'addTopicForm')
addTopicForm=DTMLFile('dtml/addTopic', globals()) addTopicForm=DTMLFile('dtml/addTopic', globals())
......
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