svn commit: r1649615 - in /ofbiz/trunk/framework: base/src/org/ofbiz/base/util/UtilFormatOut.java webtools/webapp/webtools/entity/ListGeneric.ftl

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

svn commit: r1649615 - in /ofbiz/trunk/framework: base/src/org/ofbiz/base/util/UtilFormatOut.java webtools/webapp/webtools/entity/ListGeneric.ftl

adrianc
Author: adrianc
Date: Mon Jan  5 19:15:24 2015
New Revision: 1649615

URL: http://svn.apache.org/r1649615
Log:
Fix Web Tools FindGeneric screen so it can display byte-array field types.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java
    ofbiz/trunk/framework/webtools/webapp/webtools/entity/ListGeneric.ftl

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java?rev=1649615&r1=1649614&r2=1649615&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java Mon Jan  5 19:15:24 2015
@@ -354,10 +354,17 @@ public class UtilFormatOut {
      * @return The toString() of the passed Object if not null, otherwise an empty non-null String
      */
     public static String makeString(Object obj1) {
-        if (obj1 != null)
+        if (obj1 != null) {
+            if (obj1 instanceof byte[]) {
+                byte[] data = (byte[]) obj1;
+                if (data.length > 5120) {
+                    return "[...binary data]";
+                }
+                return new String(Base64.base64Encode(data));
+            }
             return obj1.toString();
-        else
-            return "";
+        }
+        return "";
     }
 
     /** Checks to see if the passed string is null, if it is returns an empty but non-null string.

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/entity/ListGeneric.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/entity/ListGeneric.ftl?rev=1649615&r1=1649614&r2=1649615&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/entity/ListGeneric.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/entity/ListGeneric.ftl Mon Jan  5 19:15:24 2015
@@ -38,7 +38,8 @@ under the License.
                         </#if>
                         </td>
                         <#list fieldList as field>
-                            <td>${record.fields.get(field.name)!?string}</td>
+                            <td>${Static["org.ofbiz.base.util.UtilFormatOut"].makeString(record.fields.get(field.name))}</td>
+                            <#-- <td>${record.fields.get(field.name)!?string}</td> -->
                         </#list>
                     </tr>
                     <#assign alt_row = !alt_row>