You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Konstantin Piroumian <kp...@apache.org> on 2002/05/24 16:07:05 UTC

[Proposal] Sitemap parameters

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?

Konstantin
_________________________________________
Konstantin Piroumian
Lead Developer

Email: kpiroumian@apache.org
ICQ#: 2297575
Work Tel#:  +7 095 795 0520 * 1288
_________________________________________

Re: [Proposal] Sitemap parameters

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Sylvain Wallez" <sy...@anyware-tech.com>
> 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,
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>

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'
syntax)

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

>
> 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".

Agree.

>
> 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,
say:
org.a.c.Main -pskin=forrest -pstyle=cool [other arguments].

For online processing params can be set using request params, say
'cocoon-param-skin=forrest'.

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

Konstantin

>
> 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
>

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


Re: [Proposal] Sitemap parameters

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Konstantin Piroumian wrote:

>From: "Christian Haul" <ha...@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


Re: [Proposal] Sitemap parameters

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 29.May.2002 -- 01:17 PM, Konstantin Piroumian wrote:
> From: "Christian Haul" <ha...@dvs1.informatik.tu-darmstadt.de>
> >
> > 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

Konstantin, I didn't intend to promote the use of that modules. I
think the issue Nicola raised is more general than that: referencing
sitemap vars with URLs and supporting different means to obtain the
value.

With that (actually, even with the input modules) you could have a
component that takes all the vars you would like to set and refer to
them afterwards. For example take the StringConstantModule: configure
it to return a "@myskin" and refer to it whenever you need it.  Why
not extend it so that it can return different constants? That way you
will get global constants.

> 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:

Possible, I'd say.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: [Proposal] Sitemap parameters

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Carsten Ziegeler" <cz...@s-und-n.de>
>
> Konstantin Piroumian wrote:
> >
> > >
> > > You can configure the global parameters in the map:pipelines section:
> > > <map:pipelines>
> > >   <map:global-parameters>
> > >      <map:parameter name="skin" value="forrest-skin"/>
> > >   </map:global-parameters>
> >
> > One question: why 'global-parameters' and not simply 'parameters'?
> >
> Hmm, I first named it 'parameters' and then I tried 'global-parameters'
> and I thought it's a better fit, because these parameters are global
> to all pipeline sections. They are not for the map:pipelines element
> itself.

Yes, you're right, but maybe they could be declared without a wrapping
element? Simply:
<map:pipelines>
    <map:parameter name="" value="" />
    ...
</map:pipelines>

It seems to me more intuitive and similar to XSLT syntax.

Konstantin

>
> But if wanted, changing the name is really a 30sec work.
>
> Carsten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

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


RE: [Proposal] Sitemap parameters

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Konstantin Piroumian wrote:
> 
> > 
> > You can configure the global parameters in the map:pipelines section:
> > <map:pipelines>
> >   <map:global-parameters>
> >      <map:parameter name="skin" value="forrest-skin"/>
> >   </map:global-parameters>
> 
> One question: why 'global-parameters' and not simply 'parameters'?
> 
Hmm, I first named it 'parameters' and then I tried 'global-parameters'
and I thought it's a better fit, because these parameters are global
to all pipeline sections. They are not for the map:pipelines element
itself.

But if wanted, changing the name is really a 30sec work.

Carsten

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


Re: [Proposal] Sitemap parameters

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Carsten Ziegeler" <cz...@s-und-n.de>
> Stuart Roebuck wrote:
...
> > >
> > > <map:parameter name="skin" value="forrest-skin" />
> >
> > Just to say that this kind of functionality would be *really* useful.
> >
> And now the good news: it's already implemented in the latest CVS :)

You are very quick :)

> 
> You can configure the global parameters in the map:pipelines section:
> <map:pipelines>
>   <map:global-parameters>
>      <map:parameter name="skin" value="forrest-skin"/>
>   </map:global-parameters>

One question: why 'global-parameters' and not simply 'parameters'?

Konstantin

> 
> and use it:
> 
>   <map:pipeline>
>     <map:match pattern="test">
>        ...
>        <map:transform src="{../skin}.xsl"/>
>     </map:match>
> ...
> 
> Carsten
> 
> Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
> ------------------------------------------------------------------
>              Cocoon Consulting, Training and Projects
> ------------------------------------------------------------------
> mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
>                     http://ziegeler.bei.t-online.de
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

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


