Skip to content

Commit

Permalink
note about custom class added
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed May 11, 2014
1 parent bc1e7f8 commit 112129e
Showing 1 changed file with 14 additions and 2 deletions.
Expand Up @@ -7,11 +7,23 @@
<div class="instructions">
<h2>Resource Type Configuration Map</h2>
<p>To configure a bunch of URLs in the same way, one can use a <em>resource type configuration map</em>, which is an XML file called <code>map.rc-map</code>. This file has to be in the repository which is configured as the <em>rti (resource type identifier)</em> repository in a realm (in the file <a href="../realm/realm-configuration.html"><code>realm.xml</code></a>).</p>
<p>Within this file, one can define a wildcard matcher to select a group of URLs which points for every match to one <a href="resource_type_configuration.html">resource-type-configuration</a>, as in this example:</p>
<p>Inside this file, one can define a wildcard matcher to select a group of URLs which points for every match to one <a href="resource_type_configuration.html">resource type configuration</a>, as in this example:</p>

<pre>&lt;rc-map&gt;<br /> &lt;matcher pattern="/en/index.html" rcpath="/homepage_yanel-rc.xml"/&gt;<br />&#160; &lt;matcher pattern="/**.html" rcpath="/generic-xhtml-page_yanel-rc.xml"/&gt;<br /> &lt;matcher pattern="/news/**.html" rcpath="/web-bulletin-entry_yanel-rc.xml"/&gt;<br />&lt;/rc-map&gt;
</pre>

<p>Please note that the attribute <code>rcpath</code> uses <em>absolute</em> pathnames, because each repository is considered a separate volume, and all paths refer to the root of this volume, in this case the directory where the <a href="resource_type_configuration.html">resource type configuration</a> repository is located.</p>
<p>&#160;</p>

<p>
Inside the file <code>map.rc-map</code> one can also define a matcher using a custom class to match a request to a resource type configuration, as in the following example:
</p>

<pre>&lt;rc-map&gt;<br /> &lt;matcher class="org.wyona.yanel.impl.MobileRegistrationMatcher" rcpath="/registration-mobile_yanel-rc.xml"/&gt;<br />&lt;/rc-map&gt;
</pre>

<p>The custom class has to implement <code>org.wyona.yanel.core.MatcherV1#match(org.wyona.yanel.core.map.Realm realm, String path, javax.servlet.http.HttpServletRequest request)</code></p>

</div>
</body>
</html>
</html>

0 comments on commit 112129e

Please sign in to comment.