cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject [C2][Patch][Vote] A Selector that tests on sitemap parameters
Date Wed, 09 May 2001 12:05:18 GMT
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

Mime
View raw message