1 16 package org.apache.cocoon.components.treeprocessor.sitemap; 17 18 import org.apache.avalon.framework.parameters.Parameters; 19 import org.apache.cocoon.components.treeprocessor.InvokeContext; 20 import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode; 21 import org.apache.cocoon.components.treeprocessor.SimpleParentProcessingNode; 22 import org.apache.cocoon.components.treeprocessor.variables.VariableResolver; 23 import org.apache.cocoon.environment.Environment; 24 25 import java.util.Map ; 26 27 33 34 public class ActSetNode extends SimpleParentProcessingNode 35 implements ParameterizableProcessingNode { 36 37 38 private Map parameters; 39 40 41 private ActionSetNode actionSet; 42 43 public void setParameters(Map parameterMap) { 44 this.parameters = parameterMap; 45 } 46 47 public void setActionSet(ActionSetNode actionSet) { 48 this.actionSet = actionSet; 49 } 50 51 public final boolean invoke(Environment env, InvokeContext context) 52 throws Exception { 53 54 super.invoke(env, context); 56 57 Parameters resolvedParams = VariableResolver.buildParameters( 58 this.parameters, 59 context, 60 env.getObjectModel() 61 ); 62 63 Map result = this.actionSet.call(env, context, resolvedParams); 64 65 if (context.getRedirector().hasRedirected()) { 66 return true; 67 68 } else if (result == null) { 69 return false; 70 71 } else if (this.children == null) { 72 return true; 73 74 } else { 75 return this.invokeNodes(this.children, env, context, null, result); 76 } 77 } 78 } 79 | Popular Tags |