cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@cocoon.apache.org
Subject [Cocoon Wiki] New: CookieSelector
Date Wed, 14 Jul 2004 20:02:50 GMT
   Date: 2004-07-14T13:02:50
   Editor: MichaelTiffany <mtiffany71@aol.com>
   Wiki: Cocoon Wiki
   Page: CookieSelector
   URL: http://wiki.apache.org/cocoon/CookieSelector

   no comment

New Page:

==  CookieSelector  ==
- TARGET-AUDIENCE: '''*beginner*''' [[BR]]
- COCOON-RELEASES: 2.1.4[[BR]]
- DOCUMENT-STATUS: '''*draft*''' [[BR]]
----

=== What you will get from this page ===
How to use the CookieSelector.

If you wondered how to use the CookieSelector, here's how.

In the sitemap's <map:selectors> block, make sure you have:

{{{
<map:selector name="cookie-selector" src="org.apache.cocoon.selection.CookieSelector"/>
}}}

I may be preaching to the choir here, but as a gentle reminder: the "name" attribute for the
selector doesn't need to be "cookie-selector," it can be anything you want it to be, so long

as you don't reuse the name for something else...

Here's a snippet from my sitemap.xmap that uses the CookieSelector:

{{{
<map:match pattern="**.html">
  <map:aggregate element="root">
    <map:part src="cocoon://{1}.links"/>
    <map:part src="cocoon://content/{1}.html"/>
    <map:part src="cocoon://get-quote"/>
    <map:part src="cocoon://skin-form"/>
  </map:aggregate>
  <map:select type="cookie-selector">
  <map:parameter name="cookie-name" value="the-name-of-the-cookie"/>
    <map:when test="skin-style-1">
      <map:transform src="stylesheets/facade/abstract-style.xsl"/>
    </map:when>
    <map:when test="skin-style-2">
      <map:transform src="stylesheets/facade/vanity-style.xsl"/>
    </map:when>                      
    <map:otherwise>
      <map:transform src="stylesheets/facade/default-style.xsl"/>
    </map:otherwise>
  </map:select>   
  <map:serialize type="html"/>
</map:match> 
}}}

----
===  page metadata ===
- AUTHOR:[MichaelTiffany[BR]]
- AUTHOR-CONTACT: mailto:mtiffany71@aol.com[[BR]]
- REVIEWED-BY:[[BR]]
- REVIEWER-CONTACT:[[BR]]

Mime
View raw message