ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaco...@apache.org
Subject svn commit: r739785 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
Date Sun, 01 Feb 2009 16:54:54 GMT
Author: jacopoc
Date: Sun Feb  1 16:54:53 2009
New Revision: 739785

URL: http://svn.apache.org/viewvc?rev=739785&view=rev
Log:
Modified two FreeMarkerWorker methods to return the Environment object; no functional change,
but this mode is required by the upcoming new screen renderer based on Freemarker macros.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java

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=739785&r1=739784&r2=739785&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 Sun
Feb  1 16:54:53 2009
@@ -162,7 +162,7 @@
         renderTemplate(template, context, outWriter);
     }
  
-    public static void renderTemplateFromString(String templateString, String templateLocation,
Map<String, Object> context, Appendable outWriter) throws TemplateException, IOException
{
+    public static Environment renderTemplateFromString(String templateString, String templateLocation,
Map<String, Object> context, Appendable outWriter) throws TemplateException, IOException
{
         Template template = cachedTemplates.get(templateLocation);
         if (template == null) {
             synchronized (cachedTemplates) {
@@ -176,7 +176,7 @@
             }
         }
         
-        renderTemplate(template, context, outWriter);
+        return renderTemplate(template, context, outWriter);
     }
  
     /**
@@ -185,7 +185,7 @@
      * @param context The context Map
      * @param outWriter The Writer to render to
      */
-    public static void renderTemplate(Template template, Map<String, Object> context,
Appendable outWriter) throws TemplateException, IOException {
+    public static Environment renderTemplate(Template template, Map<String, Object>
context, Appendable outWriter) throws TemplateException, IOException {
         // make sure there is no "null" string in there as FreeMarker will try to use it
         context.remove("null");
         // Since the template cache keeps a single instance of a Template that is shared
among users,
@@ -198,6 +198,7 @@
         Environment env = template.createProcessingEnvironment(context, (Writer)outWriter);
         applyUserSettings(env, context);
         env.process();
+        return env;
     }
     
     /**



Mime
View raw message