Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

IIndexableObjectWrapper

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


optilude+lists at gmail

Apr 5, 2009, 3:14 AM

Post #1 of 8 (1347 views)
Permalink
IIndexableObjectWrapper

Hi,

Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
has a method _getWrappedObject(), to return the object that was wrapped
by the indexable object wrapper. It is (or rather, will be) used by
TextIndexNG3, which needs to access the raw object during indexing.

Any objections to pushing this down into CMFCore's definition of that
interface?

Martin

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

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


jens at dataflake

Apr 5, 2009, 4:27 AM

Post #2 of 8 (1296 views)
Permalink
Re: IIndexableObjectWrapper [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Apr 5, 2009, at 12:14 , Martin Aspeli wrote:

> Hi,
>
> Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
> has a method _getWrappedObject(), to return the object that was
> wrapped
> by the indexable object wrapper. It is (or rather, will be) used by
> TextIndexNG3, which needs to access the raw object during indexing.
>
> Any objections to pushing this down into CMFCore's definition of that
> interface?

A method name starting with an underscore is presumably a "private"
method with restricted use by the internal implementation. I would at
least rename it to something without underscore before putting it into
the interface.

jens



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAknYlZsACgkQRAx5nvEhZLJJ+wCdET6ALpOqhnySeR2kmMPTa71H
Vq8AoKxcUx7HfQPgv5CQh8kLWghU+n/6
=L3qs
-----END PGP SIGNATURE-----
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


optilude+lists at gmail

Apr 5, 2009, 5:46 AM

Post #3 of 8 (1292 views)
Permalink
Re: IIndexableObjectWrapper [In reply to]

Jens Vagelpohl wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> On Apr 5, 2009, at 12:14 , Martin Aspeli wrote:
>
>> Hi,
>>
>> Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
>> has a method _getWrappedObject(), to return the object that was
>> wrapped
>> by the indexable object wrapper. It is (or rather, will be) used by
>> TextIndexNG3, which needs to access the raw object during indexing.
>>
>> Any objections to pushing this down into CMFCore's definition of that
>> interface?
>
> A method name starting with an underscore is presumably a "private"
> method with restricted use by the internal implementation. I would at
> least rename it to something without underscore before putting it into
> the interface.

In general, I agree, but there's a problem: any method on the wrapper
could collide with an index or metadata item and thus get indexed in the
catalog. Thus, the method is "private" in the sense that it's not to be
considered part of the "wrapped" object.

It may not seem very likely that someone has an index called
getWrappedObject, but there's (stupid) support in Archetypes to create
indexes from fields based on the accessors of those fields, so an
auto-created index for an AT field wrappedObject would default to being
called getWrappedObject(). Again, not hugely likely, but I think it
makes sense to say that all methods on the wrapper that are *not*
"indexable" are "private" in this sense.

Martin

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

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2009 at wcm-solutions

Apr 5, 2009, 7:41 AM

Post #4 of 8 (1298 views)
Permalink
Re: IIndexableObjectWrapper [In reply to]

Martin Aspeli wrote:
> Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
> has a method _getWrappedObject(), to return the object that was wrapped
> by the indexable object wrapper. It is (or rather, will be) used by
> TextIndexNG3, which needs to access the raw object during indexing.

Why is there a need to access the raw object? The wrapper should provide
all the interfaces and attributes required for indexing.

Cheers, Yuppie

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


optilude+lists at gmail

Apr 5, 2009, 8:36 AM

Post #5 of 8 (1301 views)
Permalink
Re: IIndexableObjectWrapper [In reply to]

yuppie wrote:
> Martin Aspeli wrote:
>> Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
>> has a method _getWrappedObject(), to return the object that was wrapped
>> by the indexable object wrapper. It is (or rather, will be) used by
>> TextIndexNG3, which needs to access the raw object during indexing.
>
> Why is there a need to access the raw object? The wrapper should provide
> all the interfaces and attributes required for indexing.

TextIndexNG3 does some deeper inspection on the object. It basically
needs to bypass some of the things that are ordinarily intercepted by
the wrapper. Andreas Jung will have to give more detail, but it feels
prudent to me to have some kind of API to get the wrapped object for
cases like this in any case.

plone.indexer now has this (and we're rapidly approaching a stable
release - rc2 just went today), so it's not crucial that it's in CMF,
but it'd be nicer if it were.

Martin

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

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

Apr 5, 2009, 8:46 AM

Post #6 of 8 (1303 views)
Permalink
Re: IIndexableObjectWrapper [In reply to]

Previously yuppie wrote:
> Martin Aspeli wrote:
> > Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
> > has a method _getWrappedObject(), to return the object that was wrapped
> > by the indexable object wrapper. It is (or rather, will be) used by
> > TextIndexNG3, which needs to access the raw object during indexing.
>
> Why is there a need to access the raw object? The wrapper should provide
> all the interfaces and attributes required for indexing.

TextIndexNG3 needs the unwrapped object to be able to look for adapters
that provide indexable text for that object.

Wichert.

--
Wichert Akkerman <wichert [at] wiggy> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2009 at wcm-solutions

Apr 5, 2009, 9:07 AM

Post #7 of 8 (1300 views)
Permalink
Re: IIndexableObjectWrapper [In reply to]

Wichert Akkerman wrote:
> Previously yuppie wrote:
>> Martin Aspeli wrote:
>>> Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
>>> has a method _getWrappedObject(), to return the object that was wrapped
>>> by the indexable object wrapper. It is (or rather, will be) used by
>>> TextIndexNG3, which needs to access the raw object during indexing.
>> Why is there a need to access the raw object? The wrapper should provide
>> all the interfaces and attributes required for indexing.
>
> TextIndexNG3 needs the unwrapped object to be able to look for adapters
> that provide indexable text for that object.

That's BBB code for old IndexableObjectWrappers that don't use
IndexableObjectSpecification. With the correct __providedBy__ there is
no need to unwrap the object before looking up adapters.

Cheers, Yuppie

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


lists at zopyx

Apr 13, 2009, 12:40 PM

Post #8 of 8 (1227 views)
Permalink
Re: IIndexableObjectWrapper [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05.04.2009 16:36 Uhr, Martin Aspeli wrote:
> yuppie wrote:
>> Martin Aspeli wrote:
>>> Plone 3.3's IIndexableObjectWrapper implementation (in plone.indexer)
>>> has a method _getWrappedObject(), to return the object that was wrapped
>>> by the indexable object wrapper. It is (or rather, will be) used by
>>> TextIndexNG3, which needs to access the raw object during indexing.
>> Why is there a need to access the raw object? The wrapper should provide
>> all the interfaces and attributes required for indexing.
>
> TextIndexNG3 does some deeper inspection on the object. It basically
> needs to bypass some of the things that are ordinarily intercepted by
> the wrapper. Andreas Jung will have to give more detail, but it feels
> prudent to me to have some kind of API to get the wrapped object for
> cases like this in any case.
>
>

If there are some requirements for TXNG3, I will work on TXNG 3.3.0 soon
again. Also Wichert made (or intended) to make some related changes
within the TXNG core directly due an incompatibility with TXNG 3.2.X
and the newest Plone 3.2 release (coming with an updated CMF version).

Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknjlS4ACgkQCJIWIbr9KYx3dwCeO4ofLAEAQ33IuxKHk1MEITm+
cFEAoJDv9k6lNntg0wsYD+mM1JgyRAO7
=+M+B
-----END PGP SIGNATURE-----
Attachments: lists.vcf (0.31 KB)

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.