blob: 27453614c9473d4026b19729ff1afd67278b354e [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>Notifying 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 Notifying Generator of Cocoon." name="DC.Description">
</head>
<body>
<h1>Notifying Generator</h1>
<p>
The notifying generator creates XML content describing an error condition.
When an error occurs in a pipeline with a defined an error handler, the
sitemap manager activates the error generator, feeding it the cause of
the error.
</p>
<ul>
<li>Name : &lt;notifier&gt;</li>
<li>Class: org.apache.cocoon.sitemap.NotifyingGenerator</li>
<li>Cacheable: No.</li>
<li>Mode: Sitemap internal</li>
</ul>
<h1>DTD</h1>
<p>
XML generated by notifying generator uses the
namespace <span class="codefrag">http://apache.org/cocoon/error/2.0</span> and
the <span class="codefrag">error</span> prefix.
</p>
<p>
Usually the error condition is described by a throwable object.
The information of this throwable object is used by the
error generator to produce the xml content.
The various elements of the xml content include the following.
</p>
<ul>
<li>
The element <span class="codefrag">notify</span> is the root element, having
attributes <span class="codefrag">type</span> and <span class="codefrag">sender</span>.
The attribute <span class="codefrag">type</span> has fixed value <span class="codefrag">error</span>.
The attribute <span class="codefrag">sender</span> describes the sender of the
error notification object. In the current implementation, it has
fixed value <span class="codefrag">org.apache.cocoon.sitemap.ErrorNotifier</span>.
</li>
<li>
The element <span class="codefrag">title</span> stores the title of the eror notification.
In the current implementation, it has fixed value <span class="codefrag">Cocoon error</span>.
</li>
<li>
The <span class="codefrag">source</span> element stores the class name of the throwable object
of the error notification.
</li>
<li>
The <span class="codefrag">message</span> element stores the <span class="codefrag">getMessage()</span> result
of the throwable object of the error notification, and may be empty.
</li>
<li>
The <span class="codefrag">description</span> element stores the <span class="codefrag">toString()</span> result
of the throwable object of the error notification.
</li>
<li>
Optional <span class="codefrag">extra</span> elements stores nested exceptions
of the throwable object of the error notification.
</li>
</ul>
<pre class="code">
&lt;!ELEMENT notify (title, source, message, description, extra*)&gt;
&lt;!ATTLIST notiy
type CDATA #REQUIRED
sender CDATA #REQUIRED
&gt;
&lt;!ELEMENT title #PCDATA&gt;
&lt;!ELEMENT source #PCDATA&gt;
&lt;!ELEMENT message #PCDATA&gt;
&lt;!ELEMENT description #PCDATA&gt;
&lt;!ELEMENT extra #PCDATA&gt;
&lt;!ATTLIST extra description #CDATA&gt;
&lt;!ELEMENT statusinfo (group|value)*&gt;
</pre>
<h1>Example</h1>
<p>
The following example outputs the xml content of
an error generator:
</p>
<pre class="code">
&lt;?xml version="1.0"
encoding="UTF-8"?&gt;
&lt;error:notify
error:type="error"
error:sender="org.apache.cocoon.sitemap.ErrorNotifier"
xmlns:error="http://apache.org/cocoon/error/2.0"&gt;
&lt;error:title&gt;Cocoon error&lt;/error:title&gt;
&lt;error:source&gt;java.lang.NullPointerException&lt;/error:source&gt;
&lt;error:message&gt;&lt;/error:message&gt;
&lt;error:description&gt;&lt;/error:description&gt;
&lt;error:extra description=""&gt;&lt;/error:extra&gt;
&lt;/error:notify&gt;
</pre>
</body>
</html>