| <!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"> |
| ... |
| <map:components> |
| ... |
| <map:generators default="file"> |
| ... |
| <map:generator name="linkStatus" |
| src="org.apache.cocoon.generation.LinkStatusGenerator"/> |
| </map:generators> |
| <map:serialize default="html"> |
| <map:serializer name="links" |
| src="org.apache.cocoon.serialization.LinkSerializer"/> |
| </map:serialize> |
| </map:components> |
| <map:views> |
| <map:view> |
| <map:view from-position="last" name="links"> |
| <map:serialize type="links"/> |
| </map:view> |
| ... |
| </map:view> |
| </pre> |
| |
| <p> |
| Next define in your pipeline to use the LinkStatusGenerator |
| </p> |
| |
| <pre class="code"> |
| <map:match pattern="/linkStatus"> |
| <map:generate type="linkStatus" name="my-root"/> |
| ... |
| <map:serialize/> |
| </map:match> |
| </pre> |
| |
| |
| |
| </body> |
| </html> |