Issue 15751: Changed way of generating in-fields metadata
authorIván Perdomo <ivan.perdomo@openbravo.com>
Tue, 08 Mar 2011 17:37:32 +0100
changeset 11111 f86ffe5c4524
parent 11110 fb8d3320754b
child 11112 1e4f6fe09807
Issue 15751: Changed way of generating in-fields metadata
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/FKSearchUIDefinition.java
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/FKSearchUIDefinition.java	Tue Mar 08 16:51:39 2011 +0100
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/FKSearchUIDefinition.java	Tue Mar 08 17:37:32 2011 +0100
@@ -29,6 +29,7 @@
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.client.kernel.KernelUtils;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.data.Sqlc;
 import org.openbravo.model.ad.domain.ModelImplementation;
 import org.openbravo.model.ad.domain.ModelImplementationMapping;
 import org.openbravo.model.ad.domain.Reference;
@@ -119,21 +120,24 @@
         // TODO: warn
         return superJsonStr;
       }
-      final List<String> inFields = new ArrayList<String>();
+      final JSONArray inFields = new JSONArray();
       final List<String> outFields = new ArrayList<String>();
       for (SelectorColumn selectorColumn : selector.getADSelectorColumnList()) {
         if (selectorColumn.isActive()) {
-          String columnName = selectorColumn.getName()
+          String columnName = selectorColumn.getDBColumnName()
               + (selectorColumn.getSuffix() != null ? selectorColumn.getSuffix() : "");
-          columnName = "inp" + columnName;
+          columnName = "inp" + Sqlc.TransformaNombreColumna(columnName);
           if (selectorColumn.getColumnType().equals("I")) {
-            inFields.add(columnName);
+            JSONObject inField = new JSONObject();
+            inField.put("columnName", columnName);
+            inField.put("parameterName", "inp" + selectorColumn.getName());
+            inFields.put(inField);
           } else {
             outFields.add(columnName);
           }
         }
       }
-      json.put("inFields", new JSONArray(inFields));
+      json.put("inFields", inFields);
       json.put("outFields", new JSONArray(outFields));
 
       return json.toString();