cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [Proposal] Sitemap parameters
Date Wed, 29 May 2002 13:32:25 GMT
Konstantin Piroumian wrote:

>From: "Christian Haul" <haul@dvs1.informatik.tu-darmstadt.de>
>
>>On 27.May.2002 -- 11:49 AM, Carsten Ziegeler wrote:
>>
>>>Konstantin Piroumian wrote:
>>>
>>>>Hi alls!
>>>>
>>>>While inspecting the Forrest's sitemap
>>>>(src/documentation/conf/sitemap.xmap)
>>>>I've found several lines that are using Ant substitution params like:
>>>><map:transform src="skins/@skin@/xslt/html/{type}.xsl">.
>>>>
>>>>Won't it be better to have parameters at the top level in sitemap that
>>>>
>can
>
>>>>be set externally, just as it is done in XSLT? So, those skin
>>>>parameters can
>>>>be set like this:
>>>>
>>>><map:sitemap ...>
>>>>    <map:parameter name="skin">forrest-skin</map:parameter>
>>>>...
>>>>
>>>>    <map:transform src="skins/{../skin}/xslt/html/{type}.xsl">
>>>>...
>>>></map:sitemap>
>>>>
>>>>This parameters can be defined when Cocoon is called from the command
>>>>
>line
>
>>>>as command line arguments. Though, I have no idea how these parameters
>>>>
>can
>
>>>>be set when running Cocoon as servlet, maybe 'cocoon-param' request
>>>>parameters can be used.
>>>>
>>>>Are there any technical difficulties in implementing this? Any
>>>>
>comments,
>
>>>>suggestions?
>>>>
>>>I would suggest to have these parameters as a configuration of the
>>>map:pipelines
>>>section, rather than the complete sitemap.
>>>
>>Hi,
>>
>>could this be relevant to your discussion (I'm sneaking in 'cause I
>>saw Carsten's cross post to cocoon-dev)?
>>
>>http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102249009904928&w=2
>>
>
>I've seen that discussion, but had problems with mail server and couldn't
>join to it.
>
>My proposal is a little different. 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, otherwise
>the default value is used that is specified in declaration of the parameter:
>
><map:parameter name="skin" value="forrest-skin" />
>
>Konstantin
>

Konstantin, see my proposal on the "InputModule for variable 
substitution thread" at 
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102267878917025 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>

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

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 ?

Sylvain

-- 
Sylvain Wallez
 Anyware Technologies                  Apache Cocoon
 http://www.anyware-tech.com           mailto:sylvain@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message