cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: [Proposal] Sitemap parameters
Date Fri, 31 May 2002 07:55:27 GMT
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


Mime
View raw message