You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2014/10/28 09:28:26 UTC

svn commit: r1634813 - /ofbiz/branches/json-integration-refactoring/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java

Author: jacopoc
Date: Tue Oct 28 08:28:25 2014
New Revision: 1634813

URL: http://svn.apache.org/r1634813
Log:
Removed no more used JSON method (forgot to remove in my last commit).

Modified:
    ofbiz/branches/json-integration-refactoring/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java

Modified: ofbiz/branches/json-integration-refactoring/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/json-integration-refactoring/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java?rev=1634813&r1=1634812&r2=1634813&view=diff
==============================================================================
--- ofbiz/branches/json-integration-refactoring/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java (original)
+++ ofbiz/branches/json-integration-refactoring/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java Tue Oct 28 08:28:25 2014
@@ -18,9 +18,6 @@
  *******************************************************************************/
 package org.ofbiz.humanres;
 
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -29,7 +26,6 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import javolution.util.FastMap;
-import net.sf.json.JSONObject;
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilValidate;
@@ -243,34 +239,4 @@ public class HumanResEvents {
         request.setAttribute("hrTree", categoryList);
         return "success";
     }
-    
-    @SuppressWarnings("unchecked")
-    public static void toJsonObjectList(List attrList, HttpServletResponse response){
-        String jsonStr = "[";
-        for (Object attrMap : attrList) {
-            JSONObject json = JSONObject.fromObject(attrMap);
-            jsonStr = jsonStr + json.toString() + ',';
-        }
-        jsonStr = jsonStr + "{ } ]";
-        if (UtilValidate.isEmpty(jsonStr)) {
-            Debug.logError("JSON Object was empty; fatal error!",module);
-        }
-        // set the X-JSON content type
-        response.setContentType("application/json");
-        // jsonStr.length is not reliable for unicode characters
-        try {
-            response.setContentLength(jsonStr.getBytes("UTF8").length);
-        } catch (UnsupportedEncodingException e) {
-            Debug.logError("Problems with Json encoding",module);
-        }
-        // return the JSON String
-        Writer out;
-        try {
-            out = response.getWriter();
-            out.write(jsonStr);
-            out.flush();
-        } catch (IOException e) {
-            Debug.logError("Unable to get response writer",module);
-        }
-    }
 }