svn commit: r1642661 [3/4] - in /ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./ applications/accounting/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/olap/ applications/accounting/servicedef/ appl...

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

svn commit: r1642661 [3/4] - in /ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23: ./ applications/accounting/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/olap/ applications/accounting/servicedef/ appl...

jleroux@apache.org
Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java Mon Dec  1 10:16:27 2014
@@ -46,7 +46,6 @@ import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.serialize.SerializeException;
 import org.ofbiz.entity.serialize.XmlSerializer;
 import org.ofbiz.entity.util.EntityQuery;
-import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
@@ -194,7 +193,7 @@ public class EbayStoreHelper {
                 Debug.logError("Require field partyId.",module);
                 return ebayCategoryId;
             }
-            productCategoryRoles = delegator.findByAnd("ProductCategoryRole", UtilMisc.toMap("productCategoryId", productCategoryId, "partyId", partyId, "roleTypeId", "EBAY_ACCOUNT"), null, false);
+            productCategoryRoles = EntityQuery.use(delegator).from("ProductCategoryRole").where("productCategoryId", productCategoryId, "partyId", partyId, "roleTypeId", "EBAY_ACCOUNT").queryList();
             if (productCategoryRoles != null && productCategoryRoles.size()>0) {
                 for (GenericValue productCategoryRole : productCategoryRoles) {
                     ebayCategoryId = productCategoryRole.getString("comments");
@@ -239,14 +238,14 @@ public class EbayStoreHelper {
                     break;
                 } else {
                     // check from child category level 1
-                    List<GenericValue> productCategoryRollupList = delegator.findByAnd("ProductCategoryRollup",  UtilMisc.toMap("parentProductCategoryId",catalogCategory.getString("productCategoryId")), null, false);
+                    List<GenericValue> productCategoryRollupList = EntityQuery.use(delegator).from("ProductCategoryRollup").where("parentProductCategoryId",catalogCategory.getString("productCategoryId")).queryList();
                     for (GenericValue productCategoryRollup : productCategoryRollupList) {
                         if (productCategoryRollup.containsValue(productCategoryId)) {
                             flag = true;
                             break;
                         } else {
                             // check from level 2
-                            List<GenericValue> prodCategoryRollupList = delegator.findByAnd("ProductCategoryRollup",  UtilMisc.toMap("parentProductCategoryId",productCategoryRollup.getString("productCategoryId")), null, false);
+                            List<GenericValue> prodCategoryRollupList = EntityQuery.use(delegator).from("ProductCategoryRollup").where("parentProductCategoryId",productCategoryRollup.getString("productCategoryId")).queryList();
                             for (GenericValue prodCategoryRollup : prodCategoryRollupList) {
                                 if (prodCategoryRollup.containsValue(productCategoryId)) {
                                     flag = true;
@@ -277,7 +276,7 @@ public class EbayStoreHelper {
             GenericValue ebayProductPref = EntityQuery.use(delegator).from("EbayProductStorePref").where("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId).queryOne();
             String jobId = ebayProductPref.getString("autoPrefJobId");
             if (UtilValidate.isNotEmpty(jobId)) {
-                List<GenericValue> jobs = delegator.findByAnd("JobSandbox", UtilMisc.toMap("parentJobId", jobId, "statusId", "SERVICE_PENDING"), null, false);
+                List<GenericValue> jobs = EntityQuery.use(delegator).from("JobSandbox").where("parentJobId", jobId, "statusId", "SERVICE_PENDING").queryList();
                 if (jobs.size() == 0) {
                     Map<String, Object>inMap = FastMap.newInstance();
                     inMap.put("jobId", jobId);
@@ -358,7 +357,7 @@ public class EbayStoreHelper {
         try {
             GenericValue ebayProductPref = EntityQuery.use(delegator).from("EbayProductStorePref").where("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId).queryOne();
             String jobId = ebayProductPref.getString("autoPrefJobId");
-            List<GenericValue> jobs = delegator.findByAnd("JobSandbox", UtilMisc.toMap("parentJobId", jobId ,"statusId", "SERVICE_PENDING"), null, false);
+            List<GenericValue> jobs = EntityQuery.use(delegator).from("JobSandbox").where("parentJobId", jobId ,"statusId", "SERVICE_PENDING").queryList();
 
             Map<String, Object>inMap = FastMap.newInstance();
             inMap.put("userLogin", userLogin);
@@ -471,7 +470,7 @@ public class EbayStoreHelper {
         HashMap<String, Object> attributeMapList = UtilGenerics.cast(context.get("attributeMapList"));
         String productListingId = (String) context.get("productListingId");
         try {
-           List<GenericValue> attributeToClears = delegator.findByAnd("EbayProductListingAttribute", UtilMisc.toMap("productListingId", productListingId), null, false);
+           List<GenericValue> attributeToClears = EntityQuery.use(delegator).from("EbayProductListingAttribute").where("productListingId", productListingId).queryList();
            for (int clearCount = 0; clearCount < attributeToClears.size(); clearCount++) {
               GenericValue valueToClear = attributeToClears.get(clearCount);
               if (valueToClear != null) {
@@ -496,7 +495,7 @@ public class EbayStoreHelper {
     public static ItemType prepareAddItem(Delegator delegator, GenericValue attribute) {
         ItemType item = new ItemType();
         try {
-            List<GenericValue> attrs = delegator.findByAnd("EbayProductListingAttribute", UtilMisc.toMap("productListingId", attribute.getString("productListingId")), null, false);
+            List<GenericValue> attrs = EntityQuery.use(delegator).from("EbayProductListingAttribute").where("productListingId", attribute.getString("productListingId")).queryList();
             AmountType amount = new AmountType();
             AmountType shippingServiceCost = new AmountType();
             PictureDetailsType picture = new PictureDetailsType();
@@ -718,7 +717,7 @@ public class EbayStoreHelper {
     public static boolean isReserveInventory(Delegator delegator, String productId, String productStoreId) {
         boolean isReserve = false;
         try {
-            GenericValue ebayProductStore = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("EbayProductStoreInventory", UtilMisc.toMap("productStoreId", productStoreId, "productId", productId), null, false)));
+            GenericValue ebayProductStore = EntityQuery.use(delegator).from("EbayProductStoreInventory").where("productStoreId", productStoreId, "productId", productId).filterByDate().queryFirst();
             if (UtilValidate.isNotEmpty(ebayProductStore)) {
                 BigDecimal atp = ebayProductStore.getBigDecimal("availableToPromiseListing");
                 int intAtp = atp.intValue();

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java Mon Dec  1 10:16:27 2014
@@ -386,7 +386,7 @@ public class EbayStoreInventoryServices
 
         try {
             if (context.get("productStoreId") != null && context.get("facilityId") != null) {
-                ebayProductStoreInventoryList = delegator.findByAnd("EbayProductStoreInventory", UtilMisc.toMap("facilityId",(String)context.get("facilityId"),"productStoreId",(String)context.get("productStoreId")), null, false);
+                ebayProductStoreInventoryList = EntityQuery.use(delegator).from("EbayProductStoreInventory").where("facilityId",(String)context.get("facilityId"),"productStoreId",(String)context.get("productStoreId")).queryList();
                 for (GenericValue ebayProductStoreInventory : ebayProductStoreInventoryList) {
                     if (ebayProductStoreInventory.get("ebayProductId") != null) {
                         dispatcher.runSync("updateEbayInventoryStatusByProductId", UtilMisc.toMap("productStoreId", (String)context.get("productStoreId"), "facilityId", (String)context.get("facilityId"), "folderId", ebayProductStoreInventory.get("folderId"), "productId", ebayProductStoreInventory.get("productId"), "ebayProductId", ebayProductStoreInventory.get("ebayProductId"), "userLogin", context.get("userLogin")));

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java Mon Dec  1 10:16:27 2014
@@ -35,7 +35,6 @@ import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilGenerics;
-import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.ebay.EbayHelper;
@@ -213,7 +212,7 @@ public class EbayStoreOrder {
                 String contactMechId = "";
                 GenericValue partyAttribute = null;
                 if (UtilValidate.isNotEmpty(context.get("eiasTokenBuyer").toString())) {
-                    partyAttribute = EntityUtil.getFirst(delegator.findByAnd("PartyAttribute", UtilMisc.toMap("attrValue", context.get("eiasTokenBuyer").toString()), null, false));
+                    partyAttribute = EntityQuery.use(delegator).from("PartyAttribute").where("attrValue", context.get("eiasTokenBuyer").toString()).queryFirst();
                 }
 
                 // if we get a party, check its contact information.
@@ -444,7 +443,7 @@ public class EbayStoreOrder {
             // If matching party not found then try to find partyId from PartyAttribute entity.
             GenericValue partyAttribute = null;
             if (UtilValidate.isNotEmpty(context.get("eiasTokenBuyer"))) {
-                partyAttribute = EntityUtil.getFirst(delegator.findByAnd("PartyAttribute", UtilMisc.toMap("attrValue", (String) context.get("eiasTokenBuyer")), null, false));
+                partyAttribute = EntityQuery.use(delegator).from("PartyAttribute").where("attrValue", (String) context.get("eiasTokenBuyer")).queryFirst();
                 if (UtilValidate.isNotEmpty(partyAttribute)) {
                     partyId = (String) partyAttribute.get("partyId");
                 }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ecommerce/data/DemoShipping.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ecommerce/data/DemoShipping.xml?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ecommerce/data/DemoShipping.xml (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ecommerce/data/DemoShipping.xml Mon Dec  1 10:16:27 2014
@@ -32,54 +32,143 @@ under the License.
     <PartyRole partyId="USPS" roleTypeId="CARRIER"/>
     <PartyRole partyId="UPS" roleTypeId="CARRIER"/>
     <PartyRole partyId="DHL" roleTypeId="CARRIER"/>
+    <PartyRole partyId="FEDEX" roleTypeId="CARRIER"/>
+
     <PartyRole partyId="Company" roleTypeId="CARRIER"/>
     <PartyRole partyId="_NA_" roleTypeId="CARRIER"/>
-    <PartyRole partyId="FEDEX" roleTypeId="CARRIER"/>
 
     <ShipmentMethodType description="No Shipping" shipmentMethodTypeId="NO_SHIPPING"/>
     <ShipmentMethodType description="Local Delivery" shipmentMethodTypeId="LOCAL_DELIVERY"/>
-    <ShipmentMethodType description="Ground Home Delivery" shipmentMethodTypeId="GROUND_HOME"/>
-    <ShipmentMethodType description="Ground" shipmentMethodTypeId="GROUND"/>
-    <ShipmentMethodType description="Standard" shipmentMethodTypeId="STANDARD"/>
+
+    <ShipmentMethodType description="Next Morning" shipmentMethodTypeId="NEXT_AM"/>
+    <ShipmentMethodType description="Next Afternoon" shipmentMethodTypeId="NEXT_PM"/>
+    <ShipmentMethodType description="Same Day" shipmentMethodTypeId="SAME_DAY"/>
+    <ShipmentMethodType description="Guaranteed Next Day" shipmentMethodTypeId="NEXT_DAY"/>
     <ShipmentMethodType description="Air" shipmentMethodTypeId="AIR"/>
     <ShipmentMethodType description="Third Day" shipmentMethodTypeId="THIRD_DAY"/>
-    <ShipmentMethodType description="Second Day" shipmentMethodTypeId="SECOND_DAY"/>
-    <ShipmentMethodType description="Guaranteed Next Day" shipmentMethodTypeId="NEXT_DAY"/>
-    <ShipmentMethodType description="Next Afternoon" shipmentMethodTypeId="NEXT_PM"/>
-    <ShipmentMethodType description="Next Morning" shipmentMethodTypeId="NEXT_AM"/>
-    <ShipmentMethodType description="Express" shipmentMethodTypeId="EXPRESS"/>
-    <ShipmentMethodType description="Standard Overnight" shipmentMethodTypeId="ST_OVERNIGHT"/>
+    <ShipmentMethodType description="International Express" shipmentMethodTypeId="INT_EXPRESS"/>
+
     <ShipmentMethodType description="Priority Overnight" shipmentMethodTypeId="PR_OVERNIGHT"/>
+    <ShipmentMethodType description="Standard Overnight" shipmentMethodTypeId="ST_OVERNIGHT"/>
     <ShipmentMethodType description="First Overnight" shipmentMethodTypeId="FI_OVERNIGHT"/>
-    <ShipmentMethodType description="Same Day" shipmentMethodTypeId="SAME_DAY"/>
-    <ShipmentMethodType description="International Express" shipmentMethodTypeId="INT_EXPRESS"/>
+    <ShipmentMethodType description="Second Day" shipmentMethodTypeId="SECOND_DAY"/>
+    <ShipmentMethodType description="Express Saver" shipmentMethodTypeId="EXPRESS_SAVER"/>
+    <ShipmentMethodType description="International Priority" shipmentMethodTypeId="INTERNAT_PRI"/>
+    <ShipmentMethodType description="International Economy" shipmentMethodTypeId="INTERNAT_ECON"/>
+    <ShipmentMethodType description="International First" shipmentMethodTypeId="INTERNAT_FI"/>
+    <ShipmentMethodType description="1Day Freight" shipmentMethodTypeId="FIRST_DAY_FR"/>
+    <ShipmentMethodType description="2Day Freight" shipmentMethodTypeId="SECOND_DAY_FR"/>
+    <ShipmentMethodType description="3Day Freight" shipmentMethodTypeId="THIRD_DAY_FR"/>
+    <ShipmentMethodType description="Ground" shipmentMethodTypeId="GROUND"/>
+    <ShipmentMethodType description="Ground Home Delivery" shipmentMethodTypeId="GROUND_HOME"/>
+    <ShipmentMethodType description="International Economy Freight" shipmentMethodTypeId="INTERNAT_ECON_FR"/>
+    <ShipmentMethodType description="International Priority Freight" shipmentMethodTypeId="INTERNAT_PRI_FR"/>
+    <ShipmentMethodType description="2Day AM" shipmentMethodTypeId="SECOND_DAY_AM"/>
+    <ShipmentMethodType description="Europe First Priority" shipmentMethodTypeId="EUROPE_FI_PRIORITY"/>
+    <ShipmentMethodType description="Smart Post" shipmentMethodTypeId="SMART_POST"/>
+    <ShipmentMethodType description="Fedex National Freight" shipmentMethodTypeId="FEDEX_NATIONAL_FR"/>
+    <ShipmentMethodType description="Fedex International Ground " shipmentMethodTypeId="FEDEX_INT_GROUND"/>
+    <ShipmentMethodType description="Fedex Freight" shipmentMethodTypeId="FEDEX_FREIGHT"/>
 
+    <ShipmentMethodType description="Standard" shipmentMethodTypeId="STANDARD"/>
+    <ShipmentMethodType description="Three-Day Select" shipmentMethodTypeId="THIRD_DAY_AIR_SEL"/>
+    <ShipmentMethodType description="Second Day Air" shipmentMethodTypeId="SECOND_DAY_AIR"/>
+    <ShipmentMethodType description="Second Day Air Early A.M.  " shipmentMethodTypeId="SECOND_DAY_AIR_AM"/>
+    <ShipmentMethodType description="Next Day Air Saver" shipmentMethodTypeId="NEXT_DAY_AIR_SA"/>
+    <ShipmentMethodType description="Next Day Air" shipmentMethodTypeId="NEXT_DAY_AIR"/>
+    <ShipmentMethodType description="Next Day Air Early A.M." shipmentMethodTypeId="NEXT_DAY_AIR_AM"/>
+    <ShipmentMethodType description="Worldwide ExpressSM" shipmentMethodTypeId="WORLDWIDE_EXPRESS"/>
+    <ShipmentMethodType description="Worldwide Express Plus" shipmentMethodTypeId="WORLDWIDE_EXPR_PLUS"/>
+    <ShipmentMethodType description="Worldwide ExpeditedSM" shipmentMethodTypeId="WORLDWIDE_EXPEDITED"/>
+    <ShipmentMethodType description="Saver" shipmentMethodTypeId="SAVER"/>
+
+    <ShipmentMethodType description="First Class" shipmentMethodTypeId="FIRST_CLASS"/>
+    <ShipmentMethodType description="First Class International" shipmentMethodTypeId="FC_INTERNATIONAL"/>
+    <ShipmentMethodType description="Priority" shipmentMethodTypeId="PRIORITY"/>
+    <ShipmentMethodType description="Priority International" shipmentMethodTypeId="PR_INTERNATIONAL"/>
+    <ShipmentMethodType description="Express" shipmentMethodTypeId="EXPRESS"/>
+    <ShipmentMethodType description="Express International" shipmentMethodTypeId="EXP_INTERNATIONAL"/>
+    <ShipmentMethodType description="Media Mail" shipmentMethodTypeId="MEDIA_MAIL"/>
+    <ShipmentMethodType description="Standard Post" shipmentMethodTypeId="STANDARD_POST"/>
+    <ShipmentMethodType description="Library" shipmentMethodTypeId="LIBRARY"/>
+
+    <ShipmentMethodType description="Express Saturday" shipmentMethodTypeId="EXP_SATURDAY"/>
+    <ShipmentMethodType description="Express 10.30 AM" shipmentMethodTypeId="EXP_10_30_AM"/>
+
+    <!-- Local options -->
     <CarrierShipmentMethod partyId="Company" roleTypeId="CARRIER" shipmentMethodTypeId="LOCAL_DELIVERY" sequenceNumber="4"/>
+    <CarrierShipmentMethod partyId="_NA_" roleTypeId="CARRIER" shipmentMethodTypeId="STANDARD" sequenceNumber="5"/>
+    <CarrierShipmentMethod partyId="_NA_" roleTypeId="CARRIER" shipmentMethodTypeId="NO_SHIPPING" sequenceNumber="5"/>
+
+    <!-- Fedex shipping options -->
+    <CarrierShipmentMethod shipmentMethodTypeId="PR_OVERNIGHT" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="01" carrierServiceCode="PRIORITYOVERNIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="ST_OVERNIGHT" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="02" carrierServiceCode="STANDARDOVERNIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="FI_OVERNIGHT" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="03" carrierServiceCode="FIRSTOVERNIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="SECOND_DAY" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="04" carrierServiceCode="FEDEX2DAY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="EXPRESS_SAVER" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="05" carrierServiceCode="FEDEXEXPRESSSAVER"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="FIRST_DAY_FR" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="06" carrierServiceCode="FEDEX1DAYFREIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="SECOND_DAY_FR" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="07" carrierServiceCode="FEDEX2DAYFREIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="THIRD_DAY_FR" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="08" carrierServiceCode="FEDEX3DAYFREIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="GROUND" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="09" carrierServiceCode="FEDEXGROUND"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="GROUND_HOME" partyId="FEDEX" roleTypeId="CARRIER"  sequenceNumber="10" carrierServiceCode="GROUNDHOMEDELIVERY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="SECOND_DAY_AM" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="11" carrierServiceCode="SECONDDAYAM"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="SMART_POST" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="12" carrierServiceCode="SMARTPOST"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="FEDEX_NATIONAL_FR" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="13" carrierServiceCode="FEDEXNATIONALFREIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="FEDEX_FREIGHT" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="14" carrierServiceCode="FEDEXFREIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="FEDEX_INT_GROUND" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="15" carrierServiceCode="INTERNATIONALGROUND"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="INTERNAT_PRI" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="16" carrierServiceCode="INTERNATIONALPRIORITY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="INTERNAT_ECON" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="17" carrierServiceCode="INTERNATIONALECONOMY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="INTERNAT_FI" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="18" carrierServiceCode="INTERNATIONALFIRST"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="INTERNAT_ECON_FR" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="19" carrierServiceCode="INTERNATIONALECONOMYFREIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="INTERNAT_PRI_FR" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="20" carrierServiceCode="INTERNATIONALPRIORITYFREIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="EUROPE_FI_PRIORITY" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="21" carrierServiceCode="EUROPEFIRSTINTERNATIONALPRIORITY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="NEXT_AM" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="22" carrierServiceCode="FIRSTOVERNIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="NEXT_PM" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="23" carrierServiceCode="STANDARDOVERNIGHT"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="SAME_DAY" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="24" carrierServiceCode="SAMEDAY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="NEXT_DAY" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="25" carrierServiceCode="PRIORITYOVERNIGHT"/>
+
+    <!-- UPS shipping options -->
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="STANDARD" sequenceNumber="01" carrierServiceCode="11"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="THIRD_DAY_AIR_SEL" sequenceNumber="02" carrierServiceCode="12"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY_AIR" sequenceNumber="03" carrierServiceCode="02"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY_AIR_AM" sequenceNumber="04" carrierServiceCode="59"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_DAY_AIR_SA" sequenceNumber="05" carrierServiceCode="13"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_DAY_AIR" sequenceNumber="06" carrierServiceCode="01"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_DAY_AIR_AM" sequenceNumber="07" carrierServiceCode="14"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="WORLDWIDE_EXPRESS" sequenceNumber="08" carrierServiceCode="07"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="WORLDWIDE_EXPR_PLUS" sequenceNumber="09" carrierServiceCode="54"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="WORLDWIDE_EXPEDITED" sequenceNumber="10" carrierServiceCode="08"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="SAVER" sequenceNumber="11" carrierServiceCode="65"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="12" carrierServiceCode="03"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="AIR" sequenceNumber="13" carrierServiceCode="02"/>
+    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="THIRD_DAY" sequenceNumber="14" carrierServiceCode="THIRDDAY"/>
+    <!-- End of UPS Data -->
+
+    <!-- USPS Data -->
     <!-- For USPS, only certain container types are allowed for rate estimates of Priority or Express service codes -->
     <CarrierShipmentMethod partyId="USPS" roleTypeId="CARRIER" shipmentMethodTypeId="STANDARD" sequenceNumber="7" carrierServiceCode="Parcel"/>
-    <CarrierShipmentMethod partyId="USPS" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" sequenceNumber="6" carrierServiceCode="Express"/>
-    <CarrierShipmentMethod partyId="USPS" roleTypeId="CARRIER" shipmentMethodTypeId="INT_EXPRESS" sequenceNumber="8" carrierServiceCode="INTEXPRESS"/>
-    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="4" carrierServiceCode="03"/>
-    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="THIRD_DAY" sequenceNumber="3" carrierServiceCode="THIRDDAY"/>
-    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY" sequenceNumber="2" carrierServiceCode="02"/>
-    <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_DAY" sequenceNumber="1" carrierServiceCode="01"/>
-    <CarrierShipmentMethod partyId="_NA_" roleTypeId="CARRIER" shipmentMethodTypeId="STANDARD" sequenceNumber="5"/>
-    <CarrierShipmentMethod partyId="_NA_" roleTypeId="CARRIER" shipmentMethodTypeId="NO_SHIPPING" sequenceNumber="8"/>
-    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" sequenceNumber="9" carrierServiceCode="E"/>
-    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_PM" sequenceNumber="10" carrierServiceCode="N"/>
-    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY" sequenceNumber="11" carrierServiceCode="S"/>
-    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="12" carrierServiceCode="G"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="SAME_DAY" sequenceNumber="12" carrierServiceCode="SAMEDAY"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_AM" sequenceNumber="13" carrierServiceCode="FIRSTOVERNIGHT"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="FI_OVERNIGHT" sequenceNumber="13" carrierServiceCode="FIRSTOVERNIGHT"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_DAY" sequenceNumber="14" carrierServiceCode="PRIORITYOVERNIGHT"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="PR_OVERNIGHT" sequenceNumber="14" carrierServiceCode="PRIORITYOVERNIGHT"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_PM" sequenceNumber="15" carrierServiceCode="STANDARDOVERNIGHT"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="ST_OVERNIGHT" sequenceNumber="15" carrierServiceCode="STANDARDOVERNIGHT"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY" sequenceNumber="16" carrierServiceCode="FEDEX2DAY"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" sequenceNumber="17" carrierServiceCode="FEDEXEXPRESSSAVER"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="18" carrierServiceCode="FEDEXGROUND"/>
-    <CarrierShipmentMethod partyId="FEDEX" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND_HOME" sequenceNumber="19" carrierServiceCode="GROUNDHOMEDELIVERY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="FIRST_CLASS" partyId="USPS" roleTypeId="CARRIER" sequenceNumber="01" carrierServiceCode="FIRST CLASS"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="FC_INTERNATIONAL" partyId="USPS" roleTypeId="CARRIER" sequenceNumber="02" carrierServiceCode="FIRST CLASS"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="PRIORITY" partyId="USPS" roleTypeId="CARRIER" sequenceNumber="03" carrierServiceCode="PRIORITY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="PR_INTERNATIONAL" partyId="USPS" roleTypeId="CARRIER" sequenceNumber="04" carrierServiceCode="PRIORITY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="EXPRESS" partyId="USPS" roleTypeId="CARRIER" sequenceNumber="05" carrierServiceCode="EXPRESS"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="EXP_INTERNATIONAL" partyId="USPS" roleTypeId="CARRIER" sequenceNumber="06" carrierServiceCode="EXPRESS"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="MEDIA_MAIL" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="07" carrierServiceCode="MEDIA"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="STANDARD_POST" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="08" carrierServiceCode="STANDARD POST"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="LIBRARY" partyId="FEDEX" roleTypeId="CARRIER" sequenceNumber="09" carrierServiceCode="LIBRARY"/>
+    <CarrierShipmentMethod shipmentMethodTypeId="INT_EXPRESS" partyId="USPS" roleTypeId="CARRIER" sequenceNumber="10" carrierServiceCode="INTEXPRESS"/>
+
+    <!-- End of USPS Data-->
+
+    <!-- DHL shipping options -->
+    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="INT_EXPRESS" sequenceNumber="1" carrierServiceCode="IE"/>
+    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="EXP_SATURDAY" sequenceNumber="2" carrierServiceCode="E SAT"/>
+    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="EXP_10_30_AM" sequenceNumber="3" carrierServiceCode="E 10.30 AM"/>
+    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" sequenceNumber="4" carrierServiceCode="E"/>
+    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_PM" sequenceNumber="5" carrierServiceCode="N"/>
+    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY" sequenceNumber="6" carrierServiceCode="S"/>
+    <CarrierShipmentMethod partyId="DHL" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="7" carrierServiceCode="G"/>
+    <!-- End of DHL Data-->
 
     <ProductStoreShipmentMeth productStoreShipMethId="9000" productStoreId="9000" partyId="_NA_" includeNoChargeItems="Y" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="NO_SHIPPING" sequenceNumber="6"/>
     <ProductStoreShipmentMeth productStoreShipMethId="9001" productStoreId="9000" partyId="UPS" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="3"/>
@@ -95,7 +184,7 @@ under the License.
     <ProductStoreShipmentMeth productStoreShipMethId="9011" productStoreId="9000" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_DAY" sequenceNumber="12"/>
     <ProductStoreShipmentMeth productStoreShipMethId="9012" productStoreId="9000" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="NEXT_PM" sequenceNumber="13"/>
     <ProductStoreShipmentMeth productStoreShipMethId="9013" productStoreId="9000" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="SECOND_DAY" sequenceNumber="14"/>
-    <ProductStoreShipmentMeth productStoreShipMethId="9014" productStoreId="9000" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" sequenceNumber="15"/>
+    <ProductStoreShipmentMeth productStoreShipMethId="9014" productStoreId="9000" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS_SAVER" sequenceNumber="15"/>
     <ProductStoreShipmentMeth productStoreShipMethId="9015" productStoreId="9000" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="16"/>
     <ProductStoreShipmentMeth productStoreShipMethId="9016" productStoreId="9000" partyId="FEDEX" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND_HOME" sequenceNumber="17"/>
 
@@ -124,7 +213,7 @@ under the License.
     <ShipmentCostEstimate productStoreShipMethId="9011" productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9204" shipmentMethodTypeId="NEXT_DAY" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/>
     <ShipmentCostEstimate productStoreShipMethId="9012" productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9205" shipmentMethodTypeId="NEXT_PM" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/>
     <ShipmentCostEstimate productStoreShipMethId="9013" productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9206" shipmentMethodTypeId="SECOND_DAY" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/>
-    <ShipmentCostEstimate productStoreShipMethId="9014" productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9207" shipmentMethodTypeId="EXPRESS" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/>
+    <ShipmentCostEstimate productStoreShipMethId="9014" productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9207" shipmentMethodTypeId="EXPRESS_SAVER" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/>
     <ShipmentCostEstimate productStoreShipMethId="9015" productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9208" shipmentMethodTypeId="GROUND" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/>
     <ShipmentCostEstimate productStoreShipMethId="9016" productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9209" shipmentMethodTypeId="GROUND_HOME" carrierPartyId="FEDEX" carrierRoleTypeId="CARRIER"/>
                           

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java Mon Dec  1 10:16:27 2014
@@ -398,7 +398,7 @@ public class ProductsExportToGoogle {
                 return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.invalidCountryCode", locale));
             }
             // Get the list of products to be exported to Google Base
-            List<GenericValue> productsList  = delegator.findList("Product", EntityCondition.makeCondition("productId", EntityOperator.IN, selectResult), null, null, null, false);
+            List<GenericValue> productsList  = EntityQuery.use(delegator).from("Product").where(EntityCondition.makeCondition("productId", EntityOperator.IN, selectResult)).queryList();
 
             // Get the tracking code
             if (UtilValidate.isEmpty(trackingCodeId) || "_NA_".equals(trackingCodeId)) {
@@ -433,7 +433,7 @@ public class ProductsExportToGoogle {
                 String productName = null;
                 String productDescription = null;
                 //String productURL = null;
-                List<GenericValue> productAndInfos = delegator.findByAnd("ProductContentAndInfo", UtilMisc.toMap("productId", prod.getString("productId"), "localeString", localeString, "thruDate", null), null, false);
+                List<GenericValue> productAndInfos = EntityQuery.use(delegator).from("ProductContentAndInfo").where("productId", prod.getString("productId"), "localeString", localeString, "thruDate", null).queryList();
                 if (productAndInfos.size() > 0) {
                     for (GenericValue productContentAndInfo : productAndInfos ) {
                         String dataReSourceId = productContentAndInfo.getString("dataResourceId");
@@ -548,7 +548,7 @@ public class ProductsExportToGoogle {
                 // item_type is the categories in which your product should belong.
                 UtilXml.addChildElementNSValue(entryElem, "g:item_type", "products", feedDocument, googleBaseNSUrl);
 
-                List<GenericValue> productCategoryMembers = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition("productId", EntityOperator.EQUALS, prod.getString("productId")), null, UtilMisc.toList("productCategoryId"), null, false);
+                List<GenericValue> productCategoryMembers = EntityQuery.use(delegator).from("ProductCategoryMember").where("productId", prod.getString("productId")).orderBy("productCategoryId").queryList();
 
                 Iterator<GenericValue> productCategoryMembersIter = productCategoryMembers.iterator();
                 while (productCategoryMembersIter.hasNext()) {
@@ -758,7 +758,7 @@ public class ProductsExportToGoogle {
             }
             
             //Add quantity item
-            List<GenericValue> inventoryItems = delegator.findByAnd("InventoryItem", UtilMisc.toMap("productId", product.getString("productId")), null, false);
+            List<GenericValue> inventoryItems = EntityQuery.use(delegator).from("InventoryItem").where("productId", product.getString("productId")).queryList();
             if (UtilValidate.isNotEmpty(inventoryItems)) {
                 BigDecimal totalquantity = new BigDecimal(0);
                 for (GenericValue inventoryItem : inventoryItems) {
@@ -780,7 +780,7 @@ public class ProductsExportToGoogle {
                 String shippingWeight = product.getString("weight") + " " + uom.getString("description");
                 UtilXml.addChildElementNSValue(entryElem, "g:shipping_weight", shippingWeight, feedDocument, googleBaseNSUrl);
             }
-            List<GenericValue> productFeatureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", UtilMisc.toMap("productId", product.getString("productId")), null, false);
+            List<GenericValue> productFeatureAndAppls = EntityQuery.use(delegator).from("ProductFeatureAndAppl").where("productId", product.getString("productId")).queryList();
             if (productFeatureAndAppls.size() > 0) {
                 for (GenericValue productFeatureAndAppl : productFeatureAndAppls) {
                     //Add Genre

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java Mon Dec  1 10:16:27 2014
@@ -97,8 +97,7 @@ public class GoogleCheckoutHelper {
         String externalId = info.getGoogleOrderNumber();
         GenericValue order = null;
         try {
-            List<GenericValue> orders = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId, "salesChannelEnumId" , SALES_CHANNEL), null, false);
-            order = EntityUtil.getFirst(orders);
+            order = EntityQuery.use(delegator).from("OrderHeader").where("externalId", externalId, "salesChannelEnumId" , SALES_CHANNEL).queryFirst();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
@@ -140,15 +139,16 @@ public class GoogleCheckoutHelper {
 
     public void processAuthNotification(AuthorizationAmountNotification info) throws GeneralException {
         String externalId = info.getGoogleOrderNumber();
-        List<GenericValue> orders = null;
+        GenericValue order = null;
         GenericValue orderPaymentPreference = null;
         try {
-            orders = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId, "salesChannelEnumId", SALES_CHANNEL), null, false);
+            order = EntityQuery.use(delegator).from("OrderHeader")
+                         .where("externalId", externalId, "salesChannelEnumId", SALES_CHANNEL)
+                         .queryFirst();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
-        if (UtilValidate.isNotEmpty(orders)) {
-            GenericValue order = EntityUtil.getFirst(orders);
+        if (UtilValidate.isNotEmpty(order)) {
             List<GenericValue> orderPaymentPreferences = order.getRelated("OrderPaymentPreference", null, null, false);
             if (UtilValidate.isNotEmpty(orderPaymentPreferences)) {
                 orderPaymentPreference = EntityUtil.getFirst(orderPaymentPreferences);
@@ -169,15 +169,16 @@ public class GoogleCheckoutHelper {
 
     public void processChargeNotification(ChargeAmountNotification info) throws GeneralException {
         String externalId = info.getGoogleOrderNumber();
-        List<GenericValue> orders = null;
+        GenericValue order = null;
         GenericValue orderPaymentPreference = null;
         try {
-            orders = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId, "salesChannelEnumId", SALES_CHANNEL), null, false);
+            order = EntityQuery.use(delegator).from("OrderHeader")
+                         .where("externalId", externalId, "salesChannelEnumId", SALES_CHANNEL)
+                         .queryFirst();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
-        if (UtilValidate.isNotEmpty(orders)) {
-            GenericValue order = EntityUtil.getFirst(orders);
+        if (UtilValidate.isNotEmpty(order)) {
             List<GenericValue> orderPaymentPreferences = order.getRelated("OrderPaymentPreference", null, null, false);
             if (UtilValidate.isNotEmpty(orderPaymentPreferences)) {
                 orderPaymentPreference = EntityUtil.getFirst(orderPaymentPreferences);
@@ -199,15 +200,16 @@ public class GoogleCheckoutHelper {
 
     public void processRefundNotification(RefundAmountNotification info) throws GeneralException {
         String externalId = info.getGoogleOrderNumber();
-        List<GenericValue> orders = null;
+        GenericValue order = null;
         GenericValue orderPaymentPreference = null;
         try {
-            orders = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId, "salesChannelEnumId", SALES_CHANNEL), null, false);
+            order = EntityQuery.use(delegator).from("OrderHeader")
+                        .where("externalId", externalId, "salesChannelEnumId", SALES_CHANNEL)
+                        .queryFirst();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
-        if (UtilValidate.isNotEmpty(orders)) {
-            GenericValue order = EntityUtil.getFirst(orders);
+        if (UtilValidate.isNotEmpty(order)) {
             List<GenericValue> orderPaymentPreferences = order.getRelated("OrderPaymentPreference", null, null, false);
             if (UtilValidate.isNotEmpty(orderPaymentPreferences)) {
                 orderPaymentPreference = EntityUtil.getFirst(orderPaymentPreferences);
@@ -237,7 +239,7 @@ public class GoogleCheckoutHelper {
         String externalId = info.getGoogleOrderNumber();
 
         // check and make sure this order doesn't already exist
-        List<GenericValue> existingOrder = delegator.findByAnd("OrderHeader", UtilMisc.toMap("externalId", externalId), null, false);
+        List<GenericValue> existingOrder = EntityQuery.use(delegator).from("OrderHeader").where("externalId", externalId).queryList();
         if (UtilValidate.isNotEmpty(existingOrder)) {
             //throw new GeneralException("Google order #" + externalId + " already exists.");
             Debug.logWarning("Google order #" + externalId + " already exists.", module);
@@ -409,8 +411,7 @@ public class GoogleCheckoutHelper {
         String shippingName = shipping.getShippingName();
         GenericValue googleShipping = null;
         try {
-            googleShipping = delegator.findOne("GoogleCoShippingMethod", UtilMisc.toMap("shipmentMethodName", shippingName,
-                    "productStoreId", cart.getProductStoreId()), false);
+            googleShipping = EntityQuery.use(delegator).from("GoogleCoShippingMethod").where("shipmentMethodName", shippingName, "productStoreId", cart.getProductStoreId()).queryOne();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
@@ -556,10 +557,10 @@ public class GoogleCheckoutHelper {
         String contactMechPurposeTypeId = getAddressType(addrType);
 
         // check to make sure the purpose doesn't already exist
-        List<GenericValue> values = delegator.findByAnd("PartyContactWithPurpose", UtilMisc.toMap("partyId", partyId,
-                "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null, false);
-        values = EntityUtil.filterByDate(values, null, "contactFromDate", "contactThruDate", true);
-        values = EntityUtil.filterByDate(values, null, "purposeFromDate", "purposeThruDate", true);
+        List<GenericValue> values = EntityQuery.use(delegator).from("PartyContactWithPurpose")
+                .where("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId)
+                .filterByDate("contactFromDate", "contactThruDate", "purposeFromDate", "purposeThruDate")
+                .queryList();
 
         if (UtilValidate.isEmpty(values)) {
             Map<String, Object> addPurposeMap = FastMap.newInstance();
@@ -606,8 +607,7 @@ public class GoogleCheckoutHelper {
 
         List<GenericValue> cmLookup;
         try {
-            cmLookup = delegator.findByAnd(entityName, lookupMap, UtilMisc.toList("-fromDate"), false);
-            cmLookup = EntityUtil.filterByDate(cmLookup);
+            cmLookup = EntityQuery.use(delegator).from(entityName).where(lookupMap).orderBy("-fromDate").filterByDate().queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             throw e;
@@ -657,14 +657,14 @@ public class GoogleCheckoutHelper {
         if (geoCode != null && geoCode.length() == 3) {
             return geoCode;
         }
-        List<GenericValue> geos = null;
+        GenericValue geo = null;
         try {
-            geos = delegator.findByAnd("Geo", UtilMisc.toMap("geoCode", geoCode, "geoTypeId", "COUNTRY"), null, false);
+            geo = EntityQuery.use(delegator).from("Geo").where("geoCode", geoCode, "geoTypeId", "COUNTRY").queryFirst();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
-        if (UtilValidate.isNotEmpty(geos)) {
-            return EntityUtil.getFirst(geos).getString("geoId");
+        if (UtilValidate.isNotEmpty(geo)) {
+            return geo.getString("geoId");
         } else {
             return "_NA_";
         }
@@ -673,10 +673,9 @@ public class GoogleCheckoutHelper {
     protected boolean hasHoldOrderNotes(String orderId) {
         EntityCondition idCond = EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId);
         EntityCondition content = EntityCondition.makeCondition("noteInfo", EntityOperator.LIKE, "%Order is held%");
-        EntityCondition mainCond = EntityCondition.makeCondition(UtilMisc.toList(idCond, content), EntityOperator.AND);
         List<GenericValue> holdOrderNotes = null;
         try {
-            holdOrderNotes = delegator.findList("OrderHeaderNoteView", mainCond, null, null, null, false);
+            holdOrderNotes = EntityQuery.use(delegator).from("OrderHeaderNoteView").where(idCond, content).queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java Mon Dec  1 10:16:27 2014
@@ -29,7 +29,6 @@ import javolution.util.FastMap;
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
-import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilNumber;
 import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
@@ -131,7 +130,7 @@ public class GoogleRequestServices {
         // setup shipping options support
         List<GenericValue> shippingOptions = null;
         try {
-            shippingOptions = delegator.findByAnd("GoogleCoShippingMethod", UtilMisc.toMap("productStoreId", productStoreId), null, false);
+            shippingOptions = EntityQuery.use(delegator).from("GoogleCoShippingMethod").where("productStoreId", productStoreId).queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
@@ -303,7 +302,7 @@ public class GoogleRequestServices {
 
         List<GenericValue> returnItems = null;
         try {
-            returnItems = delegator.findByAnd("ReturnItem", UtilMisc.toMap("returnId", returnId), null, false);
+            returnItems = EntityQuery.use(delegator).from("ReturnItem").where("returnId", returnId).queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
@@ -512,7 +511,7 @@ public class GoogleRequestServices {
     }
 
     private static void sendItemsShipped(Delegator delegator, String shipmentId) throws GeneralException {
-        List<GenericValue> issued = delegator.findByAnd("ItemIssuance", UtilMisc.toMap("shipmentId", shipmentId), null, false);
+        List<GenericValue> issued = EntityQuery.use(delegator).from("ItemIssuance").where("shipmentId", shipmentId).queryList();
         if (UtilValidate.isNotEmpty(issued)) {
             try {
                 GenericValue googleOrder = null;
@@ -534,9 +533,7 @@ public class GoogleRequestServices {
                             isr = new ShipItemsRequest(mInfo, externalId);
                         }
                         // locate the shipment package content record
-                        Map<String, ? extends Object> spcLup = UtilMisc.toMap("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItemSeqId);
-                        List<GenericValue> spc = delegator.findByAnd("ShipmentPackageContent", spcLup, null, false);
-                        GenericValue packageContent = EntityUtil.getFirst(spc);
+                        GenericValue packageContent = EntityQuery.use(delegator).from("ShipmentPackageContent").where("shipmentId", shipmentId, "shipmentItemSeqId", shipmentItemSeqId).queryFirst();
                         String carrier = null;
                         if (UtilValidate.isNotEmpty(packageContent)) {
                             GenericValue shipPackage = packageContent.getRelatedOne("ShipmentPackage", false);

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/hhfacility/src/org/ofbiz/hhfacility/FacilityServices.java Mon Dec  1 10:16:27 2014
@@ -32,6 +32,7 @@ import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.product.product.ProductWorker;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
@@ -75,8 +76,7 @@ public class FacilityServices {
         // todo: change this to a select from inv_items where productId and facilityId matches distinct (locationSeqId).
         List<GenericValue> invItemList = null;
         try {
-            invItemList = delegator.findByAnd("InventoryItem",
-                UtilMisc.toMap("productId", productId, "facilityId", facilityId), null, false);
+            invItemList = EntityQuery.use(delegator).from("InventoryItem").where("productId", productId, "facilityId", facilityId).queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             throw new GeneralRuntimeException(e.getMessage());
@@ -138,7 +138,7 @@ public class FacilityServices {
         // Now get the inventory items that are found for that location, facility and product
         List<GenericValue> invItemList = null;
         try {
-            invItemList = delegator.findByAnd("InventoryItem", UtilMisc.toMap("productId", productId, "facilityId", facilityId, "locationSeqId", locationSeqId), null, false);
+            invItemList = EntityQuery.use(delegator).from("InventoryItem").where("productId", productId, "facilityId", facilityId, "locationSeqId", locationSeqId).queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, "updateProductStocktake failed getting inventory items", module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ProductErrorFailedProductStockTake", locale));

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/ProductDocument.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/ProductDocument.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/ProductDocument.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/ProductDocument.java Mon Dec  1 10:16:27 2014
@@ -99,7 +99,7 @@ public class ProductDocument implements
                         !"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.abbrev", "0")) ||
                         !"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductFeatureAndAppl.idCode", "0"))) {
 
-                    List<GenericValue> productFeatureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", UtilMisc.toMap("productId", productId), null, false);
+                    List<GenericValue> productFeatureAndAppls = EntityQuery.use(delegator).from("ProductFeatureAndAppl").where("productId", productId).queryList();
                     productFeatureAndAppls = this.filterByThruDate(productFeatureAndAppls);
 
                     for (GenericValue productFeatureAndAppl: productFeatureAndAppls) {
@@ -119,7 +119,7 @@ public class ProductDocument implements
                         this.addTextFieldByWeight(doc, "featureAbbreviation", productFeatureAndAppl.getString("abbrev"), "index.weight.ProductFeatureAndAppl.abbrev", 0, false, "fullText");
                         this.addTextFieldByWeight(doc, "featureCode", productFeatureAndAppl.getString("idCode"), "index.weight.ProductFeatureAndAppl.idCode", 0, false, "fullText");
                         // Get the ProductFeatureGroupIds
-                        List<GenericValue> productFeatureGroupAppls = delegator.findByAnd("ProductFeatureGroupAppl", UtilMisc.toMap("productFeatureId", productFeatureAndAppl.get("productFeatureId")), null, false);
+                        List<GenericValue> productFeatureGroupAppls = EntityQuery.use(delegator).from("ProductFeatureGroupAppl").where("productFeatureId", productFeatureAndAppl.get("productFeatureId")).queryList();
                         productFeatureGroupAppls = this.filterByThruDate(productFeatureGroupAppls);
                         for (GenericValue productFeatureGroupAppl : productFeatureGroupAppls) {
                             fromDate = productFeatureGroupAppl.getTimestamp("fromDate");
@@ -140,7 +140,7 @@ public class ProductDocument implements
                 if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductAttribute.attrName", "0")) ||
                         !"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.ProductAttribute.attrValue", "0"))) {
 
-                    List<GenericValue> productAttributes = delegator.findByAnd("ProductAttribute", UtilMisc.toMap("productId", productId), null, false);
+                    List<GenericValue> productAttributes = EntityQuery.use(delegator).from("ProductAttribute").where("productId", productId).queryList();
                     for (GenericValue productAttribute: productAttributes) {
                         this.addTextFieldByWeight(doc, "attributeName", productAttribute.getString("attrName"), "index.weight.ProductAttribute.attrName", 0, false, "fullText");
                         this.addTextFieldByWeight(doc, "attributeValue", productAttribute.getString("attrValue"), "index.weight.ProductAttribute.attrValue", 0, false, "fullText");
@@ -149,7 +149,7 @@ public class ProductDocument implements
 
                 // GoodIdentification
                 if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.GoodIdentification.idValue", "0"))) {
-                    List<GenericValue> goodIdentifications = delegator.findByAnd("GoodIdentification", UtilMisc.toMap("productId", productId), null, false);
+                    List<GenericValue> goodIdentifications = EntityQuery.use(delegator).from("GoodIdentification").where("productId", productId).queryList();
                     for (GenericValue goodIdentification: goodIdentifications) {
                         String goodIdentificationTypeId = goodIdentification.getString("goodIdentificationTypeId");
                         String idValue = goodIdentification.getString("idValue");
@@ -162,7 +162,7 @@ public class ProductDocument implements
                 // Virtual ProductIds
                 if ("Y".equals(product.getString("isVirtual"))) {
                     if (!"0".equals(UtilProperties.getPropertyValue("prodsearch", "index.weight.Variant.Product.productId", "0"))) {
-                        List<GenericValue> variantProductAssocs = delegator.findByAnd("ProductAssoc", UtilMisc.toMap("productId", productId, "productAssocTypeId", "PRODUCT_VARIANT"), null, false);
+                        List<GenericValue> variantProductAssocs = EntityQuery.use(delegator).from("ProductAssoc").where("productId", productId, "productAssocTypeId", "PRODUCT_VARIANT").queryList();
                         variantProductAssocs = this.filterByThruDate(variantProductAssocs);
                         for (GenericValue variantProductAssoc: variantProductAssocs) {
                             Timestamp fromDate = variantProductAssoc.getTimestamp("fromDate");
@@ -190,7 +190,7 @@ public class ProductDocument implements
                         Debug.logWarning("Could not parse weight number: " + e.toString(), module);
                     }
 
-                    List<GenericValue> productContentAndInfos = delegator.findByAnd("ProductContentAndInfo", UtilMisc.toMap("productId", productId, "productContentTypeId", productContentTypeId), null, false);
+                    List<GenericValue> productContentAndInfos = EntityQuery.use(delegator).from("ProductContentAndInfo").where("productId", productId, "productContentTypeId", productContentTypeId).queryList();
                     productContentAndInfos = this.filterByThruDate(productContentAndInfos);
                     for (GenericValue productContentAndInfo: productContentAndInfos) {
                         Timestamp fromDate = productContentAndInfo.getTimestamp("fromDate");

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java Mon Dec  1 10:16:27 2014
@@ -31,6 +31,7 @@ import org.ofbiz.base.util.UtilPropertie
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
@@ -72,9 +73,8 @@ public class SearchServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         try {
-            List<GenericValue> productFeatureAppls = delegator.findByAnd("ProductFeatureAppl", UtilMisc.toMap("productFeatureId", context.get("productFeatureId")), null, false);
-            // Only re-index the active appls, future dated ones will get picked up on that product's re-index date
-            productFeatureAppls = EntityUtil.filterByDate(productFeatureAppls);
+             // Only re-index the active appls, future dated ones will get picked up on that product's re-index date
+             List<GenericValue> productFeatureAppls = EntityQuery.use(delegator).from("ProductFeatureAppl").where("productFeatureId", context.get("productFeatureId")).filterByDate().queryList();
 
             for (GenericValue productFeatureAppl : productFeatureAppls) {
                 try {
@@ -105,7 +105,7 @@ public class SearchServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         try {
-            List<GenericValue> contents = delegator.findByAnd("Content", UtilMisc.toMap("dataResourceId", context.get("dataResourceId")), null, false);
+            List<GenericValue> contents = EntityQuery.use(delegator).from("Content").where("dataResourceId", context.get("dataResourceId")).queryList();
             for (GenericValue content : contents) {
                 dispatcher.runSync("indexProductsFromContent",
                         UtilMisc.toMap(
@@ -123,7 +123,7 @@ public class SearchServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         try {
-            List<GenericValue> productContents = delegator.findByAnd("ProductContent", UtilMisc.toMap("contentId", context.get("contentId")), null, false);
+            List<GenericValue> productContents = EntityQuery.use(delegator).from("ProductContent").where("contentId", context.get("contentId")).queryList();
             for (GenericValue productContent : productContents) {
                 try {
                     dispatcher.runSync("indexProduct", UtilMisc.toMap("productId", productContent.get("productId")));
@@ -149,7 +149,7 @@ public class SearchServices {
         return ServiceUtil.returnSuccess();
     }
     private static void indexProductCategoryRollup(String parentProductCategoryId, Delegator delegator, LocalDispatcher dispatcher, Set<String> excludeProductCategoryIds) throws GenericEntityException {
-        List<GenericValue> productCategoryRollups = delegator.findByAnd("ProductCategoryRollup", UtilMisc.toMap("parentProductCategoryId", parentProductCategoryId), null, false);
+        List<GenericValue> productCategoryRollups = EntityQuery.use(delegator).from("ProductCategoryRollup").where("parentProductCategoryId", parentProductCategoryId).queryList();
         for (GenericValue productCategoryRollup : productCategoryRollups) {
             String productCategoryId = productCategoryRollup.getString("productCategoryId");
             // Avoid infinite recursion
@@ -162,7 +162,7 @@ public class SearchServices {
     }
 
     private static void indexProductCategoryMembers(String productCategoryId, Delegator delegator, LocalDispatcher dispatcher) throws GenericEntityException {
-        List<GenericValue> productCategoryMembers = delegator.findByAnd("ProductCategoryMember", UtilMisc.toMap("productCategoryId", productCategoryId), null, false);
+        List<GenericValue> productCategoryMembers = EntityQuery.use(delegator).from("ProductCategoryMember").where("productCategoryId", productCategoryId).queryList();
         for (GenericValue productCategoryMember : productCategoryMembers) {
             try {
                 dispatcher.runSync("indexProduct", UtilMisc.toMap("productId", productCategoryMember.get("productId")));

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java Mon Dec  1 10:16:27 2014
@@ -31,8 +31,8 @@ import org.ofbiz.content.content.Content
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.service.LocalDispatcher;
-
 import org.apache.lucene.util.Version;
 
 /**
@@ -75,7 +75,7 @@ public class SearchWorker {
         List<GenericValue> contentList = new ArrayList<GenericValue>();
         for (String id : idList) {
             try {
-                GenericValue content = delegator.findOne("Content", UtilMisc .toMap("contentId", id), true);
+                GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", id).cache(true).queryOne();
                 if (content != null) {
                     contentList.add(content);
                 }

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Mon Dec  1 10:16:27 2014
@@ -182,7 +182,7 @@ public class OagisInventoryServices {
                                 EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
                                 EntityCondition.makeCondition("inventoryItemTypeId", EntityOperator.EQUALS, "NON_SERIAL_INV_ITEM"),
                                 EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
-                        List<GenericValue> invItemAndDetails = delegator.findList("InventoryItemDetailForSum", condition, UtilMisc.toSet("quantityOnHandSum"), null, null, false);
+                        List<GenericValue> invItemAndDetails = EntityQuery.use(delegator).select("quantityOnHandSum").from("InventoryItemDetailForSum").where(condition).queryList();
                         for (GenericValue inventoryItemDetailForSum : invItemAndDetails) {
                             quantityOnHandTotal += inventoryItemDetailForSum.getDouble("quantityOnHandSum").doubleValue();
                         }
@@ -196,7 +196,7 @@ public class OagisInventoryServices {
                             EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId),
                             EntityCondition.makeCondition("inventoryItemTypeId", EntityOperator.EQUALS, "SERIALIZED_INV_ITEM"),
                             EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
-                    long invItemQuantCount = delegator.findCountByCondition("InventoryItemStatusForCount", serInvCondition, null, null);
+                    long invItemQuantCount = EntityQuery.use(delegator).from("InventoryItemStatusForCount").where(serInvCondition).queryCount();
                     quantityOnHandTotal += invItemQuantCount;
 
                     // check for mismatch in quantity
@@ -400,7 +400,7 @@ public class OagisInventoryServices {
         // before getting into this check to see if we've tried once and had an error, if so set isErrorRetry even if it wasn't passed in
         GenericValue previousOagisMessageInfo = null;
         try {
-            previousOagisMessageInfo = delegator.findOne("OagisMessageInfo", omiPkMap, false);
+            previousOagisMessageInfo = EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne();
         } catch (GenericEntityException e) {
             String errMsg = "Error getting OagisMessageInfo from database for message ID [" + omiPkMap + "]: " + e.toString();
             Debug.logInfo(e, errMsg, module);
@@ -700,7 +700,7 @@ public class OagisInventoryServices {
         // before getting into this check to see if we've tried once and had an error, if so set isErrorRetry even if it wasn't passed in
         GenericValue previousOagisMessageInfo = null;
         try {
-            previousOagisMessageInfo = delegator.findOne("OagisMessageInfo", omiPkMap, false);
+            previousOagisMessageInfo = EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne();
         } catch (GenericEntityException e) {
             String errMsg = "Error getting OagisMessageInfo from database for message ID [" + omiPkMap + "]: " + e.toString();
             Debug.logInfo(e, errMsg, module);
@@ -898,9 +898,8 @@ public class OagisInventoryServices {
                                     Set<String> productIdSet = ProductWorker.getRefurbishedProductIdSet(productId, delegator);
                                     productIdSet.add(productId);
 
-                                    EntityCondition bySerialNumberCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNum),
-                                            EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
-                                    List<GenericValue> inventoryItemsBySerialNumber = delegator.findList("InventoryItem", bySerialNumberCondition, null, null, null, false);
+                                    List<GenericValue> inventoryItemsBySerialNumber = EntityQuery.use(delegator).from("InventoryItem").where(EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNum),
+                                            EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet))).queryList();
 
                                     if (OagisServices.requireSerialNumberExist != null) {
                                         // according to requireSerialNumberExist make sure serialNumber does or does not exist in database, add an error message as needed
@@ -1354,9 +1353,8 @@ public class OagisInventoryServices {
                             Set<String> productIdSet = ProductWorker.getRefurbishedProductIdSet(productId, delegator);
                             productIdSet.add(productId);
 
-                            EntityCondition bySerialNumberCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNum),
-                                    EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
-                            List<GenericValue> inventoryItemsBySerialNumber = delegator.findList("InventoryItem", bySerialNumberCondition, null, null, null, false);
+                            List<GenericValue> inventoryItemsBySerialNumber = EntityQuery.use(delegator).from("InventoryItem").where(EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", EntityOperator.EQUALS, serialNum),
+                                    EntityOperator.AND, EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet))).queryList();
 
                             // this is a status update, so referenced serial number MUST already exist
                             if (inventoryItemsBySerialNumber.size() == 0) {

Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java?rev=1642661&r1=1642660&r2=1642661&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java (original)
+++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java Mon Dec  1 10:16:27 2014
@@ -242,7 +242,7 @@ public class OagisServices {
         Locale locale = (Locale) context.get("locale");
         GenericValue userLogin = null;
         try {
-            userLogin = delegator.findOne("UserLogin",UtilMisc.toMap("userLoginId", "system"), false);
+            userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", "system").queryOne();
         } catch (GenericEntityException e) {
             String errMsg = "Error Getting UserLogin with userLoginId 'system':" + e.toString();
             Debug.logError(e, errMsg, module);
@@ -325,7 +325,7 @@ public class OagisServices {
             } else {
                 Map<String, Object> originalOmiPkMap = UtilMisc.toMap("logicalId", (Object) dataAreaLogicalId, "component", dataAreaComponent,
                         "task", dataAreaTask, "referenceId", dataAreaReferenceId);
-                GenericValue originalOagisMsgInfo = delegator.findOne("OagisMessageInfo", originalOmiPkMap, false);
+                GenericValue originalOagisMsgInfo = EntityQuery.use(delegator).from("OagisMessageInfo").where(originalOmiPkMap).queryOne();
                 if (originalOagisMsgInfo != null) {
                     for (Element dataAreaConfirmMsgElement : dataAreaConfirmMsgList) {
                         String description = UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:DESCRIPTN");
@@ -445,7 +445,7 @@ public class OagisServices {
 
             if (UtilValidate.isNotEmpty(referenceId) && (UtilValidate.isEmpty(component) || UtilValidate.isEmpty(task) || UtilValidate.isEmpty(referenceId))) {
                 // try looking up by just the referenceId, those alone are often unique, return error if there is more than one result
-                List<GenericValue> oagisMessageInfoList = delegator.findByAnd("OagisMessageInfo", UtilMisc.toMap("referenceId", referenceId), null, false);
+                List<GenericValue> oagisMessageInfoList = EntityQuery.use(delegator).from("OagisMessageInfo").where("referenceId", referenceId).queryList();
                 if (oagisMessageInfoList.size() == 1) {
                     oagisMessageInfo = oagisMessageInfoList.get(0);
                 } else if (oagisMessageInfoList.size() > 1) {
@@ -453,7 +453,7 @@ public class OagisServices {
                     return ServiceUtil.returnError(UtilProperties.getMessage(resource, "OagisErrorLookupByReferenceError", UtilMisc.toMap("messageSize", messageSize.toString(), "referenceId", referenceId), locale));
                 }
             } else {
-                oagisMessageInfo = delegator.findOne("OagisMessageInfo", oagisMessageInfoKey, false);
+                oagisMessageInfo = EntityQuery.use(delegator).from("OagisMessageInfo").where(oagisMessageInfoKey).queryOne();
             }
 
             if (oagisMessageInfo == null) {
@@ -548,7 +548,7 @@ public class OagisServices {
         GenericValue oagisMessageInfo = null;
         Map<String, Object> oagisMessageInfoKey = UtilMisc.toMap("logicalId", (Object) logicalId, "component", component, "task", task, "referenceId", referenceId);
         try {
-            oagisMessageInfo = delegator.findOne("OagisMessageInfo", oagisMessageInfoKey, false);
+            oagisMessageInfo = EntityQuery.use(delegator).from("OagisMessageInfo").where(oagisMessageInfoKey).queryOne();
         } catch (GenericEntityException e) {
             Debug.logError(e, "Error Getting Entity OagisMessageInfo: " + e.toString(), module);
         }