Commit f9e3f440 authored by Andreas Jung's avatar Andreas Jung

integrated into the ZMI

parent a3ed0554
...@@ -38,6 +38,7 @@ from Products.PluginIndexes.TextIndex import Splitter ...@@ -38,6 +38,7 @@ from Products.PluginIndexes.TextIndex import Splitter
import urllib, time, sys import urllib, time, sys
import string,logging import string,logging
from IZCatalog import IZCatalog from IZCatalog import IZCatalog
from ProgressHandler import ZLogHandler
LOG = logging.getLogger('Zope.ZCatalog') LOG = logging.getLogger('Zope.ZCatalog')
...@@ -510,7 +511,9 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -510,7 +511,9 @@ class ZCatalog(Folder, Persistent, Implicit):
message='No items were specified!', message='No items were specified!',
action = "./manage_catalogIndexes",) action = "./manage_catalogIndexes",)
self.reindexIndex(ids, REQUEST) pgthreshold = self._getProgressThreshold()
handler = (pgthreshold > 0) and ZLogHandler(pgthreshold) or None
self.reindexIndex(ids, REQUEST, handler)
if REQUEST and RESPONSE: if REQUEST and RESPONSE:
RESPONSE.redirect( RESPONSE.redirect(
...@@ -886,6 +889,11 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -886,6 +889,11 @@ class ZCatalog(Folder, Persistent, Implicit):
RESPONSE.redirect( RESPONSE.redirect(
URL1 + '/manage_main?manage_tabs_message=Catalog%20Changed') URL1 + '/manage_main?manage_tabs_message=Catalog%20Changed')
def _getProgressThreshold(self):
if not hasattr(self, 'pgthreshold'):
self.pgthreshold = 0
return self.pgthreshold
def manage_convertBTrees(self, threshold=200): def manage_convertBTrees(self, threshold=200):
"""Convert the catalog's data structures to use BTrees package""" """Convert the catalog's data structures to use BTrees package"""
assert type(threshold) is type(0) assert type(threshold) is type(0)
......
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