public final boolean invoke(Environment env,
InvokeContext context) throws Exception {
Map objectModel = env.getObjectModel();
context.getProcessingPipeline().setGenerator(
this.generatorName,
source.resolve(context, objectModel),
VariableResolver.buildParameters(this.parameters, context, objectModel),
this.pipelineHints == null
? Parameters.EMPTY_PARAMETERS
: VariableResolver.buildParameters(this.pipelineHints, context, objectModel)
);
// Check view
if (this.views != null) {
//inform the pipeline that we have a branch point
context.getProcessingPipeline().informBranchPoint();
String cocoonView = env.getView();
if (cocoonView != null) {
// Get view node
ProcessingNode viewNode = (ProcessingNode)this.views.get(cocoonView);
if (viewNode != null) {
if (getLogger().isInfoEnabled()) {
getLogger().info("Jumping to view " + cocoonView + " from generator at " + this.getLocation());
}
return viewNode.invoke(env, context);
}
}
}
// Return false to continue sitemap invocation
return false;
}
|