The
AbstractRegexpSelector abstract class defines a simple selector
operating over configured regular-expression patterns.
Configuration of an
AbstractRegexpSelector is quite simple: first of
all the patterns used for selections must be configured:
<map:components>
...
<map:selectors default="...">
<map:selector name="..." src="org.apache.cocoon.selection....">
<pattern name="empty">^$</pattern>
<pattern name="number">^[0-9]+$</pattern>
<pattern name="string">^.+$</pattern>
</map:selector>
</map:selectors>
</map:components>
Then, each configured pattern can be referenced in the pipelines section of
the sitemap:
<map:pipelines>
...
<map:match ...>
...
<map:select type="browser">
<map:when test="empty">...</map:when>
<map:when test="number">...</map:when>
<map:when test="string">...</map:when>
<map:otherwise>...</map:otherwise>
</map:select>
...
</map:match>
...
</map:pipelines>
author: Pier Fumagalli version: CVS $Id: AbstractRegexpSelector.java 30941 2004-07-29 19:56:58Z vgritsenko $ |