cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Piroumian <>
Subject Re: [Proposal] Sitemap parameters
Date Wed, 29 May 2002 13:53:57 GMT
From: "Sylvain Wallez" <>
> Konstantin Piroumian wrote:

<skip />

>> While input modules provide a way to
> >_get_ variable values from different sources (sitemap, request, etc.), my
> >need is to _set_ global parameters for the sitemap to avoid things like
> >@skin@ in matcher patterns, etc. Of course these params can be used as
> >"sitemap:param-name" everywhere when needed. The above example would look
> >like:
> >
> ><map:transform src="skins/{sitemap:skin}/xslt/html/{type}.xsl">.
> >
> >Behavior can be the same as for the XSLT params: if a value is specified
> >externally (from command line or request params) then it's used,
> >the default value is used that is specified in declaration of the
> >
> ><map:parameter name="skin" value="forrest-skin" />
> >
> >Konstantin
> >
> Konstantin, see my proposal on the "InputModule for variable
> substitution thread" at
> where I
> make a proposal about this.
> We also have to decide where the value for these variables is defined.
> There are two locations for this :
> - in the mount instruction in the parent sitemap :
>     <map:mount prefix="sub/">
>       <map:parameter name="skin" value="fancy"/>
>     </map:mount>

Good idea. Didn't think of it.

> - in the sitemap itself (proposed by Carsten with a sligthly different
> syntax)
>     <map:pipeline>
>       <map:parameter name="skin" value="forrest"/>
>       <map:match pattern="/">
>       ...

In this case if you have different pipelines using the same parameter you'll
have to duplicate it.

>From the other point of view, if params are declared at the top level, it
will make people think that they can be used in component declarations etc.
(Params can be accessed in resources and views using '../skin' or '/skin'

So, no objection from me on having params in pipelines instead of the top

> Just as what's in use for both XSLT parameters and Ant properties, an
> externally-defined variable (defined in <map:mount>) would take
> precedence over a locally-defined one. Thus in the above examples,
> "fancy" will be used in the mounted sitemap instead of "forrest".


> Thoughts ?

For the Forrest case, the params of the sitemap are set during Ant's build
process, so to be able to do the same thing it will be needed to set (top
level) params for the sitemap externally, e.g. using command line arguments,
org.a.c.Main -pskin=forrest -pstyle=cool [other arguments].

For online processing params can be set using request params, say

This feature was also requested several times in cocoon-users.


> Sylvain
> --
> Sylvain Wallez
>  Anyware Technologies                  Apache Cocoon
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

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

View raw message