You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by as...@apache.org on 2007/09/08 22:17:47 UTC
svn commit: r573901 [28/44] - in /cocoon/site: site/ site/2.0/
site/2.0/developing/ site/2.0/faq/ site/2.0/howto/chaperon/
site/2.0/installing/ site/2.0/plan/ site/2.0/snippet/ site/2.0/tutorial/
site/2.0/userdocs/ site/2.0/userdocs/actions/ site/2.0/u...
Modified: cocoon/site/site/2.0/userdocs/selectors/parameter-selector.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.0/userdocs/selectors/parameter-selector.html?rev=573901&r1=573900&r2=573901&view=diff
==============================================================================
--- cocoon/site/site/2.0/userdocs/selectors/parameter-selector.html (original)
+++ cocoon/site/site/2.0/userdocs/selectors/parameter-selector.html Sat Sep 8 13:17:41 2007
@@ -1,371 +1,371 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Parameter Selector</title>
-<STYLE type="text/css">
-a.menu {
- color: #FFFFFF;
- text-align:left;
- font-size:12px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:plain;
- text-decoration:none;
- padding-left: 14px
-}
-
-A.menu:hover {
- color: #FFCC00
-}
-
-
-.menutitle {
- color: #000000;
- text-align:left;
- font-size:10px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:bold;
- padding-left: 8px
-}
-.menuselected {
- color: #FFCC00;
- text-align:left;
- font-size:12px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:bold;
- padding-left: 14px
-}
-</STYLE>
-</head>
-<body bgcolor="#ffffff" marginheight="4" marginwidth="4" leftmargin="4" topmargin="4" alink="#cc0000" vlink="#0086b2" link="#039acc" text="#000000">
-<table border="0" cellpadding="0" cellspacing="0" width="100%">
-<tr>
-<td align="left" valign="top" rowspan="3" height="60" width="135"><img border="0" vspace="0" hspace="0" src="images/logo.gif" height="60" width="135"></td><td background="images/line.gif" rowspan="1" colSpan="2" align="left" valign="top" height="0" width="100%"></td><td align="left" valign="top" rowspan="3" height="60" width="29"><img border="0" vspace="0" hspace="0" src="images/right.gif" height="60" width="29"></td>
-</tr>
-<tr>
-<td bgcolor="#0086b2" colspan="2" align="right" valign="top" height="35" width="100%"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="5">Parameter Selector</font></td>
-</tr>
-<tr>
-<td background="images/bottom.gif" colspan="2" width="100%" valign="top" height="20" bgcolor="#0086b2" align="right">
-<table width="288" cellspacing="0" cellpadding="0" border="0">
-<tr>
-<td align="left" valign="top" height="20" width="96"><a target="new" href="http://xml.apache.org/"><img border="0" vspace="0" hspace="0" name="xml" src="images/button-xml-lo.gif" height="20" width="96" alt="http://xml.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.apache.org/"><img border="0" vspace="0" hspace="0" name="asf" src="images/button-asf-lo.gif" height="20" width="96" alt="http://www.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.w3.org/"><img border="0" vspace="0" hspace="0" name="w3c" src="images/button-w3c-lo.gif" height="20" width="96" alt="http://www.w3.org/"></a></td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr width="100%">
-<td align="left" valign="top" width="120">
-<table width="120" cellspacing="0" cellpadding="0" border="0" bgcolor="#a0a0a0">
-<tr>
-<td valign="top" align="left"><img width="120" vspace="0" src="images/join.gif" hspace="0" height="14" border="0"><br>
-</td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../../index.html">Main</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../index.html">User Documentation</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Selectors</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="selectors.html">Overview</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Default</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="browser-selector.html">Browser Selector</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Core</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="host-selector.html">Host Selector</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="requestparameter-selector.html">Request Parameter Selector</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="requestattribute-selector.html">Request Attribute Selector</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><span class="menuselected">Parameter</span></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Optional</span></td>
-</tr>
-<tr>
-<td align="left" valign="top"><img width="120" vspace="0" src="images/close.gif" hspace="0" height="14" border="0"><br>
-</td>
-</tr>
-</table>
-</td><td>
-<table cellspacing="15" cellpadding="0" border="0">
-<tr>
-<td>
-
-
- <font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Parameter Selector</font>
-<hr style="color: #0086b2" size="1">
-
-
-<blockquote>
-<ul>
-
-<li>
-<font face="verdana, helvetica, sans serif">Name : ParameterSelector</font>
-</li>
-
-<li>
-<font face="verdana, helvetica, sans serif">Class: org.apache.cocoon.selection.ParameterSelector</font>
-</li>
-
-<li>
-<font face="verdana, helvetica, sans serif">Cacheable: not applicable</font>
-</li>
-
-</ul>
-</blockquote>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- This Selector matches a string, in the Parameters object passed to the
- selector, against a specified Cocoon internal parameter. It performs a
- case-sensitive string comparison between the value of the
- 'parameter-selector-test' parameter and the value of the 'test'
- attribute of the <code><font face="courier, monospaced"><map:when ...></font></code> element.
- </font>
-</p>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- This internal parameter could be:
- </font>
-</p>
-
-<blockquote>
-<ul>
-
-<li>
-<font face="verdana, helvetica, sans serif">A sitemap parameter from the <code><font face="courier, monospaced"><map:match ...></font></code> portion of the pipeline</font>
-</li>
-
-<li>
-<font face="verdana, helvetica, sans serif">A sitemap parameter set by an action</font>
-</li>
-
-</ul>
-</blockquote>
-
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Reasons to use ParameterSelector</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- One purpose of this selector is to choose between different components
- of a pipeline based on sitemap parameters set by an action. This would
- allow the action to control the logic required to set one or more parameters,
- which can then be used by this selector to control pipeline processing.
- Thus, complex decision-making logic can be contained in actions, while the
- sitemap simply uses the results of the actions (the parameters) to determine
- pipeline processing.
- </font>
-</p>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- Parameter Selector can also be used to select on the value of 'keys'
- (such as {1} or {../2} ) from the wildcard matcher. Information in the
- URI, such as part of a filename, can then be used to determine pipeline
- processing.
- </font>
-</p>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Examples</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- Add the component to your sitemap.xmap:
- </font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
- <map:components>
- ...
- <map:selectors>
- ...
- <map:selector
- name="parameter"
- logger="sitemap.selector.parameter"
- src="org.apache.cocoon.selection.ParameterSelector"/>
- ...</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- Use a parameter set by an action:
- </font>
-</p>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- Assume there is an action (named MyAction) that sets a parameter
- (named MyRegion) to several possible values. For more information on actions,
- including a simple example of an action that creates a sitemap parameter, see
- <a href="../concepts/actions.html">Creating and Using Actions</a>.
- </font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
- <map:match pattern="*.xml">
- <map:act type="MyAction">
- <map:generate src="{../1}.xml"/>
-
- <map:select type="parameter">
- <map:parameter name="parameter-selector-test" value="{MyRegion}"/>
-
- <!-- executes iff the value of MyRegion equals
- "United States" (without quotes) -->
- <map:when test="United States">
- <map:transform src="stylesheets/us.xsl"/>
- </map:when>
-
- <map:when test="South_America">
- <map:transform src="stylesheets/southamerica.xsl"/>
- </map:when>
-
- <map:when test="Europe">
- <map:transform src="stylesheets/europe.xsl"/>
- </map:when>
-
- <map:otherwise>
- <map:transform src="all_others.xsl"
- </map:otherwise>
-
- </map:select>
- </map:act>
- <map:serialize/>
- </map:match></pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- Use values from the URI:
- </font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
- <map:pipeline>
- <!-- {1}/{2}/myfile.xml -->
- <map:match pattern="**/*/myfile.xml">
-
- <!-- Use ParameterSelector -->
- <map:select type="parameter">
- <map:parameter name="parameter-selector-test" value="{2}"/>
-
- <!-- executes iff the value of {2} equals
- "basic" (without quotes); the requested URI
- could be **/basic/myfile.xml -->
- <map:when test="basic">
- <map:generate src="{1}/myfile.xml"/>
- <map:transform src="stylesheets/basic.xsl">
- <map:parameter name="use-request-parameters" value="true"/>
- <map:parameter name="resource" value="{2}.html"/>
- </map:transform>
- <map:serialize/>
- </map:when>
-
- <map:when test="aggregate">
- <map:aggregate element="site">
- <map:part src="cocoon:/{1}/sidebar-{1}/{2}.xml"/>
- <map:part src="cocoon:/body-{1}/{2}.xsp"/>
- </map:aggregate>
- <map:transform src="stylesheets/aggregate2xhtml.xsl"/>
- <map:serialize/>
- </map:when>
-
- <map:otherwise>
- <map:redirect-to uri="other_URI"/>
- </map:otherwise>
-
- </map:select>
- </map:match>
- ...</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-
-
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr>
-<td bgcolor="#0086b2"><img width="1" src="images/dot.gif" height="1"></td>
-</tr>
-<tr>
-<td align="center"><font size="-1" face="arial,helvetica,sanserif" color="#0086b2"><i>Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.</i></font></td>
-</tr>
-</table>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Parameter Selector</title>
+<STYLE type="text/css">
+a.menu {
+ color: #FFFFFF;
+ text-align:left;
+ font-size:12px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:plain;
+ text-decoration:none;
+ padding-left: 14px
+}
+
+A.menu:hover {
+ color: #FFCC00
+}
+
+
+.menutitle {
+ color: #000000;
+ text-align:left;
+ font-size:10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left: 8px
+}
+.menuselected {
+ color: #FFCC00;
+ text-align:left;
+ font-size:12px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left: 14px
+}
+</STYLE>
+</head>
+<body bgcolor="#ffffff" marginheight="4" marginwidth="4" leftmargin="4" topmargin="4" alink="#cc0000" vlink="#0086b2" link="#039acc" text="#000000">
+<table border="0" cellpadding="0" cellspacing="0" width="100%">
+<tr>
+<td align="left" valign="top" rowspan="3" height="60" width="135"><img border="0" vspace="0" hspace="0" src="images/logo.gif" height="60" width="135"></td><td background="images/line.gif" rowspan="1" colSpan="2" align="left" valign="top" height="0" width="100%"></td><td align="left" valign="top" rowspan="3" height="60" width="29"><img border="0" vspace="0" hspace="0" src="images/right.gif" height="60" width="29"></td>
+</tr>
+<tr>
+<td bgcolor="#0086b2" colspan="2" align="right" valign="top" height="35" width="100%"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="5">Parameter Selector</font></td>
+</tr>
+<tr>
+<td background="images/bottom.gif" colspan="2" width="100%" valign="top" height="20" bgcolor="#0086b2" align="right">
+<table width="288" cellspacing="0" cellpadding="0" border="0">
+<tr>
+<td align="left" valign="top" height="20" width="96"><a target="new" href="http://xml.apache.org/"><img border="0" vspace="0" hspace="0" name="xml" src="images/button-xml-lo.gif" height="20" width="96" alt="http://xml.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.apache.org/"><img border="0" vspace="0" hspace="0" name="asf" src="images/button-asf-lo.gif" height="20" width="96" alt="http://www.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.w3.org/"><img border="0" vspace="0" hspace="0" name="w3c" src="images/button-w3c-lo.gif" height="20" width="96" alt="http://www.w3.org/"></a></td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+<table width="100%" cellspacing="0" cellpadding="0" border="0">
+<tr width="100%">
+<td align="left" valign="top" width="120">
+<table width="120" cellspacing="0" cellpadding="0" border="0" bgcolor="#a0a0a0">
+<tr>
+<td valign="top" align="left"><img width="120" vspace="0" src="images/join.gif" hspace="0" height="14" border="0"><br>
+</td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../../index.html">Main</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../index.html">User Documentation</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Selectors</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="selectors.html">Overview</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Default</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="browser-selector.html">Browser Selector</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Core</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="host-selector.html">Host Selector</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="requestparameter-selector.html">Request Parameter Selector</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="requestattribute-selector.html">Request Attribute Selector</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><span class="menuselected">Parameter</span></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Optional</span></td>
+</tr>
+<tr>
+<td align="left" valign="top"><img width="120" vspace="0" src="images/close.gif" hspace="0" height="14" border="0"><br>
+</td>
+</tr>
+</table>
+</td><td>
+<table cellspacing="15" cellpadding="0" border="0">
+<tr>
+<td>
+
+
+ <font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Parameter Selector</font>
+<hr style="color: #0086b2" size="1">
+
+
+<blockquote>
+<ul>
+
+<li>
+<font face="verdana, helvetica, sans serif">Name : ParameterSelector</font>
+</li>
+
+<li>
+<font face="verdana, helvetica, sans serif">Class: org.apache.cocoon.selection.ParameterSelector</font>
+</li>
+
+<li>
+<font face="verdana, helvetica, sans serif">Cacheable: not applicable</font>
+</li>
+
+</ul>
+</blockquote>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ This Selector matches a string, in the Parameters object passed to the
+ selector, against a specified Cocoon internal parameter. It performs a
+ case-sensitive string comparison between the value of the
+ 'parameter-selector-test' parameter and the value of the 'test'
+ attribute of the <code><font face="courier, monospaced"><map:when ...></font></code> element.
+ </font>
+</p>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ This internal parameter could be:
+ </font>
+</p>
+
+<blockquote>
+<ul>
+
+<li>
+<font face="verdana, helvetica, sans serif">A sitemap parameter from the <code><font face="courier, monospaced"><map:match ...></font></code> portion of the pipeline</font>
+</li>
+
+<li>
+<font face="verdana, helvetica, sans serif">A sitemap parameter set by an action</font>
+</li>
+
+</ul>
+</blockquote>
+
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Reasons to use ParameterSelector</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ One purpose of this selector is to choose between different components
+ of a pipeline based on sitemap parameters set by an action. This would
+ allow the action to control the logic required to set one or more parameters,
+ which can then be used by this selector to control pipeline processing.
+ Thus, complex decision-making logic can be contained in actions, while the
+ sitemap simply uses the results of the actions (the parameters) to determine
+ pipeline processing.
+ </font>
+</p>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ Parameter Selector can also be used to select on the value of 'keys'
+ (such as {1} or {../2} ) from the wildcard matcher. Information in the
+ URI, such as part of a filename, can then be used to determine pipeline
+ processing.
+ </font>
+</p>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Examples</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ Add the component to your sitemap.xmap:
+ </font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+ <map:components>
+ ...
+ <map:selectors>
+ ...
+ <map:selector
+ name="parameter"
+ logger="sitemap.selector.parameter"
+ src="org.apache.cocoon.selection.ParameterSelector"/>
+ ...</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ Use a parameter set by an action:
+ </font>
+</p>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ Assume there is an action (named MyAction) that sets a parameter
+ (named MyRegion) to several possible values. For more information on actions,
+ including a simple example of an action that creates a sitemap parameter, see
+ <a href="../concepts/actions.html">Creating and Using Actions</a>.
+ </font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+ <map:match pattern="*.xml">
+ <map:act type="MyAction">
+ <map:generate src="{../1}.xml"/>
+
+ <map:select type="parameter">
+ <map:parameter name="parameter-selector-test" value="{MyRegion}"/>
+
+ <!-- executes iff the value of MyRegion equals
+ "United States" (without quotes) -->
+ <map:when test="United States">
+ <map:transform src="stylesheets/us.xsl"/>
+ </map:when>
+
+ <map:when test="South_America">
+ <map:transform src="stylesheets/southamerica.xsl"/>
+ </map:when>
+
+ <map:when test="Europe">
+ <map:transform src="stylesheets/europe.xsl"/>
+ </map:when>
+
+ <map:otherwise>
+ <map:transform src="all_others.xsl"
+ </map:otherwise>
+
+ </map:select>
+ </map:act>
+ <map:serialize/>
+ </map:match></pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ Use values from the URI:
+ </font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+ <map:pipeline>
+ <!-- {1}/{2}/myfile.xml -->
+ <map:match pattern="**/*/myfile.xml">
+
+ <!-- Use ParameterSelector -->
+ <map:select type="parameter">
+ <map:parameter name="parameter-selector-test" value="{2}"/>
+
+ <!-- executes iff the value of {2} equals
+ "basic" (without quotes); the requested URI
+ could be **/basic/myfile.xml -->
+ <map:when test="basic">
+ <map:generate src="{1}/myfile.xml"/>
+ <map:transform src="stylesheets/basic.xsl">
+ <map:parameter name="use-request-parameters" value="true"/>
+ <map:parameter name="resource" value="{2}.html"/>
+ </map:transform>
+ <map:serialize/>
+ </map:when>
+
+ <map:when test="aggregate">
+ <map:aggregate element="site">
+ <map:part src="cocoon:/{1}/sidebar-{1}/{2}.xml"/>
+ <map:part src="cocoon:/body-{1}/{2}.xsp"/>
+ </map:aggregate>
+ <map:transform src="stylesheets/aggregate2xhtml.xsl"/>
+ <map:serialize/>
+ </map:when>
+
+ <map:otherwise>
+ <map:redirect-to uri="other_URI"/>
+ </map:otherwise>
+
+ </map:select>
+ </map:match>
+ ...</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+
+
+</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+<table width="100%" cellspacing="0" cellpadding="0" border="0">
+<tr>
+<td bgcolor="#0086b2"><img width="1" src="images/dot.gif" height="1"></td>
+</tr>
+<tr>
+<td align="center"><font size="-1" face="arial,helvetica,sanserif" color="#0086b2"><i>Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.</i></font></td>
+</tr>
+</table>
+</body>
+</html>
Modified: cocoon/site/site/2.0/userdocs/selectors/requestattribute-selector.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.0/userdocs/selectors/requestattribute-selector.html?rev=573901&r1=573900&r2=573901&view=diff
==============================================================================
--- cocoon/site/site/2.0/userdocs/selectors/requestattribute-selector.html (original)
+++ cocoon/site/site/2.0/userdocs/selectors/requestattribute-selector.html Sat Sep 8 13:17:41 2007
@@ -1,389 +1,389 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>RequestAttribute-Selector in Cocoon</title>
-<STYLE type="text/css">
-a.menu {
- color: #FFFFFF;
- text-align:left;
- font-size:12px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:plain;
- text-decoration:none;
- padding-left: 14px
-}
-
-A.menu:hover {
- color: #FFCC00
-}
-
-
-.menutitle {
- color: #000000;
- text-align:left;
- font-size:10px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:bold;
- padding-left: 8px
-}
-.menuselected {
- color: #FFCC00;
- text-align:left;
- font-size:12px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:bold;
- padding-left: 14px
-}
-</STYLE>
-</head>
-<body bgcolor="#ffffff" marginheight="4" marginwidth="4" leftmargin="4" topmargin="4" alink="#cc0000" vlink="#0086b2" link="#039acc" text="#000000">
-<table border="0" cellpadding="0" cellspacing="0" width="100%">
-<tr>
-<td align="left" valign="top" rowspan="3" height="60" width="135"><img border="0" vspace="0" hspace="0" src="images/logo.gif" height="60" width="135"></td><td background="images/line.gif" rowspan="1" colSpan="2" align="left" valign="top" height="0" width="100%"></td><td align="left" valign="top" rowspan="3" height="60" width="29"><img border="0" vspace="0" hspace="0" src="images/right.gif" height="60" width="29"></td>
-</tr>
-<tr>
-<td bgcolor="#0086b2" colspan="2" align="right" valign="top" height="35" width="100%"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="5">RequestAttribute-Selector in Cocoon</font></td>
-</tr>
-<tr>
-<td background="images/bottom.gif" colspan="2" width="100%" valign="top" height="20" bgcolor="#0086b2" align="right">
-<table width="288" cellspacing="0" cellpadding="0" border="0">
-<tr>
-<td align="left" valign="top" height="20" width="96"><a target="new" href="http://xml.apache.org/"><img border="0" vspace="0" hspace="0" name="xml" src="images/button-xml-lo.gif" height="20" width="96" alt="http://xml.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.apache.org/"><img border="0" vspace="0" hspace="0" name="asf" src="images/button-asf-lo.gif" height="20" width="96" alt="http://www.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.w3.org/"><img border="0" vspace="0" hspace="0" name="w3c" src="images/button-w3c-lo.gif" height="20" width="96" alt="http://www.w3.org/"></a></td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr width="100%">
-<td align="left" valign="top" width="120">
-<table width="120" cellspacing="0" cellpadding="0" border="0" bgcolor="#a0a0a0">
-<tr>
-<td valign="top" align="left"><img width="120" vspace="0" src="images/join.gif" hspace="0" height="14" border="0"><br>
-</td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../../index.html">Main</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../index.html">User Documentation</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Selectors</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="selectors.html">Overview</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Default</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="browser-selector.html">Browser Selector</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Core</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="host-selector.html">Host Selector</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="requestparameter-selector.html">Request Parameter Selector</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><span class="menuselected">Request Attribute Selector</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="parameter-selector.html">Parameter</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Optional</span></td>
-</tr>
-<tr>
-<td align="left" valign="top"><img width="120" vspace="0" src="images/close.gif" hspace="0" height="14" border="0"><br>
-</td>
-</tr>
-</table>
-</td><td>
-<table cellspacing="15" cellpadding="0" border="0">
-<tr>
-<td>
-
-
- <font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">RequestAttributeSelector</font>
-<hr style="color: #0086b2" size="1">
-
-<table cellpadding="2" cellspacing="2" border="0" width="100%">
-<caption>
-<font face="verdana,helvetica,sanserif"></font>
-</caption>
-
-<tr>
-
-<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">NAME</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">host</font></td>
-
-</tr>
-
-<tr>
-
-<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">WHAT</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> component is used to
- select appropriate sitemap processing depending on a request attribute
- value.
- </font></td>
-
-</tr>
-
-<tr>
-
-<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">TYPE</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">Selector, Sitemap Component</font></td>
-
-</tr>
-
-<tr>
-
-
-<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">BLOCK</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">Core</font></td>
-
-</tr>
-
-<tr>
-
-<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">CLASS</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">org.apache.cocoon.selection.RequestAttributeSelector</font></td>
-
-</tr>
-
-
-
-<tr>
-
-<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">SINCE</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">Cocoon 2.0</font></td>
-
-</tr>
-
-<tr>
-
-<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">CACHEABLE</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">not applicable</font></td>
-
-</tr>
-
-</table>
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Description</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> tests the value of request attribute
- against the test attribute of the selector's when clause.
- </font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Usage</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> allows to control the
- sitemap processing depending on a request attribute.
- </font>
-</p>
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Sitemap pipeline examples</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- The snippet below uses a <code><font face="courier, monospaced">RequestAttributeSelector</font></code> named <code><font face="courier, monospaced">request-attribute</font></code>.
- It tests the value of request attribute named <code><font face="courier, monospaced">command</font></code> against
- <code><font face="courier, monospaced">list</font></code>, <code><font face="courier, monospaced">create</font></code>; finally it has a <code><font face="courier, monospaced">otherwise</font></code> clause.
- </font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<map:select type="request-attribute">
- <map:parameter name="attribute-name" value="command"/>
- <map:when test="list">
- ....
- </map:when>
- <map:when test="create">
- ...
- </map:when>
- ...
- <map:otherwise>
- ...
- </map:otherwise>
-</map:select>
- </pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Sitemap component configuration example</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- The snippet below declares a <code><font face="courier, monospaced">RequestAttributeSelector</font></code>
- defining to use the request attribute <code><font face="courier, monospaced">cmd</font></code>.
- </font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<map:selectors...
- <map:selector name="request-attribute"
- src="org.apache.cocoon.selection.RequestAttributeSelector"
- logger="sitemap.selector.requestattribute">
-
- <attribute-name>command</attribute-name>
- </map:selectors>
-...
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Configuration</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
-
- The configuration section of <code><font face="courier, monospaced">RequestAttributeSelector</font></code> specifies
- the default name of the request attribute, used for testing.
- </font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Setup</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
-
- Setting up a <code><font face="courier, monospaced">RequestAttributeSelector</font></code> includes
- </font>
-</p>
-
-<blockquote>
-<ul>
-
-<li>
-<font face="verdana, helvetica, sans serif">Defining an optional sitemap paramter named <code><font face="courier, monospaced">request-name</font></code>, it overrides
- the attribute-name setting in the configuration section.
- </font>
-</li>
-
-<li>
-<font face="verdana, helvetica, sans serif">choosing the <code><font face="courier, monospaced"><map:when></font></code> test expressions, and a
- optional <code><font face="courier, monospaced"><map:otherwise></font></code> clause.
- </font>
-</li>
-
-</ul>
-</blockquote>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- The test attribute of the <code><font face="courier, monospaced"><map:when></font></code> clause shall match
- the value of the request attribute.
- If no test value matches, or the request attribute is not defined at all,
- the <code><font face="courier, monospaced"><map:otherwise</font></code> clause is selected.
- </font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Effect on Object Model and Sitemap Parameters</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> has no side effects on the object model, or
- any sitemap attributes.
- </font>
-</p>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Bugs/Caveats</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- </font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">History</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- 28-12-02: initial creation
- </font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Copyright</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
- Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
- </font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">See also</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">
-
- A general documentation about selectors is available at
- <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>.
- </font>
-</p>
-
-
-
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr>
-<td bgcolor="#0086b2"><img width="1" src="images/dot.gif" height="1"></td>
-</tr>
-<tr>
-<td align="center"><font size="-1" face="arial,helvetica,sanserif" color="#0086b2"><i>Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.</i></font></td>
-</tr>
-</table>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>RequestAttribute-Selector in Cocoon</title>
+<STYLE type="text/css">
+a.menu {
+ color: #FFFFFF;
+ text-align:left;
+ font-size:12px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:plain;
+ text-decoration:none;
+ padding-left: 14px
+}
+
+A.menu:hover {
+ color: #FFCC00
+}
+
+
+.menutitle {
+ color: #000000;
+ text-align:left;
+ font-size:10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left: 8px
+}
+.menuselected {
+ color: #FFCC00;
+ text-align:left;
+ font-size:12px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left: 14px
+}
+</STYLE>
+</head>
+<body bgcolor="#ffffff" marginheight="4" marginwidth="4" leftmargin="4" topmargin="4" alink="#cc0000" vlink="#0086b2" link="#039acc" text="#000000">
+<table border="0" cellpadding="0" cellspacing="0" width="100%">
+<tr>
+<td align="left" valign="top" rowspan="3" height="60" width="135"><img border="0" vspace="0" hspace="0" src="images/logo.gif" height="60" width="135"></td><td background="images/line.gif" rowspan="1" colSpan="2" align="left" valign="top" height="0" width="100%"></td><td align="left" valign="top" rowspan="3" height="60" width="29"><img border="0" vspace="0" hspace="0" src="images/right.gif" height="60" width="29"></td>
+</tr>
+<tr>
+<td bgcolor="#0086b2" colspan="2" align="right" valign="top" height="35" width="100%"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="5">RequestAttribute-Selector in Cocoon</font></td>
+</tr>
+<tr>
+<td background="images/bottom.gif" colspan="2" width="100%" valign="top" height="20" bgcolor="#0086b2" align="right">
+<table width="288" cellspacing="0" cellpadding="0" border="0">
+<tr>
+<td align="left" valign="top" height="20" width="96"><a target="new" href="http://xml.apache.org/"><img border="0" vspace="0" hspace="0" name="xml" src="images/button-xml-lo.gif" height="20" width="96" alt="http://xml.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.apache.org/"><img border="0" vspace="0" hspace="0" name="asf" src="images/button-asf-lo.gif" height="20" width="96" alt="http://www.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.w3.org/"><img border="0" vspace="0" hspace="0" name="w3c" src="images/button-w3c-lo.gif" height="20" width="96" alt="http://www.w3.org/"></a></td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+<table width="100%" cellspacing="0" cellpadding="0" border="0">
+<tr width="100%">
+<td align="left" valign="top" width="120">
+<table width="120" cellspacing="0" cellpadding="0" border="0" bgcolor="#a0a0a0">
+<tr>
+<td valign="top" align="left"><img width="120" vspace="0" src="images/join.gif" hspace="0" height="14" border="0"><br>
+</td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../../index.html">Main</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../index.html">User Documentation</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Selectors</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="selectors.html">Overview</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Default</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="browser-selector.html">Browser Selector</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Core</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="host-selector.html">Host Selector</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="requestparameter-selector.html">Request Parameter Selector</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><span class="menuselected">Request Attribute Selector</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="parameter-selector.html">Parameter</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Optional</span></td>
+</tr>
+<tr>
+<td align="left" valign="top"><img width="120" vspace="0" src="images/close.gif" hspace="0" height="14" border="0"><br>
+</td>
+</tr>
+</table>
+</td><td>
+<table cellspacing="15" cellpadding="0" border="0">
+<tr>
+<td>
+
+
+ <font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">RequestAttributeSelector</font>
+<hr style="color: #0086b2" size="1">
+
+<table cellpadding="2" cellspacing="2" border="0" width="100%">
+<caption>
+<font face="verdana,helvetica,sanserif"></font>
+</caption>
+
+<tr>
+
+<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">NAME</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">host</font></td>
+
+</tr>
+
+<tr>
+
+<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">WHAT</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> component is used to
+ select appropriate sitemap processing depending on a request attribute
+ value.
+ </font></td>
+
+</tr>
+
+<tr>
+
+<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">TYPE</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">Selector, Sitemap Component</font></td>
+
+</tr>
+
+<tr>
+
+
+<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">BLOCK</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">Core</font></td>
+
+</tr>
+
+<tr>
+
+<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">CLASS</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">org.apache.cocoon.selection.RequestAttributeSelector</font></td>
+
+</tr>
+
+
+
+<tr>
+
+<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">SINCE</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">Cocoon 2.0</font></td>
+
+</tr>
+
+<tr>
+
+<td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">CACHEABLE</font></td><td align="left" valign="top" rowspan="1" colspan="1" bgcolor="#a0ddf0"><font face="verdana,helvetica,sanserif" size="-1" color="black">not applicable</font></td>
+
+</tr>
+
+</table>
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Description</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> tests the value of request attribute
+ against the test attribute of the selector's when clause.
+ </font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Usage</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> allows to control the
+ sitemap processing depending on a request attribute.
+ </font>
+</p>
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Sitemap pipeline examples</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ The snippet below uses a <code><font face="courier, monospaced">RequestAttributeSelector</font></code> named <code><font face="courier, monospaced">request-attribute</font></code>.
+ It tests the value of request attribute named <code><font face="courier, monospaced">command</font></code> against
+ <code><font face="courier, monospaced">list</font></code>, <code><font face="courier, monospaced">create</font></code>; finally it has a <code><font face="courier, monospaced">otherwise</font></code> clause.
+ </font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<map:select type="request-attribute">
+ <map:parameter name="attribute-name" value="command"/>
+ <map:when test="list">
+ ....
+ </map:when>
+ <map:when test="create">
+ ...
+ </map:when>
+ ...
+ <map:otherwise>
+ ...
+ </map:otherwise>
+</map:select>
+ </pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Sitemap component configuration example</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ The snippet below declares a <code><font face="courier, monospaced">RequestAttributeSelector</font></code>
+ defining to use the request attribute <code><font face="courier, monospaced">cmd</font></code>.
+ </font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<map:selectors...
+ <map:selector name="request-attribute"
+ src="org.apache.cocoon.selection.RequestAttributeSelector"
+ logger="sitemap.selector.requestattribute">
+
+ <attribute-name>command</attribute-name>
+ </map:selectors>
+...
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Configuration</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+
+ The configuration section of <code><font face="courier, monospaced">RequestAttributeSelector</font></code> specifies
+ the default name of the request attribute, used for testing.
+ </font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Setup</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+
+ Setting up a <code><font face="courier, monospaced">RequestAttributeSelector</font></code> includes
+ </font>
+</p>
+
+<blockquote>
+<ul>
+
+<li>
+<font face="verdana, helvetica, sans serif">Defining an optional sitemap paramter named <code><font face="courier, monospaced">request-name</font></code>, it overrides
+ the attribute-name setting in the configuration section.
+ </font>
+</li>
+
+<li>
+<font face="verdana, helvetica, sans serif">choosing the <code><font face="courier, monospaced"><map:when></font></code> test expressions, and a
+ optional <code><font face="courier, monospaced"><map:otherwise></font></code> clause.
+ </font>
+</li>
+
+</ul>
+</blockquote>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ The test attribute of the <code><font face="courier, monospaced"><map:when></font></code> clause shall match
+ the value of the request attribute.
+ If no test value matches, or the request attribute is not defined at all,
+ the <code><font face="courier, monospaced"><map:otherwise</font></code> clause is selected.
+ </font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Effect on Object Model and Sitemap Parameters</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ The <code><font face="courier, monospaced">RequestAttributeSelector</font></code> has no side effects on the object model, or
+ any sitemap attributes.
+ </font>
+</p>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Bugs/Caveats</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ </font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">History</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ 28-12-02: initial creation
+ </font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Copyright</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
+ </font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">See also</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">
+
+ A general documentation about selectors is available at
+ <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>.
+ </font>
+</p>
+
+
+
+</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+<table width="100%" cellspacing="0" cellpadding="0" border="0">
+<tr>
+<td bgcolor="#0086b2"><img width="1" src="images/dot.gif" height="1"></td>
+</tr>
+<tr>
+<td align="center"><font size="-1" face="arial,helvetica,sanserif" color="#0086b2"><i>Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.</i></font></td>
+</tr>
+</table>
+</body>
+</html>