You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2008/09/30 15:06:43 UTC

svn commit: r700443 - in /ofbiz/trunk/applications/party: src/org/ofbiz/party/party/PartyServices.java webapp/partymgr/WEB-INF/actions/party/PartyFinancailHistory.groovy webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy

Author: jleroux
Date: Tue Sep 30 06:06:42 2008
New Revision: 700443

URL: http://svn.apache.org/viewvc?rev=700443&view=rev
Log:
Fix an issue with Upload CSV in "Address Match Map" Party menu (importAddressMatchMapCsv). I'm still unsure for what this is exactly used, anyone an idea (this would help me to translate ;o) ?
BTW I don't like much the way javascript is used there : when you clic in the file name field it automatically opens the file search dialog box. IMO this is redundant with the button at right of field and does not allow to retrieve previous file names entered and memorized by the browser.

+ Fix a typo in PartyFinancailHistory file name (from a Bruno Busco's msg in dev ML). Sorry for double issues committing, but I guess this last one will not be a problem...

Added:
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy   (props changed)
      - copied unchanged from r700374, ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancailHistory.groovy
Removed:
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancailHistory.groovy
Modified:
    ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=700443&r1=700442&r2=700443&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Tue Sep 30 06:06:42 2008
@@ -25,6 +25,8 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.nio.ByteBuffer; 
+import java.nio.charset.Charset;
 
 import javolution.util.FastList;
 import javolution.util.FastMap;
@@ -1615,8 +1617,9 @@
 
     public static Map<String, Object> importAddressMatchMapCsv(DispatchContext dctx, Map<String, ? extends Object> context) {
         GenericDelegator delegator = dctx.getDelegator();
-        byte[] fileBytes = (byte[]) context.get("uploadedFile");
-        String csvFile = new String(fileBytes);
+        ByteBuffer fileBytes = (ByteBuffer) context.get("uploadedFile");
+        String encoding = System.getProperty("file.encoding");
+        String csvFile = Charset.forName(encoding).decode(fileBytes).toString();
         csvFile = csvFile.replaceAll("\\r", "");
         String[] records = csvFile.split("\\n");
 

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain