unico 2004/01/26 08:07:18
Modified: src/java/org/apache/cocoon/components/cprocessor
sitemap2xconf.xsl
src/java/org/apache/cocoon/components/cprocessor/sitemap
HandleErrorsNode.java PipelineNode.java
src/webapp sitemap.xmap
src/webapp/WEB-INF cocoon.xconf
src/java/org/apache/cocoon/components/notification
DefaultNotifyingBuilder.java
Log:
make handle-errors node work
Revision Changes Path
1.4 +26 -1
cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap2xconf.xsl
Index: sitemap2xconf.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap2xconf.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sitemap2xconf.xsl 26 Jan 2004 15:45:35 -0000 1.3
+++ sitemap2xconf.xsl 26 Jan 2004 16:07:18 -0000 1.4
@@ -106,7 +106,7 @@
</xsl:apply-templates>
</xsl:template>
- <xsl:template match="map:pipeline|map:handle-errors">
+ <xsl:template match="map:pipeline">
<xsl:param name="parent-id"/>
<xsl:variable name="id">
<xsl:value-of select="$parent-id"/>-<xsl:value-of select="position()"/>
@@ -125,6 +125,31 @@
</xsl:for-each>
</pipeline-node>
<xsl:apply-templates
select="map:match|map:select|map:act|map:handle-errors">
+ <xsl:with-param name="parent-id">
+ <xsl:value-of select="$id" />
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="map:handle-errors">
+ <xsl:param name="parent-id"/>
+ <xsl:variable name="id">
+ <xsl:value-of select="$parent-id"/>-<xsl:value-of select="position()"/>
+ </xsl:variable>
+ <handle-errors-node id="{$id}" logger="sitemap.processor">
+ <xsl:apply-templates select="@*|map:parameter" mode="copy" />
+ <!-- TODO:
+ allow
map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to
?
+ -->
+ <xsl:for-each select="map:match|map:select|map:act">
+ <xsl:element name="{local-name()}">
+ <xsl:attribute name="id-ref">
+ <xsl:value-of select="$id"/>-<xsl:value-of select="position()" />
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </handle-errors-node>
+ <xsl:apply-templates select="map:match|map:select|map:act">
<xsl:with-param name="parent-id">
<xsl:value-of select="$id" />
</xsl:with-param>
1.3 +9 -2
cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/HandleErrorsNode.java
Index: HandleErrorsNode.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/HandleErrorsNode.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HandleErrorsNode.java 5 Jan 2004 08:17:30 -0000 1.2
+++ HandleErrorsNode.java 26 Jan 2004 16:07:18 -0000 1.3
@@ -55,6 +55,7 @@
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.components.cprocessor.InvokeContext;
+import org.apache.cocoon.components.cprocessor.ProcessingNode;
import org.apache.cocoon.components.cprocessor.SimpleParentProcessingNode;
import org.apache.cocoon.environment.Environment;
@@ -63,8 +64,14 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=ProcessingNode
+ * @x-avalon.lifestyle type=singleton
+ * @x-avalon.info name=handle-errors-node
*/
-public final class HandleErrorsNode extends SimpleParentProcessingNode {
+public final class HandleErrorsNode extends SimpleParentProcessingNode
+implements ProcessingNode {
private int statusCode;
1.3 +9 -2
cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/PipelineNode.java
Index: PipelineNode.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/PipelineNode.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PipelineNode.java 5 Jan 2004 08:17:30 -0000 1.2
+++ PipelineNode.java 26 Jan 2004 16:07:18 -0000 1.3
@@ -54,6 +54,8 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.Logger;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
import org.apache.cocoon.ConnectionResetException;
import org.apache.cocoon.ResourceNotFoundException;
import org.apache.cocoon.components.cprocessor.InvokeContext;
@@ -106,7 +108,12 @@
this.errorHandlerHelper.enableLogging(logger);
handledErrorsLogger = logger.getChildLogger("handled-errors");
}
-
+
+ public void service(ServiceManager manager) throws ServiceException {
+ super.service(manager);
+ this.errorHandlerHelper.service(manager);
+ }
+
public void configure(Configuration config) throws
ConfigurationException {
super.configure(config);
m_type = config.getAttribute("type", null);
1.38 +1 -3 cocoon-2.2/src/webapp/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/webapp/sitemap.xmap,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- sitemap.xmap 30 Dec 2003 11:27:51 -0000 1.37
+++ sitemap.xmap 26 Jan 2004 16:07:18 -0000 1.38
@@ -646,7 +646,6 @@
| error to be displayed on screen. The "exception" selector can help
| you to define different screens for different error types.
+-->
- <!--
<map:handle-errors>
<map:select type="exception">
@@ -677,7 +676,6 @@
</map:select>
</map:handle-errors>
- -->
</map:pipeline>
</map:pipelines>
1.39 +2 -1 cocoon-2.2/src/webapp/WEB-INF/cocoon.xconf
Index: cocoon.xconf
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/webapp/WEB-INF/cocoon.xconf,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- cocoon.xconf 7 Jan 2004 15:03:29 -0000 1.38
+++ cocoon.xconf 26 Jan 2004 16:07:18 -0000 1.39
@@ -239,7 +239,8 @@
logger="core.modules.input"
/>
<global-variables id="global-variables"/>
-
+
+ <notifying-builder id="notifying" />
<!-- TODO: entries below are still 2.1 configuration -->
1.4 +4 -3
cocoon-2.2/src/java/org/apache/cocoon/components/notification/DefaultNotifyingBuilder.java
Index: DefaultNotifyingBuilder.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/notification/DefaultNotifyingBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultNotifyingBuilder.java 27 Oct 2003 01:41:52 -0000 1.3
+++ DefaultNotifyingBuilder.java 26 Jan 2004 16:07:18 -0000 1.4
@@ -72,8 +72,9 @@
* TODO: is no x-avalon.lifestyle correct/allowed here?
*
* @avalon.component
- * @avalon.service type="NotifyingBuilder"
- * @x-avalon.info name="notifying-builder"
+ * @avalon.service type=NotifyingBuilder
+ * @x-avalon.info name=notifying-builder
+ * @x-avalon.lifestyle type=singleton
*/
public class DefaultNotifyingBuilder implements NotifyingBuilder {