[ofbiz-framework] branch trunk updated: Improved: Open FTL File from browser (OFBIZ-12018)

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

[ofbiz-framework] branch trunk updated: Improved: Open FTL File from browser (OFBIZ-12018)

James Yong-2
This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 582e6c6  Improved: Open FTL File from browser (OFBIZ-12018)
582e6c6 is described below

commit 582e6c6ac9929b77e2eb8b55864a549838863957
Author: James Yong <[hidden email]>
AuthorDate: Sat Oct 3 11:08:14 2020 +0800

    Improved: Open FTL File from browser (OFBIZ-12018)
   
    Comment + Rename method
---
 .../src/main/java/org/apache/ofbiz/common/CommonEvents.java       | 8 +++++++-
 .../src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java   | 2 +-
 .../src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java  | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java b/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
index b8b9a2e..20ddb6d 100644
--- a/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/CommonEvents.java
@@ -451,8 +451,14 @@ public class CommonEvents {
         return "success";
     }
 
+    /**
+     * Open the source file. Only when widget.dev.namedBorder=SOURCE
+     * @param request
+     * @param response
+     * @return
+     */
     public static String openSourceFile(HttpServletRequest request, HttpServletResponse response) {
-        ModelWidget.NamedBorderType namedBorderType = ModelWidget.widgetNamedBorderEnabled();
+        ModelWidget.NamedBorderType namedBorderType = ModelWidget.widgetNamedBorderType();
         if (namedBorderType == ModelWidget.NamedBorderType.SOURCE) {
             String sourceLocation = request.getParameter("sourceLocation");
             if (UtilValidate.isNotEmpty(sourceLocation) && sourceLocation.startsWith("component:")) {
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
index 8d9015d..65723ad 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
@@ -171,7 +171,7 @@ public class HtmlWidget extends ModelScreenWidget {
                 boolean insertWidgetNamedBorder = false;
                 NamedBorderType namedBorderType = null;
                 if (!location.endsWith(".fo.ftl")) {
-                    namedBorderType = ModelWidget.widgetNamedBorderEnabled();
+                    namedBorderType = ModelWidget.widgetNamedBorderType();
                     if (namedBorderType != NamedBorderType.NONE) {
                         insertWidgetNamedBorder = true;
                     }
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java
index 9393d7a..cdbe9aa 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelWidget.java
@@ -156,7 +156,7 @@ public abstract class ModelWidget implements Serializable {
      * determine how to display named border for development
      * @return NamedBorderType from <code>widget.dev.namedBorder</code> property
      */
-    public static NamedBorderType widgetNamedBorderEnabled() {
+    public static NamedBorderType widgetNamedBorderType() {
         return NamedBorderType.valueOf(UtilProperties.getPropertyValue("widget", "widget.dev.namedBorder", NamedBorderType.NONE.toString()));
     }
 }