Quantcast

Batching implementation in Plone

classic Classic list List threaded Threaded
3 messages Options
Tom Gross Tom Gross
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Batching implementation in Plone

Hi list

When I was working on a custom search page and implementing the
batch-navigation I found there are a least 3! batching implementations
in the current Plone >= 4.1:

  - CMFPlone.PloneBatch
  - plone.app.content.batching
  - z3c.batching (via plone.z3cform)

I wonder if it is possible to unify them and if a PLIP is necessary to
do this for Plone 4.2/4.3? IMO there should be one official place for
the batching implementation. This makes it easier for third party
product authors to reuse and style it. Also the endusers will profit
because there is only one way batches are used in the CMS.

Probably it is feasible to revive Hannos plone.sequencebatch [1] acting
as a wrapper for z3c.batching and import it from the other places for
backwards compatibility.

I volonteer to work on this but want to know some opinions beforehand.

Cheers
-Tom

[1] http://pypi.python.org/pypi/plone.sequencebatch/1.0a1


------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Ross Patterson-2 Ross Patterson-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Batching implementation in Plone

Tom Gross <[hidden email]> writes:

> When I was working on a custom search page and implementing the
> batch-navigation I found there are a least 3! batching implementations
> in the current Plone >= 4.1:
>
>   - CMFPlone.PloneBatch
>   - plone.app.content.batching
>   - z3c.batching (via plone.z3cform)
>
> I wonder if it is possible to unify them and if a PLIP is necessary to
> do this for Plone 4.2/4.3? IMO there should be one official place for
> the batching implementation. This makes it easier for third party
> product authors to reuse and style it. Also the endusers will profit
> because there is only one way batches are used in the CMS.

It sounds PLIP worthy to me.

> Probably it is feasible to revive Hannos plone.sequencebatch [1] acting
> as a wrapper for z3c.batching and import it from the other places for
> backwards compatibility.

As for which approach to take, can you outline the options and
tradeoffs?

Ross


------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Hanno Schlichting-4 Hanno Schlichting-4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Batching implementation in Plone

In reply to this post by Tom Gross
On Thu, Sep 15, 2011 at 4:46 PM, Tom Gross <[hidden email]> wrote:
> I wonder if it is possible to unify them and if a PLIP is necessary to
> do this for Plone 4.2/4.3? IMO there should be one official place for
> the batching implementation.

I think you need a PLIP. In order to unify the batch implementation
used in the folder contents listing (plone.app.content), you actually
need to change a lot of the other code in there as well. Currently
there's a number of unhelpful abstractions in the way, that prevent
you from using the PloneBatch class and the corresponding catalog
batch support - something that would help to speed the whole thing up.

In general it does make sense to have fewer batch implementations. So
far I was considering to put one into ZCatalog itself, which would
deal with the special issues that has. Catalog results are variants of
a Lazy class, which in recent Zope has gotten some batch support in
itself. Basically you tell the catalog at query time which batch you
want and it will give you back a lazy result list of only the items in
the wanted batch. In addition it has an "actual result count" which
represents the total number of results. You need that total number in
order to calculate the typical batch navigation links. So there's some
good deal of ZCatalog specific code in PloneBatch, which won't make
sense in z3c.batching.

> Probably it is feasible to revive Hannos plone.sequencebatch [1] acting
> as a wrapper for z3c.batching and import it from the other places for
> backwards compatibility.

plone.sequencebatch only contains a copy of an old CMFPlone.PloneBatch
class. I did that when I was trying to disentangle dependencies of
Plone's own distributions. That project has failed, and I no longer
think there's much point in it.

So feel free to reuse the plone.sequencebatch name and distribution
and put anything else into it. It's never been used by anyone or
anything.

Hanno

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Loading...