You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by un...@apache.org on 2004/03/11 00:37:31 UTC
cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap PipelineNodeBuilder.java PipelineNode.java
unico 2004/03/10 15:37:31
Modified: src/java/org/apache/cocoon/components/treeprocessor/sitemap
PipelineNodeBuilder.java PipelineNode.java
Log:
more comprehensible error message when no pipelines declared
Revision Changes Path
1.5 +7 -4 cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java
Index: PipelineNodeBuilder.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PipelineNodeBuilder.java 5 Mar 2004 13:02:52 -0000 1.4
+++ PipelineNodeBuilder.java 10 Mar 2004 23:37:31 -0000 1.5
@@ -21,6 +21,7 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.components.pipeline.ProcessingPipeline;
import org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNodeBuilder;
import org.apache.cocoon.components.treeprocessor.ProcessingNode;
import org.apache.cocoon.components.treeprocessor.ProcessingNodeBuilder;
@@ -43,7 +44,9 @@
public ProcessingNode buildNode(Configuration config)
throws Exception {
- PipelineNode node = new PipelineNode( config );
+
+ String type = this.treeBuilder.getTypeForStatement(config, ProcessingPipeline.ROLE + "Selector");
+ PipelineNode node = new PipelineNode(type);
this.treeBuilder.setupNode(node, config);
node.setInternalOnly(config.getAttributeAsBoolean("internal-only", false));
@@ -66,9 +69,9 @@
if (builder instanceof HandleErrorsNodeBuilder) {
// Error handler : check type
HandleErrorsNode handler = (HandleErrorsNode)builder.buildNode(childConfig);
- int type = handler.getStatusCode();
+ int status = handler.getStatusCode();
- switch(type) {
+ switch(status) {
case -1: // main handler (needs generator)
if (mainHandler != null) {
throw new ConfigurationException("Duplicate <handle-errors> at " + handler.getLocation());
1.13 +3 -3 cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
Index: PipelineNode.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- PipelineNode.java 5 Mar 2004 13:02:52 -0000 1.12
+++ PipelineNode.java 10 Mar 2004 23:37:31 -0000 1.13
@@ -71,8 +71,8 @@
* A constructor to receive the optional expires parameter
* and optional parameters for the processing pipeline
*/
- public PipelineNode(Configuration config) {
- this.processingPipeline = config.getAttribute("type", null);
+ public PipelineNode(String name) {
+ this.processingPipeline = name;
}
/**