[Zope3-dev] Brainstorming page architecture, pagelets, portlets, etc.

Alain Poirier alain.poirier at net-ng.com
Mon Nov 15 14:22:33 EST 2004


Hi,

As I find this discussion about the Zope 3 page architecture very 
interesting, here are my 2 cents ...

My 2 main problems with the current Zope 3 implementation are :

 1. To me a component view doesn't have to set the whole HTML page, even
    by calling ZPT macros. It's a big problem in term of design, work for
    the designers, developpers/designers separation and reusability.

 2. "Pages", "portlet", "pagelet", "form", "layout" .. are not mecanisms the
    Zope 3 page architecture must offer. But they are what you can do
    _using_ the Zope 3 page architecture.

 
I simply see the page architecture like that :

  - You've got components
  - You put views on them
  - A view can aggregate other views

Here we did it with a presentation service. It's the presentation service 
that "put views on the components" by selecting the correct view of the
component to use. And each view asks the presentation service when it wants
to aggregate a view of an other component.

Also, the classical Zope 2/3 way, when the URL A/B/C is called is to render
C. We found more values by letting the presentation service first renders a
view on the HTTP request that aggregate a view on A that can aggregates a
view of B that can aggregate a view of C (of course, each view can also
aggregate views of components not in the URL path, by always calling the
presentation service).

It's the view of the HTTP request object (component ?) that insert the
<html><body>... tags and insert the view of A between the <body></body>
tags.


Example of a typical use : URL /mysite/news

The view of 'mysite' is a "hard-coded" layout view, that create a table
with a horizontal row at the top for the menu, a vertical column at
the left side for the tree-view and a large area at right for the
content. Into the menu bar, the 'header' view of a navigation component
is called, via the presentation service. Into the column, the 'tree-view'
view of the same navigation component is called. Into the content area,
the default view of the "next" component is called.

The presentation service find the "next" component is the 'news' component
and renders its default view. This default view is a generic layout view
that renders all the children ('flash' components) of the news component,
all in a row.

Note :

  - None of the views are complete HTML page. They are only HTML fragment.
  - Generaly, the designers do the views on the "parent" components : they
    set the general site layout, the views of the menu, tree-views .... (CSS
    and JS included). But they reuse the views of the "leaf" components,
    made by the developpers (for example, the sum-up and complete views of
    the 'flash' component)

 
With such a mecanisme, "portlet" are only, for example, some views on
components connected to some external XML streams. "Portal" is only a view
of a component that dynamically knows the views to render into its 3
columns ...



More information about the Zope3-dev mailing list