[Zope-CMF] IndexableObjectWrapper

Martin Aspeli optilude+lists at gmail.com
Mon Mar 9 22:33:37 EDT 2009


Jens Vagelpohl wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> On Mar 9, 2009, at 22:47 , Wichert Akkerman wrote:
> 
>> Previously Jens Vagelpohl wrote:
>>> On Mar 9, 2009, at 21:09 , Miles wrote:
>>>
>>>> Can anyone tell me if it is possible to register an adapter to
>>>> provide a
>>>> different IndexableObjectWrapper class from the stock CMF one?
>>>>
>>> You already noticed that the wrapper is instantiated directly, so
>>> that's what's going on. No magic, no component architecture.
>>>
>>> Whether that is good or bad or should be changed is a different  
>>> issue.
>> Martin Aspeli implemented an adapter based index wrapper for Plone  
>> 3.3.
> 
> It's nice to see that Plone has it, but that doesn't help anyone  
> working off the CMF itself. I wish there was more communication to  
> determine where improvements fit best. Not knowing how Plone  
> implemented it I would make a guess this one small item would have  
> been better off in the CMF itself.

Point taken!

Back in the day (before Plone 3.0), Alec Mitchell and I implemented a 
simple wrapper adapter that lets you look up a different version of the 
IndexableObjectWrapper. However, this wasn't terribly useful, because it 
seems what people want is not to replace the wrapper wholesale, but to 
provide different 'indexers' for specific catalogued attributes on a 
per-type basis.

Even before that, Plone had its own ExtensibleIndexableObjectWrapper 
that let you add 'getters' for attributes on the wrapper via module 
level imports. This has worked well, except that there's no way to make 
particular indexers work only on one particular content type.

In Plone 3.3, with the plone.indexer package, we've changed this so that 
you can add new 'getters' to the standard IOW via adapters. This is in 
the plone.indexer package: http://pypi.python.org/pypi/plone.indexer

This should work with plain CMF and be simple to hook into the catalogue 
tool. There are some discussions about licensing going on with the Plone 
Foundation, but chances are good that it can be licensed in such a way 
that CMF could adopt it you want. Doing so should be simple, even, and 
I'd be willing to help make this happen.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book



More information about the Zope-CMF mailing list