Plone Tests Summarizer | 1 Jan 2011 12:58
Picon

Plone Tests: 5 OK, 1 Failed

Summary of messages to the testbot list.
Period Fri Dec 31 12:00:00 2010 UTC to Sat Jan  1 12:00:00 2011 UTC.
There were 6 messages: 1 from ATContentTypes Tests, 1 from Archetypes Tests, 1 from Plone Libraries Tests,
1 from Plone Products Tests, 2 from Plone Tests.

Test failures
-------------

Subject: FAILED (124 packages, 5 failures) : Plone-4.1 Zope-2.13 Python-2.6.5
From: Plone Tests
Date: Sat Jan  1 09:12:33 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017269.html

Tests passed OK
---------------

Subject: OK : Plone-3.3 Zope-2.10 Python-2.4.6
From: Plone Products Tests
Date: Sat Jan  1 08:47:49 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017264.html

Subject: OK : Plone-3.3 Zope-2.10 Python-2.4.6
From: Plone Libraries Tests
Date: Sat Jan  1 08:52:49 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017265.html

Subject: OK : AT-1.5 Plone-3.3 Zope-2.10 Python-2.4.6
From: Archetypes Tests
Date: Sat Jan  1 08:59:05 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017266.html
(Continue reading)

Martin Aspeli | 1 Jan 2011 23:53
Picon

Image scales and __bobo_traverse__ vs plone.app.imaging's ImageTraverser

Hi,

In e.g. ATNewsItem, we still have (in Plone 4):

    def __bobo_traverse__(self, REQUEST, name):
        """Transparent access to image scales
        """
        if name.startswith('image'):
            field = self.getField('image')
            image = None
            if name == 'image':
                image = field.getScale(self)
            else:
                scalename = name[len('image_'):]
                if scalename in field.getAvailableSizes(self):
                    image = field.getScale(self, scale=scalename)
            if image is not None and not isinstance(image, basestring):
                # image might be None or '' for empty images
                return image

        return ATDocumentBase.__bobo_traverse__(self, REQUEST, name)

I thought this became obsolete when we added the ImageTraverser to
plone.app.imaging. Why is it still there?

The underlying question is, "is it enough to just implement tag() to
get thumbnailing in folder_summary_view?"

Cheers,
Martin
(Continue reading)

David Glick | 2 Jan 2011 00:50
Favicon

Re: Image scales and __bobo_traverse__ vs plone.app.imaging's ImageTraverser

On 1/1/11 5:53 PM, Martin Aspeli wrote:
> Hi,
>
> In e.g. ATNewsItem, we still have (in Plone 4):
>
>     def __bobo_traverse__(self, REQUEST, name):
>
> I thought this became obsolete when we added the ImageTraverser to
> plone.app.imaging. Why is it still there?
IIRC the traverser in plone.app.imaging only works for publish
traversal, not path traversal, and there is code in Plone which relies
on the latter (e.g. tal:condition="exists:here/image_thumb")
> The underlying question is, "is it enough to just implement tag() to
> get thumbnailing in folder_summary_view?"
If you use the new  <at>  <at> images view (also in plone.app.imaging, and another
implementation in plone.namedfile for Dexterity content), then you don't
need tag or a custom __bobo_traverse__.

The Plone templates that use scales should be updated to use this new
approach and then the custom __bobo_traverse__'s in ATContentTypes can
be deprecated, but no one has taken care of doing that yet.

David
----------		
David Glick
 Web Developer
 davidglick@...
 206.286.1235x32

Groundwire: You Are Connected		
(Continue reading)

Martin Aspeli | 2 Jan 2011 12:06
Picon

Re: Image scales and __bobo_traverse__ vs plone.app.imaging's ImageTraverser

On 1 January 2011 23:50, David Glick <davidglick@...> wrote:
> On 1/1/11 5:53 PM, Martin Aspeli wrote:
>> Hi,
>>
>> In e.g. ATNewsItem, we still have (in Plone 4):
>>
>>     def __bobo_traverse__(self, REQUEST, name):
>>
>> I thought this became obsolete when we added the ImageTraverser to
>> plone.app.imaging. Why is it still there?
> IIRC the traverser in plone.app.imaging only works for publish
> traversal, not path traversal, and there is code in Plone which relies
> on the latter (e.g. tal:condition="exists:here/image_thumb")

