svn commit: r598362 - in /ofbiz/trunk/framework: base/config/debug.properties widget/config/widget.properties widget/src/org/ofbiz/widget/ModelWidget.java widget/src/org/ofbiz/widget/screen/ScreenWidgetViewHandler.java

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

svn commit: r598362 - in /ofbiz/trunk/framework: base/config/debug.properties widget/config/widget.properties widget/src/org/ofbiz/widget/ModelWidget.java widget/src/org/ofbiz/widget/screen/ScreenWidgetViewHandler.java

jleroux@apache.org
Author: jleroux
Date: Mon Nov 26 09:58:54 2007
New Revision: 598362

URL: http://svn.apache.org/viewvc?rev=598362&view=rev
Log:
A slightly modified patch from Adrian Crum "Enable HTML whitespace removal through debug.properties element" (https://issues.apache.org/jira/browse/OFBIZ-1420) - OFBIZ-1420
I finally uncommented the line widget.verbose=true in widget.properties and put an help in http://docs.ofbiz.org/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide#ApacheOFBizTechnicalProductionSetupGuide-Widgetssetting

Added:
    ofbiz/trunk/framework/widget/config/widget.properties   (with props)
Modified:
    ofbiz/trunk/framework/base/config/debug.properties
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidget.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenWidgetViewHandler.java

Modified: ofbiz/trunk/framework/base/config/debug.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/config/debug.properties?rev=598362&r1=598361&r2=598362&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/config/debug.properties (original)
+++ ofbiz/trunk/framework/base/config/debug.properties Mon Nov 26 09:58:54 2007
@@ -32,6 +32,3 @@
 print.warning=true
 print.error=true
 print.fatal=true
-
-# Enable screen widget boundary comments
-#widget.verbose=true

Added: ofbiz/trunk/framework/widget/config/widget.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/config/widget.properties?rev=598362&view=auto
==============================================================================
--- ofbiz/trunk/framework/widget/config/widget.properties (added)
+++ ofbiz/trunk/framework/widget/config/widget.properties Mon Nov 26 09:58:54 2007
@@ -0,0 +1,24 @@
+###############################################################################
+# 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.
+###############################################################################
+
+# Enable HTML whitespace compression
+#compress.HTML=true
+
+# Enable screen widget boundary comments
+widget.verbose=true

Propchange: ofbiz/trunk/framework/widget/config/widget.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/widget/config/widget.properties
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/widget/config/widget.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidget.java?rev=598362&r1=598361&r2=598362&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidget.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidget.java Mon Nov 26 09:58:54 2007
@@ -103,7 +103,7 @@
      * @param parameters Optional parameters Map
      */
     public static boolean widgetBoundaryCommentsEnabled(Map parameters) {
-        boolean result = "true".equals(UtilProperties.getPropertyValue("debug", "widget.verbose"));
+        boolean result = "true".equals(UtilProperties.getPropertyValue("widget", "widget.verbose"));
         if (!result && parameters != null) {
             result = "true".equals(parameters.get(enableBoundaryCommentsParam));
         }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenWidgetViewHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenWidgetViewHandler.java?rev=598362&r1=598361&r2=598362&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenWidgetViewHandler.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenWidgetViewHandler.java Mon Nov 26 09:58:54 2007
@@ -30,6 +30,8 @@
 
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilJ2eeCompat;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.template.FreeMarkerWorker;
 import org.ofbiz.webapp.view.ViewHandler;
 import org.ofbiz.webapp.view.ViewHandlerException;
@@ -76,8 +78,8 @@
             }
 
             // compress HTML output if configured to do so
-            String compressHTML = null;
-            if (this.servletContext != null) {
+            String compressHTML = UtilProperties.getPropertyValue("widget", "compress.HTML");
+            if (UtilValidate.isEmpty(compressHTML) && this.servletContext != null) {
                 compressHTML = (String) this.servletContext.getAttribute("compressHTML");
             }
             if ("true".equals(compressHTML)) {