[Zope3-Users] Re: [z3-five] zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3

David Pratt fairwinds at eastlink.ca
Sun Apr 9 20:33:16 EDT 2006


Hi Martin. I can think of the benefits of viewlets in for Zope2 in 
general, not just in Plone3 but the way they may integrate with CMF 
particularly. These are good questions you are asking and hopefully 
there will be a way to make this work sooner than later. I am very 
interested in how cpsskins v3 will be fitting into the picture also.
The Z2 integration will be started soon at a sprint soon. Viewlets and 
portlets seem pretty synonymous and cpsskins provides a way to 
manipulate portlets visually which is very nice.  The recent posts on 
formlib integration with viewlets also has my interest since it should 
make portlet development super easy as well. formlib by itself is pretty 
sweet on its own. :-)

Regards,
David

Martin Aspeli wrote:
> Hi guys (sorry for the crosspost, this is rather a cross-area post),
> 
> I'm reading the docs for zope.contentprovider and zope.viewlet, and 
> there are many reasons why we'd like to use this in Plone. The way the 
> release cycles work, Plone 3.0 would be the natural place to put some of 
> this. Now, I have a few questions:
> 
>  - In what version of Zope 3 did zope.contentprovider and zope.viewlet 
> appear? They're not in my Zope 2.9 lib/python/zope.
> 
>  - Are they scheduled to be in Zope 2.10?
> 
> The main achilles heel as far as I can tell is the TALES 'provider:' 
> expression. I'm guessing that without using the Zope 3 ZPT and TALES 
> implementations, Zope 2 won't be able to use these.
> 
>  - Is it the intention to use the Zope 3 ZPT and TALES engines in Zope 
> 2.10? If not, are they scheduled for some other time? How much work is 
> needed for this to be a reality?
> 
> Now, I have a feeling that this could be faked in Zope 2 with something 
> like:
> 
>     <tal:block replace="structure python:provider('provider.name')" />
> 
> the object 'provider' would have to be defined globally (in 
> global_defines.pt in Plone). Its implementation would basically be 
> identical to the TALESProviderExpression in zope.contentprovider, with a 
> __call__() method that called update() and render() on an 
> IContentProvider looked up by the name it was passed.
> 
> The tricky part is the ITALNamespaceData update magic that needs to read 
> the TAL context:
> 
>  - Is there some way a python object referred in an expression like the 
> one above could be passed or acquire (literally or figuratively) TAL 
> objects defined in the current context at that point?
> 
>  - If not, based on your practical experience, how much is this used - 
> would zope.contentprovider and zope.viewlet be useless if Plone had to 
> say "we only support a subset of the zope.contentprovider API" (note: we 
> really don't want to do that, I'm just looking at options here)
> 
> The other problem with this implementation is that it would call 
> viewlets/content providers sequentially, i.e. call update(), then 
> render() for each object as it discovered them, not call all the 
> update()'s and then all the render()'s. I note that the 
> zope.contentprovider README.txt mentions that this is bad, but the 
> TALESProviderExpression implementation seems to suffer from exactly the 
> same problem.
> 
>  - Is this expected behaviour? Is it considered as "known issue"? Are 
> there plans to improve on this?
> 
> Thanks a lot!
> 
> Martin
> 
> 
> 
> --(muted)
> 
> _______________________________________________
> z3-five mailing list
> z3-five at codespeak.net
> http://codespeak.net/mailman/listinfo/z3-five
> 


More information about the Zope3-users mailing list