RE: [Proposal] Sitemap parameters

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Nicola Ken Barozzi wrote:
>
> From: "Carsten Ziegeler" <cz...@s-und-n.de>
>
> > You can configure the global parameters in the map:pipelines section:
> > <map:pipelines>
> >   <map:global-parameters>
> >      <map:parameter name="skin" value="forrest-skin"/>
> >   </map:global-parameters>
> >
> > and use it:
> >
> >   <map:pipeline>
> >     <map:match pattern="test">
> >        ...
> >        <map:transform src="{../skin}.xsl"/>
> >     </map:match>
> > ...
>
> :-)
>
> Is there a way to set the parameter out of the sitemap?
> It seems that using inputmodules one could write:
>
>  <map:pipelines>
>    <map:global-parameters>
>       <map:parameter name="skin" value="{request:skin}"/>
>    </map:global-parameters>
> ...
>
> which could be really cool, since it gives both the possibility of setting
> it from the outside and setting it in a single point.
> It seems that both approaches have their use :-)
>
Yes, this is a very good idea.
I haven't looked at the input modules yet, but it should be possible,
so patches are welcome :)

Carsten

Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
------------------------------------------------------------------
             Cocoon Consulting, Training and Projects
------------------------------------------------------------------
mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
                    http://ziegeler.bei.t-online.de


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


Re: [Proposal] Sitemap parameters

Posted by Nicola Ken Barozzi <ni...@apache.org>.
From: "Carsten Ziegeler" <cz...@s-und-n.de>

> You can configure the global parameters in the map:pipelines section:
> <map:pipelines>
>   <map:global-parameters>
>      <map:parameter name="skin" value="forrest-skin"/>
>   </map:global-parameters>
>
> and use it:
>
>   <map:pipeline>
>     <map:match pattern="test">
>        ...
>        <map:transform src="{../skin}.xsl"/>
>     </map:match>
> ...

:-)

Is there a way to set the parameter out of the sitemap?
It seems that using inputmodules one could write:

 <map:pipelines>
   <map:global-parameters>
      <map:parameter name="skin" value="{request:skin}"/>
   </map:global-parameters>
...

which could be really cool, since it gives both the possibility of setting
it from the outside and setting it in a single point.
It seems that both approaches have their use :-)

--
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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


Re: [Proposal] Sitemap parameters

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 29.May.2002 -- 04:25 PM, Christian Haul wrote:
> On 29.May.2002 -- 04:12 PM, Carsten Ziegeler wrote:
> > Konstantin Piroumian wrote:
> > > >
> > > > Do we need to introduce new special element - <map:global-parameters/> -
> > > > here? Won't it be better to just declare parameters right inside
> > > > <map:pipelines/> element?
> > >
> > > You are reading my thoughts! ;)))
> > >
> 
> If one would extent the StringConstantModule to hold more than one
> constant, or even look at the request object first whether the
> parameter should be overridden, one could
> 
> (in cocoon.xconf or wherever components can be declared)
> 
>    <input-modules logger="core.modules.input">
>       <component-instance name="global-defaults" class="org.apache.cocoon.components.modules.input.DefaultsModule">
> 	    <skin>myskin</skin>
>         <base-url>http://localhost:8080</base-url>
>         <!-- more default values ad lib -->
>       </component-instance>
>    </input-modules>
> 
> (in sitemap.xmap)
> 
>    <map:transform src="apply-skin.xsl">
>       <map:parameter name="skin" value="{/module:global-defaults:skin}"/>
>       <map:parameter name="base" value="{/module:global-defaults:base-url}"/>
>    </map:transform>
> 
> Plus, by chosing different names for multiple instances of such module
> one could have different contexts. 
> 
> Would that make sense?

Since input modules are not yet supported for variable substitiotion, I have
created a sample for this using an action. This particular action returns
only an emtpy map but sets request attributes. I believe it sufficient to
illustrate the concept / how the new input module works.

Update your 2.1-dev from CVS, build and deploy, then get

http://www.dvs1.informatik.tu-darmstadt.de/~haul/misc/c2/modules-test.jar

unpack in $COCOON/mount, point your browser to http://localhost:8080/cocoon/mount/modules/test

Add request parameter "skin" to URL (http://localhost:8080/cocoon/mount/modules/test?skin=test)

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: [Proposal] Sitemap parameters

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 29.May.2002 -- 04:12 PM, Carsten Ziegeler wrote:
> Konstantin Piroumian wrote:
> > >
> > > Do we need to introduce new special element - <map:global-parameters/> -
> > > here? Won't it be better to just declare parameters right inside
> > > <map:pipelines/> element?
> >
> > You are reading my thoughts! ;)))
> >

