"");
Velocity.init(properties);
}
catch (Exception e)
{
throw new GeneratorException(
"Could not initialize velocity",
e);
}
SourceElement sourceElement = controllerState.getSourceElement();
String inputElementName = getInputElementName();
if (inputElementName != null
&& !inputElementName.equals(sourceElement.getName()))
{
throw new GeneratorException("Input element name, "
+ sourceElement.getName()
+ ", is not the expected name, "
+ getInputElementName()
+ ", for outlet "
+ getName());
}
Context context = createVelocityContext(controllerState);
Writer writer = new StringWriter();
try
{
Velocity.evaluate(context, writer,
"VelocityTemplateOutlet:" + getName(),
getContent(controllerState));
writer.flush();
writer.close();
}
catch (Exception e)
{
log.error("error during execution of outlet "
+ getName()
+ " : " + e.getMessage(),
e);
throw new GeneratorException(
"Error during execution of outlet "
+ getName()
+ " : "
+ e.getMessage(),
e);