[Generator-rt-devel] generator_runtime/src/java/generator/runtime/velocity VelocityProcessor.java,
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/velocity In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11801/src/java/generator/runtime/velocity Modified Files: VelocityProcessor.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: VelocityProcessor.java =================================================================== RCS file: /cvsroot/generator-rt/generator_runtime/src/java/generator/runtime/velocity/VelocityProcessor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** VelocityProcessor.java 21 Oct 2008 10:52:47 -0000 1.10 --- VelocityProcessor.java 5 Apr 2010 02:31:41 -0000 1.11 *************** *** 27,30 **** --- 27,31 ---- import java.io.Writer; import java.util.Map; + import java.util.Properties; import org.apache.velocity.Template; *************** *** 47,51 **** private final Log log = LogManager.getLog(VelocityProcessor.class); ! private static final String DEFAULT_BASE = "${application/@webroot}/WEB-INF/xsl/"; private VelocityEngine velocityEngine; --- 48,52 ---- private final Log log = LogManager.getLog(VelocityProcessor.class); ! private static final String DEFAULT_BASE = "${application/@webroot}/WEB-INF/velocity/"; private VelocityEngine velocityEngine; *************** *** 69,74 **** } ! public void initialize(ApplicationProperties props) { ! super.initialize(props); } --- 70,89 ---- } ! public void initialize(ApplicationProperties appProps) { ! super.initialize(appProps); ! this.velocityEngine = new VelocityEngine(); ! Properties props = new Properties(); ! String defaultEncoding = appProps.stringProperty("velocity/@encoding", ! appProps.stringProperty("application/@encoding", "")); ! if (defaultEncoding != null) { ! props.put(VelocityEngine.INPUT_ENCODING, defaultEncoding); ! } ! String basePath = appProps.stringProperty("velocity/@base", DEFAULT_BASE); ! props.put("file.resource.loader.path", basePath); ! try { ! this.velocityEngine.init(props); ! } catch (Exception err) { ! log.error("Error during velocity initialization", err); ! } } *************** *** 82,86 **** * @param stylesheetName The name of the stylesheet we need */ ! public void processTemplate(Writer out, Map attributes, String stylesheetName, String subTemplateName, String encoding, String forceOutputMethod) throws IOException { long startTime = System.currentTimeMillis(); --- 97,101 ---- * @param stylesheetName The name of the stylesheet we need */ ! public void processTemplate(Writer out, Map attributes, String stylesheetName, String subTemplateName, String encoding, String forceOutputMethod) throws IOException { long startTime = System.currentTimeMillis(); |