details:   /erp/devel/pi/rev/05cdc556ab64
changeset: 13101:05cdc556ab64
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Tue Jul 05 13:42:54 2011 +0200
summary:   Related to issue 17789.
> The correct preference (regarding client, org, user and role) will be picked.
> Also fixed problem in case the decimal separator had more than one char.

diffstat:

 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
 |  25 ++++++---
 1 files changed, 17 insertions(+), 8 deletions(-)

diffs (55 lines):

diff -r 1f6a1644be3e -r 05cdc556ab64 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
--- 
a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
      Tue Jul 05 13:33:42 2011 +0200
+++ 
b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
      Tue Jul 05 13:42:54 2011 +0200
@@ -195,8 +195,10 @@
         }
         if ("csv".equals(exportAs)) {
           try {
-            String encoding = 
Preferences.getPreferenceValue("OBSERDS_CSVTextEncoding", true, null,
-                null, OBContext.getOBContext().getUser(), null, null);
+            String encoding = 
Preferences.getPreferenceValue("OBSERDS_CSVTextEncoding", true,
+                OBContext.getOBContext().getCurrentClient(), 
OBContext.getOBContext()
+                    .getCurrentOrganization(), 
OBContext.getOBContext().getUser(), OBContext
+                    .getOBContext().getRole(), null);
             response.setContentType("text/csv; charset=" + encoding);
           } catch (PropertyNotFoundException e) {
             // There is no preference for encoding, using standard one which 
works on Excel
@@ -254,15 +256,19 @@
         VariablesSecureApp vars = new VariablesSecureApp(request);
         try {
           prefDecimalSeparator = 
Preferences.getPreferenceValue("OBSERDS_CSVDecimalSeparator",
-              true, null, null, OBContext.getOBContext().getUser(), null, 
null);
+              true, OBContext.getOBContext().getCurrentClient(), 
OBContext.getOBContext()
+                  .getCurrentOrganization(), 
OBContext.getOBContext().getUser(), OBContext
+                  .getOBContext().getRole(), null);
         } catch (PropertyNotFoundException e) {
           // There is no preference for the decimal separator.
         }
         decimalSeparator = 
vars.getSessionValue("#DecimalSeparator|generalQtyEdition").substring(0,
             1);
         try {
-          fieldSeparator = 
Preferences.getPreferenceValue("OBSERDS_CSVFieldSeparator", true, null,
-              null, OBContext.getOBContext().getUser(), null, null);
+          fieldSeparator = 
Preferences.getPreferenceValue("OBSERDS_CSVFieldSeparator", true,
+              OBContext.getOBContext().getCurrentClient(), 
OBContext.getOBContext()
+                  .getCurrentOrganization(), 
OBContext.getOBContext().getUser(), OBContext
+                  .getOBContext().getRole(), null);
         } catch (PropertyNotFoundException e) {
           // There is no preference for the field separator. Using the default 
one.
           fieldSeparator = ",";
@@ -453,9 +459,12 @@
             } else {
               keyValue = format.format(new BigDecimal(keyValue.toString()));
               if (prefDecimalSeparator != null) {
-                keyValue = keyValue.toString().replace(
-                    format.getDecimalFormatSymbols().getDecimalSeparator(),
-                    prefDecimalSeparator.charAt(0));
+                keyValue = keyValue
+                    .toString()
+                    .replace(
+                        new 
Character(format.getDecimalFormatSymbols().getDecimalSeparator())
+                            .toString(),
+                        prefDecimalSeparator);
               }
 
             }

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to