Author: jacopoc
Date: Tue Jun 24 08:33:04 2014
New Revision: 1605029
URL: http://svn.apache.org/r1605029
Log:
Upgrade to the most recent version of Freemarker-2.3-gae: this is not an
official release yet but it will be soon; I have committed this work, as
discussed in the dev list, in order to get help from the community to test this
new improved version of Freemarker and provide feedback to the Freemarker
community.
Added:
ofbiz/trunk/framework/base/lib/freemarker-2.3-gae-d4ffa9e3727b83b95fd546591aa15dbad0118bd0.jar
(with props)
Removed:
ofbiz/trunk/framework/base/lib/freemarker-2.3.19-null-wildcards.jar
Modified:
ofbiz/trunk/.classpath
ofbiz/trunk/LICENSE
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
Modified: ofbiz/trunk/.classpath
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/.classpath?rev=1605029&r1=1605028&r2=1605029&view=diff
==============================================================================
--- ofbiz/trunk/.classpath (original)
+++ ofbiz/trunk/.classpath Tue Jun 24 08:33:04 2014
@@ -23,7 +23,7 @@
<classpathentry kind="lib"
path="framework/base/lib/clhm-release-1.0-lru.jar"/>
<classpathentry kind="lib" path="framework/base/lib/hamcrest-all-1.2.jar"/>
<classpathentry kind="lib" path="framework/base/lib/fop-1.1.jar"/>
- <classpathentry kind="lib"
path="framework/base/lib/freemarker-2.3.19-null-wildcards.jar"/>
+ <classpathentry kind="lib"
path="framework/base/lib/freemarker-2.3-gae-d4ffa9e3727b83b95fd546591aa15dbad0118bd0.jar"/>
<classpathentry kind="lib" path="framework/base/lib/httpclient-4.2.1.jar"/>
<classpathentry kind="lib"
path="framework/base/lib/httpclient-cache-4.2.1.jar"/>
<classpathentry kind="lib" path="framework/base/lib/httpcore-4.2.1.jar"/>
Modified: ofbiz/trunk/LICENSE
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=1605029&r1=1605028&r2=1605029&view=diff
==============================================================================
--- ofbiz/trunk/LICENSE (original)
+++ ofbiz/trunk/LICENSE Tue Jun 24 08:33:04 2014
@@ -444,7 +444,7 @@ BSD License:
applications/content/lib/dom4j-1.6.1.jar
framework/base/lib/antisamy-bin.1.2.jar
framework/base/lib/bsh-engine-modified.jar
-framework/base/lib/freemarker-2.3.19-null-wildcards.jar
+framework/base/lib/freemarker-2.3-gae-d4ffa9e3727b83b95fd546591aa15dbad0118bd0.jar
framework/base/lib/hamcrest-all-1.2.jar
framework/base/lib/httpunit-1.7.jar
framework/base/lib/ical4j-1.0-rc2.jar
Added:
ofbiz/trunk/framework/base/lib/freemarker-2.3-gae-d4ffa9e3727b83b95fd546591aa15dbad0118bd0.jar
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/lib/freemarker-2.3-gae-d4ffa9e3727b83b95fd546591aa15dbad0118bd0.jar?rev=1605029&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
ofbiz/trunk/framework/base/lib/freemarker-2.3-gae-d4ffa9e3727b83b95fd546591aa15dbad0118bd0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java?rev=1605029&r1=1605028&r2=1605029&view=diff
==============================================================================
---
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
(original)
+++
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
Tue Jun 24 08:33:04 2014
@@ -66,6 +66,7 @@ import freemarker.template.TemplateExcep
import freemarker.template.TemplateExceptionHandler;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import freemarker.template.Version;
/** FreeMarkerWorker - Freemarker Template Engine Utilities.
*
@@ -74,9 +75,11 @@ public class FreeMarkerWorker {
public static final String module = FreeMarkerWorker.class.getName();
+ public static final Version version = new Version(2, 3, 21);
+
// use soft references for this so that things from Content records don't
kill all of our memory, or maybe not for performance reasons... hmmm, leave to
config file...
private static final UtilCache<String, Template> cachedTemplates =
UtilCache.createUtilCache("template.ftl.general", 0, 0, false);
- private static final BeansWrapper defaultOfbizWrapper =
configureBeansWrapper(new BeansWrapper());
+ private static final BeansWrapper defaultOfbizWrapper =
configureBeansWrapper(new BeansWrapper(version));
private static final Configuration defaultOfbizConfig =
makeConfiguration(defaultOfbizWrapper);
public static BeansWrapper getDefaultOfbizWrapper() {
@@ -84,12 +87,11 @@ public class FreeMarkerWorker {
}
public static <T extends BeansWrapper> T configureBeansWrapper(T wrapper) {
- wrapper.setNullWildcards(true);
return wrapper;
}
public static Configuration makeConfiguration(BeansWrapper wrapper) {
- Configuration newConfig = new Configuration();
+ Configuration newConfig = new Configuration(version);
newConfig.setObjectWrapper(wrapper);
newConfig.setSharedVariable("Static", wrapper.getStaticModels());
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java?rev=1605029&r1=1605028&r2=1605029&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
(original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
Tue Jun 24 08:33:04 2014
@@ -49,6 +49,7 @@ import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import freemarker.template.Version;
/**
* Widget Library - Screen model HTML class.
@@ -58,10 +59,14 @@ public class HtmlWidget extends ModelScr
public static final String module = HtmlWidget.class.getName();
private static final UtilCache<String, Template> specialTemplateCache =
UtilCache.createUtilCache("widget.screen.template.ftl.general", 0, 0, false);
- protected static Configuration specialConfig =
FreeMarkerWorker.makeConfiguration(FreeMarkerWorker.configureBeansWrapper(new
ExtendedWrapper()));
+ protected static Configuration specialConfig =
FreeMarkerWorker.makeConfiguration(FreeMarkerWorker.configureBeansWrapper(new
ExtendedWrapper(FreeMarkerWorker.version)));
// not sure if this is the best way to get FTL to use my fancy MapModel
derivative, but should work at least...
public static class ExtendedWrapper extends BeansWrapper {
+ public ExtendedWrapper(Version version) {
+ super(version);
+ }
+
@SuppressWarnings("unchecked")
@Override
public TemplateModel wrap(Object object) throws TemplateModelException
{