sidnei's reindexing improvements

Rob Miller <ra-UE+B0n23d/[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
okay, i've managed to take a look at the 'sidnei-indexing-sanity' branch 
of archetypes.  AFAICT, it introduces the following changes:

- in BaseObject.BaseObject.update(), it eliminates a reindexObject() 
call if the object is currently being initialized (i.e. 
initializeArchetype() has been called).

- in CatalogMultiplex.CatalogMultiplex.indexObject() and 
unindexObject(), it doesn't index either the UID catalog or the 
Reference catalog, since this is already done by either the 
manage_afterAdd() or the manage_beforeDelete() method in the 
Referenceable mix-in.

- similarly, in CatalogMultiplex.CatalogMultiplex.reindexObject(), the 
UID and reference catalogs are not indexed unless certain indexes are 
explicitly passed in to the method.

- reindexing is removed altogether from 
CatalogMultiplex.CatalogMultiplex.manage_afterClone, w/ the assumption 
being that all necessary reindexing happens in 
Referenceable.manage_afterAdd.

- in Referenceable.manage_afterClone, an _updateCatalog call is skipped 
if the isCopy is not true.

these are definitely band-aid measures, and they don't fix the problem 
entirely, but they do make some improvements.  according to my 
calculations, when running the CMFPlone unit tests, sidnei's branch 
results in 237 less 'object already unindexed' errors.

ultimately, we do want some sort of event driven indexing scheme.  i'm 
particularly not happy about removing some of the indexing from 
CatalogMultplex and putting the indexing burden on the manage_after* 
methods.  but for now, there are some wins to be had w/ sidnei's 
changes.  anyone have objections to this code making it into the AT 1.3 
branch?

-r



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.