sylvain 2004/01/18 14:19:58
Modified: src/java/org/apache/cocoon/components/treeprocessor
DefaultTreeBuilder.java
Log:
Ensure components have their location in parameters
Revision Changes Path
1.5 +7 -2
cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java
Index: DefaultTreeBuilder.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DefaultTreeBuilder.java 10 Sep 2003 17:43:02 -0000 1.4
+++ DefaultTreeBuilder.java 18 Jan 2004 22:19:58 -0000 1.5
@@ -69,15 +69,18 @@
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.context.Contextualizable;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.cocoon.Constants;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.components.ExtendedComponentSelector;
import org.apache.cocoon.components.LifecycleHelper;
import org.apache.cocoon.components.source.SourceUtil;
+import
org.apache.cocoon.components.treeprocessor.variables.NOPVariableResolver;
import
org.apache.cocoon.components.treeprocessor.variables.VariableResolverFactory;
import org.apache.cocoon.sitemap.PatternException;
import org.apache.excalibur.source.Source;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -502,10 +505,12 @@
Configuration[] children = config.getChildren(this.parameterElement);
if (children.length == 0) {
- return null;
+ // Parameters are only the component's location
+ return Collections.singletonMap(new
NOPVariableResolver(Constants.SITEMAP_PARAMETERS_LOCATION), new
NOPVariableResolver(config.getLocation()));
}
Map params = new HashMap();
+ params.put(new
NOPVariableResolver(Constants.SITEMAP_PARAMETERS_LOCATION), new
NOPVariableResolver(config.getLocation()));
for (int i = 0; i < children.length; i++) {
Configuration child = children[i];
if (true) { // FIXME : check namespace