Author: doogie
Date: Sat May 12 21:20:48 2012 New Revision: 1337675 URL: http://svn.apache.org/viewvc?rev=1337675&view=rev Log: DEPRECATION: specialpurpose/ebaystore: findByPrimaryKey variants replaced with findOne Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayBestOfferAutoPref.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayFeedback.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCustomerService.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayBestOfferAutoPref.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayBestOfferAutoPref.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayBestOfferAutoPref.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayBestOfferAutoPref.java Sat May 12 21:20:48 2012 @@ -90,7 +90,7 @@ public class EbayBestOfferAutoPref { Map<String, Object> ebayCondition11 = UtilMisc.<String, Object>toMap("userLogin", userLogin); ebayCondition11.put("acceptanceCondition", condition11); - GenericValue productStorePref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_BEST_OFFER")); + GenericValue productStorePref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_BEST_OFFER"), false); if (UtilValidate.isEmpty(productStorePref)) { String prefCondId1 = delegator.getNextSeqId("EbayProductStorePrefCond"); String parentPrefCondId = prefCondId1; Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java Sat May 12 21:20:48 2012 @@ -196,7 +196,7 @@ public class EbayEvents { for (String productId : productIds) { AddItemCall addItemCall = new AddItemCall(apiContext); ItemType item = new ItemType(); - GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); item.setTitle(product.getString("internalName")); item.setCurrency(CurrencyCodeType.USD); String productDescription = ""; @@ -544,7 +544,7 @@ public class EbayEvents { EbayStoreSiteFacade sf = null; // find is exiting product and set category into item in additem call try { - if (UtilValidate.isNotEmpty(delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)))) { + if (UtilValidate.isNotEmpty(delegator.findOne("Product", UtilMisc.toMap("productId", productId), false))) { ApiContext apiContext = getApiContext(request); Map<String,Object> addItemObject = getAddItemListingObject(request, apiContext); List<Map<String,Object>> addItemlist = UtilGenerics.checkList(addItemObject.get("itemListing")); Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayFeedback.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayFeedback.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayFeedback.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayFeedback.java Sat May 12 21:20:48 2012 @@ -80,7 +80,7 @@ public class EbayFeedback { FeedbackDetailType[] feedback = feedbackCall.getFeedback(); if (feedback != null) { String partyId = null; - GenericValue userLoginEx = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userID)); + GenericValue userLoginEx = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", userID), false); if (userLoginEx == null) { //Party GenericValue party = delegator.makeValue("Party"); @@ -109,7 +109,7 @@ public class EbayFeedback { //convert to ofbiz String contentId = feedback[i].getFeedbackID(); Date eBayDateTime = feedback[i].getCommentTime().getTime(); - GenericValue contentCheck = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId)); + GenericValue contentCheck = delegator.findOne("Content", UtilMisc.toMap("contentId", contentId), false); if (contentCheck != null) { continue; } Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStore.java Sat May 12 21:20:48 2012 @@ -281,7 +281,7 @@ public class EbayStore { if (ebayParentCategoryId != null) { List<GenericValue> productCategoryRollupList = delegator.findByAnd("ProductCategoryRollup", UtilMisc.toMap("parentProductCategoryId", productCategory.getString("productCategoryId")), UtilMisc.toList("sequenceNum ASC")); for (GenericValue productCategoryRollup : productCategoryRollupList) { - productCategory = delegator.findByPrimaryKey("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryRollup.getString("productCategoryId"))); + productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryRollup.getString("productCategoryId")), false); StoreCustomCategoryType childCategoryType = new StoreCustomCategoryType(); String ebayChildCategoryId = EbayStoreHelper.retriveEbayCategoryIdByPartyId(delegator, productCategory.getString("productCategoryId"), context.get("partyId").toString()); if (ebayChildCategoryId == null) { @@ -324,7 +324,7 @@ public class EbayStore { if (ebayParentCategoryId != null) { List<GenericValue> productChildCategoryRollupList = delegator.findByAnd("ProductCategoryRollup", UtilMisc.toMap("parentProductCategoryId",productParentCategoryRollup.getString("productCategoryId")),UtilMisc.toList("sequenceNum ASC")); for (GenericValue productChildCategoryRollup : productChildCategoryRollupList) { - productCategory = delegator.findByPrimaryKey("ProductCategory", UtilMisc.toMap("productCategoryId", productChildCategoryRollup.getString("productCategoryId"))); + productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productChildCategoryRollup.getString("productCategoryId")), false); StoreCustomCategoryType childCategoryType = new StoreCustomCategoryType(); String ebayChildCategoryId = EbayStoreHelper.retriveEbayCategoryIdByPartyId(delegator,productCategory.getString("productCategoryId"),context.get("partyId").toString()); if (ebayChildCategoryId == null) { @@ -443,7 +443,7 @@ public class EbayStore { // Prepare data for set to XML GenericValue productStore = null; if (UtilValidate.isNotEmpty(context.get("productStoreId").toString())) { - productStore = delegator.findByPrimaryKey("ProductStore",UtilMisc.toMap("productStoreId", context.get("productStoreId").toString())); + productStore = delegator.findOne("ProductStore",UtilMisc.toMap("productStoreId", context.get("productStoreId").toString()), false); } Element itemElem = UtilXml.addChildElement(storeRequestElem, "Store", storeDocument); UtilXml.addChildElementValue(itemElem, "Name", productStore.getString("storeName"), storeDocument); @@ -523,7 +523,7 @@ public class EbayStore { //UtilXml.addChildElementValue(StoreCategoriesElem, "Country", (String)context.get("country"), storeDocument); GenericValue category = null; if (UtilValidate.isNotEmpty(context.get("prodCatalogId"))) { - category = delegator.findByPrimaryKeyCache("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryId)); + category = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryId), true); } String categoryName = category.getString("productCategoryId").toString(); if (category.getString("categoryName").toString() != null) { @@ -1548,7 +1548,7 @@ public class EbayStore { Map<String, Object> eBayConfigResult = EbayHelper.buildEbayConfig(context, delegator); Map<String, Object> response = null; try { - GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", context.get("productId").toString())); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", context.get("productId").toString()), false); int intAtp = 1; String facilityId = ""; if (UtilValidate.isNotEmpty(context.get("requireEbayInventory")) && "on".equals(context.get("requireEbayInventory").toString())) { @@ -2458,7 +2458,7 @@ public class EbayStore { public static boolean checkExistProduct(Delegator delegator, String productId) { boolean checkResult = false; try { - GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); if(UtilValidate.isNotEmpty(product)) { checkResult = true; } Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreAutoPreferences.java Sat May 12 21:20:48 2012 @@ -142,7 +142,7 @@ public class EbayStoreAutoPreferences { try { ApiContext apiContext = EbayStoreHelper.getApiContext(productStoreId, locale, delegator); - ebayProductStorePref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_PIT_FB")); + ebayProductStorePref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_PIT_FB"), false); if (UtilValidate.isNotEmpty(ebayProductStorePref) && UtilValidate.isNotEmpty(ebayProductStorePref.getString("autoPrefJobId"))) { isAutoPositiveFeedback = ebayProductStorePref.getString("enabled"); // if isAutoPositiveFeedback is N that means not start this job run service @@ -267,7 +267,7 @@ public class EbayStoreAutoPreferences { } Map<String, Object> context = UtilMisc.<String, Object>toMap("userLogin", userLogin, "serviceName", "autoPrefLeaveFeedbackOption"); - ebayProductStorePref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_PIT_FB")); + ebayProductStorePref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_PIT_FB"), false); context.put("productStoreId", productStoreId); context.put("autoPrefEnumId", "EBAY_AUTO_PIT_FB"); if (UtilValidate.isNotEmpty(ebayProductStorePref) && UtilValidate.isNotEmpty(ebayProductStorePref.getString("autoPrefJobId"))) { @@ -315,7 +315,7 @@ public class EbayStoreAutoPreferences { try { ApiContext apiContext = EbayStoreHelper.getApiContext(productStoreId, locale, delegator); - ebayProductStorePref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_FB_RMD")); + ebayProductStorePref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_FB_RMD"), false); if (UtilValidate.isNotEmpty(ebayProductStorePref) && UtilValidate.isNotEmpty(ebayProductStorePref.getString("autoPrefJobId"))) { isAutoFeedbackReminder = ebayProductStorePref.getString("enabled"); // if isAutoPositiveFeedback is N that means not start this job run service @@ -353,7 +353,7 @@ public class EbayStoreAutoPreferences { for (SellingManagerSoldOrderType item : items) { // call send Map<String, Object> sendMap = FastMap.newInstance(); - GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_FEEBACK_REMIN")); + GenericValue productStoreEmail = delegator.findOne("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_FEEBACK_REMIN"), false); String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation"); sendMap.put("bodyScreenUri", bodyScreenLocation); String subjectString = productStoreEmail.getString("subject"); @@ -410,7 +410,7 @@ public class EbayStoreAutoPreferences { serviceMap.put("productStoreId", productStoreId); Map<String, Object> eBayUserLogin = dispatcher.runSync("getEbayStoreUser", serviceMap); String eBayUserLoginId = (String) eBayUserLogin.get("userLoginId"); - GenericValue party = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", eBayUserLoginId)); + GenericValue party = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", eBayUserLoginId), false); String partyId = party.getString("partyId"); //save sold items to OFbBiz product entity Map<String, Object> resultService = dispatcher.runSync("getEbaySoldItems", serviceMap); @@ -419,7 +419,7 @@ public class EbayStoreAutoPreferences { for (int itemCount = 0; itemCount < soldItems.size(); itemCount++) { Map<String, Object> soldItemMap = soldItems.get(itemCount); if (UtilValidate.isNotEmpty(soldItemMap.get("itemId"))) { - GenericValue productCheck = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", soldItemMap.get("itemId"))); + GenericValue productCheck = delegator.findOne("Product", UtilMisc.toMap("productId", soldItemMap.get("itemId")), false); if (productCheck == null) { Map<String, Object> inMap = FastMap.newInstance(); inMap.put("productId", soldItemMap.get("itemId")); @@ -487,7 +487,7 @@ public class EbayStoreAutoPreferences { itemToBeRelisted.setItemID(product.getString("productId")); relistItemCall.setItemToBeRelisted(itemToBeRelisted); relistItemCall.relistItem(); - GenericValue productStore = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", product.getString("productId"))); + GenericValue productStore = delegator.findOne("Product", UtilMisc.toMap("productId", product.getString("productId")), false); productStore.set("isVirtual", "Y"); productStore.store(); Debug.logInfo("Relisted Item - " + product.getString("productId"), module); @@ -662,7 +662,7 @@ public class EbayStoreAutoPreferences { try { ApiContext apiContext = EbayStoreHelper.getApiContext(productStoreId, locale, delegator); - ebayProductStorePref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_FB_RMD")); + ebayProductStorePref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_FB_RMD"), false); if (UtilValidate.isNotEmpty(ebayProductStorePref) && UtilValidate.isNotEmpty(ebayProductStorePref.getString("autoPrefJobId"))) { isAutoSendEmail = ebayProductStorePref.getString("enabled"); // if isAutoPositiveFeedback is N that means not start this job run service @@ -687,7 +687,7 @@ public class EbayStoreAutoPreferences { for (SellingManagerSoldOrderType item : items) { // call send Map<String, Object> sendMap = FastMap.newInstance(); - GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_PAY_RECIEVED")); + GenericValue productStoreEmail = delegator.findOne("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_PAY_RECIEVED"), false); String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation"); sendMap.put("bodyScreenUri", bodyScreenLocation); String subjectString = productStoreEmail.getString("subject"); @@ -734,7 +734,7 @@ public class EbayStoreAutoPreferences { SellingManagerSoldOrderType[] sellingManagerSoldOrders = sellingManagerSoldListings.getSellingManagerSoldListings(); if (sellingManagerSoldOrders != null) { int soldOrderLength = sellingManagerSoldOrders.length; - GenericValue ebayPref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "ENA_COMB_ORD")); + GenericValue ebayPref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "ENA_COMB_ORD"), false); if (UtilValidate.isNotEmpty(ebayPref)) { Timestamp beginDate = UtilDateTime.toTimestamp("01/01/2001 00:00:00"); @@ -941,7 +941,7 @@ public class EbayStoreAutoPreferences { String buyerUserId = bidder.get("userId").toString(); Map<String, Object> sendMap = FastMap.newInstance(); - GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_WIN_BUYER_NOTI")); + GenericValue productStoreEmail = delegator.findOne("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_WIN_BUYER_NOTI"), false); String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation"); sendMap.put("bodyScreenUri", bodyScreenLocation); String subjectString = productStoreEmail.getString("subject"); @@ -1001,7 +1001,7 @@ public class EbayStoreAutoPreferences { String buyerEmail = item.get("buyerEmail").toString(); Map<String, Object> sendMap = FastMap.newInstance(); - GenericValue productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_ITEM_DISPATCH")); + GenericValue productStoreEmail = delegator.findOne("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "EBAY_ITEM_DISPATCH"), false); String bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation"); sendMap.put("bodyScreenUri", bodyScreenLocation); String subjectString = productStoreEmail.getString("subject"); @@ -1147,7 +1147,7 @@ public class EbayStoreAutoPreferences { Locale locale = (Locale) context.get("locale"); try { String productStoreId = (String) context.get("productStoreId"); - GenericValue ebayProductStorePref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_BEST_OFFER")); + GenericValue ebayProductStorePref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", "EBAY_AUTO_BEST_OFFER"), false); String parentPrefCondId = ebayProductStorePref.getString("parentPrefCondId"); List<GenericValue> ebayProductStorePrefCond = delegator.findByAnd("EbayProductStorePrefCond", UtilMisc.toMap("parentPrefCondId", parentPrefCondId)); //Parameters @@ -1294,7 +1294,7 @@ public class EbayStoreAutoPreferences { String buyerMessage = bestOfferType.getBuyerMessage(); if (ignoreOfferMessage.equals("Y") && UtilValidate.isNotEmpty(buyerMessage)) { - GenericValue userOfferCheck = delegator.findByPrimaryKey("EbayUserBestOffer", UtilMisc.toMap("itemId", itemID, "userId", buyerUserID)); + GenericValue userOfferCheck = delegator.findOne("EbayUserBestOffer", UtilMisc.toMap("itemId", itemID, "userId", buyerUserID), false); if (UtilValidate.isEmpty(userOfferCheck)) { GenericValue ebayUserBestOffer = delegator.makeValue("EbayUserBestOffer"); ebayUserBestOffer.put("productStoreId", productStoreId); Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCustomerService.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCustomerService.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCustomerService.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreCustomerService.java Sat May 12 21:20:48 2012 @@ -130,7 +130,7 @@ public class EbayStoreCustomerService { } else { return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "EbayStoreRequiredContactStatusSetting", locale)); } - GenericValue ebayUserBestOffer = delegator.findByPrimaryKey("EbayUserBestOffer", UtilMisc.toMap("userId", userId, "itemId", itemId)); + GenericValue ebayUserBestOffer = delegator.findOne("EbayUserBestOffer", UtilMisc.toMap("userId", userId, "itemId", itemId), false); ebayUserBestOffer.set("contactStatus", contactStatus); ebayUserBestOffer.store(); @@ -159,7 +159,7 @@ public class EbayStoreCustomerService { String itemId = (String) context.get("itemId"); String userId = (String) context.get("userId"); try { - GenericValue ebayUserBestOffer = delegator.findByPrimaryKey("EbayUserBestOffer", UtilMisc.toMap("itemId", itemId, "userId", userId)); + GenericValue ebayUserBestOffer = delegator.findOne("EbayUserBestOffer", UtilMisc.toMap("itemId", itemId, "userId", userId), false); ebayUserBestOffer.remove(); result.put("productStoreId", productStoreId); } catch (Exception e) { Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java Sat May 12 21:20:48 2012 @@ -173,7 +173,7 @@ public class EbayStoreHelper { Debug.logError("Require field partyId.",module); return false; } - partyRole = delegator.findByPrimaryKey("PartyRole", UtilMisc.toMap("partyId", partyId, "roleTypeId", "EBAY_ACCOUNT")); + partyRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", partyId, "roleTypeId", "EBAY_ACCOUNT"), false); if (partyRole == null) { Debug.logError("Party Id ".concat(partyId).concat("not have roleTypeId EBAY_ACCOUNT"),module); return false; @@ -273,7 +273,7 @@ public class EbayStoreHelper { String autoPrefEnumId = (String) context.get("autoPrefEnumId"); String serviceName = (String) context.get("serviceName"); try { - GenericValue ebayProductPref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId)); + GenericValue ebayProductPref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId), false); String jobId = ebayProductPref.getString("autoPrefJobId"); if (UtilValidate.isNotEmpty(jobId)) { List<GenericValue> jobs = delegator.findByAnd("JobSandbox", UtilMisc.toMap("parentJobId", jobId, "statusId", "SERVICE_PENDING")); @@ -304,7 +304,7 @@ public class EbayStoreHelper { info = RecurrenceInfo.makeInfo(delegator, startTime, 4, 1, -1); infoId = info.primaryKey(); // set the persisted fields - GenericValue enumeration = delegator.findByPrimaryKey("Enumeration", UtilMisc.toMap("enumId", autoPrefEnumId)); + GenericValue enumeration = delegator.findOne("Enumeration", UtilMisc.toMap("enumId", autoPrefEnumId), false); jobName = enumeration.getString("description"); if (jobName == null) { jobName = Long.toString((new Date().getTime())); @@ -353,7 +353,7 @@ public class EbayStoreHelper { String productStoreId = (String) context.get("productStoreId"); String autoPrefEnumId = (String) context.get("autoPrefEnumId"); try { - GenericValue ebayProductPref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId)); + GenericValue ebayProductPref = delegator.findOne("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId), false); String jobId = ebayProductPref.getString("autoPrefJobId"); List<GenericValue> jobs = delegator.findByAnd("JobSandbox", UtilMisc.toMap("parentJobId", jobId ,"statusId", "SERVICE_PENDING")); @@ -436,7 +436,7 @@ public class EbayStoreHelper { AddItemRequestType req = new AddItemRequestType(); AddItemResponseType resp = null; try { - GenericValue userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + GenericValue userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); ItemType item = addItemCall.getItem(); req.setItem(item); resp = (AddItemResponseType) addItemCall.execute(req); @@ -616,7 +616,7 @@ public class EbayStoreHelper { GetOrdersRequestType req = new GetOrdersRequestType(); GetOrdersResponseType resp = null; try { - GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + GenericValue orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); if (UtilValidate.isNotEmpty(orderHeader)) { String externalId = orderHeader.getString("externalId").toString(); List<GenericValue> orderShipment = orderHeader.getRelated("OrderShipment"); Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java Sat May 12 21:20:48 2012 @@ -91,7 +91,7 @@ public class EbayStoreInventoryServices invenReq = new GetSellingManagerInventoryRequestType(); invenResp = (GetSellingManagerInventoryResponseType) invenCall.execute(invenReq); if (invenResp != null && "SUCCESS".equals(invenResp.getAck().toString())) { - GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId"))); + GenericValue ebayProductStoreInventory = delegator.findOne("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId")), false); SellingManagerProductType[] sellingManagerProductTypeList = invenResp.getSellingManagerProduct(); for (SellingManagerProductType sellingManagerProductType : sellingManagerProductTypeList) { @@ -150,9 +150,9 @@ public class EbayStoreInventoryServices productReq = new AddSellingManagerProductRequestType(); productReq.setFolderID(new Long(folderId)); SellingManagerProductDetailsType sellingManagerProductDetailsType = new SellingManagerProductDetailsType(); - GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId"))); + GenericValue ebayProductStoreInventory = delegator.findOne("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId")), false); - sellingManagerProductDetailsType.setProductName((delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId))).getString("internalName")); + sellingManagerProductDetailsType.setProductName((delegator.findOne("Product", UtilMisc.toMap("productId", productId), false)).getString("internalName")); //Must keep productId in SKU NUMBER because ebay allow productId field only long value. sellingManagerProductDetailsType.setCustomLabel(productId); if (ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue()); @@ -197,7 +197,7 @@ public class EbayStoreInventoryServices ReviseSellingManagerProductCall call = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator)); req = new ReviseSellingManagerProductRequestType(); SellingManagerProductDetailsType sellingManagerProductDetailsType = new SellingManagerProductDetailsType(); - GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId"))); + GenericValue ebayProductStoreInventory = delegator.findOne("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", context.get("facilityId"), "productStoreId", context.get("productStoreId")), false); Long ebayProductId = null; if (ebayProductStoreInventory != null && ebayProductStoreInventory.getLong("ebayProductId") == null) { Debug.logError("Can not update product "+productId+" has no ebay product Id in EbayProductStoreInventory. ", module); @@ -208,7 +208,7 @@ public class EbayStoreInventoryServices } sellingManagerProductDetailsType.setProductID(ebayProductId); - sellingManagerProductDetailsType.setProductName((delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId))).getString("internalName")); + sellingManagerProductDetailsType.setProductName((delegator.findOne("Product", UtilMisc.toMap("productId", productId), false)).getString("internalName")); //Must keep productId in SKU NUMBER because ebay allow productId field only long value. sellingManagerProductDetailsType.setCustomLabel(productId); if (ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue()); @@ -337,7 +337,7 @@ public class EbayStoreInventoryServices } try { if (productStoreId != null && ebayProductId != null) { - ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", facilityId, "productStoreId", productStoreId)); + ebayProductStoreInventory = delegator.findOne("EbayProductStoreInventory", UtilMisc.toMap("productId", productId, "facilityId", facilityId, "productStoreId", productStoreId), false); GetSellingManagerInventoryCall call = new GetSellingManagerInventoryCall(EbayStoreHelper.getApiContext(productStoreId, locale, delegator)); req = new GetSellingManagerInventoryRequestType(); resp = (GetSellingManagerInventoryResponseType) call.execute(req); Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java (original) +++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java Sat May 12 21:20:48 2012 @@ -104,7 +104,7 @@ public class EbayStoreOrder { if (UtilValidate.isEmpty(productStoreId)) { 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 (UtilValidate.isNotEmpty(productStore)) { defaultCurrencyUomId = productStore.getString("defaultCurrencyUomId"); payToPartyId = productStore.getString("payToPartyId"); @@ -150,7 +150,7 @@ public class EbayStoreOrder { 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)); } @@ -219,7 +219,7 @@ public class EbayStoreOrder { 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, context); String emailBuyer = context.get("emailBuyer").toString(); @@ -315,7 +315,7 @@ public class EbayStoreOrder { 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"); @@ -452,7 +452,7 @@ public class EbayStoreOrder { // 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/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy Sat May 12 21:20:48 2012 @@ -30,7 +30,7 @@ inMap.put("productStoreId", parameters.p inMap.put("userLogin", context.get("userLogin")); resultUser = dispatcher.runSync("getEbayStoreUser", inMap); ownerUser = resultUser.get("userLoginId"); -userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", ownerUser)); +userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", ownerUser), false); if (userLogin) { partyId = userLogin.get("partyId"); } Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy?rev=1337675&r1=1337674&r2=1337675&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy (original) +++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy Sat May 12 21:20:48 2012 @@ -64,7 +64,7 @@ content = [:]; item = addItem.getItem(); productId = item.getSKU(); - product = delegator.findByPrimaryKeyCache("Product", [productId : productId]); + product = delegator.findOne("Product", [productId : productId], true); contentWrapper = new ProductContentWrapper(product, request); content.productContentWrapper = contentWrapper; content.product = product; |
Free forum by Nabble | Edit this page |