blob: 262a3475770f2db87a98ca52a0704b75a1688d97 [file] [log] [blame]
<!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=UTF-8">
<title>LinkStatus Generator</title>
<link href="http://purl.org/DC/elements/1.0/" rel="schema.DC">
<meta content="Bernhard Huber" name="DC.Creator">
<meta content="This document describes the LinkStatus generator." name="DC.Description">
</head>
<body>
<h1>LinkStatus Generator</h1>
<p>
The LinkStatus Generator emits a list of links that are reachable.
</p>
<p>
The LinkStatusGenerator has serveral configuration options.
</p>
<dl>
<dt>include-name</dt>
<dd>RE pattern for including links
<br>
By default <span class="codefrag">include-name</span> is empty.
</dd>
<dt>exclude-name</dt>
<dd>RE pattern for excluding links.
<br>
By default <span class="codefrag">exclude-name</span> is defined as
<span class="codefrag">.*\.gif(\?.*)?$,
.*\.png(\?.*)?$,
.*\.jpe?g(\?.*)?$,
.*\.js(\?.*)?$,
.*\.css(\?.*)?$
</span>.
</dd>
<dt>link-content-type</dt>
<dd>expected MIME type of xml document requested on view
<em>link-query-view</em>
<br>
By default <span class="codefrag">link-content-type</span> is set to
<span class="codefrag">application/x-cocoon-links</span>.
</dd>
<dt>link-view-query</dt>
<dd>A query-string appended to the crawling URL
<br>
By default <span class="codefrag">link-view-query</span> is set to
<span class="codefrag">cocoon-view=links</span>.
</dd>
<dt>user-agent</dt>
<dd>HTTP user-agent for requesting links,
By default <span class="codefrag">user-agent</span> is set to
value of <span class="codefrag">org.apache.cocoon.Constants.COMPLETE_NAME</span>,
ie. <span class="codefrag">Apache Cocoon 2.1-dev</span>
</dd>
<dt>accept</dt>
<dd>Not currently used</dd>
</dl>
<p>
A simple example might help to use the LinkStatusGenerator effectivly:
</p>
<p>
Add the LinkStatusGenerator to the components in your sitemap.xmap
</p>
<pre class="code">
...
&lt;map:components&gt;
...
&lt;map:generators default="file"&gt;
...
&lt;map:generator name="linkStatus"
src="org.apache.cocoon.generation.LinkStatusGenerator"/&gt;
&lt;/map:generators&gt;
&lt;map:serialize default="html"&gt;
&lt;map:serializer name="links"
src="org.apache.cocoon.serialization.LinkSerializer"/&gt;
&lt;/map:serialize&gt;
&lt;/map:components&gt;
&lt;map:views&gt;
&lt;map:view&gt;
&lt;map:view from-position="last" name="links"&gt;
&lt;map:serialize type="links"/&gt;
&lt;/map:view&gt;
...
&lt;/map:view&gt;
</pre>
<p>
Next define in your pipeline to use the LinkStatusGenerator
</p>
<pre class="code">
&lt;map:match pattern="/linkStatus"&gt;
&lt;map:generate type="linkStatus" name="my-root"/&gt;
...
&lt;map:serialize/&gt;
&lt;/map:match&gt;
</pre>
</body>
</html>