You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Paul Russell <pa...@luminas.co.uk> on 2001/01/18 21:57:09 UTC
[C2] Content aggregation: The options.
Hi guys,
I've tasked myself to start building the content aggregation, and I need
you guys input on the best way to approach this.
We have several options for sitemap syntax and implementation:
1) Sub-pipeline approach
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- [...] -->
<map:pipelines>
<map:pipeline>
<map:match pattern="welcome">
<map:aggregate>
<map:aggregate-generate src="content/resources/menu.xml"/>
<map:aggregate-generate type="serverpages" src="content/welcome.xml"/>
</map:aggregate>
<map:translate src="stylesheets/aggregate-to-html.xsl"/>
<map:translate src="stylesheets/content-to-html.xsl"/>
<map:serialize/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
2) Sub-uri approach
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:pipelines>
<map:pipeline>
<map:match pattern="welcome">
<map:aggregate>
<map:part uri="cocoon:///menu" name="menu"/>
<map:part uri="cocoon:///welcome" name="content"/>
</map:aggregate>
<map:translate src="stylesheets/aggregate-to-html.xsl"/>
<map:translate src="stylesheets/content-to-html.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="menu">
<map:generate src="content/resources/menu.xml"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="welcome">
<map:generate src="content/welcome.xml"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
My personal preference is for the first one, primarily because it avoids
having to reparse (or a hack to avoid it), and - to me - it's semantically
clearer and more flexible. What do you guys think? Anyone got any other
ideas?
Paul.
--
Paul Russell Email: paul@luminas.co.uk
Technical Director Tel: +44 (0)20 8553 6622
Luminas Internet Applications Fax: +44 (0)870 28 47489
This is not an official statement or order. Web: www.luminas.co.uk
Re: [C2] Content aggregation: The options.
Posted by Ross Burton <ro...@mail.com>.
Paul Russell wrote:
>
> Hi guys,
>
> I've tasked myself to start building the content aggregation, and I need
> you guys input on the best way to approach this.
>
> We have several options for sitemap syntax and implementation:
>
> 1) Sub-pipeline approach
>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> <!-- [...] -->
> <map:pipelines>
> <map:pipeline>
> <map:match pattern="welcome">
> <map:aggregate>
> <map:aggregate-generate src="content/resources/menu.xml"/>
> <map:aggregate-generate type="serverpages" src="content/welcome.xml"/>
> </map:aggregate>
> <map:translate src="stylesheets/aggregate-to-html.xsl"/>
> <map:translate src="stylesheets/content-to-html.xsl"/>
> <map:serialize/>
> </map:match>
> </map:pipeline>
> </map:pipelines>
> </map:sitemap>
>
> 2) Sub-uri approach
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> <map:pipelines>
> <map:pipeline>
> <map:match pattern="welcome">
> <map:aggregate>
> <map:part uri="cocoon:///menu" name="menu"/>
> <map:part uri="cocoon:///welcome" name="content"/>
> </map:aggregate>
> <map:translate src="stylesheets/aggregate-to-html.xsl"/>
> <map:translate src="stylesheets/content-to-html.xsl"/>
> <map:serialize/>
> </map:match>
> <map:match pattern="menu">
> <map:generate src="content/resources/menu.xml"/>
> <map:serialize type="xml"/>
> </map:match>
> <map:match pattern="welcome">
> <map:generate src="content/welcome.xml"/>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
> </map:pipelines>
> </map:sitemap>
>
> My personal preference is for the first one, primarily because it avoids
> having to reparse (or a hack to avoid it), and - to me - it's semantically
> clearer and more flexible. What do you guys think? Anyone got any other
> ideas?
I'm in preference of 1 too I think. Although 2 is just a use-case of 1
(if some attributes are renamed), as in 1) the type of the agregator
could be CocoonGenerator, which reads XML from instructions in the
sitemap... 2 does allow individual sections of the page to be
manipulated before being aggregated, but is this needed... Not sure.
Wasn't there an optional atribute to wrap each part with a specific tag?
Something like:
<map:aggregate-generate tag="menu" src="content/resources/menu.xml"/>
So that content with possibly different root elements can be identified
by the element they are contained within.
Anyway, I've gotta go to work!
Ross Burton