[Zope-CMF] Re: Abusing GenericSetup during traditional installs

Ross Patterson me at rpatterson.net
Wed Dec 6 00:43:33 EST 2006


I got tired of reindexing large indexes that were cleared
unintelligently by the index import adapters so I wrote the following
exportimport.pluginindexes and overrides.zcml.  I'm posting them here
in case anyone wants to use the code.

This doesn't handle reindexing indexes when it's needed but it does
keep the adapters from needlessly clearing the indexes.

Ross

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pluginindexes.py
Type: text/x-python
Size: 2628 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-cmf/attachments/20061205/ddb5e532/pluginindexes.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: overrides.zcml
Type: application/octet-stream
Size: 1221 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-cmf/attachments/20061205/ddb5e532/overrides.obj
-------------- next part --------------

yuppie <y.2006_ at wcm-solutions.de> writes:

> Hi Stefan!
>
>
> Stefan H. Holek wrote:
>> On 17. Aug 2006, at 15:50, yuppie wrote:
>>
>>> My approach would be to improve the catalog adapters. Even if you
>>> stick to the behavior implemented in setuphandlers.py it would have
>>> been easier and more straight forward to implement it in a subclass
>>> of ZCatalogXMLAdapter, overriding the default adapter.
>>>
>>
>> I have tried this initially but found it impossible to "override"
>> the existing adapter for IZCatalog. I always got complaints from the
>> adapter machinery about duplicate registrations. I may be missing
>> something here...
>
> Did you try it using an overrides.zcml file? Works for me - at least
> with other adapters.
>
>>> But fixing some general catalog adapter issues will make your
>>> special behavior obsolete:
>>>
>>> - The adapters should compare the new settings with the existing
>>> ones and make sure indexes are only updated if they are actually
>>> changed. This is not implemented so far.
>>>
>>> - The adapters should modify existing indexes if the profile
>>> contains new settings. This is not implemented for the 'extra'
>>> elements.
>>>
>>> - Reindexing might be very expensive. That's the reason why
>>> GenericSetup does no reindexing, you have to do it manually. We
>>> need a better solution for that, maybe some bookkeeping which
>>> indexes need to be reindexed and a button in the setup tool that
>>> triggers reindexing.
>>
>> +1 on all accounts
>
> As always: contributions are welcome...
>
>
> Cheers,
>
> 	Yuppie
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF at lists.zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests


More information about the Zope-CMF mailing list