If one would extent the StringConstantModule to hold more than one
constant, or even look at the request object first whether the
parameter should be overridden, one could

(in cocoon.xconf or wherever components can be declared)

   <input-modules logger="core.modules.input">
      <component-instance name="global-defaults" class="org.apache.cocoon.components.modules.input.DefaultsModule">
	    <skin>myskin</skin>
        <base-url>http://localhost:8080</base-url>
        <!-- more default values ad lib -->
      </component-instance>
   </input-modules>

(in sitemap.xmap)

   <map:transform src="apply-skin.xsl">
      <map:parameter name="skin" value="{/module:global-defaults:skin}"/>
      <map:parameter name="base" value="{/module:global-defaults:base-url}"/>
   </map:transform>

Plus, by chosing different names for multiple instances of such module
one could have different contexts. 

Would that make sense?

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


RE: [Proposal] Sitemap parameters

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> 
> Konstantin Piroumian wrote:
> > >
> > > Do we need to introduce new special element -
<map:global-parameters/> -
> > > here? Won't it be better to just declare parameters right inside
> > > <map:pipelines/> element?
> >
> > You are reading my thoughts! ;)))
> >
> Ok, ok, two against one :( - patch at will


One thing left - to add {/paramname} syntax...
Hint-hint ;)

Vadim

> 
> Carsten


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


RE: [Proposal] Sitemap parameters

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Konstantin Piroumian wrote:
> >
> > Do we need to introduce new special element - <map:global-parameters/> -
> > here? Won't it be better to just declare parameters right inside
> > <map:pipelines/> element?
>
> You are reading my thoughts! ;)))
>
Ok, ok, two against one :( - patch at will

Carsten


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


Re: [Proposal] Sitemap parameters

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Vadim Gritsenko" <va...@verizon.net>
> > From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> > 
> > 
> > Stuart Roebuck wrote:
> > >
> > > On Wednesday, May 29, 2002, at 10:17 AM, Konstantin Piroumian wrote:
> > >
> > > > 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" />
> > >
> > > Just to say that this kind of functionality would be *really*
> useful.
> > >
> > And now the good news: it's already implemented in the latest CVS :)
> > 
> > You can configure the global parameters in the map:pipelines section:
> > <map:pipelines>
> >   <map:global-parameters>
> 
> Do we need to introduce new special element - <map:global-parameters/> -
> here? Won't it be better to just declare parameters right inside
> <map:pipelines/> element?

You are reading my thoughts! ;)))

KP