Ah, right. That kind of sucks. :) It should just check a marker
interface or something.

>> The underlying question is, "is it enough to just implement tag() to
>> get thumbnailing in folder_summary_view?"
> If you use the new  <at>  <at> images view (also in plone.app.imaging, and another
> implementation in plone.namedfile for Dexterity content), then you don't
> need tag or a custom __bobo_traverse__.
>
> The Plone templates that use scales should be updated to use this new
> approach and then the custom __bobo_traverse__'s in ATContentTypes can
> be deprecated, but no one has taken care of doing that yet.

It's a shame we didn't do this for 4.0, but I'm guessing BBB concerns
intervened. Is it too late for 4.1? Having tag() and __bobo_traverse__
on your own types is too confusing, really.
(Continue reading)

David Glick | 2 Jan 2011 12:29
Favicon

Re: Image scales and __bobo_traverse__ vs plone.app.imaging's ImageTraverser


On Jan 2, 2011, at 6:07 AM, "Martin Aspeli"
<optilude+lists@...> wrote:

> On 1 January 2011 23:50, David Glick <davidglick@...> wrote:
>> On 1/1/11 5:53 PM, Martin Aspeli wrote:
>>> Hi,
>>>
>>> In e.g. ATNewsItem, we still have (in Plone 4):
>>>
>>>     def __bobo_traverse__(self, REQUEST, name):
>>>
>>> I thought this became obsolete when we added the ImageTraverser to
>>> plone.app.imaging. Why is it still there?
>> IIRC the traverser in plone.app.imaging only works for publish
>> traversal, not path traversal, and there is code in Plone which relies
>> on the latter (e.g. tal:condition="exists:here/image_thumb")
>
> Ah, right. That kind of sucks. :) It should just check a marker
> interface or something.

I don't think a marker interface makes sense; a content item may have arbitrary number of image fields for
which we want to check if a value exists. Instead we should make sure the new images adapter for accessing
scales includes an API to check if an image is present.

>
>>> The underlying question is, "is it enough to just implement tag() to
>>> get thumbnailing in folder_summary_view?"
>> If you use the new  <at>  <at> images view (also in plone.app.imaging, and another
>> implementation in plone.namedfile for Dexterity content), then you don't
(Continue reading)

Plone Tests Summarizer | 2 Jan 2011 12:58
Picon

Plone Tests: 5 OK, 1 Failed

Summary of messages to the testbot list.
Period Sat Jan  1 12:00:00 2011 UTC to Sun Jan  2 12:00:00 2011 UTC.
There were 6 messages: 1 from ATContentTypes Tests, 1 from Archetypes Tests, 1 from Plone Libraries Tests,
1 from Plone Products Tests, 2 from Plone Tests.

Test failures
-------------

Subject: FAILED (124 packages, 6 failures) : Plone-4.1 Zope-2.13 Python-2.6.5
From: Plone Tests
Date: Sun Jan  2 09:06:08 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017275.html

Tests passed OK
---------------

Subject: OK : Plone-3.3 Zope-2.10 Python-2.4.6
From: Plone Products Tests
Date: Sun Jan  2 08:41:23 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017270.html

Subject: OK : Plone-3.3 Zope-2.10 Python-2.4.6
From: Plone Libraries Tests
Date: Sun Jan  2 08:46:23 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017271.html

Subject: OK : AT-1.5 Plone-3.3 Zope-2.10 Python-2.4.6
From: Archetypes Tests
Date: Sun Jan  2 08:52:40 CET 2011
URL: http://lists.plone.org/pipermail/testbot/2011-January/017272.html
(Continue reading)

Martin Aspeli | 2 Jan 2011 16:37
Picon

Re: Image scales and __bobo_traverse__ vs plone.app.imaging's ImageTraverser

On 2 January 2011 11:29, David Glick <davidglick@...> wrote:

> It was more because Andi and I didn't have time than because of BBB concerns. Though at this point we have to
pay more attention to BBB. +1 for using the new scales in Plone itself for 4.1; but the old path traversal
should continue to work until 4.2 at least.

