cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@yahoo.com>
Subject Re: [C2][Patch][Vote] A Selector that tests on sitemap parameters
Date Wed, 09 May 2001 12:11:39 GMT
+1. Leo, can you please post a meaningful sample too?

Thanks,
dims

--- Leo Sutic <leo.sutic@inspireinfrastructure.com> wrote:
> All,
> 
> a week ago I submitted that the sitemap parameters should be made available
> to selectors. The voting never happened, but I believe the idea has enough
> merit that I now submit three patches for inclusion into Cocoon2.
> 
> The modified files are:
> ParameterSelectorFactory.java : The factory class creating parameter
> selectors.
> 
> Selector.java : The selector now takes a Parameter reference in addition to
> earlier parameters.
> 
> sitemap.xsl : <parameter/> tags within <map:select/> are handled just as
> they are for actions, etc. instead of being ignored.
> 
> No changes were necessary to the other selector factories.
> 
> Usage:
> 
>   <map:selector name="parameter"
> factory="org.apache.cocoon.selection.ParameterSelectorFactory"/>
> 
>   .
>   .
>   .
> 
> 
>    <map:select type="parameter">
>      <parameter name="parameter-selector-test"
> value="{$mySitemapParameter}"/>
>       <map:when test="myParameterValue">
>          <!-- executes iff {$mySitemapParameter} == "myParameterValue" -->
>          <map:transform src="stylesheets/page/uk.xsl"/>
>       </map:when>
>       <map:otherwise>
>          <map:transform src="stylesheets/page/us.xsl"/>
>       </map:otherwise>
>    </map:select>
> 
> 
> /LS
> 

> ATTACHMENT part 2 application/octet-stream name=ParameterSelectorFactory.java


> ATTACHMENT part 3 application/octet-stream name=Selector.java.diff


> ATTACHMENT part 4 application/octet-stream name=sitemap.xsl.diff
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

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


Mime
View raw message