stephan 2003/07/29 07:29:10
Modified: src/java/org/apache/cocoon/components/treeprocessor/sitemap ActNodeBuilder.java Log: Throw configuration exception if the <map:actions-sets> element is missing. Revision Changes Path 1.2 +11 -5 cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActNodeBuilder.java Index: ActNodeBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActNodeBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ActNodeBuilder.java 9 Mar 2003 00:09:20 -0000 1.1 +++ ActNodeBuilder.java 29 Jul 2003 14:29:10 -0000 1.2 @@ -51,8 +51,10 @@ package org.apache.cocoon.components.treeprocessor.sitemap; import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.cocoon.acting.Action; import org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNodeBuilder; +import org.apache.cocoon.components.treeprocessor.CategoryNode; import org.apache.cocoon.components.treeprocessor.CategoryNodeBuilder; import org.apache.cocoon.components.treeprocessor.LinkedProcessingNodeBuilder; import org.apache.cocoon.components.treeprocessor.ProcessingNode; @@ -110,10 +112,14 @@ if (this.actSetNode != null) { // Link action-set call to the action set - this.actSetNode.setActionSet( - (ActionSetNode)CategoryNodeBuilder.getNamedNode( - this.treeBuilder, "action-sets", this.actSetName) - ); + CategoryNode actionSets = CategoryNodeBuilder.getCategoryNode(this.treeBuilder, "action-sets"); + + if (actionSets == null) + throw new ConfigurationException("This sitemap contains no action sets. Cannot call at " + actSetNode.getLocation()); + + ActionSetNode actionSetNode = (ActionSetNode)actionSets.getNodeByName(this.actSetName); + + this.actSetNode.setActionSet(actionSetNode); } } }