[Generator-rt-devel] generator_runtime/src/java/generator/runtime/automailer VelocityMailRenderCon
Brought to you by:
rickknowles
|
From: Rick K. <ric...@us...> - 2010-04-05 02:31:50
|
Update of /cvsroot/generator-rt/generator_runtime/src/java/generator/runtime/automailer In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11801/src/java/generator/runtime/automailer Modified Files: VelocityMailRenderController.java Log Message: A bunch of translation tag changes and addons to the velocity mail rendering. A fix to the DBConnectionPool keep alive process also included. Index: VelocityMailRenderController.java =================================================================== RCS file: /cvsroot/generator-rt/generator_runtime/src/java/generator/runtime/automailer/VelocityMailRenderController.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VelocityMailRenderController.java 30 Mar 2010 02:46:36 -0000 1.1 --- VelocityMailRenderController.java 5 Apr 2010 02:31:42 -0000 1.2 *************** *** 44,52 **** */ public class VelocityMailRenderController extends Controller { ! private final Log log = LogManager.getLog(MailRenderController.class); public String execute(Map attributes) { String mailTemplateName = getFlowParameter("mailTemplate", null); - String dateFormat = getFlowParameter("dateFormat", "yyyy-MM-dd HH:mm:ss"); if (mailTemplateName == null) { --- 44,51 ---- */ public class VelocityMailRenderController extends Controller { ! private final Log log = LogManager.getLog(VelocityMailRenderController.class); public String execute(Map attributes) { String mailTemplateName = getFlowParameter("mailTemplate", null); if (mailTemplateName == null) { *************** *** 56,63 **** // Build the input context ! Map velocityAtts = new HashMap(attributes); ! velocityAtts.put("properties", getProperties()); ! velocityAtts.put("dateFormatter", new SimpleDateFormat(dateFormat)); ! velocityAtts.put("now", new Date()); log.debug("Rendering email contents with velocity"); --- 55,59 ---- // Build the input context ! Map velocityAtts = buildVelocityContext(attributes); log.debug("Rendering email contents with velocity"); *************** *** 73,76 **** --- 69,82 ---- } + protected Map buildVelocityContext(Map attributes) { + String dateFormat = getFlowParameter("dateFormat", "yyyy-MM-dd HH:mm:ss"); + + Map velocityAtts = new HashMap(attributes); + velocityAtts.put("properties", getProperties()); + velocityAtts.put("dateFormatter", new SimpleDateFormat(dateFormat)); + velocityAtts.put("now", new Date()); + return velocityAtts; + } + protected CachingTextProcessor getTextProcessor() { String textProcessorName = getFlowParameter("textProcessor", VelocityContextInitializer.ATTR_VELOCITY_ENGINE); |