You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2004/09/04 05:14:05 UTC
svn commit: rev 43316 - cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/selectors
Author: crossley
Date: Fri Sep 3 20:14:04 2004
New Revision: 43316
Added:
cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/selectors/regular-expression-header-selector.xml (contents, props changed)
Log:
Add document which was missing from commit r36051
Submitted by: Colin Paul Adams as bug #30321
Added: cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/selectors/regular-expression-header-selector.xml
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/documentation/xdocs/userdocs/selectors/regular-expression-header-selector.xml Fri Sep 3 20:14:04 2004
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
+
+<!--
+ <![CDATA[ CVS Version: $Id: regular-expression-header-selector.xml,v 1.0 2004/07/08 $
+ ]]>
+-->
+
+<document>
+ <header>
+ <title>Regular-Ecpression-Header-Selector in Cocoon</title>
+ <version>0.1</version>
+ <type>Technical document</type>
+ <authors>
+ <person name="Colin Adams" email="colin@colina.demon.co.uk"/>
+ </authors>
+ <abstract>This document describes the RegexpHeaderSelector of Cocoon.</abstract>
+ </header>
+ <body>
+ <s1 title="RegexpHeaderSelector">
+ <table>
+ <tr>
+ <td>NAME</td><td>regexp-header</td>
+ </tr>
+ <tr>
+ <td>WHAT</td><td>The <code>RegexpHeaderSelector</code> component is used to
+ select appropriate sitemap processing depending on a particular header value.
+ </td>
+ </tr>
+ <tr>
+ <td>TYPE</td><td>Selector, Sitemap Component</td>
+ </tr>
+ <tr>
+ <!-- choose Core, the block name, or Scratchpad
+ depending on where RegexpHeaderSelector sources live
+ -->
+ <td>BLOCK</td><td>Core</td>
+ </tr>
+ <tr>
+ <td>CLASS</td><td>org.apache.cocoon.selection.RegexpHeaderSelector</td>
+ </tr>
+ <!-- uncomment folling tr iff RegexpHeaderSelector is deprecated -->
+ <!--tr>
+ <td>DEPRECATED</td><td>Cocoon 2.1</td>
+ </tr-->
+ <tr>
+ <td>SINCE</td><td>Cocoon 2.1.6</td>
+ </tr>
+ <tr>
+ <td>CACHEABLE</td><td>not applicable</td>
+ </tr>
+ </table>
+ </s1>
+ <s1 title="Description">
+ <p>
+ The <code>RegexpheaderSelector</code> tests a header field against
+ the test attribute of the selectors when clause.
+ </p>
+ </s1>
+ <s1 title="Usage">
+ <p>
+ The <code>RegexpHeaderSelector</code> allows to define sitemap
+ processing based on the content of a particular header field.
+ </p>
+ <s2 title="Sitemap pipeline examples">
+ <p></p>
+ <source><![CDATA[
+<map:select type="regexp-header">
+ <map:when test="xhtml">
+ ....
+ </map:when>
+ ...
+ <map:otherwise>
+ ...
+ </map:otherwise>
+</map:select>
+ ]]></source>
+ </s2>
+
+ <s2 title="Sitemap component configuration example">
+ <p>
+ </p>
+ <source><![CDATA[
+<map:selectors...
+ <map:selector name="regexp-header"
+ src="org.apache.cocoon.selection.RegexpHeaderSelector"
+
+ <pattern name="xhtml">application/xhtml\+xml</pattern>
+ ...
+ <header-name>accept</header-name>
+
+ </map:selectors>
+...
+]]></source>
+ </s2>
+ <s2 title="Configuration">
+ <p>
+ <!-- Explain the sitemap selector configuration, options when declaring browser selector -->
+ The configuration section of <code>RegexpHeaderSelector</code> specifies
+ a mapping from header strings to symbolic pattern names.
+ </p>
+ <p>
+ Each pattern element specifies a name attribute holding the symbolic pattern name
+ used in the test attribute expression. The contents contains
+ a regular expression to match against the header value.
+ </p>
+ <p>
+ The header concerned is named by the contents of the header-name element.
+ </p>
+ </s2>
+ <s2 title="Setup">
+ <p>
+ <!-- Explain the sitemap selector setup, ie options when using this selector -->
+ Setting up a <code>RegexpHeaderSelector</code> includes choosing the
+ <code><map:when></code> test expressions, and a
+ optional <code><map:otherwise></code> clause.
+ </p>
+ <p>
+ The test attribute of the <code><map:when></code> clause must match
+ a pattern attribute name value. The value of the test attribute in a
+ <code><map:when></code> clause must be declared in a
+ <code>pattern</code> name attribute.
+ </p>
+ <p>The header-name can be overridden by a parameter element.
+ </p>
+ </s2>
+ <s2 title="Effect on Object Model and Sitemap Parameters">
+ <p>
+ The <code>RegexpHeaderSelector</code> has no side effects on the object model, or
+ any sitemap parameters.
+ </p>
+ </s2>
+ </s1>
+ <s1 title="Bugs/Caveats">
+ <p>
+ The <code>RegexpHeaderSelector</code> adds the response header attribute
+ <code>Vary</code> having a value of the header name, indicating
+ that the response differ for different user agents. This information
+ especially meaningfull for an http-proxy server.
+ </p>
+ </s1>
+ <s1 title="History">
+ <p>
+ 26-07-04: initial creation
+ </p>
+ </s1>
+ <s1 title="See also">
+ <p>
+ <!-- Links to related components pages. -->
+ A general documentation about selectors is available at
+ <link href="../concepts/matchers_selectors.html">Matchers and Selectors</link>.
+ </p>
+ </s1>
+ </body>
+</document>
+