svn commit: r920115 - in /ofbiz/trunk/framework: base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java widget/config/freemarkerImports.properties

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r920115 - in /ofbiz/trunk/framework: base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java widget/config/freemarkerImports.properties

buscob
Author: buscob
Date: Sun Mar  7 21:11:16 2010
New Revision: 920115

URL: http://svn.apache.org/viewvc?rev=920115&view=rev
Log:
The widgets macros are now usable in the FTL files also.
Using these macros in FTL should improve code reuse and avoid having different HTML between widgets based screens and FTL based ones.
This has been developed in OFBIZ-3541.
Thank you Bilgin and Jacques for reviewing and improving the patch.

Added:
    ofbiz/trunk/framework/widget/config/freemarkerImports.properties
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=920115&r1=920114&r2=920115&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 Mar  7 21:11:16 2010
@@ -84,6 +84,7 @@
         newConfig.setLocalizedLookup(false);
         newConfig.setSharedVariable("StringUtil", new BeanModel(new StringUtil(), wrapper));
         newConfig.setTemplateLoader(new FlexibleTemplateLoader());
+        newConfig.setAutoImports(UtilProperties.getProperties("freemarkerImports"));
         try {
             newConfig.setSetting("datetime_format", "yyyy-MM-dd HH:mm:ss.SSS");
             newConfig.setSetting("number_format", "0.##########");

Added: ofbiz/trunk/framework/widget/config/freemarkerImports.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/config/freemarkerImports.properties?rev=920115&view=auto
==============================================================================
--- ofbiz/trunk/framework/widget/config/freemarkerImports.properties (added)
+++ ofbiz/trunk/framework/widget/config/freemarkerImports.properties Sun Mar  7 21:11:16 2010
@@ -0,0 +1,22 @@
+###############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+###############################################################################
+
+screenrenderer=component://widget/templates/htmlScreenMacroLibrary.ftl
+formrenderer=component://widget/templates/htmlFormMacroLibrary.ftl
+treerenderer=component://widget/templates/htmlTreeMacroLibrary.ftl