cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject [RT] Content Aggregation-another spin (long)
Date Tue, 23 Jan 2001 22:03:30 GMT
I will try to recunstruct a message I was working on when
Mozilla crashed unexpectedly and killed it without trace.

My thoughts regarding this came from an article I read
(I can't remember where), and some examples of JSP I have
seen.  Aggregation is most useful with portals, but there
are also other uses for it.

The basic gist of the artical is using XSL in a manner to
transform from a template and include the portions you need.
While I wrote stream of consciousness in my previous note,
I will get straight to the point:

We have a template for a site like this:

+--------------------------+
|          Header          |
+---+------------------+---+
|   |                  |   |
| N |                  | N |
| a |       Body       | e |
| v |                  | w |
|   |                  | s |
+---+------------------+---+

The JSP methodology is that it puts the basic look in one
template and include the various aspects.  We can achieve
this relatively crude functionality using XSP and the
<util:include-uri href="dest"/> approach.  XSL allows us
to go farther with this template approach and specify
a single namespace that a transformer (or aggregator)
will use to substitute the different parts.

Aggregation as a process is a mixture of Generation and
Transformation at the same time.  (Technically it is a
generator in the strictist form, but like XSP there is
some substitution going on).

This template approach is very powerful because it allows
companies to leverage their existing expertise in site
design and use existing tools like Adobe PageMaker.

This is the way I envisage it working:

<!-- In the sitemap -->

<map:match pattern="**.html">
  <map:aggregate template="templates/site.xhtml">
    <map:part name="header">
      <map:generate src="templates/header.xhtml">
    </map:part>
    <map:part name="nav">
      <map:generate type="serverpages" src="docs/nav.xsp"/>
      <map:transform src="stylesheets/nav2xhtml.xsl"/>
    </map:part>
    <map:part name="body">
      <map:generate src="docs/{1}.xml"/>
      <map:transform src="stylesheets/document2xhtml.xsl"/>
    </map:part>
    <map:part name="news">
      <map:aggregate type="directory" template="templates/news.xml">
        <map:part name="item" src="news/">
          <map:transform src="stylesheets/news2xhtml.xsl"/>
        </map:part>
      </map:aggregate>
    </map:part>
  </map:aggregate>
  <!-- further transformation could be done here -->
  <map:serialize/>
</map:match>

<!-- In the template -->

<html>
  <header><title>Your Title</title></header>
  <body>
    <div class="header"><agg:part name="header"/></div>
    <div class="nav"><agg:part name="nav"/></div>
    <div class="body"><agg:part name="body"/></div>
    <div class="news"><agg:part name="news"/></div>
  </body>
</html>

<!-- In the news template -->

<news>
  <newsitem><map:part name="item"/><newsitem>
</news>

This really only adds one more Sitemap Component:
aggregate

It can have more than one type: sitemap and directory
for starters.

Both use an external template (note the relatively simple
examples I included), that is much easier for the average
web designer to maintain--the fact that they only need to
include one tag really helps them out.

The other way of doing this is to explicitly make the aggregation
a complex type of generator.  If it can altered like the
SQL Transformer gets its parameters/configurations, then that
would work as well.

Mime
View raw message