You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2012/05/12 23:20:39 UTC

svn commit: r1337674 - in /ofbiz/trunk/specialpurpose/ebay: src/org/ofbiz/ebay/EbayHelper.java src/org/ofbiz/ebay/EbayOrderServices.java src/org/ofbiz/ebay/ImportOrdersFromEbay.java webapp/ebay/find/EbayAdvancedSearch.ftl

Author: doogie
Date: Sat May 12 21:20:38 2012
New Revision: 1337674

URL: http://svn.apache.org/viewvc?rev=1337674&view=rev
Log:
DEPRECATION: specialpurpose/ebay: findByPrimaryKey variants replaced
with findOne

Modified:
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
    ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java?rev=1337674&r1=1337673&r2=1337674&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java Sat May 12 21:20:38 2012
@@ -516,7 +516,7 @@ public class EbayHelper {
             GenericValue postalAddress;
             try {
                 // get the postal address for this contact mech
-                postalAddress = delegator.findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", contactMechId));
+                postalAddress = delegator.findOne("PostalAddress", UtilMisc.toMap("contactMechId", contactMechId), false);
 
                 // match values to compare by modifying them the same way they
                 // were when they were created
@@ -588,8 +588,8 @@ public class EbayHelper {
             GenericValue phoneNumber;
             try {
                 // get the phone number for this contact mech
-                phoneNumber = delegator.findByPrimaryKey("TelecomNumber", UtilMisc
-                        .toMap("contactMechId", contactMechId));
+                phoneNumber = delegator.findOne("TelecomNumber", UtilMisc
+                        .toMap("contactMechId", contactMechId), false);
 
                 // now compare values. If one matches, that's our phone number.
                 // Return the related contact mech id.
@@ -622,7 +622,7 @@ public class EbayHelper {
                     titleFirstWord = title.substring(0, title.indexOf(' '));
                 }
                 if (UtilValidate.isNotEmpty(titleFirstWord)) {
-                    GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", titleFirstWord));
+                    GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", titleFirstWord), false);
                     if (UtilValidate.isNotEmpty(product)) {
                         productId = product.getString("productId");
                     }

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java?rev=1337674&r1=1337673&r2=1337674&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java Sat May 12 21:20:38 2012
@@ -992,7 +992,7 @@ public class EbayOrderServices {
             if (productStoreId == null) {
                 return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productStoreIdIsMandatory", locale));
             } else {
-                GenericValue productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
+                GenericValue productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), false);
                 if (productStore != null) {
                     defaultCurrencyUomId = productStore.getString("defaultCurrencyUomId");
                     payToPartyId = productStore.getString("payToPartyId");
@@ -1150,7 +1150,7 @@ public class EbayOrderServices {
                 // if we get a party, check its contact information.
                 if (UtilValidate.isNotEmpty(partyId)) {
                     Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, module);
-                    GenericValue party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId));
+                    GenericValue party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
 
                     contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, shippingAddressCtx);
                     String emailBuyer = (String) context.get("emailBuyer");

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java?rev=1337674&r1=1337673&r2=1337674&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java Sat May 12 21:20:38 2012
@@ -141,7 +141,7 @@ public class ImportOrdersFromEbay {
             if (UtilValidate.isNotEmpty(orderId)) {
                 // Get the order header and verify if this order has been imported
                 // from eBay (i.e. sales channel = EBAY_CHANNEL and externalId is set)
-                orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
+                orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false);
                 if (orderHeader == null) {
                     Debug.logError("Cannot find order with orderId [" + orderId + "]", module);
                     return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.errorRetrievingOrderFromOrderId", locale));
@@ -600,7 +600,7 @@ public class ImportOrdersFromEbay {
             if (productStoreId == null) {
                 return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productStoreIdIsMandatory", locale));
             } else {
-                GenericValue productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
+                GenericValue productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), false);
                 if (productStore != null) {
                     defaultCurrencyUomId = productStore.getString("defaultCurrencyUomId");
                     payToPartyId = productStore.getString("payToPartyId");
@@ -658,7 +658,7 @@ public class ImportOrdersFromEbay {
             if (UtilValidate.isEmpty(productId)) {
                 return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productIdNotAvailable", locale));
             } else {
-                GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
+                GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
                 if (UtilValidate.isEmpty(product)) {
                     return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productIdDoesNotExist", locale));
                 }
@@ -735,7 +735,7 @@ public class ImportOrdersFromEbay {
                 if (UtilValidate.isNotEmpty(partyAttribute)) {
                     partyId = (String) partyAttribute.get("partyId");
                     Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, module);
-                    GenericValue party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId));
+                    GenericValue party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
 
                     contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, parameters);
                     String emailBuyer = (String) parameters.get("emailBuyer");

Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl?rev=1337674&r1=1337673&r2=1337674&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl (original)
+++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayAdvancedSearch.ftl Sat May 12 21:20:38 2012
@@ -269,7 +269,7 @@ under the License.
           </tr>
           <#list productFeatureTypeIdsOrdered as productFeatureTypeId>
             <#assign findPftMap = Static["org.ofbiz.base.util.UtilMisc"].toMap("productFeatureTypeId", productFeatureTypeId) />
-            <#assign productFeatureType = delegator.findByPrimaryKeyCache("ProductFeatureType", findPftMap) />
+            <#assign productFeatureType = delegator.findOne("ProductFeatureType", findPftMap, true) />
             <#assign productFeatures = productFeaturesByTypeMap[productFeatureTypeId] />
             <tr>
               <td class="label" align="right" valign="middle">