[Product-Developers] schemaextender + Catalog + AnnotationStorage issue

4 Messages Forum Options Options
Embed this topic
Permalink
ickewa
[Product-Developers] schemaextender + Catalog + AnnotationStorage issue
Reply Threaded MoreMore options
Print post
Permalink
hi,
I extended some plone types with schemaextender,
adding a boolean and a stringfield which i want to have as catalog metadata.
When I use AnnotationStorage for these fields, they do not show up in
the catalog, with default storage they do.

Does someone have an explanation for this?

Christian

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Martin Aspeli-2
[Product-Developers] Re: schemaextender + Catalog + AnnotationStorage issue
Reply Threaded MoreMore options
Print post
Permalink
Christian Thieme wrote:
> hi,
> I extended some plone types with schemaextender,
> adding a boolean and a stringfield which i want to have as catalog metadata.
> When I use AnnotationStorage for these fields, they do not show up in
> the catalog, with default storage they do.
>
> Does someone have an explanation for this?

There is no generated accessor or mutator for these fields, so the
catalog doesn't know what to index. AttributeStorage may work because it
actually scribbles an attribute onto the object, although this is
somewhat messy.

Instead, I'd register a catalog indexer with the
ExtensibleIndexableObjectWrapper - see CatalogTool.py in Plone.

Martin

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


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
M.J. Pieters
Re: [Product-Developers] Re: schemaextender + Catalog + AnnotationStorage issue
Reply Threaded MoreMore options
Print post
Permalink
On Sat, Jun 14, 2008 at 12:27 AM, Martin Aspeli <optilude@...> wrote:
> Instead, I'd register a catalog indexer with the
> ExtensibleIndexableObjectWrapper - see CatalogTool.py in Plone.

ExtensibleIndexableObjectWrapper is a prime candidate for the
component architecture btw.

--
Martijn Pieters

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Martin Aspeli-2
[Product-Developers] Re: schemaextender + Catalog + AnnotationStorage issue
Reply Threaded MoreMore options
Print post
Permalink
Martijn Pieters wrote:
> On Sat, Jun 14, 2008 at 12:27 AM, Martin Aspeli <optilude@...> wrote:
>> Instead, I'd register a catalog indexer with the
>> ExtensibleIndexableObjectWrapper - see CatalogTool.py in Plone.
>
> ExtensibleIndexableObjectWrapper is a prime candidate for the
> component architecture btw.

+1

I stupidly made a half-hearted attempt at this for 3.0, but it wasn't
terribly useful.

I think you want something whereby:

  a) the wrapper it looked up by adapter on the indexed object
  b) the default wrapper's __getattr__() method looks up the indexing
attributes by subscription adapter on the indexed context

Martin

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


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers