Back to index

plone3  3.1.7
Functions
CMFPlone.migrations.v2_1.final_two11 Namespace Reference

Functions

def final_two11
def reindexPathIndex

Function Documentation

2.1-final -> 2.1.1

Definition at line 6 of file final_two11.py.

00006 
00007 def final_two11(portal):
00008     """2.1-final -> 2.1.1
00009     """
00010     out = []
00011     
00012     # Make the portal a Zope3 site
00013     enableZope3Site(portal, out)
00014 
00015     # register some tools as utilities
00016     registerToolsAsUtilities(portal, out)
00017 
00018     try:
00019         fixUpSMIGlobs(portal, out)
00020     except TypeError:
00021         fixUpSMIGlobs(out)
00022 
00023 
00024     # Update path index for new EPI version
00025     reindexPathIndex(portal, out)
00026 
00027     return out
00028 

Here is the call graph for this function:

Rebuilds the path index.

Definition at line 29 of file final_two11.py.

00029 
00030 def reindexPathIndex(portal, out):
00031     """Rebuilds the path index."""
00032     from Products.ZCatalog.ZCatalog import ZCatalog
00033     for catalog in portal.objectValues():
00034         if not isinstance(catalog, ZCatalog):
00035             # catalog is not really a catalog
00036             continue
00037         for name,index in catalog.Indexes.objectItems():
00038             if (index.meta_type == "ExtendedPathIndex" and
00039             getattr(catalog.Indexes._getOb('path', None), '_index_parents', None) is None):
00040                 # Reduce threshold for the reindex run
00041                 old_threshold = catalog.threshold
00042                 pg_threshold = getattr(catalog, 'pgthreshold', 0)
00043                 catalog.pgthreshold = 300
00044                 catalog.threshold = 2000
00045                 catalog.clearIndex(name)
00046                 catalog.manage_reindexIndex(ids=[name])
00047                 catalog.threshold = old_threshold
00048                 catalog.pgthreshold = pg_threshold
00049                 out.append("Reindexed %s index in catalog %s."%(name, catalog.getId()))

Here is the caller graph for this function: