| <!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 : <notifier></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"> |
| <!ELEMENT notify (title, source, message, description, extra*)> |
| <!ATTLIST notiy |
| type CDATA #REQUIRED |
| sender CDATA #REQUIRED |
| > |
| <!ELEMENT title #PCDATA> |
| <!ELEMENT source #PCDATA> |
| <!ELEMENT message #PCDATA> |
| <!ELEMENT description #PCDATA> |
| <!ELEMENT extra #PCDATA> |
| <!ATTLIST extra description #CDATA> |
| <!ELEMENT statusinfo (group|value)*> |
| </pre> |
| |
| |
| <h1>Example</h1> |
| |
| <p> |
| The following example outputs the xml content of |
| an error generator: |
| </p> |
| |
| <pre class="code"> |
| <?xml version="1.0" |
| encoding="UTF-8"?> |
| |
| <error:notify |
| error:type="error" |
| error:sender="org.apache.cocoon.sitemap.ErrorNotifier" |
| xmlns:error="http://apache.org/cocoon/error/2.0"> |
| |
| <error:title>Cocoon error</error:title> |
| <error:source>java.lang.NullPointerException</error:source> |
| <error:message></error:message> |
| <error:description></error:description> |
| <error:extra description=""></error:extra> |
| </error:notify> |
| </pre> |
| |
| |
| </body> |
| </html> |