if(!(ctxObj instanceof RenderingContext)){
throw new TemplateProcessingException("Musst pass a RenderingContext here");
}
RenderingContext renderingContext = (RenderingContext)ctxObj;
TemplateDefinition templateDefinition = (TemplateDefinition)renderingContext.getRenderableDefinition();
String dlg = templateDefinition.getDialog();
if(dlg!=null){
helper.attribute("dialog", dlg);
}
helper.attribute("preview", String.valueOf(MgnlContext.getAggregationState().isPreviewMode()));