> Betreff: [Zope3-dev] Are pagelets content providers?
> During the gocept sprint on z3c.form last week we found that
> the interface of pagelets (z3c.pagelet.interfaces.IPagelet)
> is a mere marker interface on top of IBrowserPage, which
> seems to me a bit thin.
Yes and no ;-)
I was carfully skip some additional method decalration
because I didn't know if we gona use IPagelets without
render and update in other implementations.
> For one, the implementation of pagelets makes use of the
> render and update methods. Since these methods are the ones
> to be customized when writing custom pagelets, they should be
Yes you are probably right, feel free to add them to the IPagelet
interface. I didn't use the IPagelet interface without
render/update till now and I see no other usecase without
them. Or does anybody see such non render/update usecase
> While it would be easy enough to just add the methods to
> IPagelet (which has actually been done for render by now), I
> think IPagelet should really be an extension to
> zope.contentprovider.interfaces.IContentProvider in addition
> to IBrowserPage. It is already possible to use pagelets such
> as z3c.form.form.Form as content providers. While the pagelet
> implementation distinguishes between pagelet and pagelet
> renderer, only the latter being declared the content
> provider, this distinction seems to be made only in order for
> the content provider lookup to return the same pagelet
> instance that is the view. The renderer then only (sort of)
> forwards the pagelet's own content provider functionality, so
> the pagelet might as well be declared a content provider itself.
I disagree, the IPagelet is not a IContentProvider. The pagelet
is the component which defines the content and the renderer is
the content provider. It's a delegation pattern.
I explicit didn't implement IContentProvider in IPagelet
because a pagelet has to conceptual functionality of a page
and not of a content provider or viewlet thing.
Hm, probably the naming of the pagelet within it's (*let)
in the name is not so good as I was thinking. It could
suggest that the pagelet is a additional page content like
viewlets or content providers. But a pagelet is a
full replacement for the IBrowserPage and not additional.
The interface IPagelet(IBrowserPage) should reflect the
The IPageletRenderer(IContentProvider) should describe
the pattern how the pagelet content get accessed.
Dou you see my idea behind this declarations?
What do you think, should we add render/update to the
IPagelet which is not defined in IBrowserPage?
Or should we add a IRenderUpdate interface in zope.?
which we can use in zope.formlib, z3c.form, z3c.pagelet
and probably many more interfaces?
> Any thoughts, objections, ideas?
> Zope3-dev mailing list
Zope3-dev mailing list