joerg 2003/07/18 23:51:24
Modified: site/2.1/userdocs/selectors browser-selector.html browser-selector.pdf host-selector.html host-selector.pdf parameter-selector.html parameter-selector.pdf requestattribute-selector.html requestattribute-selector.pdf requestparameter-selector.html requestparameter-selector.pdf selectors.html selectors.pdf Log: date-selector added, rest updated Revision Changes Path 1.5 +507 -497 cocoon-site/site/2.1/userdocs/selectors/browser-selector.html Index: browser-selector.html =================================================================== RCS file: /home/cvs/cocoon-site/site/2.1/userdocs/selectors/browser-selector.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- browser-selector.html 21 May 2003 15:23:50 -0000 1.4 +++ browser-selector.html 19 Jul 2003 06:51:23 -0000 1.5 @@ -1,501 +1,511 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> -<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Browser-Selector in Cocoon</title> -<link type="text/css" href="../../skin/page.css" rel="stylesheet"> -</head> -<body text="#000000" bgcolor="#FFFFFF"> -<!--================= start Navigation Path ==================--> -<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="../../skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Navigation Path ==================--> -<!--================= start Banner ==================--> -<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<!--================= start Group Logo ==================--> -<td bgcolor="#294563"><a href="http://xml.apache.org"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/group-logo.gif"></a></td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> -<!--================= end Project Logo ==================--> -<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> -<form target="_blank" action="http://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> -<tr> -<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif"><input name="Search" value="Search" type="submit"> -<br> -<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> - the Apache Cocoon site - - - </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> -</tr> -</table> -</form> -</td> -<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" bgcolor="#294563" colspan="2"> -<!--================= start Tabs ==================--> -<div class="tab"> -<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td width="8"><img alt="" height="8" width="8" src="../../skin/images/spacer.gif"></td><td valign="bottom"> -<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> -</tr> -</table> -</td> -</tr> -</table> -</div> -<!--================= end Tabs ==================--> -</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Banner ==================--> -<!--================= start Menu, NavBar, Content ==================--> -<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top"> -<table summary="menu" border="0" cellspacing="0" cellpadding="0"> -<tr> -<!--================= start left top NavBar ==================--> -<td rowspan="3" valign="top"> -<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> -</tr> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td> -<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> -<!--================= start Menu items ==================--> -<div class="menu"> -<ul> -<li> -<font color="#CFDCED">Navigation</font> -<ul> - -<li> -<a href="../../index.html">Main</a> -</li> - -<li> -<a href="../index.html">User Documentation</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Selectors</font> -<ul> - -<li> -<a href="selectors.html">Overview</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Default</font> -<ul> - -<li> -<span class="sel"><font color="#ffcc00">Browser Selector</font></span> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Core</font> -<ul> - -<li> -<a href="host-selector.html">Host Selector</a> -</li> - -<li> -<a href="requestparameter-selector.html">Request Parameter Selector</a> -</li> - -<li> -<a href="requestattribute-selector.html">Request Attribute Selector</a> -</li> - -<li> -<a href="parameter-selector.html">Parameter</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Optional</font> -<ul> - -</ul> -</li> -</ul> -</div> -<!--================= end Menu items ==================--> -</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> -</tr> -<tr> -<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td><td valign="top" width="100%"> -<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> -<!--================= start middle NavBar ==================--> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end middle NavBar ==================--> -<!--================= start Content==================--> -<tr> -<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="100%"> -<div class="content"> -<table class="title" summary=""> -<tr> -<td valign="middle"> -<h1>Browser-Selector in Cocoon</h1> -</td><script Language="Javascript"> - -function printit(){ -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script Language="Javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write('<td nowrap="nowrap" width="40" align="center">'); - document.write(' <a class="dida" href="javascript:printit()">'); - document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" border="0"><br>'); - document.write(' print</a>'); - document.write('</td>'); -} -</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="browser-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" border="0"><br> - PDF</a></td> -</tr> -</table> -<p> -<font size="-2">by Bernhard Huber</font> -</p> -<ul class="minitoc"> -<li> -<a href="#BrowserSelector">BrowserSelector</a> -</li> -<li> -<a href="#Description">Description</a> -</li> -<li> -<a href="#Usage">Usage</a> -<ul class="minitoc"> -<li> -<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> -</li> -<li> -<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> -</li> -<li> -<a href="#Configuration">Configuration</a> -</li> -<li> -<a href="#Setup">Setup</a> -</li> -<li> -<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> -</li> -</ul> -</li> -<li> -<a href="#Bugs%2FCaveats">Bugs/Caveats</a> -</li> -<li> -<a href="#History">History</a> -</li> -<li> -<a href="#Copyright">Copyright</a> -</li> -<li> -<a href="#See+also">See also</a> -</li> -</ul> - -<a name="N1001D"></a><a name="BrowserSelector"></a> -<h3>BrowserSelector</h3> -<div style="margin-left: 0 ; border: 2px"> -<table class="ForrestTable" cellspacing="1" cellpadding="4"> - -<tr> - -<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">browser</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">BrowserSelector</span> component is used to - select appropriate sitemap processing depending on the <span class="codefrag">User-Agent</span> - header value. - </td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> - -</tr> - -<tr> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Browser-Selector in Cocoon</title> +<link type="text/css" href="../../skin/page.css" rel="stylesheet"> +</head> +<body text="#000000" bgcolor="#FFFFFF"> +<!--================= start Navigation Path ==================--> +<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Navigation Path ==================--> +<!--================= start Banner ==================--> +<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<!--================= start Group Logo ==================--> +<td bgcolor="#294563"><a href=""></a></td> +<!--================= end Group Logo ==================--> +<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> +<!--================= end Project Logo ==================--> +<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> +<form target="_blank" action="http://www.google.com/search" method="get"> +<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> +<tr> +<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><input name="Search" value="Search" type="submit"> +<br> +<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> + the Apache Cocoon site + + + </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> +</tr> +</table> +</form> +</td> +<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" bgcolor="#294563" colspan="2"> +<!--================= start Tabs ==================--> +<div class="tab"> +<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td width="6"><img alt="" height="8" width="6" src="../../skin/images/spacer.gif"></td><td valign="bottom"> +<table summary="selected tab" style="height: 1.8em" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> +</tr> +</table> +</td> +</tr> +</table> +</div> +<!--================= end Tabs ==================--> +</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Banner ==================--> +<!--================= start Menu, NavBar, Content ==================--> +<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top"> +<table summary="menu" border="0" cellspacing="0" cellpadding="0"> +<tr> +<!--================= start left top NavBar ==================--> +<td rowspan="3" valign="top"> +<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> +</tr> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td> +<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> +<!--================= start Menu items ==================--> +<div class="menu"> +<ul> +<li> +<font color="#CFDCED">Navigation</font> +<ul> + +<li> +<a href="../../index.html">Main</a> +</li> + +<li> +<a href="../index.html">User Documentation</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Selectors</font> +<ul> + +<li> +<a href="selectors.html">Overview</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Default</font> +<ul> + +<li> +<span class="sel"><font color="#ffcc00">Browser Selector</font></span> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Core</font> +<ul> + +<li> +<a href="host-selector.html">Host Selector</a> +</li> + +<li> +<a href="parameter-selector.html">Parameter Selector</a> +</li> + +<li> +<a href="requestattribute-selector.html">Request Attribute Selector</a> +</li> + +<li> +<a href="requestparameter-selector.html">Request Parameter Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Optional</font> +<ul> + +</ul> +</li> +<li> +<font color="#CFDCED">Scratchpad</font> +<ul> + +<li> +<a href="date-selector.html">Date Selector</a> +</li> + +</ul> +</li> +</ul> +</div> +<!--================= end Menu items ==================--> +</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> +</tr> +<tr> +<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td><td valign="top" width="100%"> +<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> +<!--================= start middle NavBar ==================--> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end middle NavBar ==================--> +<!--================= start Content==================--> +<tr> +<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="100%"> +<div class="content"> +<table class="title" summary=""> +<tr> +<td valign="middle"> +<h1>Browser-Selector in Cocoon</h1> +</td><script Language="Javascript"> + +function printit(){ +if (window.print) { + window.print() ; +} else { + var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; +document.body.insertAdjacentHTML('beforeEnd', WebBrowser); + WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; +} +} +</script><script Language="Javascript"> +var NS = (navigator.appName == "Netscape"); +var VERSION = parseInt(navigator.appVersion); +if (VERSION > 3) { + document.write('<td nowrap="nowrap" width="40" align="center">'); + document.write(' <a class="dida" href="javascript:printit()">'); + document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" class="skin"><br>'); + document.write(' print</a>'); + document.write('</td>'); +} +</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="browser-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" class="skin"><br> + PDF</a></td> +</tr> +</table> +<p> +<font size="-2">by Bernhard Huber</font> +</p> +<ul class="minitoc"> +<li> +<a href="#BrowserSelector">BrowserSelector</a> +</li> +<li> +<a href="#Description">Description</a> +</li> +<li> +<a href="#Usage">Usage</a> +<ul class="minitoc"> +<li> +<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> +</li> +<li> +<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> +</li> +<li> +<a href="#Configuration">Configuration</a> +</li> +<li> +<a href="#Setup">Setup</a> +</li> +<li> +<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> +</li> +</ul> +</li> +<li> +<a href="#Bugs%2FCaveats">Bugs/Caveats</a> +</li> +<li> +<a href="#History">History</a> +</li> +<li> +<a href="#Copyright">Copyright</a> +</li> +<li> +<a href="#See+also">See also</a> +</li> +</ul> + +<a name="N1001D"></a><a name="BrowserSelector"></a> +<h3>BrowserSelector</h3> +<div style="margin-left: 0 ; border: 2px"> +<table class="ForrestTable" cellspacing="1" cellpadding="4"> + +<tr> + +<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">browser</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">BrowserSelector</span> component is used to + select appropriate sitemap processing depending on the <span class="codefrag">User-Agent</span> + header value. + </td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> + +</tr> + +<tr> <!-- choose Core, the block name, or Scratchpad depending on where BrowserSelector sources live - --> - -<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.BrowserSelector</td> - -</tr> - <!-- uncomment folling tr iff BrowserSelector is deprecated --> + --> + +<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.BrowserSelector</td> + +</tr> + <!-- uncomment folling tr iff BrowserSelector is deprecated --> <!--tr> <td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td> - </tr--> - -<tr> - -<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> - -</tr> - -</table> -</div> - -<a name="N10086"></a><a name="Description"></a> -<h3>Description</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">BrowserSelector</span> tests the user agent header field against - the test attribute of the selectors when clause. - </p> -</div> - -<a name="N10092"></a><a name="Usage"></a> -<h3>Usage</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">BrowserSelector</span> allows to define brower specific sitemap - processing. - </p> -<a name="N1009D"></a><a name="Sitemap+pipeline+examples"></a> -<h4>Sitemap pipeline examples</h4> -<div style="margin-left: 0 ; border: 2px"> -<p></p> -<pre class="code"> -<map:select type="browser"> - <map:when test="netscape"> - .... - </map:when> - <map:when test="explorer"> - ... - </map:when> - ... - <map:otherwise> - ... - </map:otherwise> -</map:select> - </pre> -</div> -<a name="N100AA"></a><a name="Sitemap+component+configuration+example"></a> -<h4>Sitemap component configuration example</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - -</p> -<pre class="code"> -<map:selectors... - <map:selector name="browser" - src="org.apache.cocoon.selection.BrowserSelector" - logger="sitemap.selector.browser" - - <browser name="explorer" useragent="MSIE"/> - ... - <browser name="mozilla5" useragent="Moziall/5"/> - <browser name="netscape" useragent="Mozilla"/> - - </map:selectors> -... -</pre> -</div> -<a name="N100B8"></a><a name="Configuration"></a> -<h4>Configuration</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector configuration, options when declaring browser selector --> - The configuration section of <span class="codefrag">BrowserSelector</span> specifies - a mapping from user-agent strings to symbolic browser names. - </p> -<p> - Each browser element specifies a name attribute holding the symbolic browser name - used in the test attribute expression. The attribute useragent contains - a matchable substring of some real user-agent values. - </p> -<p> - It is allowed to specify for a browser name more than one entry. This way - a symbolic browser name is matched by different user-agent substrings. - The snippet belows will yield true for <span class="codefrag">test="wap-handset"</span> if - the user-agent header contains <span class="codefrag">Nokia</span>, <span class="codefrag">UP</span>, or - <span class="codefrag">Wapalizer</span>. - </p> -<pre class="code"> -... - <browser name="wap-handset" useragent="Nokia"/> - <browser name="wap-handset" useragent="UP"/> - <browser name="wap-handset" useragent="Wapalizer"/> -... - </pre> -</div> -<a name="N100DD"></a><a name="Setup"></a> -<h4>Setup</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector setup, ie options when using browser selector --> - Setting up a <span class="codefrag">BrowserSelector</span> includes choosing the - <span class="codefrag"><map:when></span> test expressions, and a - optional <span class="codefrag"><map:otherwise></span> clause. - </p> -<p> - The test attribute of the <span class="codefrag"><map:when></span> clause must match - a browser attribute name value. The value of the test attribute in a - <span class="codefrag"><map:when></span> clause must be declared in a - <span class="codefrag">browser</span> name attribute. - </p> -</div> -<a name="N100FD"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> -<h4>Effect on Object Model and Sitemap Parameters</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">BrowserSelector</span> has no side effects on the object model, or - any sitemap parameters. - </p> -</div> -</div> - -<a name="N1010A"></a><a name="Bugs%2FCaveats"></a> -<h3>Bugs/Caveats</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">BrowserSelector</span> adds the response header attribute - <span class="codefrag">Vary</span> having value <span class="codefrag">User-Agent</span> indicating - that the response differ for different user agents. This information - especially meaningfull for an http-proxy server. - </p> -</div> - -<a name="N1011C"></a><a name="History"></a> -<h3>History</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - 28-12-02: initial creation - </p> -</div> - -<a name="N10125"></a><a name="Copyright"></a> -<h3>Copyright</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - </p> -</div> - -<a name="N1012E"></a><a name="See+also"></a> -<h3>See also</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Links to related components pages. --> - A general documentation about selectors is available at - <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. - </p> -</div> - -</div> -</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end Content==================--> -</table> -</td> -</tr> -</table> -<!--================= end Menu, NavBar, Content ==================--> -<!--================= start Footer ==================--> -<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> -<tr> -<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> -</tr> -<tr> -<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © - 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- - document.write(" - "+"Last Published: " + document.lastModified); - // --></script></font></td> -</tr> -<tr> -<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> -</tr> -</table> -<!--================= end Footer ==================--> -</body> -</html> + </tr--> + +<tr> + +<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> + +</tr> + +</table> +</div> + +<a name="N10086"></a><a name="Description"></a> +<h3>Description</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">BrowserSelector</span> tests the user agent header field against + the test attribute of the selectors when clause. + </p> +</div> + +<a name="N10092"></a><a name="Usage"></a> +<h3>Usage</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">BrowserSelector</span> allows to define brower specific sitemap + processing. + </p> +<a name="N1009D"></a><a name="Sitemap+pipeline+examples"></a> +<h4>Sitemap pipeline examples</h4> +<div style="margin-left: 0 ; border: 2px"> +<p></p> +<pre class="code"> +<map:select type="browser"> + <map:when test="netscape"> + .... + </map:when> + <map:when test="explorer"> + ... + </map:when> + ... + <map:otherwise> + ... + </map:otherwise> +</map:select> + </pre> +</div> +<a name="N100AA"></a><a name="Sitemap+component+configuration+example"></a> +<h4>Sitemap component configuration example</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + +</p> +<pre class="code"> +<map:selectors... + <map:selector name="browser" + src="org.apache.cocoon.selection.BrowserSelector" + logger="sitemap.selector.browser" + + <browser name="explorer" useragent="MSIE"/> + ... + <browser name="mozilla5" useragent="Moziall/5"/> + <browser name="netscape" useragent="Mozilla"/> + + </map:selectors> +... +</pre> +</div> +<a name="N100B8"></a><a name="Configuration"></a> +<h4>Configuration</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector configuration, options when declaring browser selector --> + The configuration section of <span class="codefrag">BrowserSelector</span> specifies + a mapping from user-agent strings to symbolic browser names. + </p> +<p> + Each browser element specifies a name attribute holding the symbolic browser name + used in the test attribute expression. The attribute useragent contains + a matchable substring of some real user-agent values. + </p> +<p> + It is allowed to specify for a browser name more than one entry. This way + a symbolic browser name is matched by different user-agent substrings. + The snippet belows will yield true for <span class="codefrag">test="wap-handset"</span> if + the user-agent header contains <span class="codefrag">Nokia</span>, <span class="codefrag">UP</span>, or + <span class="codefrag">Wapalizer</span>. + </p> +<pre class="code"> +... + <browser name="wap-handset" useragent="Nokia"/> + <browser name="wap-handset" useragent="UP"/> + <browser name="wap-handset" useragent="Wapalizer"/> +... + </pre> +</div> +<a name="N100DD"></a><a name="Setup"></a> +<h4>Setup</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector setup, ie options when using browser selector --> + Setting up a <span class="codefrag">BrowserSelector</span> includes choosing the + <span class="codefrag"><map:when></span> test expressions, and a + optional <span class="codefrag"><map:otherwise></span> clause. + </p> +<p> + The test attribute of the <span class="codefrag"><map:when></span> clause must match + a browser attribute name value. The value of the test attribute in a + <span class="codefrag"><map:when></span> clause must be declared in a + <span class="codefrag">browser</span> name attribute. + </p> +</div> +<a name="N100FD"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> +<h4>Effect on Object Model and Sitemap Parameters</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">BrowserSelector</span> has no side effects on the object model, or + any sitemap parameters. + </p> +</div> +</div> + +<a name="N1010A"></a><a name="Bugs%2FCaveats"></a> +<h3>Bugs/Caveats</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">BrowserSelector</span> adds the response header attribute + <span class="codefrag">Vary</span> having value <span class="codefrag">User-Agent</span> indicating + that the response differ for different user agents. This information + especially meaningfull for an http-proxy server. + </p> +</div> + +<a name="N1011C"></a><a name="History"></a> +<h3>History</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + 28-12-02: initial creation + </p> +</div> + +<a name="N10125"></a><a name="Copyright"></a> +<h3>Copyright</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + </p> +</div> + +<a name="N1012E"></a><a name="See+also"></a> +<h3>See also</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Links to related components pages. --> + A general documentation about selectors is available at + <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. + </p> +</div> + +</div> +</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end Content==================--> +</table> +</td> +</tr> +</table> +<!--================= end Menu, NavBar, Content ==================--> +<!--================= start Footer ==================--> +<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> +<tr> +<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> +</tr> +<tr> +<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © + 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- + document.write(" - "+"Last Published: " + document.lastModified); + // --></script></font></td> +</tr> +<tr> +<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> +</tr> +</table> +<!--================= end Footer ==================--> +</body> +</html> 1.2 +159 -215 cocoon-site/site/2.1/userdocs/selectors/browser-selector.pdf <<Binary file>> 1.5 +518 -507 cocoon-site/site/2.1/userdocs/selectors/host-selector.html Index: host-selector.html =================================================================== RCS file: /home/cvs/cocoon-site/site/2.1/userdocs/selectors/host-selector.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- host-selector.html 21 May 2003 15:23:50 -0000 1.4 +++ host-selector.html 19 Jul 2003 06:51:23 -0000 1.5 @@ -1,511 +1,522 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> -<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Host-Selector in Cocoon</title> -<link type="text/css" href="../../skin/page.css" rel="stylesheet"> -</head> -<body text="#000000" bgcolor="#FFFFFF"> -<!--================= start Navigation Path ==================--> -<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="../../skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Navigation Path ==================--> -<!--================= start Banner ==================--> -<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<!--================= start Group Logo ==================--> -<td bgcolor="#294563"><a href="http://xml.apache.org"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/group-logo.gif"></a></td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> -<!--================= end Project Logo ==================--> -<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> -<form target="_blank" action="http://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> -<tr> -<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif"><input name="Search" value="Search" type="submit"> -<br> -<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> - the Apache Cocoon site - - - </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> -</tr> -</table> -</form> -</td> -<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" bgcolor="#294563" colspan="2"> -<!--================= start Tabs ==================--> -<div class="tab"> -<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td width="8"><img alt="" height="8" width="8" src="../../skin/images/spacer.gif"></td><td valign="bottom"> -<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> -</tr> -</table> -</td> -</tr> -</table> -</div> -<!--================= end Tabs ==================--> -</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Banner ==================--> -<!--================= start Menu, NavBar, Content ==================--> -<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top"> -<table summary="menu" border="0" cellspacing="0" cellpadding="0"> -<tr> -<!--================= start left top NavBar ==================--> -<td rowspan="3" valign="top"> -<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> -</tr> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td> -<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> -<!--================= start Menu items ==================--> -<div class="menu"> -<ul> -<li> -<font color="#CFDCED">Navigation</font> -<ul> - -<li> -<a href="../../index.html">Main</a> -</li> - -<li> -<a href="../index.html">User Documentation</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Selectors</font> -<ul> - -<li> -<a href="selectors.html">Overview</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Default</font> -<ul> - -<li> -<a href="browser-selector.html">Browser Selector</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Core</font> -<ul> - -<li> -<span class="sel"><font color="#ffcc00">Host Selector</font></span> -</li> - -<li> -<a href="requestparameter-selector.html">Request Parameter Selector</a> -</li> - -<li> -<a href="requestattribute-selector.html">Request Attribute Selector</a> -</li> - -<li> -<a href="parameter-selector.html">Parameter</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Optional</font> -<ul> - -</ul> -</li> -</ul> -</div> -<!--================= end Menu items ==================--> -</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> -</tr> -<tr> -<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td><td valign="top" width="100%"> -<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> -<!--================= start middle NavBar ==================--> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end middle NavBar ==================--> -<!--================= start Content==================--> -<tr> -<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="100%"> -<div class="content"> -<table class="title" summary=""> -<tr> -<td valign="middle"> -<h1>Host-Selector in Cocoon</h1> -</td><script Language="Javascript"> - -function printit(){ -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script Language="Javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write('<td nowrap="nowrap" width="40" align="center">'); - document.write(' <a class="dida" href="javascript:printit()">'); - document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" border="0"><br>'); - document.write(' print</a>'); - document.write('</td>'); -} -</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="host-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" border="0"><br> - PDF</a></td> -</tr> -</table> -<p> -<font size="-2">by Bernhard Huber</font> -</p> -<ul class="minitoc"> -<li> -<a href="#HostSelector">HostSelector</a> -</li> -<li> -<a href="#Description">Description</a> -</li> -<li> -<a href="#Usage">Usage</a> -<ul class="minitoc"> -<li> -<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> -</li> -<li> -<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> -</li> -<li> -<a href="#Configuration">Configuration</a> -</li> -<li> -<a href="#Setup">Setup</a> -</li> -<li> -<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> -</li> -</ul> -</li> -<li> -<a href="#Bugs%2FCaveats">Bugs/Caveats</a> -</li> -<li> -<a href="#History">History</a> -</li> -<li> -<a href="#Copyright">Copyright</a> -</li> -<li> -<a href="#See+also">See also</a> -</li> -</ul> - -<a name="N1001D"></a><a name="HostSelector"></a> -<h3>HostSelector</h3> -<div style="margin-left: 0 ; border: 2px"> -<table class="ForrestTable" cellspacing="1" cellpadding="4"> - -<tr> - -<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">host</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">HostSelector</span> component is used to - select appropriate sitemap processing depending on <span class="codefrag">Host</span> header - value. - </td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> - -</tr> - -<tr> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Host-Selector in Cocoon</title> +<link type="text/css" href="../../skin/page.css" rel="stylesheet"> +</head> +<body text="#000000" bgcolor="#FFFFFF"> +<!--================= start Navigation Path ==================--> +<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Navigation Path ==================--> +<!--================= start Banner ==================--> +<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<!--================= start Group Logo ==================--> +<td bgcolor="#294563"><a href=""></a></td> +<!--================= end Group Logo ==================--> +<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> +<!--================= end Project Logo ==================--> +<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> +<form target="_blank" action="http://www.google.com/search" method="get"> +<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> +<tr> +<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><input name="Search" value="Search" type="submit"> +<br> +<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> + the Apache Cocoon site + + + </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> +</tr> +</table> +</form> +</td> +<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" bgcolor="#294563" colspan="2"> +<!--================= start Tabs ==================--> +<div class="tab"> +<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td width="6"><img alt="" height="8" width="6" src="../../skin/images/spacer.gif"></td><td valign="bottom"> +<table summary="selected tab" style="height: 1.8em" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> +</tr> +</table> +</td> +</tr> +</table> +</div> +<!--================= end Tabs ==================--> +</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Banner ==================--> +<!--================= start Menu, NavBar, Content ==================--> +<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top"> +<table summary="menu" border="0" cellspacing="0" cellpadding="0"> +<tr> +<!--================= start left top NavBar ==================--> +<td rowspan="3" valign="top"> +<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> +</tr> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td> +<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> +<!--================= start Menu items ==================--> +<div class="menu"> +<ul> +<li> +<font color="#CFDCED">Navigation</font> +<ul> + +<li> +<a href="../../index.html">Main</a> +</li> + +<li> +<a href="../index.html">User Documentation</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Selectors</font> +<ul> + +<li> +<a href="selectors.html">Overview</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Default</font> +<ul> + +<li> +<a href="browser-selector.html">Browser Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Core</font> +<ul> + +<li> +<span class="sel"><font color="#ffcc00">Host Selector</font></span> +</li> + +<li> +<a href="parameter-selector.html">Parameter Selector</a> +</li> + +<li> +<a href="requestattribute-selector.html">Request Attribute Selector</a> +</li> + +<li> +<a href="requestparameter-selector.html">Request Parameter Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Optional</font> +<ul> + +</ul> +</li> +<li> +<font color="#CFDCED">Scratchpad</font> +<ul> + +<li> +<a href="date-selector.html">Date Selector</a> +</li> + +</ul> +</li> +</ul> +</div> +<!--================= end Menu items ==================--> +</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> +</tr> +<tr> +<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td><td valign="top" width="100%"> +<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> +<!--================= start middle NavBar ==================--> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end middle NavBar ==================--> +<!--================= start Content==================--> +<tr> +<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="100%"> +<div class="content"> +<table class="title" summary=""> +<tr> +<td valign="middle"> +<h1>Host-Selector in Cocoon</h1> +</td><script Language="Javascript"> + +function printit(){ +if (window.print) { + window.print() ; +} else { + var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; +document.body.insertAdjacentHTML('beforeEnd', WebBrowser); + WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; +} +} +</script><script Language="Javascript"> +var NS = (navigator.appName == "Netscape"); +var VERSION = parseInt(navigator.appVersion); +if (VERSION > 3) { + document.write('<td nowrap="nowrap" width="40" align="center">'); + document.write(' <a class="dida" href="javascript:printit()">'); + document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" class="skin"><br>'); + document.write(' print</a>'); + document.write('</td>'); +} +</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="host-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" class="skin"><br> + PDF</a></td> +</tr> +</table> +<p> +<font size="-2">by Bernhard Huber</font> +</p> +<ul class="minitoc"> +<li> +<a href="#HostSelector">HostSelector</a> +</li> +<li> +<a href="#Description">Description</a> +</li> +<li> +<a href="#Usage">Usage</a> +<ul class="minitoc"> +<li> +<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> +</li> +<li> +<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> +</li> +<li> +<a href="#Configuration">Configuration</a> +</li> +<li> +<a href="#Setup">Setup</a> +</li> +<li> +<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> +</li> +</ul> +</li> +<li> +<a href="#Bugs%2FCaveats">Bugs/Caveats</a> +</li> +<li> +<a href="#History">History</a> +</li> +<li> +<a href="#Copyright">Copyright</a> +</li> +<li> +<a href="#See+also">See also</a> +</li> +</ul> + +<a name="N1001D"></a><a name="HostSelector"></a> +<h3>HostSelector</h3> +<div style="margin-left: 0 ; border: 2px"> +<table class="ForrestTable" cellspacing="1" cellpadding="4"> + +<tr> + +<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">host</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">HostSelector</span> component is used to + select appropriate sitemap processing depending on <span class="codefrag">Host</span> header + value. + </td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> + +</tr> + +<tr> <!-- choose Core, the block name, or Scratchpad depending on where HostSelector sources live - --> - -<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.HostSelector</td> - -</tr> - <!-- uncomment folling tr iff HostSelector is deprecated --> + --> + +<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.HostSelector</td> + +</tr> + <!-- uncomment folling tr if HostSelector is deprecated --> <!--tr> <td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td> - </tr--> - -<tr> - -<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> - -</tr> - -</table> -</div> - -<a name="N10086"></a><a name="Description"></a> -<h3>Description</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">HostSelector</span> tests the <span class="codefrag">Host</span> header field from the - request against the test attribute of the selectors when clause. - </p> -</div> - -<a name="N10095"></a><a name="Usage"></a> -<h3>Usage</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">HostSelector</span> allows to define host specific sitemap - processing. This way Cocoon can do multi-homed sitemap processing. - </p> -<a name="N100A0"></a><a name="Sitemap+pipeline+examples"></a> -<h4>Sitemap pipeline examples</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The snippet below uses a <span class="codefrag">HostSelector</span> named <span class="codefrag">host</span>, - and testing against symbolic host-sites which are configured in the <span class="codefrag">host</span> - selector section. - </p> -<pre class="code"> -<map:select type="host"> - <map:when test="uk-site"> - .... - </map:when> - <map:when test="de-site"> - ... - </map:when> - ... - <map:otherwise> - ... - </map:otherwise> -</map:select> - </pre> -</div> -<a name="N100B7"></a><a name="Sitemap+component+configuration+example"></a> -<h4>Sitemap component configuration example</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The snippet below declares a <span class="codefrag">HostSelector</span> - defining symbolic host-site names for some host domains. - </p> -<pre class="code"> -<map:selectors... - <map:selector name="host" - src="org.apache.cocoon.selection.HostSelector" - logger="sitemap.selector.host" - - <host name="uk-site" value="foo.bar.uk"/> - ... - <host name="de-site" useragent="foo.bar.de"/> - <host name="us-site" useragent="foo.bar.com"/> - - </map:selectors> -... -</pre> -</div> -<a name="N100C8"></a><a name="Configuration"></a> -<h4>Configuration</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector configuration, options when declaring host selector --> - The configuration section of <span class="codefrag">HostSelector</span> specifies - a mapping from host strings to symbolic host-site names. - </p> -<p> - Each host element specifies a name attribute holding the symbolic host-site name - used in the test attribute expression. The attribute name contains - a matchable substring of some real host header values. - </p> -<p> - It is allowed to specify for a host name more than one entry. This way - a symbolic host-site name is matched by different host header substrings. - The snippet belows will yield true for <span class="codefrag">test="central-europe"</span> if - the user-agent header contains <span class="codefrag">foo.bar.cz</span>, <span class="codefrag">foo.bar.at</span>, or - <span class="codefrag">foo.bar.hu</span>. - </p> -<pre class="code"> -... - <host name="central-europe" useragent="foo.bar.cz"/> - <host name="central-europe" useragent="foo.bar.at"/> - <host name="central-europe" useragent="foo.bar.uk"/> -... - </pre> -</div> -<a name="N100ED"></a><a name="Setup"></a> -<h4>Setup</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector setup, ie options when using host selector --> - Setting up a <span class="codefrag">HostSelector</span> includes choosing the - <span class="codefrag"><map:when></span> test expressions, and a - optional <span class="codefrag"><map:otherwise></span> clause. - </p> -<p> - The test attribute of the <span class="codefrag"><map:when></span> clause must match - a host attribute name value. The value of the test attribute in a - <span class="codefrag"><map:when></span> clause must be declared in a - <span class="codefrag">host</span> name attribute. - </p> -</div> -<a name="N1010D"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> -<h4>Effect on Object Model and Sitemap Parameters</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">HostSelector</span> has no side effects on the object model, or - any sitemap parameters. - </p> -</div> -</div> - -<a name="N1011A"></a><a name="Bugs%2FCaveats"></a> -<h3>Bugs/Caveats</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">HostSelector</span> adds the response header attribute - <span class="codefrag">Vary</span> having value <span class="codefrag">Host</span> indicating - that the response differ for different user agents. This information - especially meaningfull for an http-proxy server. - </p> -</div> - -<a name="N1012C"></a><a name="History"></a> -<h3>History</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - 28-12-02: initial creation - </p> -</div> - -<a name="N10135"></a><a name="Copyright"></a> -<h3>Copyright</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - </p> -</div> - -<a name="N1013E"></a><a name="See+also"></a> -<h3>See also</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Links to related components pages. --> - A general documentation about selectors is available at - <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. - </p> -<p> - For a detailed <span class="codefrag">Host</span> header documentation - see <a href="http://www.ietf.org/rfc/rfc2068.txt">RFC 2068</a>, especially - if Cocoon's run time environment is an http servlet environment. - </p> -</div> - -</div> -</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end Content==================--> -</table> -</td> -</tr> -</table> -<!--================= end Menu, NavBar, Content ==================--> -<!--================= start Footer ==================--> -<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> -<tr> -<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> -</tr> -<tr> -<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © - 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- - document.write(" - "+"Last Published: " + document.lastModified); - // --></script></font></td> -</tr> -<tr> -<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> -</tr> -</table> -<!--================= end Footer ==================--> -</body> -</html> + </tr--> + +<tr> + +<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> + +</tr> + +</table> +</div> + +<a name="N10086"></a><a name="Description"></a> +<h3>Description</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">HostSelector</span> tests the <span class="codefrag">Host</span> header field from the + request against the test attribute of the selectors when clause. + </p> +</div> + +<a name="N10095"></a><a name="Usage"></a> +<h3>Usage</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">HostSelector</span> allows to define host specific sitemap + processing. This way Cocoon can do multi-homed sitemap processing. + </p> +<a name="N100A0"></a><a name="Sitemap+pipeline+examples"></a> +<h4>Sitemap pipeline examples</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The snippet below uses a <span class="codefrag">HostSelector</span> named <span class="codefrag">host</span>, + and tests against symbolic host-sites which are configured in the + <span class="codefrag">host</span> selector section. + </p> +<pre class="code"> +<map:select type="host"> + <map:when test="uk-site"> + .... + </map:when> + <map:when test="de-site"> + ... + </map:when> + ... + <map:otherwise> + ... + </map:otherwise> +</map:select> + </pre> +</div> +<a name="N100B7"></a><a name="Sitemap+component+configuration+example"></a> +<h4>Sitemap component configuration example</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The snippet below declares a <span class="codefrag">HostSelector</span> + defining symbolic host-site names for some host domains. + </p> +<pre class="code"> +<map:selectors> + <map:selector name="host" + src="org.apache.cocoon.selection.HostSelector" + logger="sitemap.selector.host" + + <host name="uk-site" value="foo.bar.uk"/> + ... + <host name="de-site" value="foo.bar.de"/> + <host name="us-site" value="foo.bar.com"/> + + </map:selector> + ... +</map:selectors> +</pre> +</div> +<a name="N100C8"></a><a name="Configuration"></a> +<h4>Configuration</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector configuration, options when declaring host selector --> + The configuration section of <span class="codefrag">HostSelector</span> specifies + a mapping from host strings to symbolic host-site names. + </p> +<p> + Each host element specifies a name attribute holding the symbolic host-site name + used in the test attribute expression. The attribute name contains + a matchable substring of some real host header values. + </p> +<p> + It is allowed to specify for a host name more than one entry. This way + a symbolic host-site name is matched by different host header substrings. + The snippet belows will yield true for <span class="codefrag">test="central-europe"</span> if + the host header contains <span class="codefrag">foo.bar.cz</span>, <span class="codefrag">foo.bar.at</span>, or + <span class="codefrag">foo.bar.hu</span>. + </p> +<pre class="code"> +... + <host name="central-europe" value="foo.bar.cz"/> + <host name="central-europe" value="foo.bar.at"/> + <host name="central-europe" value="foo.bar.uk"/> +... + </pre> +</div> +<a name="N100ED"></a><a name="Setup"></a> +<h4>Setup</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector setup, ie options when using host selector --> + Setting up a <span class="codefrag">HostSelector</span> includes choosing the + <span class="codefrag"><map:when></span> test expressions and a + optional <span class="codefrag"><map:otherwise></span> clause. + </p> +<p> + The test attribute of the <span class="codefrag"><map:when></span> clause must match + a host attribute name value. The value of the test attribute in a + <span class="codefrag"><map:when></span> clause must be declared in a + <span class="codefrag">host</span> name attribute. + </p> +</div> +<a name="N1010D"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> +<h4>Effect on Object Model and Sitemap Parameters</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">HostSelector</span> has no side effects on the object model or + any sitemap parameters. + </p> +</div> +</div> + +<a name="N1011A"></a><a name="Bugs%2FCaveats"></a> +<h3>Bugs/Caveats</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">HostSelector</span> adds the response header attribute + <span class="codefrag">Vary</span> having value <span class="codefrag">Host</span> indicating + that the response differ for different hosts. This information + is particularly meaningful for a http-proxy server. + </p> +</div> + +<a name="N1012C"></a><a name="History"></a> +<h3>History</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + 28-12-02: initial creation + </p> +</div> + +<a name="N10135"></a><a name="Copyright"></a> +<h3>Copyright</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + </p> +</div> + +<a name="N1013E"></a><a name="See+also"></a> +<h3>See also</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Links to related components pages. --> + A general documentation about selectors is available at + <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. + </p> +<p> + For a detailed <span class="codefrag">Host</span> header documentation + see <a href="http://www.ietf.org/rfc/rfc2068.txt">RFC 2068</a>, especially + if Cocoon's run time environment is an http servlet environment. + </p> +</div> + +</div> +</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end Content==================--> +</table> +</td> +</tr> +</table> +<!--================= end Menu, NavBar, Content ==================--> +<!--================= start Footer ==================--> +<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> +<tr> +<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> +</tr> +<tr> +<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © + 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- + document.write(" - "+"Last Published: " + document.lastModified); + // --></script></font></td> +</tr> +<tr> +<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> +</tr> +</table> +<!--================= end Footer ==================--> +</body> +</html> 1.2 +143 -212 cocoon-site/site/2.1/userdocs/selectors/host-selector.pdf <<Binary file>> 1.5 +428 -418 cocoon-site/site/2.1/userdocs/selectors/parameter-selector.html Index: parameter-selector.html =================================================================== RCS file: /home/cvs/cocoon-site/site/2.1/userdocs/selectors/parameter-selector.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- parameter-selector.html 21 May 2003 15:23:50 -0000 1.4 +++ parameter-selector.html 19 Jul 2003 06:51:23 -0000 1.5 @@ -1,418 +1,428 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> -<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Parameter Selector</title> -<link type="text/css" href="../../skin/page.css" rel="stylesheet"> -</head> -<body text="#000000" bgcolor="#FFFFFF"> -<!--================= start Navigation Path ==================--> -<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="../../skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Navigation Path ==================--> -<!--================= start Banner ==================--> -<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<!--================= start Group Logo ==================--> -<td bgcolor="#294563"><a href="http://xml.apache.org"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/group-logo.gif"></a></td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> -<!--================= end Project Logo ==================--> -<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> -<form target="_blank" action="http://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> -<tr> -<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif"><input name="Search" value="Search" type="submit"> -<br> -<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> - the Apache Cocoon site - - - </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> -</tr> -</table> -</form> -</td> -<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" bgcolor="#294563" colspan="2"> -<!--================= start Tabs ==================--> -<div class="tab"> -<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td width="8"><img alt="" height="8" width="8" src="../../skin/images/spacer.gif"></td><td valign="bottom"> -<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> -</tr> -</table> -</td> -</tr> -</table> -</div> -<!--================= end Tabs ==================--> -</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Banner ==================--> -<!--================= start Menu, NavBar, Content ==================--> -<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top"> -<table summary="menu" border="0" cellspacing="0" cellpadding="0"> -<tr> -<!--================= start left top NavBar ==================--> -<td rowspan="3" valign="top"> -<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> -</tr> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td> -<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> -<!--================= start Menu items ==================--> -<div class="menu"> -<ul> -<li> -<font color="#CFDCED">Navigation</font> -<ul> - -<li> -<a href="../../index.html">Main</a> -</li> - -<li> -<a href="../index.html">User Documentation</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Selectors</font> -<ul> - -<li> -<a href="selectors.html">Overview</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Default</font> -<ul> - -<li> -<a href="browser-selector.html">Browser Selector</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Core</font> -<ul> - -<li> -<a href="host-selector.html">Host Selector</a> -</li> - -<li> -<a href="requestparameter-selector.html">Request Parameter Selector</a> -</li> - -<li> -<a href="requestattribute-selector.html">Request Attribute Selector</a> -</li> - -<li> -<span class="sel"><font color="#ffcc00">Parameter</font></span> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Optional</font> -<ul> - -</ul> -</li> -</ul> -</div> -<!--================= end Menu items ==================--> -</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> -</tr> -<tr> -<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td><td valign="top" width="100%"> -<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> -<!--================= start middle NavBar ==================--> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end middle NavBar ==================--> -<!--================= start Content==================--> -<tr> -<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="100%"> -<div class="content"> -<table class="title" summary=""> -<tr> -<td valign="middle"> -<h1>Parameter Selector</h1> -</td><script Language="Javascript"> - -function printit(){ -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script Language="Javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write('<td nowrap="nowrap" width="40" align="center">'); - document.write(' <a class="dida" href="javascript:printit()">'); - document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" border="0"><br>'); - document.write(' print</a>'); - document.write('</td>'); -} -</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="parameter-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" border="0"><br> - PDF</a></td> -</tr> -</table> -<h3>in @doctitle@</h3> -<p> -<font size="-2">by Beth Naquin</font> -</p> -<ul class="minitoc"> -<li> -<a href="#Parameter+Selector">Parameter Selector</a> -</li> -<li> -<a href="#Reasons+to+use+ParameterSelector">Reasons to use ParameterSelector</a> -</li> -<li> -<a href="#Examples">Examples</a> -</li> -</ul> - -<a name="N1001F"></a><a name="Parameter+Selector"></a> -<h3>Parameter Selector</h3> -<div style="margin-left: 0 ; border: 2px"> -<ul> - -<li>Name : ParameterSelector</li> - -<li>Class: org.apache.cocoon.selection.ParameterSelector</li> - -<li>Cacheable: not applicable</li> - -</ul> -<p> - 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 <span class="codefrag"><map:when ...></span> element. - </p> -<p> - This internal parameter could be: - </p> -<ul> - -<li>A sitemap parameter from the <span class="codefrag"><map:match ...></span> portion of the pipeline</li> - -<li>A sitemap parameter set by an action</li> - -</ul> -</div> - - - -<a name="N10046"></a><a name="Reasons+to+use+ParameterSelector"></a> -<h3>Reasons to use ParameterSelector</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - 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. - </p> -<p> - 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. - </p> -</div> - - -<a name="N10052"></a><a name="Examples"></a> -<h3>Examples</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - Add the component to your sitemap.xmap: - </p> -<pre class="code"> - <map:components> - ... - <map:selectors> - ... - <map:selector - name="parameter" - logger="sitemap.selector.parameter" - src="org.apache.cocoon.selection.ParameterSelector"/> - ...</pre> -<p> - Use a parameter set by an action: - </p> -<p> - 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>. - </p> -<pre class="code"> - <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> -<p> - Use values from the URI: - </p> -<pre class="code"> - <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> -</div> - - -</div> -</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end Content==================--> -</table> -</td> -</tr> -</table> -<!--================= end Menu, NavBar, Content ==================--> -<!--================= start Footer ==================--> -<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> -<tr> -<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> -</tr> -<tr> -<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © - 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- - document.write(" - "+"Last Published: " + document.lastModified); - // --></script></font></td> -</tr> -<tr> -<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> -</tr> -</table> -<!--================= end Footer ==================--> -</body> -</html> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Parameter Selector</title> +<link type="text/css" href="../../skin/page.css" rel="stylesheet"> +</head> +<body text="#000000" bgcolor="#FFFFFF"> +<!--================= start Navigation Path ==================--> +<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Navigation Path ==================--> +<!--================= start Banner ==================--> +<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<!--================= start Group Logo ==================--> +<td bgcolor="#294563"><a href=""></a></td> +<!--================= end Group Logo ==================--> +<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> +<!--================= end Project Logo ==================--> +<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> +<form target="_blank" action="http://www.google.com/search" method="get"> +<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> +<tr> +<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><input name="Search" value="Search" type="submit"> +<br> +<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> + the Apache Cocoon site + + + </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> +</tr> +</table> +</form> +</td> +<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" bgcolor="#294563" colspan="2"> +<!--================= start Tabs ==================--> +<div class="tab"> +<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td width="6"><img alt="" height="8" width="6" src="../../skin/images/spacer.gif"></td><td valign="bottom"> +<table summary="selected tab" style="height: 1.8em" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> +</tr> +</table> +</td> +</tr> +</table> +</div> +<!--================= end Tabs ==================--> +</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Banner ==================--> +<!--================= start Menu, NavBar, Content ==================--> +<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top"> +<table summary="menu" border="0" cellspacing="0" cellpadding="0"> +<tr> +<!--================= start left top NavBar ==================--> +<td rowspan="3" valign="top"> +<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> +</tr> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td> +<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> +<!--================= start Menu items ==================--> +<div class="menu"> +<ul> +<li> +<font color="#CFDCED">Navigation</font> +<ul> + +<li> +<a href="../../index.html">Main</a> +</li> + +<li> +<a href="../index.html">User Documentation</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Selectors</font> +<ul> + +<li> +<a href="selectors.html">Overview</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Default</font> +<ul> + +<li> +<a href="browser-selector.html">Browser Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Core</font> +<ul> + +<li> +<a href="host-selector.html">Host Selector</a> +</li> + +<li> +<span class="sel"><font color="#ffcc00">Parameter Selector</font></span> +</li> + +<li> +<a href="requestattribute-selector.html">Request Attribute Selector</a> +</li> + +<li> +<a href="requestparameter-selector.html">Request Parameter Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Optional</font> +<ul> + +</ul> +</li> +<li> +<font color="#CFDCED">Scratchpad</font> +<ul> + +<li> +<a href="date-selector.html">Date Selector</a> +</li> + +</ul> +</li> +</ul> +</div> +<!--================= end Menu items ==================--> +</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> +</tr> +<tr> +<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td><td valign="top" width="100%"> +<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> +<!--================= start middle NavBar ==================--> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end middle NavBar ==================--> +<!--================= start Content==================--> +<tr> +<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="100%"> +<div class="content"> +<table class="title" summary=""> +<tr> +<td valign="middle"> +<h1>Parameter Selector</h1> +</td><script Language="Javascript"> + +function printit(){ +if (window.print) { + window.print() ; +} else { + var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; +document.body.insertAdjacentHTML('beforeEnd', WebBrowser); + WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; +} +} +</script><script Language="Javascript"> +var NS = (navigator.appName == "Netscape"); +var VERSION = parseInt(navigator.appVersion); +if (VERSION > 3) { + document.write('<td nowrap="nowrap" width="40" align="center">'); + document.write(' <a class="dida" href="javascript:printit()">'); + document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" class="skin"><br>'); + document.write(' print</a>'); + document.write('</td>'); +} +</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="parameter-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" class="skin"><br> + PDF</a></td> +</tr> +</table> +<h3>in @doctitle@</h3> +<p> +<font size="-2">by Beth Naquin</font> +</p> +<ul class="minitoc"> +<li> +<a href="#Parameter+Selector">Parameter Selector</a> +</li> +<li> +<a href="#Reasons+to+use+ParameterSelector">Reasons to use ParameterSelector</a> +</li> +<li> +<a href="#Examples">Examples</a> +</li> +</ul> + +<a name="N1001F"></a><a name="Parameter+Selector"></a> +<h3>Parameter Selector</h3> +<div style="margin-left: 0 ; border: 2px"> +<ul> + +<li>Name : ParameterSelector</li> + +<li>Class: org.apache.cocoon.selection.ParameterSelector</li> + +<li>Cacheable: not applicable</li> + +</ul> +<p> + 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 <span class="codefrag"><map:when ...></span> element. + </p> +<p> + This internal parameter could be: + </p> +<ul> + +<li>A sitemap parameter from the <span class="codefrag"><map:match ...></span> portion of the pipeline</li> + +<li>A sitemap parameter set by an action</li> + +</ul> +</div> + + + +<a name="N10046"></a><a name="Reasons+to+use+ParameterSelector"></a> +<h3>Reasons to use ParameterSelector</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + 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. + </p> +<p> + 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. + </p> +</div> + + +<a name="N10052"></a><a name="Examples"></a> +<h3>Examples</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + Add the component to your sitemap.xmap: + </p> +<pre class="code"> + <map:components> + ... + <map:selectors> + ... + <map:selector + name="parameter" + logger="sitemap.selector.parameter" + src="org.apache.cocoon.selection.ParameterSelector"/> + ...</pre> +<p> + Use a parameter set by an action: + </p> +<p> + 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>. + </p> +<pre class="code"> + <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> +<p> + Use values from the URI: + </p> +<pre class="code"> + <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> +</div> + + +</div> +</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end Content==================--> +</table> +</td> +</tr> +</table> +<!--================= end Menu, NavBar, Content ==================--> +<!--================= start Footer ==================--> +<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> +<tr> +<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> +</tr> +<tr> +<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © + 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- + document.write(" - "+"Last Published: " + document.lastModified); + // --></script></font></td> +</tr> +<tr> +<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> +</tr> +</table> +<!--================= end Footer ==================--> +</body> +</html> 1.2 +82 -164 cocoon-site/site/2.1/userdocs/selectors/parameter-selector.pdf <<Binary file>> 1.5 +496 -486 cocoon-site/site/2.1/userdocs/selectors/requestattribute-selector.html Index: requestattribute-selector.html =================================================================== RCS file: /home/cvs/cocoon-site/site/2.1/userdocs/selectors/requestattribute-selector.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- requestattribute-selector.html 21 May 2003 15:23:50 -0000 1.4 +++ requestattribute-selector.html 19 Jul 2003 06:51:23 -0000 1.5 @@ -1,490 +1,500 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> -<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>RequestAttribute-Selector in Cocoon</title> -<link type="text/css" href="../../skin/page.css" rel="stylesheet"> -</head> -<body text="#000000" bgcolor="#FFFFFF"> -<!--================= start Navigation Path ==================--> -<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="../../skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Navigation Path ==================--> -<!--================= start Banner ==================--> -<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<!--================= start Group Logo ==================--> -<td bgcolor="#294563"><a href="http://xml.apache.org"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/group-logo.gif"></a></td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> -<!--================= end Project Logo ==================--> -<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> -<form target="_blank" action="http://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> -<tr> -<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif"><input name="Search" value="Search" type="submit"> -<br> -<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> - the Apache Cocoon site - - - </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> -</tr> -</table> -</form> -</td> -<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" bgcolor="#294563" colspan="2"> -<!--================= start Tabs ==================--> -<div class="tab"> -<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td width="8"><img alt="" height="8" width="8" src="../../skin/images/spacer.gif"></td><td valign="bottom"> -<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> -</tr> -</table> -</td> -</tr> -</table> -</div> -<!--================= end Tabs ==================--> -</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Banner ==================--> -<!--================= start Menu, NavBar, Content ==================--> -<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top"> -<table summary="menu" border="0" cellspacing="0" cellpadding="0"> -<tr> -<!--================= start left top NavBar ==================--> -<td rowspan="3" valign="top"> -<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> -</tr> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td> -<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> -<!--================= start Menu items ==================--> -<div class="menu"> -<ul> -<li> -<font color="#CFDCED">Navigation</font> -<ul> - -<li> -<a href="../../index.html">Main</a> -</li> - -<li> -<a href="../index.html">User Documentation</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Selectors</font> -<ul> - -<li> -<a href="selectors.html">Overview</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Default</font> -<ul> - -<li> -<a href="browser-selector.html">Browser Selector</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Core</font> -<ul> - -<li> -<a href="host-selector.html">Host Selector</a> -</li> - -<li> -<a href="requestparameter-selector.html">Request Parameter Selector</a> -</li> - -<li> -<span class="sel"><font color="#ffcc00">Request Attribute Selector</font></span> -</li> - -<li> -<a href="parameter-selector.html">Parameter</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Optional</font> -<ul> - -</ul> -</li> -</ul> -</div> -<!--================= end Menu items ==================--> -</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> -</tr> -<tr> -<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td><td valign="top" width="100%"> -<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> -<!--================= start middle NavBar ==================--> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end middle NavBar ==================--> -<!--================= start Content==================--> -<tr> -<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="100%"> -<div class="content"> -<table class="title" summary=""> -<tr> -<td valign="middle"> -<h1>RequestAttribute-Selector in Cocoon</h1> -</td><script Language="Javascript"> - -function printit(){ -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script Language="Javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write('<td nowrap="nowrap" width="40" align="center">'); - document.write(' <a class="dida" href="javascript:printit()">'); - document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" border="0"><br>'); - document.write(' print</a>'); - document.write('</td>'); -} -</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="requestattribute-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" border="0"><br> - PDF</a></td> -</tr> -</table> -<p> -<font size="-2">by Bernhard Huber</font> -</p> -<ul class="minitoc"> -<li> -<a href="#RequestAttributeSelector">RequestAttributeSelector</a> -</li> -<li> -<a href="#Description">Description</a> -</li> -<li> -<a href="#Usage">Usage</a> -<ul class="minitoc"> -<li> -<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> -</li> -<li> -<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> -</li> -<li> -<a href="#Configuration">Configuration</a> -</li> -<li> -<a href="#Setup">Setup</a> -</li> -<li> -<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> -</li> -</ul> -</li> -<li> -<a href="#Bugs%2FCaveats">Bugs/Caveats</a> -</li> -<li> -<a href="#History">History</a> -</li> -<li> -<a href="#Copyright">Copyright</a> -</li> -<li> -<a href="#See+also">See also</a> -</li> -</ul> - -<a name="N1001D"></a><a name="RequestAttributeSelector"></a> -<h3>RequestAttributeSelector</h3> -<div style="margin-left: 0 ; border: 2px"> -<table class="ForrestTable" cellspacing="1" cellpadding="4"> - -<tr> - -<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">host</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">RequestAttributeSelector</span> component is used to - select appropriate sitemap processing depending on a request attribute - value. - </td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> - -</tr> - -<tr> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>RequestAttribute-Selector in Cocoon</title> +<link type="text/css" href="../../skin/page.css" rel="stylesheet"> +</head> +<body text="#000000" bgcolor="#FFFFFF"> +<!--================= start Navigation Path ==================--> +<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Navigation Path ==================--> +<!--================= start Banner ==================--> +<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<!--================= start Group Logo ==================--> +<td bgcolor="#294563"><a href=""></a></td> +<!--================= end Group Logo ==================--> +<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> +<!--================= end Project Logo ==================--> +<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> +<form target="_blank" action="http://www.google.com/search" method="get"> +<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> +<tr> +<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><input name="Search" value="Search" type="submit"> +<br> +<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> + the Apache Cocoon site + + + </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> +</tr> +</table> +</form> +</td> +<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" bgcolor="#294563" colspan="2"> +<!--================= start Tabs ==================--> +<div class="tab"> +<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td width="6"><img alt="" height="8" width="6" src="../../skin/images/spacer.gif"></td><td valign="bottom"> +<table summary="selected tab" style="height: 1.8em" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> +</tr> +</table> +</td> +</tr> +</table> +</div> +<!--================= end Tabs ==================--> +</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Banner ==================--> +<!--================= start Menu, NavBar, Content ==================--> +<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top"> +<table summary="menu" border="0" cellspacing="0" cellpadding="0"> +<tr> +<!--================= start left top NavBar ==================--> +<td rowspan="3" valign="top"> +<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> +</tr> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td> +<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> +<!--================= start Menu items ==================--> +<div class="menu"> +<ul> +<li> +<font color="#CFDCED">Navigation</font> +<ul> + +<li> +<a href="../../index.html">Main</a> +</li> + +<li> +<a href="../index.html">User Documentation</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Selectors</font> +<ul> + +<li> +<a href="selectors.html">Overview</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Default</font> +<ul> + +<li> +<a href="browser-selector.html">Browser Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Core</font> +<ul> + +<li> +<a href="host-selector.html">Host Selector</a> +</li> + +<li> +<a href="parameter-selector.html">Parameter Selector</a> +</li> + +<li> +<span class="sel"><font color="#ffcc00">Request Attribute Selector</font></span> +</li> + +<li> +<a href="requestparameter-selector.html">Request Parameter Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Optional</font> +<ul> + +</ul> +</li> +<li> +<font color="#CFDCED">Scratchpad</font> +<ul> + +<li> +<a href="date-selector.html">Date Selector</a> +</li> + +</ul> +</li> +</ul> +</div> +<!--================= end Menu items ==================--> +</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> +</tr> +<tr> +<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td><td valign="top" width="100%"> +<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> +<!--================= start middle NavBar ==================--> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end middle NavBar ==================--> +<!--================= start Content==================--> +<tr> +<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="100%"> +<div class="content"> +<table class="title" summary=""> +<tr> +<td valign="middle"> +<h1>RequestAttribute-Selector in Cocoon</h1> +</td><script Language="Javascript"> + +function printit(){ +if (window.print) { + window.print() ; +} else { + var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; +document.body.insertAdjacentHTML('beforeEnd', WebBrowser); + WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; +} +} +</script><script Language="Javascript"> +var NS = (navigator.appName == "Netscape"); +var VERSION = parseInt(navigator.appVersion); +if (VERSION > 3) { + document.write('<td nowrap="nowrap" width="40" align="center">'); + document.write(' <a class="dida" href="javascript:printit()">'); + document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" class="skin"><br>'); + document.write(' print</a>'); + document.write('</td>'); +} +</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="requestattribute-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" class="skin"><br> + PDF</a></td> +</tr> +</table> +<p> +<font size="-2">by Bernhard Huber</font> +</p> +<ul class="minitoc"> +<li> +<a href="#RequestAttributeSelector">RequestAttributeSelector</a> +</li> +<li> +<a href="#Description">Description</a> +</li> +<li> +<a href="#Usage">Usage</a> +<ul class="minitoc"> +<li> +<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> +</li> +<li> +<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> +</li> +<li> +<a href="#Configuration">Configuration</a> +</li> +<li> +<a href="#Setup">Setup</a> +</li> +<li> +<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> +</li> +</ul> +</li> +<li> +<a href="#Bugs%2FCaveats">Bugs/Caveats</a> +</li> +<li> +<a href="#History">History</a> +</li> +<li> +<a href="#Copyright">Copyright</a> +</li> +<li> +<a href="#See+also">See also</a> +</li> +</ul> + +<a name="N1001D"></a><a name="RequestAttributeSelector"></a> +<h3>RequestAttributeSelector</h3> +<div style="margin-left: 0 ; border: 2px"> +<table class="ForrestTable" cellspacing="1" cellpadding="4"> + +<tr> + +<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">host</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">RequestAttributeSelector</span> component is used to + select appropriate sitemap processing depending on a request attribute + value. + </td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> + +</tr> + +<tr> <!-- choose Core, the block name, or Scratchpad depending on where RequestAttributeSelector sources live - --> - -<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.RequestAttributeSelector</td> - -</tr> - <!-- uncomment folling tr iff RequestAttributeSelector is deprecated --> + --> + +<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.RequestAttributeSelector</td> + +</tr> + <!-- uncomment folling tr iff RequestAttributeSelector is deprecated --> <!--tr> <td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td> - </tr--> - -<tr> - -<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> - -</tr> - -</table> -</div> - -<a name="N10083"></a><a name="Description"></a> -<h3>Description</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">RequestAttributeSelector</span> tests the value of request attribute - against the test attribute of the selector's when clause. - </p> -</div> - -<a name="N1008F"></a><a name="Usage"></a> -<h3>Usage</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">RequestAttributeSelector</span> allows to control the - sitemap processing depending on a request attribute. - </p> -<a name="N1009A"></a><a name="Sitemap+pipeline+examples"></a> -<h4>Sitemap pipeline examples</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The snippet below uses a <span class="codefrag">RequestAttributeSelector</span> named <span class="codefrag">request-attribute</span>. - It tests the value of request attribute named <span class="codefrag">command</span> against - <span class="codefrag">list</span>, <span class="codefrag">create</span>; finally it has a <span class="codefrag">otherwise</span> clause. - </p> -<pre class="code"> -<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> -</div> -<a name="N100BA"></a><a name="Sitemap+component+configuration+example"></a> -<h4>Sitemap component configuration example</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The snippet below declares a <span class="codefrag">RequestAttributeSelector</span> - defining to use the request attribute <span class="codefrag">cmd</span>. - </p> -<pre class="code"> -<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> -</div> -<a name="N100CE"></a><a name="Configuration"></a> -<h4>Configuration</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector configuration, options when declaring host selector --> - The configuration section of <span class="codefrag">RequestAttributeSelector</span> specifies - the default name of the request attribute, used for testing. - </p> -</div> -<a name="N100DC"></a><a name="Setup"></a> -<h4>Setup</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector setup, ie options when using host selector --> - Setting up a <span class="codefrag">RequestAttributeSelector</span> includes - </p> -<ul> - -<li>Defining an optional sitemap paramter named <span class="codefrag">request-name</span>, it overrides - the attribute-name setting in the configuration section. - </li> - -<li>choosing the <span class="codefrag"><map:when></span> test expressions, and a - optional <span class="codefrag"><map:otherwise></span> clause. - </li> - -</ul> -<p> - The test attribute of the <span class="codefrag"><map:when></span> clause shall match - the value of the request attribute. - If no test value matches, or the request attribute is not defined at all, - the <span class="codefrag"><map:otherwise</span> clause is selected. - </p> -</div> -<a name="N10105"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> -<h4>Effect on Object Model and Sitemap Parameters</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">RequestAttributeSelector</span> has no side effects on the object model, or - any sitemap attributes. - </p> -</div> -</div> - -<a name="N10112"></a><a name="Bugs%2FCaveats"></a> -<h3>Bugs/Caveats</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - -</p> -</div> - -<a name="N1011B"></a><a name="History"></a> -<h3>History</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - 28-12-02: initial creation - </p> -</div> - -<a name="N10124"></a><a name="Copyright"></a> -<h3>Copyright</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - </p> -</div> - -<a name="N1012D"></a><a name="See+also"></a> -<h3>See also</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Links to related components pages. --> - A general documentation about selectors is available at - <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. - </p> -</div> - -</div> -</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end Content==================--> -</table> -</td> -</tr> -</table> -<!--================= end Menu, NavBar, Content ==================--> -<!--================= start Footer ==================--> -<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> -<tr> -<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> -</tr> -<tr> -<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © - 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- - document.write(" - "+"Last Published: " + document.lastModified); - // --></script></font></td> -</tr> -<tr> -<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> -</tr> -</table> -<!--================= end Footer ==================--> -</body> -</html> + </tr--> + +<tr> + +<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> + +</tr> + +</table> +</div> + +<a name="N10083"></a><a name="Description"></a> +<h3>Description</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">RequestAttributeSelector</span> tests the value of request attribute + against the test attribute of the selector's when clause. + </p> +</div> + +<a name="N1008F"></a><a name="Usage"></a> +<h3>Usage</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">RequestAttributeSelector</span> allows to control the + sitemap processing depending on a request attribute. + </p> +<a name="N1009A"></a><a name="Sitemap+pipeline+examples"></a> +<h4>Sitemap pipeline examples</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The snippet below uses a <span class="codefrag">RequestAttributeSelector</span> named <span class="codefrag">request-attribute</span>. + It tests the value of request attribute named <span class="codefrag">command</span> against + <span class="codefrag">list</span>, <span class="codefrag">create</span>; finally it has a <span class="codefrag">otherwise</span> clause. + </p> +<pre class="code"> +<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> +</div> +<a name="N100BA"></a><a name="Sitemap+component+configuration+example"></a> +<h4>Sitemap component configuration example</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The snippet below declares a <span class="codefrag">RequestAttributeSelector</span> + defining to use the request attribute <span class="codefrag">cmd</span>. + </p> +<pre class="code"> +<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> +</div> +<a name="N100CE"></a><a name="Configuration"></a> +<h4>Configuration</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector configuration, options when declaring host selector --> + The configuration section of <span class="codefrag">RequestAttributeSelector</span> specifies + the default name of the request attribute, used for testing. + </p> +</div> +<a name="N100DC"></a><a name="Setup"></a> +<h4>Setup</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector setup, ie options when using host selector --> + Setting up a <span class="codefrag">RequestAttributeSelector</span> includes + </p> +<ul> + +<li>Defining an optional sitemap paramter named <span class="codefrag">request-name</span>, it overrides + the attribute-name setting in the configuration section. + </li> + +<li>choosing the <span class="codefrag"><map:when></span> test expressions, and a + optional <span class="codefrag"><map:otherwise></span> clause. + </li> + +</ul> +<p> + The test attribute of the <span class="codefrag"><map:when></span> clause shall match + the value of the request attribute. + If no test value matches, or the request attribute is not defined at all, + the <span class="codefrag"><map:otherwise</span> clause is selected. + </p> +</div> +<a name="N10105"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> +<h4>Effect on Object Model and Sitemap Parameters</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">RequestAttributeSelector</span> has no side effects on the object model, or + any sitemap attributes. + </p> +</div> +</div> + +<a name="N10112"></a><a name="Bugs%2FCaveats"></a> +<h3>Bugs/Caveats</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + +</p> +</div> + +<a name="N1011B"></a><a name="History"></a> +<h3>History</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + 28-12-02: initial creation + </p> +</div> + +<a name="N10124"></a><a name="Copyright"></a> +<h3>Copyright</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + </p> +</div> + +<a name="N1012D"></a><a name="See+also"></a> +<h3>See also</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Links to related components pages. --> + A general documentation about selectors is available at + <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. + </p> +</div> + +</div> +</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end Content==================--> +</table> +</td> +</tr> +</table> +<!--================= end Menu, NavBar, Content ==================--> +<!--================= start Footer ==================--> +<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> +<tr> +<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> +</tr> +<tr> +<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © + 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- + document.write(" - "+"Last Published: " + document.lastModified); + // --></script></font></td> +</tr> +<tr> +<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> +</tr> +</table> +<!--================= end Footer ==================--> +</body> +</html> 1.2 +140 -209 cocoon-site/site/2.1/userdocs/selectors/requestattribute-selector.pdf <<Binary file>> 1.5 +496 -486 cocoon-site/site/2.1/userdocs/selectors/requestparameter-selector.html Index: requestparameter-selector.html =================================================================== RCS file: /home/cvs/cocoon-site/site/2.1/userdocs/selectors/requestparameter-selector.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- requestparameter-selector.html 21 May 2003 15:23:50 -0000 1.4 +++ requestparameter-selector.html 19 Jul 2003 06:51:23 -0000 1.5 @@ -1,490 +1,500 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> -<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>RequestParameter-Selector in Cocoon</title> -<link type="text/css" href="../../skin/page.css" rel="stylesheet"> -</head> -<body text="#000000" bgcolor="#FFFFFF"> -<!--================= start Navigation Path ==================--> -<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="../../skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Navigation Path ==================--> -<!--================= start Banner ==================--> -<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<!--================= start Group Logo ==================--> -<td bgcolor="#294563"><a href="http://xml.apache.org"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/group-logo.gif"></a></td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> -<!--================= end Project Logo ==================--> -<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> -<form target="_blank" action="http://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> -<tr> -<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif"><input name="Search" value="Search" type="submit"> -<br> -<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> - the Apache Cocoon site - - - </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> -</tr> -</table> -</form> -</td> -<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" bgcolor="#294563" colspan="2"> -<!--================= start Tabs ==================--> -<div class="tab"> -<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td width="8"><img alt="" height="8" width="8" src="../../skin/images/spacer.gif"></td><td valign="bottom"> -<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> -</tr> -</table> -</td> -</tr> -</table> -</div> -<!--================= end Tabs ==================--> -</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Banner ==================--> -<!--================= start Menu, NavBar, Content ==================--> -<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top"> -<table summary="menu" border="0" cellspacing="0" cellpadding="0"> -<tr> -<!--================= start left top NavBar ==================--> -<td rowspan="3" valign="top"> -<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> -</tr> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td> -<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> -<!--================= start Menu items ==================--> -<div class="menu"> -<ul> -<li> -<font color="#CFDCED">Navigation</font> -<ul> - -<li> -<a href="../../index.html">Main</a> -</li> - -<li> -<a href="../index.html">User Documentation</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Selectors</font> -<ul> - -<li> -<a href="selectors.html">Overview</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Default</font> -<ul> - -<li> -<a href="browser-selector.html">Browser Selector</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Core</font> -<ul> - -<li> -<a href="host-selector.html">Host Selector</a> -</li> - -<li> -<span class="sel"><font color="#ffcc00">Request Parameter Selector</font></span> -</li> - -<li> -<a href="requestattribute-selector.html">Request Attribute Selector</a> -</li> - -<li> -<a href="parameter-selector.html">Parameter</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Optional</font> -<ul> - -</ul> -</li> -</ul> -</div> -<!--================= end Menu items ==================--> -</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> -</tr> -<tr> -<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td><td valign="top" width="100%"> -<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> -<!--================= start middle NavBar ==================--> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end middle NavBar ==================--> -<!--================= start Content==================--> -<tr> -<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="100%"> -<div class="content"> -<table class="title" summary=""> -<tr> -<td valign="middle"> -<h1>RequestParameter-Selector in Cocoon</h1> -</td><script Language="Javascript"> - -function printit(){ -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script Language="Javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write('<td nowrap="nowrap" width="40" align="center">'); - document.write(' <a class="dida" href="javascript:printit()">'); - document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" border="0"><br>'); - document.write(' print</a>'); - document.write('</td>'); -} -</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="requestparameter-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" border="0"><br> - PDF</a></td> -</tr> -</table> -<p> -<font size="-2">by Bernhard Huber</font> -</p> -<ul class="minitoc"> -<li> -<a href="#RequestParameterSelector">RequestParameterSelector</a> -</li> -<li> -<a href="#Description">Description</a> -</li> -<li> -<a href="#Usage">Usage</a> -<ul class="minitoc"> -<li> -<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> -</li> -<li> -<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> -</li> -<li> -<a href="#Configuration">Configuration</a> -</li> -<li> -<a href="#Setup">Setup</a> -</li> -<li> -<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> -</li> -</ul> -</li> -<li> -<a href="#Bugs%2FCaveats">Bugs/Caveats</a> -</li> -<li> -<a href="#History">History</a> -</li> -<li> -<a href="#Copyright">Copyright</a> -</li> -<li> -<a href="#See+also">See also</a> -</li> -</ul> - -<a name="N1001D"></a><a name="RequestParameterSelector"></a> -<h3>RequestParameterSelector</h3> -<div style="margin-left: 0 ; border: 2px"> -<table class="ForrestTable" cellspacing="1" cellpadding="4"> - -<tr> - -<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">host</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">RequestParameterSelector</span> component is used to - select appropriate sitemap processing depending on a request parameter - value. - </td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> - -</tr> - -<tr> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>RequestParameter-Selector in Cocoon</title> +<link type="text/css" href="../../skin/page.css" rel="stylesheet"> +</head> +<body text="#000000" bgcolor="#FFFFFF"> +<!--================= start Navigation Path ==================--> +<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Navigation Path ==================--> +<!--================= start Banner ==================--> +<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<!--================= start Group Logo ==================--> +<td bgcolor="#294563"><a href=""></a></td> +<!--================= end Group Logo ==================--> +<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> +<!--================= end Project Logo ==================--> +<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> +<form target="_blank" action="http://www.google.com/search" method="get"> +<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> +<tr> +<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><input name="Search" value="Search" type="submit"> +<br> +<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> + the Apache Cocoon site + + + </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> +</tr> +</table> +</form> +</td> +<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" bgcolor="#294563" colspan="2"> +<!--================= start Tabs ==================--> +<div class="tab"> +<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td width="6"><img alt="" height="8" width="6" src="../../skin/images/spacer.gif"></td><td valign="bottom"> +<table summary="selected tab" style="height: 1.8em" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> +</tr> +</table> +</td> +</tr> +</table> +</div> +<!--================= end Tabs ==================--> +</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Banner ==================--> +<!--================= start Menu, NavBar, Content ==================--> +<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top"> +<table summary="menu" border="0" cellspacing="0" cellpadding="0"> +<tr> +<!--================= start left top NavBar ==================--> +<td rowspan="3" valign="top"> +<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> +</tr> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td> +<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> +<!--================= start Menu items ==================--> +<div class="menu"> +<ul> +<li> +<font color="#CFDCED">Navigation</font> +<ul> + +<li> +<a href="../../index.html">Main</a> +</li> + +<li> +<a href="../index.html">User Documentation</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Selectors</font> +<ul> + +<li> +<a href="selectors.html">Overview</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Default</font> +<ul> + +<li> +<a href="browser-selector.html">Browser Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Core</font> +<ul> + +<li> +<a href="host-selector.html">Host Selector</a> +</li> + +<li> +<a href="parameter-selector.html">Parameter Selector</a> +</li> + +<li> +<a href="requestattribute-selector.html">Request Attribute Selector</a> +</li> + +<li> +<span class="sel"><font color="#ffcc00">Request Parameter Selector</font></span> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Optional</font> +<ul> + +</ul> +</li> +<li> +<font color="#CFDCED">Scratchpad</font> +<ul> + +<li> +<a href="date-selector.html">Date Selector</a> +</li> + +</ul> +</li> +</ul> +</div> +<!--================= end Menu items ==================--> +</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> +</tr> +<tr> +<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td><td valign="top" width="100%"> +<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> +<!--================= start middle NavBar ==================--> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end middle NavBar ==================--> +<!--================= start Content==================--> +<tr> +<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="100%"> +<div class="content"> +<table class="title" summary=""> +<tr> +<td valign="middle"> +<h1>RequestParameter-Selector in Cocoon</h1> +</td><script Language="Javascript"> + +function printit(){ +if (window.print) { + window.print() ; +} else { + var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; +document.body.insertAdjacentHTML('beforeEnd', WebBrowser); + WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; +} +} +</script><script Language="Javascript"> +var NS = (navigator.appName == "Netscape"); +var VERSION = parseInt(navigator.appVersion); +if (VERSION > 3) { + document.write('<td nowrap="nowrap" width="40" align="center">'); + document.write(' <a class="dida" href="javascript:printit()">'); + document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" class="skin"><br>'); + document.write(' print</a>'); + document.write('</td>'); +} +</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="requestparameter-selector.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" class="skin"><br> + PDF</a></td> +</tr> +</table> +<p> +<font size="-2">by Bernhard Huber</font> +</p> +<ul class="minitoc"> +<li> +<a href="#RequestParameterSelector">RequestParameterSelector</a> +</li> +<li> +<a href="#Description">Description</a> +</li> +<li> +<a href="#Usage">Usage</a> +<ul class="minitoc"> +<li> +<a href="#Sitemap+pipeline+examples">Sitemap pipeline examples</a> +</li> +<li> +<a href="#Sitemap+component+configuration+example">Sitemap component configuration example</a> +</li> +<li> +<a href="#Configuration">Configuration</a> +</li> +<li> +<a href="#Setup">Setup</a> +</li> +<li> +<a href="#Effect+on+Object+Model+and+Sitemap+Parameters">Effect on Object Model and Sitemap Parameters</a> +</li> +</ul> +</li> +<li> +<a href="#Bugs%2FCaveats">Bugs/Caveats</a> +</li> +<li> +<a href="#History">History</a> +</li> +<li> +<a href="#Copyright">Copyright</a> +</li> +<li> +<a href="#See+also">See also</a> +</li> +</ul> + +<a name="N1001D"></a><a name="RequestParameterSelector"></a> +<h3>RequestParameterSelector</h3> +<div style="margin-left: 0 ; border: 2px"> +<table class="ForrestTable" cellspacing="1" cellpadding="4"> + +<tr> + +<td colspan="1" rowspan="1">NAME</td><td colspan="1" rowspan="1">host</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">WHAT</td><td colspan="1" rowspan="1">The <span class="codefrag">RequestParameterSelector</span> component is used to + select appropriate sitemap processing depending on a request parameter + value. + </td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">TYPE</td><td colspan="1" rowspan="1">Selector, Sitemap Component</td> + +</tr> + +<tr> <!-- choose Core, the block name, or Scratchpad depending on where RequestParameterSelector sources live - --> - -<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.RequestParameterSelector</td> - -</tr> - <!-- uncomment folling tr iff RequestParameterSelector is deprecated --> + --> + +<td colspan="1" rowspan="1">BLOCK</td><td colspan="1" rowspan="1">Core</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CLASS</td><td colspan="1" rowspan="1">org.apache.cocoon.selection.RequestParameterSelector</td> + +</tr> + <!-- uncomment folling tr iff RequestParameterSelector is deprecated --> <!--tr> <td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td> - </tr--> - -<tr> - -<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> - -</tr> - -<tr> - -<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> - -</tr> - -</table> -</div> - -<a name="N10083"></a><a name="Description"></a> -<h3>Description</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">RequestParameterSelector</span> tests the value of request parameter - against the test attribute of the selector's when clause. - </p> -</div> - -<a name="N1008F"></a><a name="Usage"></a> -<h3>Usage</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">RequestParameterSelector</span> allows to control the - sitemap processing depending on a request parameter. - </p> -<a name="N1009A"></a><a name="Sitemap+pipeline+examples"></a> -<h4>Sitemap pipeline examples</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The snippet below uses a <span class="codefrag">RequestParameterSelector</span> named <span class="codefrag">request-parameter</span>. - It tests the value of request parameter named <span class="codefrag">command</span> against - <span class="codefrag">list</span>, <span class="codefrag">create</span>; finally it has a <span class="codefrag">otherwise</span> clause. - </p> -<pre class="code"> -<map:select type="request-parameter"> - <map:parameter name="parameter-name" value="command"/> - <map:when test="list"> - .... - </map:when> - <map:when test="create"> - ... - </map:when> - ... - <map:otherwise> - ... - </map:otherwise> -</map:select> - </pre> -</div> -<a name="N100BA"></a><a name="Sitemap+component+configuration+example"></a> -<h4>Sitemap component configuration example</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The snippet below declares a <span class="codefrag">RequestParameterSelector</span> - defining to use the request parameter <span class="codefrag">cmd</span>. - </p> -<pre class="code"> -<map:selectors... - <map:selector name="request-parameter" - src="org.apache.cocoon.selection.RequestParameterSelector" - logger="sitemap.selector.requestparameter"> - - <parameter-name>command</parameter-name> - </map:selectors> -... -</pre> -</div> -<a name="N100CE"></a><a name="Configuration"></a> -<h4>Configuration</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector configuration, options when declaring host selector --> - The configuration section of <span class="codefrag">RequestParameterSelector</span> specifies - the default name of the request parameter, used for testing. - </p> -</div> -<a name="N100DC"></a><a name="Setup"></a> -<h4>Setup</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Explain the sitemap selector setup, ie options when using host selector --> - Setting up a <span class="codefrag">RequestParameterSelector</span> includes - </p> -<ul> - -<li>Defining an optional sitemap paramter named <span class="codefrag">request-name</span>, it overrides - the parameter-name setting in the configuration section. - </li> - -<li>choosing the <span class="codefrag"><map:when></span> test expressions, and a - optional <span class="codefrag"><map:otherwise></span> clause. - </li> - -</ul> -<p> - The test attribute of the <span class="codefrag"><map:when></span> clause shall match - the value of the request parameter. - If no test value matches, or the request parameter is not defined at all, - the <span class="codefrag"><map:otherwise</span> clause is selected. - </p> -</div> -<a name="N10105"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> -<h4>Effect on Object Model and Sitemap Parameters</h4> -<div style="margin-left: 0 ; border: 2px"> -<p> - The <span class="codefrag">RequestParameterSelector</span> has no side effects on the object model, or - any sitemap parameters. - </p> -</div> -</div> - -<a name="N10112"></a><a name="Bugs%2FCaveats"></a> -<h3>Bugs/Caveats</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - -</p> -</div> - -<a name="N1011B"></a><a name="History"></a> -<h3>History</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - 28-12-02: initial creation - </p> -</div> - -<a name="N10124"></a><a name="Copyright"></a> -<h3>Copyright</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - </p> -</div> - -<a name="N1012D"></a><a name="See+also"></a> -<h3>See also</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - <!-- Links to related components pages. --> - A general documentation about selectors is available at - <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. - </p> -</div> - -</div> -</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end Content==================--> -</table> -</td> -</tr> -</table> -<!--================= end Menu, NavBar, Content ==================--> -<!--================= start Footer ==================--> -<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> -<tr> -<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> -</tr> -<tr> -<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © - 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- - document.write(" - "+"Last Published: " + document.lastModified); - // --></script></font></td> -</tr> -<tr> -<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> -</tr> -</table> -<!--================= end Footer ==================--> -</body> -</html> + </tr--> + +<tr> + +<td colspan="1" rowspan="1">SINCE</td><td colspan="1" rowspan="1">Cocoon 2.0</td> + +</tr> + +<tr> + +<td colspan="1" rowspan="1">CACHEABLE</td><td colspan="1" rowspan="1">not applicable</td> + +</tr> + +</table> +</div> + +<a name="N10083"></a><a name="Description"></a> +<h3>Description</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">RequestParameterSelector</span> tests the value of request parameter + against the test attribute of the selector's when clause. + </p> +</div> + +<a name="N1008F"></a><a name="Usage"></a> +<h3>Usage</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">RequestParameterSelector</span> allows to control the + sitemap processing depending on a request parameter. + </p> +<a name="N1009A"></a><a name="Sitemap+pipeline+examples"></a> +<h4>Sitemap pipeline examples</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The snippet below uses a <span class="codefrag">RequestParameterSelector</span> named <span class="codefrag">request-parameter</span>. + It tests the value of request parameter named <span class="codefrag">command</span> against + <span class="codefrag">list</span>, <span class="codefrag">create</span>; finally it has a <span class="codefrag">otherwise</span> clause. + </p> +<pre class="code"> +<map:select type="request-parameter"> + <map:parameter name="parameter-name" value="command"/> + <map:when test="list"> + .... + </map:when> + <map:when test="create"> + ... + </map:when> + ... + <map:otherwise> + ... + </map:otherwise> +</map:select> + </pre> +</div> +<a name="N100BA"></a><a name="Sitemap+component+configuration+example"></a> +<h4>Sitemap component configuration example</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The snippet below declares a <span class="codefrag">RequestParameterSelector</span> + defining to use the request parameter <span class="codefrag">command</span>. + </p> +<pre class="code"> +<map:selectors... + <map:selector name="request-parameter" + src="org.apache.cocoon.selection.RequestParameterSelector" + logger="sitemap.selector.requestparameter"> + + <parameter-name>command</parameter-name> + </map:selectors> +... +</pre> +</div> +<a name="N100CE"></a><a name="Configuration"></a> +<h4>Configuration</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector configuration, options when declaring host selector --> + The configuration section of <span class="codefrag">RequestParameterSelector</span> specifies + the default name of the request parameter, used for testing. + </p> +</div> +<a name="N100DC"></a><a name="Setup"></a> +<h4>Setup</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Explain the sitemap selector setup, ie options when using host selector --> + Setting up a <span class="codefrag">RequestParameterSelector</span> includes + </p> +<ul> + +<li>Defining an optional sitemap parameter named <span class="codefrag">request-name</span>, it overrides + the parameter-name setting in the configuration section. + </li> + +<li>choosing the <span class="codefrag"><map:when></span> test expressions, and a + optional <span class="codefrag"><map:otherwise></span> clause. + </li> + +</ul> +<p> + The test attribute of the <span class="codefrag"><map:when></span> clause shall match + the value of the request parameter. + If no test value matches, or the request parameter is not defined at all, + the <span class="codefrag"><map:otherwise</span> clause is selected. + </p> +</div> +<a name="N10105"></a><a name="Effect+on+Object+Model+and+Sitemap+Parameters"></a> +<h4>Effect on Object Model and Sitemap Parameters</h4> +<div style="margin-left: 0 ; border: 2px"> +<p> + The <span class="codefrag">RequestParameterSelector</span> has no side effects on the object model, or + any sitemap parameters. + </p> +</div> +</div> + +<a name="N10112"></a><a name="Bugs%2FCaveats"></a> +<h3>Bugs/Caveats</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + +</p> +</div> + +<a name="N1011B"></a><a name="History"></a> +<h3>History</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + 28-12-02: initial creation + </p> +</div> + +<a name="N10124"></a><a name="Copyright"></a> +<h3>Copyright</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. + </p> +</div> + +<a name="N1012D"></a><a name="See+also"></a> +<h3>See also</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + <!-- Links to related components pages. --> + A general documentation about selectors is available at + <a href="../concepts/matchers_selectors.html">Matchers and Selectors</a>. + </p> +</div> + +</div> +</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end Content==================--> +</table> +</td> +</tr> +</table> +<!--================= end Menu, NavBar, Content ==================--> +<!--================= start Footer ==================--> +<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> +<tr> +<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> +</tr> +<tr> +<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © + 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- + document.write(" - "+"Last Published: " + document.lastModified); + // --></script></font></td> +</tr> +<tr> +<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> +</tr> +</table> +<!--================= end Footer ==================--> +</body> +</html> 1.2 +140 -209 cocoon-site/site/2.1/userdocs/selectors/requestparameter-selector.pdf <<Binary file>> 1.5 +394 -384 cocoon-site/site/2.1/userdocs/selectors/selectors.html Index: selectors.html =================================================================== RCS file: /home/cvs/cocoon-site/site/2.1/userdocs/selectors/selectors.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- selectors.html 21 May 2003 15:23:50 -0000 1.4 +++ selectors.html 19 Jul 2003 06:51:23 -0000 1.5 @@ -1,384 +1,394 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> -<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Selectors</title> -<link type="text/css" href="../../skin/page.css" rel="stylesheet"> -</head> -<body text="#000000" bgcolor="#FFFFFF"> -<!--================= start Navigation Path ==================--> -<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" border="0" src="../../skin/images/spacer.gif"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" border="0" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Navigation Path ==================--> -<!--================= start Banner ==================--> -<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<!--================= start Group Logo ==================--> -<td bgcolor="#294563"><a href="http://xml.apache.org"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/group-logo.gif"></a></td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> -<!--================= end Project Logo ==================--> -<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> -<form target="_blank" action="http://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> -<tr> -<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif"><input name="Search" value="Search" type="submit"> -<br> -<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> - the Apache Cocoon site - - - </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> -</tr> -</table> -</form> -</td> -<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" bgcolor="#294563" colspan="2"> -<!--================= start Tabs ==================--> -<div class="tab"> -<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td width="8"><img alt="" height="8" width="8" src="../../skin/images/spacer.gif"></td><td valign="bottom"> -<table summary="selected tab" style="height: 1.7em" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> -</tr> -</table> -</td> -</tr> -</table> -</div> -<!--================= end Tabs ==================--> -</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -<!--================= end Banner ==================--> -<!--================= start Menu, NavBar, Content ==================--> -<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td valign="top"> -<table summary="menu" border="0" cellspacing="0" cellpadding="0"> -<tr> -<!--================= start left top NavBar ==================--> -<td rowspan="3" valign="top"> -<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> -</tr> -<tr> -<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td> -<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> -<!--================= start Menu items ==================--> -<div class="menu"> -<ul> -<li> -<font color="#CFDCED">Navigation</font> -<ul> - -<li> -<a href="../../index.html">Main</a> -</li> - -<li> -<a href="../index.html">User Documentation</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Selectors</font> -<ul> - -<li> -<span class="sel"><font color="#ffcc00">Overview</font></span> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Default</font> -<ul> - -<li> -<a href="browser-selector.html">Browser Selector</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Core</font> -<ul> - -<li> -<a href="host-selector.html">Host Selector</a> -</li> - -<li> -<a href="requestparameter-selector.html">Request Parameter Selector</a> -</li> - -<li> -<a href="requestattribute-selector.html">Request Attribute Selector</a> -</li> - -<li> -<a href="parameter-selector.html">Parameter</a> -</li> - -</ul> -</li> -<li> -<font color="#CFDCED">Optional</font> -<ul> - -</ul> -</li> -</ul> -</div> -<!--================= end Menu items ==================--> -</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/spacer.gif"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> -</tr> -<tr> -<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -</table> -</td><td valign="top" width="100%"> -<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> -<!--================= start middle NavBar ==================--> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> - - - </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<tr> -<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end middle NavBar ==================--> -<!--================= start Content==================--> -<tr> -<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td><td align="left" width="100%"> -<div class="content"> -<table class="title" summary=""> -<tr> -<td valign="middle"> -<h1>Selectors</h1> -</td><script Language="Javascript"> - -function printit(){ -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script Language="Javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write('<td nowrap="nowrap" width="40" align="center">'); - document.write(' <a class="dida" href="javascript:printit()">'); - document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" border="0"><br>'); - document.write(' print</a>'); - document.write('</td>'); -} -</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="selectors.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" border="0"><br> - PDF</a></td> -</tr> -</table> -<p> -<font size="-2">by Carsten Ziegeler, Gianugo Rabellino, Diana Shannon, ed.</font> -</p> -<ul class="minitoc"> -<li> -<a href="#Goal">Goal</a> -</li> -<li> -<a href="#Overview">Overview</a> -</li> -<li> -<a href="#The+Selectors+in+Cocoon">The Selectors in Cocoon</a> -</li> -</ul> - -<a name="N10024"></a><a name="Goal"></a> -<h3>Goal</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - This document lists all of the available selectors of Apache Cocoon and - describes their purpose. - You may also wish to read - <a href="../concepts/matchers_selectors.html">Using and Implementing - Matchers and Selectors</a>. - </p> -</div> - -<a name="N10031"></a><a name="Overview"></a> -<h3>Overview</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - Selectors in Apache Cocoon have a role similar to matchers - with additional flexibility. If you haven't learned about - matchers yet, read about them <a href="../matchers/matchers.html">here</a> - before continuing. Selectors are designed to evaluate a - generally simple boolean expression regarding some - part of the environment (request URI, headers, or cookies, for example). - The result of this evaluation determines which pipeline fragments - should be combined within a given pipeline. Unlike matchers, - selectors can be active decision-driving components. - For example, a matcher makes only simple - "yes/no" decisions. If a match is successful, a - pipeline is executed. If not, it is ignored. - Selectors go further by allowing more complex, multiple-choice - use cases. In short, consider matchers to be simple "if" - statements. By extension, consider selectors to have all - the power of an "if-else if-else" or "switch-case" constructs. - The selector syntax should be familiar to anyone who - uses XSLT's <span class="codefrag"><xsl:test></span> statement. - </p> -<p> - As an example, consider the typical scenario in which a page should - be rendered differently based on the client browser. - Given the large number and diversity of available browsers, - it would be awkward and counterintuitive to address this need - with a set of matchers. The BrowserSelector tests a given parameter - against the user-agent request header. Using this single selector, - we can deploy a consistent and readable setup. - </p> -<pre class="code"> - -<map:match pattern="docs/*.html"> - <map:generate src="xdocs/{1}.xml"/> - - <map:select type="browser"> - <map:when test="netscape"> - <map:transform src="stylesheets/netscape.xsl" /> - </map:when> - <map:when test="explorer"> - <map:transform src="stylesheets/ie.xsl" /> - </map:when> - <map:when test="lynx"> - <map:transform src="stylesheets/text-based.xsl" /> - </map:when> - <map:otherwise> - <map:transform src="stylesheets/html.xsl" /> - </map:otherwise> - </map:select> - - <map:serialize/> -</map:match> - -</pre> -</div> - -<a name="N10049"></a><a name="The+Selectors+in+Cocoon"></a> -<h3>The Selectors in Cocoon</h3> -<div style="margin-left: 0 ; border: 2px"> -<p> - Available Selectors in Cocoon include the following: - </p> -<ul> - -<li> -<strong>BrowserSelector</strong>: matches the value of the "test" - parameter against the HTTP User-Agent header, allowing it to - recognize the browser issuing the request;</li> - - -<li> -<strong>CodeSelector</strong>: matches a snippet of Java code - given as the "test" parameter against the environment;</li> - - -<li> -<strong>HostSelector</strong>: matches the "test" parameter value - against the Host request header</li> - - -<li> -<a href="parameter-selector.html">ParameterSelector</a>: matches the string specified - in the "test" parameter against a specified Cocoon internal - (e.g. sitemap) parameter;</li> - - -<li> -<strong>HeaderSelector</strong>: same as the Parameter selector, - but matches against the request headers;</li> - - -<li> -<strong>RequestSelector</strong>: again, same as the Parameter selector, - but matches against the Request parameters;</li> - - -<li> -<strong>SessionSelector</strong>: finally, this selector is used as - the Parameter selector to match against an arbitrary session - attribute;</li> - - -</ul> -</div> - -</div> -</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif"></td> -</tr> -<!--================= end Content==================--> -</table> -</td> -</tr> -</table> -<!--================= end Menu, NavBar, Content ==================--> -<!--================= start Footer ==================--> -<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> -<tr> -<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> -</tr> -<tr> -<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © - 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- - document.write(" - "+"Last Published: " + document.lastModified); - // --></script></font></td> -</tr> -<tr> -<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> -</tr> -</table> -<!--================= end Footer ==================--> -</body> -</html> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Selectors</title> +<link type="text/css" href="../../skin/page.css" rel="stylesheet"> +</head> +<body text="#000000" bgcolor="#FFFFFF"> +<!--================= start Navigation Path ==================--> +<table summary="navigation path" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td nowrap="nowrap" valign="middle" bgcolor="#CFDCED" height="20"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><!--===== breadcrumb trail (javascript-generated) ====--><font size="2" face="Arial, Helvetica, Sans-serif"><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script></font></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" height="2"><img height="2" width="2" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Navigation Path ==================--> +<!--================= start Banner ==================--> +<table summary="header with logos" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<!--================= start Group Logo ==================--> +<td bgcolor="#294563"><a href=""></a></td> +<!--================= end Group Logo ==================--> +<!--================= start Project Logo ==================--><td width="100%" align="center" bgcolor="#294563"><a href="http://cocoon.apache.org/"><img border="0" class="logoImage" alt="Apache Cocoon" src="../../images/project-logo.gif"></a></td> +<!--================= end Project Logo ==================--> +<!--================= start Search ==================--><td valign="top" rowspan="2" bgcolor="#294563"> +<form target="_blank" action="http://www.google.com/search" method="get"> +<table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F"> +<tr> +<td colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="cocoon.apache.org" name="sitesearch" type="hidden"><input size="15" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><input name="Search" value="Search" type="submit"> +<br> +<font face="Arial, Helvetica, Sans-serif" size="2" color="white"> + the Apache Cocoon site + + + </font></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-left.gif"></td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td><img alt="" border="0" height="10" width="9" src="../../skin/images/search-right.gif"></td> +</tr> +</table> +</form> +</td> +<!--================= start Search ==================--><td bgcolor="#294563"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" bgcolor="#294563" colspan="2"> +<!--================= start Tabs ==================--> +<div class="tab"> +<table summary="tab bar" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td width="6"><img alt="" height="8" width="6" src="../../skin/images/spacer.gif"></td><td valign="bottom"> +<table summary="selected tab" style="height: 1.8em" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b><a href="../../index.html"><font color="#000000">Home</font></a></b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="../../skin/images/tabSel-right.gif"></td> +</tr> +</table> +</td> +</tr> +</table> +</div> +<!--================= end Tabs ==================--> +</td><td bgcolor="#294563"><img alt="" width="1" height="1" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#4C6C8F" colspan="4"><img width="1" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +<!--================= end Banner ==================--> +<!--================= start Menu, NavBar, Content ==================--> +<table summary="page content" bgcolor="#ffffff" width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td valign="top"> +<table summary="menu" border="0" cellspacing="0" cellpadding="0"> +<tr> +<!--================= start left top NavBar ==================--> +<td rowspan="3" valign="top"> +<table summary="blue line" border="0" cellpadding="0" cellspacing="0"> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td bgcolor="#CFDCED"><font color="#4C6C8F" size="4" face="Arial, Helvetica, Sans-serif"> </font></td> +</tr> +<tr> +<td bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td> +<!--================= end left top NavBar ==================--><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap" valign="top" bgcolor="#4C6C8F"> +<!--================= start Menu items ==================--> +<div class="menu"> +<ul> +<li> +<font color="#CFDCED">Navigation</font> +<ul> + +<li> +<a href="../../index.html">Main</a> +</li> + +<li> +<a href="../index.html">User Documentation</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Selectors</font> +<ul> + +<li> +<span class="sel"><font color="#ffcc00">Overview</font></span> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Default</font> +<ul> + +<li> +<a href="browser-selector.html">Browser Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Core</font> +<ul> + +<li> +<a href="host-selector.html">Host Selector</a> +</li> + +<li> +<a href="parameter-selector.html">Parameter Selector</a> +</li> + +<li> +<a href="requestattribute-selector.html">Request Attribute Selector</a> +</li> + +<li> +<a href="requestparameter-selector.html">Request Parameter Selector</a> +</li> + +</ul> +</li> +<li> +<font color="#CFDCED">Optional</font> +<ul> + +</ul> +</li> +<li> +<font color="#CFDCED">Scratchpad</font> +<ul> + +<li> +<a href="date-selector.html">Date Selector</a> +</li> + +</ul> +</li> +</ul> +</div> +<!--================= end Menu items ==================--> +</td><td valign="bottom" bgcolor="#4C6C8F"><img width="10" height="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td valign="bottom" align="left" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-left.gif"></td><td bgcolor="#4C6C8F"><img height="10" width="10" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td valign="bottom" align="right" colspan="2" rowspan="2" bgcolor="#4C6C8F"><img height="10" width="10" border="0" alt="" src="../../skin/images/menu-right.gif"></td> +</tr> +<tr> +<td height="1" bgcolor="#294563"><img width="1" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +</table> +</td><td valign="top" width="100%"> +<table summary="content" width="100%" border="0" cellpadding="0" cellspacing="0"> +<!--================= start middle NavBar ==================--> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td align="left" width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="right" width="50%" bgcolor="#CFDCED"><font color="#4C6C8F" size="3" face="Arial, Helvetica, Sans-serif"> + + + </font><img width="10" height="8" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td width="10" bgcolor="#CFDCED"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<tr> +<td colspan="4" bgcolor="#294563"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end middle NavBar ==================--> +<!--================= start Content==================--> +<tr> +<td align="left" width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td align="left" width="100%"> +<div class="content"> +<table class="title" summary=""> +<tr> +<td valign="middle"> +<h1>Selectors</h1> +</td><script Language="Javascript"> + +function printit(){ +if (window.print) { + window.print() ; +} else { + var WebBrowser = '<OBJECT CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" HEIGHT="0" WIDTH="0" ID="WebBrowser1"></OBJECT>'; +document.body.insertAdjacentHTML('beforeEnd', WebBrowser); + WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; +} +} +</script><script Language="Javascript"> +var NS = (navigator.appName == "Netscape"); +var VERSION = parseInt(navigator.appVersion); +if (VERSION > 3) { + document.write('<td nowrap="nowrap" width="40" align="center">'); + document.write(' <a class="dida" href="javascript:printit()">'); + document.write(' <img alt="Print this Page" src="../../skin/images/printer.gif" class="skin"><br>'); + document.write(' print</a>'); + document.write('</td>'); +} +</script><td nowrap="nowrap" width="40" align="center"><a class="dida" href="selectors.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" class="skin"><br> + PDF</a></td> +</tr> +</table> +<p> +<font size="-2">by Carsten Ziegeler, Gianugo Rabellino, Diana Shannon, ed.</font> +</p> +<ul class="minitoc"> +<li> +<a href="#Goal">Goal</a> +</li> +<li> +<a href="#Overview">Overview</a> +</li> +<li> +<a href="#The+Selectors+in+Cocoon">The Selectors in Cocoon</a> +</li> +</ul> + +<a name="N10024"></a><a name="Goal"></a> +<h3>Goal</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + This document lists all of the available selectors of Apache Cocoon and + describes their purpose. + You may also wish to read + <a href="../concepts/matchers_selectors.html">Using and Implementing + Matchers and Selectors</a>. + </p> +</div> + +<a name="N10031"></a><a name="Overview"></a> +<h3>Overview</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + Selectors in Apache Cocoon have a role similar to matchers + with additional flexibility. If you haven't learned about + matchers yet, read about them <a href="../matchers/matchers.html">here</a> + before continuing. Selectors are designed to evaluate a + generally simple boolean expression regarding some + part of the environment (request URI, headers, or cookies, for example). + The result of this evaluation determines which pipeline fragments + should be combined within a given pipeline. Unlike matchers, + selectors can be active decision-driving components. + For example, a matcher makes only simple + "yes/no" decisions. If a match is successful, a + pipeline is executed. If not, it is ignored. + Selectors go further by allowing more complex, multiple-choice + use cases. In short, consider matchers to be simple "if" + statements. By extension, consider selectors to have all + the power of an "if-else if-else" or "switch-case" constructs. + The selector syntax should be familiar to anyone who + uses XSLT's <span class="codefrag"><xsl:test></span> statement. + </p> +<p> + As an example, consider the typical scenario in which a page should + be rendered differently based on the client browser. + Given the large number and diversity of available browsers, + it would be awkward and counterintuitive to address this need + with a set of matchers. The BrowserSelector tests a given parameter + against the user-agent request header. Using this single selector, + we can deploy a consistent and readable setup. + </p> +<pre class="code"> + +<map:match pattern="docs/*.html"> + <map:generate src="xdocs/{1}.xml"/> + + <map:select type="browser"> + <map:when test="netscape"> + <map:transform src="stylesheets/netscape.xsl" /> + </map:when> + <map:when test="explorer"> + <map:transform src="stylesheets/ie.xsl" /> + </map:when> + <map:when test="lynx"> + <map:transform src="stylesheets/text-based.xsl" /> + </map:when> + <map:otherwise> + <map:transform src="stylesheets/html.xsl" /> + </map:otherwise> + </map:select> + + <map:serialize/> +</map:match> + +</pre> +</div> + +<a name="N10049"></a><a name="The+Selectors+in+Cocoon"></a> +<h3>The Selectors in Cocoon</h3> +<div style="margin-left: 0 ; border: 2px"> +<p> + Available Selectors in Cocoon include the following: + </p> +<ul> + +<li> +<strong>BrowserSelector</strong>: matches the value of the "test" + parameter against the HTTP User-Agent header, allowing it to + recognize the browser issuing the request;</li> + + +<li> +<strong>CodeSelector</strong>: matches a snippet of Java code + given as the "test" parameter against the environment;</li> + + +<li> +<strong>HostSelector</strong>: matches the "test" parameter value + against the Host request header</li> + + +<li> +<a href="parameter-selector.html">ParameterSelector</a>: matches the string specified + in the "test" parameter against a specified Cocoon internal + (e.g. sitemap) parameter;</li> + + +<li> +<strong>HeaderSelector</strong>: same as the Parameter selector, + but matches against the request headers;</li> + + +<li> +<strong>RequestSelector</strong>: again, same as the Parameter selector, + but matches against the Request parameters;</li> + + +<li> +<strong>SessionSelector</strong>: finally, this selector is used as + the Parameter selector to match against an arbitrary session + attribute;</li> + + +</ul> +</div> + +</div> +</td><td width="10"><img width="10" height="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td> +</tr> +<!--================= end Content==================--> +</table> +</td> +</tr> +</table> +<!--================= end Menu, NavBar, Content ==================--> +<!--================= start Footer ==================--> +<table summary="footer" cellspacing="0" cellpadding="0" width="100%" border="0"> +<tr> +<td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"><a href="../../skin/images/label.gif"></a><a href="../../skin/images/page.gif"></a><a href="../../skin/images/chapter.gif"></a><a href="../../skin/images/chapter_open.gif"></a><a href="../../skin/images/current.gif"></a><a href="../..//favicon.ico"></a></td> +</tr> +<tr> +<td colspan="2" bgcolor="#CFDCED" class="copyright" align="center"><font size="2" face="Arial, Helvetica, Sans-Serif">Copyright © + 1999-2003 The Apache Software Foundation. All rights reserved.<script type="text/javascript" language="JavaScript"><!-- + document.write(" - "+"Last Published: " + document.lastModified); + // --></script></font></td> +</tr> +<tr> +<td colspan="2" align="left" bgcolor="#CFDCED" class="logos"></td> +</tr> +</table> +<!--================= end Footer ==================--> +</body> +</html> 1.2 +88 -170 cocoon-site/site/2.1/userdocs/selectors/selectors.pdf <<Binary file>>