svn commit: r1137206 - in /ofbiz/branches/release11.04: ./ applications/order/script/org/ofbiz/order/customer/ applications/party/webapp/partymgr/WEB-INF/actions/party/ applications/product/script/org/ofbiz/product/test/ framework/common/widget/ framew...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1137206 - in /ofbiz/branches/release11.04: ./ applications/order/script/org/ofbiz/order/customer/ applications/party/webapp/partymgr/WEB-INF/actions/party/ applications/product/script/org/ofbiz/product/test/ framework/common/widget/ framew...

jleroux@apache.org
Author: jleroux
Date: Sat Jun 18 15:40:46 2011
New Revision: 1137206

URL: http://svn.apache.org/viewvc?rev=1137206&view=rev
Log:
"Applied fix from trunk for revision: 1137201"
------------------------------------------------------------------------
r1137201 | jleroux | 2011-06-18 17:17:22 +0200 (sam., 18 juin 2011) | 21 lines

A patch from Leon "Trivial patch to ModelViewEntity class to make view entity able to handle entity condition between field from one entity and another" https://issues.apache.org/jira/browse/OFBIZ-4321


In view entity definition, we can use <condition-expr> to create a filter condition between field and some value using specific operator. It should be also possible to make condition between field and rel-field through some kind operator. Such as:

<view-entity entity-name="xxx" package-name="xxx">
        ...
        <entity-condition>
            <condition-expr entity-alias="A" field-name="a" operator="equals" rel-entity-alias="B" rel-field-name="b"  />
        </entity-condition>
    </view-entity>

But there's a trivial defect in current ModelViewEntity which prevent this case working.

} else if ( value == null && (operator.equals(EntityOperator.EQUALS) || operator.equals(EntityOperator.NOT_EQUAL))) {
                return EntityCondition.makeCondition(lhs, UtilGenerics.<EntityComparisonOperator<?,?>>cast(operator), null);
            } else {

In the above code extracted from ModelViewEntity, it does not consider the condition that the relField could be defined when value==null.

JLR:I checked that || should not be used in <<value == null && this.relFieldName>>, it was not obvious to me but is correct
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release11.04/   (props changed)
    ofbiz/branches/release11.04/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml   (props changed)
    ofbiz/branches/release11.04/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy   (props changed)
    ofbiz/branches/release11.04/applications/product/script/org/ofbiz/product/test/InventoryTests.xml   (props changed)
    ofbiz/branches/release11.04/framework/common/widget/HelpScreens.xml   (props changed)
    ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
    ofbiz/branches/release11.04/framework/security/data/PasswordSecurityData.xml   (props changed)
    ofbiz/branches/release11.04/specialpurpose/ebaystore/lib/   (props changed)
    ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy   (props changed)
    ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy   (props changed)
    ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy   (props changed)

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4:951708-952957
 /ofbiz/branches/jquery:952958-1044489
 /ofbiz/branches/multitenant20100310:921280-927264
-/ofbiz/trunk:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1133353,1134990,1135199,1135686,1135929
+/ofbiz/trunk:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1133353,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:951708-952957
 /ofbiz/branches/jquery/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:921280-927264
-/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:951708-952957
 /ofbiz/branches/jquery/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:921280-927264
-/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/applications/product/script/org/ofbiz/product/test/InventoryTests.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:951708-952957
 /ofbiz/branches/jquery/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:921280-927264
-/ofbiz/trunk/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/framework/common/widget/HelpScreens.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/framework/common/widget/HelpScreens.xml:951708-952957
 /ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/framework/common/widget/HelpScreens.xml:921280-927264
-/ofbiz/trunk/framework/common/widget/HelpScreens.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/framework/common/widget/HelpScreens.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Modified: ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java?rev=1137206&r1=1137205&r2=1137206&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java (original)
+++ ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java Sat Jun 18 15:40:46 2011
@@ -1300,7 +1300,7 @@ public class ModelViewEntity extends Mod
                             EntityOperator.OR,
                             EntityCondition.makeCondition(lhs, EntityOperator.EQUALS, null));
                 }
-            } else if ( value == null && (operator.equals(EntityOperator.EQUALS) || operator.equals(EntityOperator.NOT_EQUAL))) {
+            } else if ( value == null && this.relFieldName == null && (operator.equals(EntityOperator.EQUALS) || operator.equals(EntityOperator.NOT_EQUAL))) {
                 return EntityCondition.makeCondition(lhs, UtilGenerics.<EntityComparisonOperator<?,?>>cast(operator), null);
             } else {
                 if (ignoreCase) {

Propchange: ofbiz/branches/release11.04/framework/security/data/PasswordSecurityData.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/securityext/data/PasswordSecurityData.xml:951708-952957
 /ofbiz/branches/jquery/applications/securityext/data/PasswordSecurityData.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/securityext/data/PasswordSecurityData.xml:921280-927264
-/ofbiz/trunk/framework/security/data/PasswordSecurityData.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/framework/security/data/PasswordSecurityData.xml:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/specialpurpose/ebaystore/lib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/ebaystore/lib:951708-952957
 /ofbiz/branches/jquery/specialpurpose/ebaystore/lib:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/ebaystore/lib:921280-927264
-/ofbiz/trunk/specialpurpose/ebaystore/lib:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/specialpurpose/ebaystore/lib:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:951708-952957
 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:921280-927264
-/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:951708-952957
 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:921280-927264
-/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201

Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jun 18 15:40:46 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:951708-952957
 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:952958-1044489
 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:921280-927264
-/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929
+/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:1100197,1100880,1104423,1131144,1131396,1132496,1132749,1134990,1135199,1135686,1135929,1137201