*/
@Override
public void doBuild(PipelineData pipelineData)
throws Exception
{
RunData data = getRunData(pipelineData);
// Get the context needed by Velocity.
Context context = TurbineVelocity.getContext(pipelineData);
data.getResponse().setContentType("text/html");
String screenName = data.getScreen();
log.debug("Loading Screen " + screenName);
// First, generate the screen and put it in the context so
// we can grab it the layout template.
ConcreteElement results =
screenLoader.eval(pipelineData, screenName);
String returnValue = (results == null) ? "" : results.toString();
// variable for the screen in the layout template
context.put(TurbineConstants.SCREEN_PLACEHOLDER, returnValue);
// variable to reference the navigation screen in the layout template
context.put(TurbineConstants.NAVIGATION_PLACEHOLDER,
new TemplateNavigation(data));
// Grab the layout template set in the VelocityPage.
// If null, then use the default layout template
// (done by the TemplateInfo object)
String templateName = data.getTemplateInfo().getLayoutTemplate();
log.debug("Now trying to render layout " + templateName);
// Now, generate the layout template.
String temp = TurbineVelocity.handleRequest(context,
prefix + templateName);
// Finally we do a transformation and send the result
// back to the browser
XSLTServiceFacade.transform(
data.getTemplateInfo().getScreenTemplate(),
new StringReader(temp), data.getResponse().getWriter());
}