cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Hoskens">
Subject Re: Using sitemap parameters in a cinclude transformation
Date Mon, 22 Mar 2004 12:17:37 GMT
The cinclude transformer itself does not have the capability to pass and
fill in parameters. You should combine the cinclude with another technique
such as:

   1)  JXTemplateGenerator:(preferred way)  this uses Jexl and JXPath to
access variables, you got some standard objects you can use here such as
request/parameters and session, look for the docs in your cocoon under flow
    <map:generate type="jx" ....>
        <map:parameter name="url" value=""/>

        ->sourcefile: something like <cinclude:include

 2)   XSP: (old way) in XSP you can create your cinclude tags and use logic
to get your sitemapparameter (parameters.getParameter(..))
    <map:generate type="serverpages"...>
        <map:parameter name="" value=""/>

        String url = paramters.getParameter("...");
        create your element and add an attribute
        <xsp:attribute name="src"><xsp:expr>url</xsp:expr></xsp:attribute>

thus replace your normal xml generator with one of the previous generators
and adjust your source file.

Kind Regards,

----- Original Message ----- 
From: "Björn Voigt" <>
To: <>
Sent: Monday, March 22, 2004 8:38 AM
Subject: Using sitemap parameters in a cinclude transformation

> Moin Cocooners,
> I want aggregate some internal pipelines. The generated file
> should have a more complex structure instead of only one root element,
> which the simple sitemap aggregation is providing.
> I want use the cinclude mechanism, but it seems to be not able to
> handle parameters from the sitemap. Is this not possible with cinclude?
> I will replace this:
>        <map:match pattern="*.html">
>          <map:aggregate element="site">
>            <map:part src="cocoon:/menu-{0}"/>
>            <map:part src="cocoon:/body-{0}"/>
>          </map:aggregate>
>     <map:transform type="encodeURL"/>
> [...]
>        </map:match>
> with something like this:
> <map:match pattern="pattern="*.html"">
>    <map:generate src="aggregation.xml"/>
>    <map:transform type="cinclude">
> <map:parameter name="value" value="{1}"/>
>    </map:transform>
>    [...]
> </map:match>
> <site xmlns:cinclude="">
>      <cinclude:include src="cocoon:/menu-{value}"/>
>      <cinclude:include src="cocoon:/menu-{value}"/>
> </site>
> Thank you for helpfull ideas,
> Björn Voigt
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message