details:   /erp/devel/pi/rev/79f249b147b7
changeset: 12375:79f249b147b7
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue May 24 13:40:48 2011 +0200
summary:   fixed bug 14438: MMC: Typo in one the messages

details:   /erp/devel/pi/rev/dd0fc0ef1fd1
changeset: 12376:dd0fc0ef1fd1
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Tue May 24 13:43:32 2011 +0200
summary:   fixed bug 17019: Old search references where not usable in new grid 
and filter

diffstat:

 
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
 |  26 +++++++--
 src-db/database/sourcedata/AD_MESSAGE.xml                                      
             |   2 +-
 2 files changed, 20 insertions(+), 8 deletions(-)

diffs (95 lines):

diff -r f9c85dd122b0 -r dd0fc0ef1fd1 
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
--- 
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
       Tue May 24 11:46:51 2011 +0200
+++ 
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
       Tue May 24 13:43:32 2011 +0200
@@ -35,6 +35,7 @@
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
+import org.openbravo.base.model.domaintype.SearchDomainType;
 import org.openbravo.base.structure.IdentifierProvider;
 import org.openbravo.base.util.Check;
 import org.openbravo.client.kernel.RequestContext;
@@ -369,9 +370,7 @@
     if (fieldName.equals(JsonConstants.IDENTIFIER)
         || fieldName.endsWith("." + JsonConstants.IDENTIFIER)) {
       clause = computeLeftWhereClauseForIdentifier(property, fieldName, 
clause);
-    }
-
-    if (!property.isPrimitive()) {
+    } else if (!isPrimitive(property)) {
       clause = clause + ".id";
     }
 
@@ -404,7 +403,7 @@
       clause = alias;
     }
 
-    if (!property.isPrimitive()) {
+    if (!isPrimitive(property)) {
       // an in parameter use it...
       if 
(localValue.toString().contains(JsonConstants.IN_PARAMETER_SEPARATOR)) {
         final List<String> values = new ArrayList<String>();
@@ -434,7 +433,7 @@
       return value;
     }
     // a FK
-    if (!property.isPrimitive()) {
+    if (!isPrimitive(property)) {
       return value;
     }
     if (isLike(operator)) {
@@ -458,6 +457,10 @@
       return typedValues;
     }
 
+    if (property.getDomainType() instanceof SearchDomainType) {
+      return value;
+    }
+
     if (Boolean.class == property.getPrimitiveObjectType()) {
       return new Boolean(value.toString());
     } else if (property.isNumericType()) {
@@ -782,7 +785,7 @@
           // not supported ignoring it
           continue;
         }
-        if (!prop.isPrimitive()) {
+        if (!isPrimitive(prop)) {
           // get identifier properties from target entity
           // TODO: currently only supports one level, recursive
           // calls have the danger of infinite loops in case of
@@ -906,7 +909,7 @@
     // check if any new JoinDefinitions should be created
     for (int i = (joinedPropertyIndex + 1); i < props.size(); i++) {
       final Property prop = props.get(i);
-      if (prop.isPrimitive()) {
+      if (isPrimitive(prop)) {
         break;
       }
       // a joinable property
@@ -997,4 +1000,13 @@
   public void setCriteria(JSONObject criteria) {
     this.criteria = criteria;
   }
+
+  /**
+   * Returns whether current property is primitive, old selectors are treated 
as primitive for
+   * filtering purposes.
+   * 
+   */
+  private boolean isPrimitive(Property prop) {
+    return prop.isPrimitive() || prop.getDomainType() instanceof 
SearchDomainType;
+  }
 }
diff -r f9c85dd122b0 -r dd0fc0ef1fd1 src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Tue May 24 11:46:51 2011 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Tue May 24 13:43:32 2011 +0200
@@ -18335,7 +18335,7 @@
 <!--C535B71262404F3A846A3412824FBEBF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C535B71262404F3A846A3412824FBEBF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C535B71262404F3A846A3412824FBEBF-->  
<VALUE><![CDATA[CannotEnableNonSubscribedModules]]></VALUE>
-<!--C535B71262404F3A846A3412824FBEBF-->  <MSGTEXT><![CDATA[Cannot enable the 
following commercial modules because the current license do not include 
them]]></MSGTEXT>
+<!--C535B71262404F3A846A3412824FBEBF-->  <MSGTEXT><![CDATA[Cannot enable the 
following commercial modules because the current license does not include 
them]]></MSGTEXT>
 <!--C535B71262404F3A846A3412824FBEBF-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
 <!--C535B71262404F3A846A3412824FBEBF-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--C535B71262404F3A846A3412824FBEBF--></AD_MESSAGE>

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to