OFBIZ-6277: Merge changes from r1675521 to Trunk:

Log:
============================================================
new Configuration() is deprecated; instead, the desired
freemarker version should be passed in.  To make it easier to control
the version centrally, add a helper method on FreeMarkerWorker that
wraps the instantiation of the Configuration object.
============================================================


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1731380 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Deepak Dixit
2016-02-20 12:01:23 +00:00
parent 0de44f32b9
commit 51cb141c5e
2 changed files with 6 additions and 2 deletions
@@ -88,8 +88,12 @@ public class FreeMarkerWorker {
return defaultOfbizWrapper;
}
public static Configuration newConfiguration() {
return new Configuration(version);
}
public static Configuration makeConfiguration(BeansWrapper wrapper) {
Configuration newConfig = new Configuration(version);
Configuration newConfig = newConfiguration();
newConfig.setObjectWrapper(wrapper);
TemplateHashModel staticModels = wrapper.getStaticModels();
@@ -376,7 +376,7 @@ public class EntitySaxReader implements javolution.xml.sax.ContentHandler, Error
Reader templateReader = new InputStreamReader(templateUrl.openStream());
StringWriter outWriter = new StringWriter();
Configuration config = new Configuration(FreeMarkerWorker.version);
Configuration config = FreeMarkerWorker.newConfiguration();
config.setObjectWrapper(FreeMarkerWorker.getDefaultOfbizWrapper());
config.setSetting("datetime_format", "yyyy-MM-dd HH:mm:ss.SSS");