vgritsenko 2003/05/08 06:42:07
Modified: src/webapp/samples samples.xml src/webapp/samples/errorhandling sitemap.xmap src/webapp/samples/errorhandling/exception error-giving-page.xml sitemap.xmap Added: src/webapp/samples/errorhandling samples.xml Removed: src/webapp/samples/errorhandling main.xml Log: Continuing with corporate standard for samples pages... Revision Changes Path 1.17 +2 -2 cocoon-2.1/src/webapp/samples/samples.xml Index: samples.xml =================================================================== RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/samples.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- samples.xml 8 May 2003 11:24:02 -0000 1.16 +++ samples.xml 8 May 2003 13:42:07 -0000 1.17 @@ -137,7 +137,7 @@ <sample name="Request Page" href="request.html"> This example shows the usage of the RequestGenerator. </sample> - <sample name="Error handling" href="errorhandling/main"> + <sample name="Error handling" href="errorhandling/"> An example page producing exceptions and handling them. Demonstrates the handler hierarchy and the exception selectors. </sample> 1.5 +53 -40 cocoon-2.1/src/webapp/samples/errorhandling/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/errorhandling/sitemap.xmap,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- sitemap.xmap 8 May 2003 11:24:03 -0000 1.4 +++ sitemap.xmap 8 May 2003 13:42:07 -0000 1.5 @@ -1,52 +1,65 @@ <?xml version="1.0" encoding="UTF-8"?> + +<!-- CVS $Id$ --> + <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> - <map:components> - <map:selectors default="browser"> - <map:selector name="exception" src="org.apache.cocoon.selection.XPathExceptionSelector"> - <exception name="application" class="org.apache.cocoon.samples.errorhandling.ApplicationException"> - <xpath name="application1" test="errorCode=1"/> - <xpath name="application2" test="errorCode=2"/> - </exception> - <exception name="validation" class="org.apache.cocoon.samples.errorhandling.ValidationException"/> - <exception name="resourceNotFound" class="org.apache.cocoon.ResourceNotFoundException"/> - <exception class="java.lang.Throwable" unroll="true"/> - </map:selector> - </map:selectors> - - </map:components> - - <map:pipelines> - <map:pipeline> - <map:match pattern="main"> - <map:generate src="main.xml"/> - <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl"> + <map:components> + <map:selectors default="browser"> + <map:selector name="exception" src="org.apache.cocoon.selection.XPathExceptionSelector"> + <exception name="application" class="org.apache.cocoon.samples.errorhandling.ApplicationException"> + <xpath name="application1" test="errorCode=1"/> + <xpath name="application2" test="errorCode=2"/> + </exception> + <exception name="validation" class="org.apache.cocoon.samples.errorhandling.ValidationException"/> + <exception name="not-found" class="org.apache.cocoon.ResourceNotFoundException"/> + <exception class="java.lang.Throwable" unroll="true"/> + </map:selector> + </map:selectors> + </map:components> + + <map:pipelines> + <map:pipeline> + <map:match pattern=""> + <map:redirect-to uri="welcome"/> + </map:match> + + <map:match pattern="welcome"> + <map:generate src="samples.xml"/> + <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl"> <map:parameter name="contextPath" value="{request:contextPath}"/> </map:transform> - <map:serialize/> - </map:match> - </map:pipeline> - - <map:pipeline> - <map:mount uri-prefix="exception" src="exception/"/> - - <map:handle-errors> - <map:select type="exception"> - <map:when test="resourceNotFound"> - <map:generate src="resourceNotFound.htm"/> - <map:serialize/> - </map:when> - </map:select> - </map:handle-errors> + <map:serialize/> + </map:match> - </map:pipeline> + <map:match pattern="main"> + <map:generate src="main.xml"/> + <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl"> + <map:parameter name="contextPath" value="{request:contextPath}"/> + </map:transform> + <map:serialize/> + </map:match> + </map:pipeline> + + <map:pipeline> + <map:mount uri-prefix="exception" src="exception/"/> + + <map:handle-errors> + <map:select type="exception"> + <map:when test="not-found"> + <map:generate src="resourceNotFound.htm"/> + <map:serialize/> + </map:when> + </map:select> + </map:handle-errors> + </map:pipeline> - <map:handle-errors> + <map:handle-errors> <map:generate type="notifying"/> <map:transform src="context://stylesheets/system/error2html.xslt"> <map:parameter name="contextPath" value="{request:contextPath}"/> - </map:transform> - </map:handle-errors> + </map:transform> + </map:handle-errors> + </map:pipelines> - </map:pipelines> </map:sitemap> 1.1 cocoon-2.1/src/webapp/samples/errorhandling/samples.xml Index: samples.xml =================================================================== <?xml version="1.0" encoding="iso-8859-1"?> <!-- CVS $Id: samples.xml,v 1.1 2003/05/08 13:42:07 vgritsenko Exp $ --> <samples name="Error Handling Samples" xmlns:xlink="http://www.w3.org/1999/xlink"> <group name="Back"> <sample name="Back" href="../"> Back to the samples home page. </sample> </group> <group name="Cocoon Exceptions"> <note>Choose what exception you want to generate...</note> <sample name="SAXParseException" href="exception/generror"> Attempt to read invalid XML file. </sample> <sample name="ValidationException" href="exception/exception?exception=validation"> Generate ValidationException. </sample> <sample name="ResourceNotFoundException" href="exception/exception?exception=resourceNotFound"> Generate ResourceNotFoundException. </sample> </group> <group name="Application Exceptions"> <sample name="ApplicationException (1)" href="exception/exception?exception=application&code=1"> Generate ApplicationException with error code 1. </sample> <sample name="ApplicationException (2)" href="exception/exception?exception=application&code=2"> Generate ApplicationException with error code 2. </sample> <sample name="ApplicationException (3)" href="exception/exception?exception=application&code=3"> Generate ApplicationException with error code 3. </sample> </group> <group name="Java Exceptions"> <sample name="NullPointerException" href="exception/exception?exception=nullPointer"> Generate NullPointerException. </sample> <sample name="Error" href="exception/exception?exception=error"> Generate Error. </sample> <sample name="No Exception" href="exception/exception"> Generate Error. </sample> </group> </samples> 1.2 +2 -2 cocoon-2.1/src/webapp/samples/errorhandling/exception/error-giving-page.xml Index: error-giving-page.xml =================================================================== RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/errorhandling/exception/error-giving-page.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- error-giving-page.xml 8 May 2003 11:24:03 -0000 1.1 +++ error-giving-page.xml 8 May 2003 13:42:07 -0000 1.2 @@ -10,7 +10,7 @@ ]> <page> - <!-- NOTE: this error is not well-formed intentionally in order to trigger an exception + <!-- NOTE: this page is not well-formed intentionally in order to trigger an exception and show how the sitemap error handling works --> <title>Hello<title> <content> 1.5 +43 -42 cocoon-2.1/src/webapp/samples/errorhandling/exception/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/errorhandling/exception/sitemap.xmap,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- sitemap.xmap 8 May 2003 11:24:03 -0000 1.4 +++ sitemap.xmap 8 May 2003 13:42:07 -0000 1.5 @@ -1,53 +1,54 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- CVS $Id$ --> + <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> - <map:components> - <map:generators default="file"> - <map:generator name="exception" src="org.apache.cocoon.samples.errorhandling.ExceptionGenerator"/> - </map:generators> - </map:components> - - <map:pipelines> - - <map:pipeline> - - <map:match pattern="exception"> - <map:generate type="exception"/> - <map:serialize/> - </map:match> + + <map:components> + <map:generators default="file"> + <map:generator name="exception" src="org.apache.cocoon.samples.errorhandling.ExceptionGenerator"/> + </map:generators> + </map:components> + + <map:pipelines> + <map:pipeline> + + <map:match pattern="exception"> + <map:generate type="exception"/> + <map:serialize/> + </map:match> <map:match pattern="generror"> <map:generate src="error-giving-page.xml"/> <map:serialize/> </map:match> - <map:handle-errors> - <map:select type="exception"> - <map:when test="validation"> - <map:generate src="validation.htm"/> - <map:serialize/> - </map:when> - </map:select> - </map:handle-errors> - - </map:pipeline> - - <map:handle-errors> - <map:select type="exception"> - <map:when test="application1"> - <map:generate src="application1.htm"/> - <map:serialize/> - </map:when> - <map:when test="application2"> - <map:generate src="application2.htm"/> - <map:serialize/> - </map:when> - <map:when test="application"> - <map:generate src="application.htm"/> - <map:serialize/> - </map:when> - </map:select> - </map:handle-errors> + <map:handle-errors> + <map:select type="exception"> + <map:when test="validation"> + <map:generate src="validation.htm"/> + <map:serialize/> + </map:when> + </map:select> + </map:handle-errors> + </map:pipeline> + + <map:handle-errors> + <map:select type="exception"> + <map:when test="application1"> + <map:generate src="application1.htm"/> + <map:serialize/> + </map:when> + <map:when test="application2"> + <map:generate src="application2.htm"/> + <map:serialize/> + </map:when> + <map:when test="application"> + <map:generate src="application.htm"/> + <map:serialize/> + </map:when> + </map:select> + </map:handle-errors> - </map:pipelines> + </map:pipelines> </map:sitemap>