> 
> Then it will be simply:
> 
> <map:pipelines>
>   <map:parameter name="skin" value="forrest-skin"/>
> 
> (Which can be thought of as: "parameters for the *all* pipelines)
> 
>   <map:pipeline>
>     <map:match pattern="test">
>        ...
>        <map:transform src="{../skin}.xsl"/>
>     </map:match>
>     ...
> 
> </map:pipelines>
> 
> 
> Vadim
> 
> >      <map:parameter name="skin" value="forrest-skin"/>
> >   </map:global-parameters>
> > 
> > and use it:
> > 
> >   <map:pipeline>
> >     <map:match pattern="test">
> >        ...
> >        <map:transform src="{../skin}.xsl"/>
> >     </map:match>
> > ...
> > 
> > Carsten
> > 
> > Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
> > ------------------------------------------------------------------
> >              Cocoon Consulting, Training and Projects
> > ------------------------------------------------------------------
> > mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
> >                     http://ziegeler.bei.t-online.de
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

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


RE: [Proposal] Sitemap parameters

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> 
> 
> Stuart Roebuck wrote:
> >
> > On Wednesday, May 29, 2002, at 10:17 AM, Konstantin Piroumian wrote:
> >
> > > 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" />
> >
> > Just to say that this kind of functionality would be *really*
useful.
> >
> And now the good news: it's already implemented in the latest CVS :)
> 
> You can configure the global parameters in the map:pipelines section:
> <map:pipelines>
>   <map:global-parameters>

Do we need to introduce new special element - <map:global-parameters/> -
here? Won't it be better to just declare parameters right inside
<map:pipelines/> element?

Then it will be simply:

<map:pipelines>
  <map:parameter name="skin" value="forrest-skin"/>

(Which can be thought of as: "parameters for the *all* pipelines)

  <map:pipeline>
    <map:match pattern="test">
       ...
       <map:transform src="{../skin}.xsl"/>
    </map:match>
    ...

</map:pipelines>


Vadim

>      <map:parameter name="skin" value="forrest-skin"/>
>   </map:global-parameters>
> 
> and use it:
> 
>   <map:pipeline>
>     <map:match pattern="test">
>        ...
>        <map:transform src="{../skin}.xsl"/>
>     </map:match>
> ...
> 
> Carsten
> 
> Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
> ------------------------------------------------------------------
>              Cocoon Consulting, Training and Projects
> ------------------------------------------------------------------
> mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
>                     http://ziegeler.bei.t-online.de


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


RE: [Proposal] Sitemap parameters

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Stuart Roebuck wrote:
>
> On Wednesday, May 29, 2002, at 10:17 AM, Konstantin Piroumian wrote:
>
> > 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" />
>
> Just to say that this kind of functionality would be *really* useful.
>
And now the good news: it's already implemented in the latest CVS :)

You can configure the global parameters in the map:pipelines section:
<map:pipelines>
  <map:global-parameters>
     <map:parameter name="skin" value="forrest-skin"/>
  </map:global-parameters>

and use it:

  <map:pipeline>
    <map:match pattern="test">
       ...
       <map:transform src="{../skin}.xsl"/>
    </map:match>
...

Carsten

Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
------------------------------------------------------------------
             Cocoon Consulting, Training and Projects
------------------------------------------------------------------
mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
                    http://ziegeler.bei.t-online.de


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


Re: [Proposal] Sitemap parameters

Posted by Stuart Roebuck <st...@adolos.co.uk>.
On Wednesday, May 29, 2002, at 10:17 AM, Konstantin Piroumian wrote:

> 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" />

Just to say that this kind of functionality would be *really* useful.

Stuart.


            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, 
etc.
ADOLOS                                           <http://www.adolos.com/>


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


Re: [Proposal] Sitemap parameters

Posted by Stuart Roebuck <st...@adolos.co.uk>.
On Wednesday, May 29, 2002, at 10:17 AM, Konstantin Piroumian wrote:

> 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" />

Just to say that this kind of functionality would be *really* useful.

Stuart.


            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, 
etc.
ADOLOS                                           <http://www.adolos.com/>


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


Re: [Proposal] Sitemap parameters

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Christian Haul" <ha...@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


>
> Chris.
>
> --
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

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


Re: [Proposal] Sitemap parameters

Posted by Christian Haul <ha...@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

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: [Proposal] Sitemap parameters

Posted by Christian Haul <ha...@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

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

Re: [Proposal] Sitemap parameters

Posted by Nicola Ken Barozzi <ni...@apache.org>.
From: "Carsten Ziegeler" <cz...@s-und-n.de>
>
> 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?

We need that the parameter is set outside of the sitemap, and the usual way
is an Action.

Why haven't I done it this way?
Because it needs to run both commandline and live, and we need anyway to
have one sitemap per project.

I couldn't come up with an Action that makes it easy to be used both in CLI
and in a server that has multiple Forrest sitemaps mounted.

I'd be happy to have it, though :-)

--
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------



RE: [Proposal] Sitemap parameters

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
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.

I'm currently thinking of adding a configuration possibility to the
map:pipelines
component anyway, because of the rather ugly configuration of the
authentication
components. They are currently configured in an action but are for the
complete
sitemap.

I thought of somethink like:
<map:pipelines>
   <map:pipeline-parameters>
       <map:parameter name="skin">forrest-skin</map:parameter>
   </map:pipeline-parameters>
   <map:component-configurations>
       <authentication>
            <handlers>
                  ...
       </authentication>
   </map:component-configurations>

  <map:pipeline>
       ...
  </map:pipeline>
</map:pipelines>

Carsten


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


RE: [Proposal] Sitemap parameters

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
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.

I'm currently thinking of adding a configuration possibility to the
map:pipelines
component anyway, because of the rather ugly configuration of the
authentication
components. They are currently configured in an action but are for the
complete
sitemap.

I thought of somethink like:
<map:pipelines>
   <map:pipeline-parameters>
       <map:parameter name="skin">forrest-skin</map:parameter>
   </map:pipeline-parameters>
   <map:component-configurations>
       <authentication>
            <handlers>
                  ...
       </authentication>
   </map:component-configurations>

  <map:pipeline>
       ...
  </map:pipeline>
</map:pipelines>

Carsten