ovidiu 02/03/13 11:04:52 Added: src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap CallNodeBuilder2.java Log: Call node builder that creates either a CallNode or a CallFunctionNode. Revision Changes Path 1.1 xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap/CallNodeBuilder2.java Index: CallNodeBuilder2.java =================================================================== 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.components.treeprocessor.AbstractProcessingNodeBuilder; import org.apache.cocoon.components.treeprocessor.CategoryNode; import org.apache.cocoon.components.treeprocessor.CategoryNodeBuilder; import org.apache.cocoon.components.treeprocessor.MapStackResolver; import org.apache.cocoon.components.treeprocessor.LinkedProcessingNodeBuilder; import org.apache.cocoon.components.treeprocessor.ProcessingNode; import java.util.*; public class CallNodeBuilder2 extends CallNodeBuilder implements LinkedProcessingNodeBuilder { protected String functionName; public ProcessingNode buildNode(Configuration config) throws Exception { this.resourceName = config.getAttribute("resource", null); this.functionName = config.getAttribute("function", null); if (resourceName == null && functionName == null) throw new ConfigurationException("<map:call> must have either a 'resource' or a 'function' attribute!"); if (resourceName != null) this.node = new CallNode(); else this.node = new CallFunctionNode(functionName); this.treeBuilder.setupNode(this.node, config); return this.node; } public void linkNode() throws Exception { if (resourceName != null) super.linkNode(); // else do nothing } }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]