+1 - the problem is that right now, we have:

                    <a href="#"
                       tal:condition="exists:item_object/image_thumb"
                       tal:attributes="href python:test(item_type in
use_view_action, item_url+'/view', item_url)">
                        <img src="" alt=""
                             tal:replace="structure python:
path('nocall:item_object/tag')(scale='thumb', css_class='tileImage')"
/>
                    </a>

This means that you have to have an image_thumb (and so probably a
__bobo_traverse__) for your type's image to show up in the listing.

Martin

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
(Continue reading)

Hanno Schlichting | 2 Jan 2011 18:42
Picon
Gravatar

Batching improvements

Hi.

Inspired by some work in collective.solr, I made some improvements to
the batching logic in Plone over x-mas. This is a short explanation -
I suspect the p.a.contentlisting and maybe p.a.search code needs to be
adjusted to this as well.

So far we did a catalog query of some sort, often with a sort_on
argument (score, folder position, publication date, ...), then later
on wrap it in Plone's Batch class in some template and at last decide
which batch of 10 or 20 items to show.

After my changes, we decide which batch to show first (reading
variables from the request), then do the catalog query passing the
batch variables into the query and at last wrap the result in the
Batch class. The catalog can then use the batching hints internally to
optimize things. I did these changes in the generic getFolderContents
skin script and the queryCatalog method of the topic class.

The optimizations are in ZCatalog itself in Zope 2.13 / Plone 4.1 and
backported to Plone 4 via experimental.catalogqueryplan. You can do
the template / code changes in any Plone version without any negative
effect, as extra arguments to the catalog will simply be ignored.

The two query arguments you need to pass on are b_start and b_size.
b_start is usually just read from the request. b_size depends on the
template. The b_size you pass to the catalog needs to be the batch
size plus the orphan value - so usually b_size + 1.

There's currently two optimizations in the catalog:
(Continue reading)

Martin Aspeli | 2 Jan 2011 19:07
Picon
Gravatar

Re: Batching improvements

Hi Hanno,

Great work :-)

On 2 January 2011 17:42, Hanno Schlichting <hanno@...> wrote:

> The optimizations are in ZCatalog itself in Zope 2.13 / Plone 4.1 and
> backported to Plone 4 via experimental.catalogqueryplan. You can do
> the template / code changes in any Plone version without any negative
> effect, as extra arguments to the catalog will simply be ignored.

So, does this mean that it's possible to write templates that batch
correctly in all versions of Plone, but which batch more efficiently
in Plone 4.1 (or 4.0 w/ experimental.catalogqueryplan)? Or will you
get no batching in older versions?

Are there any changes to the pattern used in templates?

Martin

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
Hanno Schlichting | 2 Jan 2011 19:43
Picon
Gravatar

Re: Batching improvements

On Sun, Jan 2, 2011 at 7:07 PM, Martin Aspeli <optilude@...> wrote:
> On 2 January 2011 17:42, Hanno Schlichting <hanno@...> wrote:
>> The optimizations are in ZCatalog itself in Zope 2.13 / Plone 4.1 and
>> backported to Plone 4 via experimental.catalogqueryplan. You can do
>> the template / code changes in any Plone version without any negative
>> effect, as extra arguments to the catalog will simply be ignored.
>
> So, does this mean that it's possible to write templates that batch
> correctly in all versions of Plone, but which batch more efficiently
> in Plone 4.1 (or 4.0 w/ experimental.catalogqueryplan)? Or will you
> get no batching in older versions?

You get proper batching via wrapping a catalog result in the
PloneBatch class. None of that has changed, so it all works in the
same way.

> Are there any changes to the pattern used in templates?

That's hard to say in general, as there's no real pattern - before we
switch to plone.app.contentlisting. The standard templates like
folder_listing, folder_summary_view etc. all get the improvement
automatically via the changes I made in getFolderContents and
topic.queryCatalog (incl. the monkey patched version in
collective.dancing, argh!)

If you have a custom template you should probably have something like
this in a tal:define:

b_size python:10;
b_start request/b_start | python:0;
(Continue reading)


Gmane