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:21:16 UTC
svn commit: r1337678 - in /ofbiz/trunk/specialpurpose/googlebase:
src/org/ofbiz/googlebase/ProductsExportToGoogle.java
webapp/googlebase/WEB-INF/actions/FilterProducts.groovy
webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl
Author: doogie
Date: Sat May 12 21:21:16 2012
New Revision: 1337678
URL: http://svn.apache.org/viewvc?rev=1337678&view=rev
Log:
DEPRECATION: specialpurpose/googlebase: findByPrimaryKey variants
replaced with findOne
Modified:
ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy
ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl
Modified: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java?rev=1337678&r1=1337677&r2=1337678&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (original)
+++ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java Sat May 12 21:21:16 2012
@@ -436,7 +436,7 @@ public class ProductsExportToGoogle {
if (productAndInfos.size() > 0) {
for (GenericValue productContentAndInfo : productAndInfos ) {
String dataReSourceId = productContentAndInfo.getString("dataResourceId");
- GenericValue electronicText = delegator.findByPrimaryKey("ElectronicText", UtilMisc.toMap("dataResourceId", dataReSourceId));
+ GenericValue electronicText = delegator.findOne("ElectronicText", UtilMisc.toMap("dataResourceId", dataReSourceId), false);
if ("PRODUCT_NAME".equals(productContentAndInfo.getString("productContentTypeId")))
productName = electronicText.getString("textData");
if ("LONG_DESCRIPTION".equals(productContentAndInfo.getString("productContentTypeId")))
@@ -495,7 +495,7 @@ public class ProductsExportToGoogle {
String googleProductId = null;
if (!"insert".equals(actionType)) {
try {
- googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID_" + localeString));
+ googleProduct = delegator.findOne("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID_" + localeString), false);
if (UtilValidate.isNotEmpty(googleProduct)) {
googleProductId = googleProduct.getString("idValue");
}
@@ -583,7 +583,7 @@ public class ProductsExportToGoogle {
UtilXml.addChildElementNSValue(entryElem, "g:brand", prod.getString("brandName"), feedDocument, googleBaseNSUrl);
}
try {
- googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "SKU"));
+ googleProduct = delegator.findOne("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "SKU"), false);
if (UtilValidate.isNotEmpty(googleProduct)) {
UtilXml.addChildElementNSValue(entryElem, "g:ean", googleProduct.getString("idValue"), feedDocument, googleBaseNSUrl);
}
@@ -775,7 +775,7 @@ public class ProductsExportToGoogle {
UtilXml.addChildElementNSValue(entryElem, "g:online_only", "y", feedDocument, googleBaseNSUrl);
//Add shipping weight
if (UtilValidate.isNotEmpty(product.getString("weight")) && UtilValidate.isNotEmpty(product.getString("weightUomId"))) {
- GenericValue uom = delegator.findByPrimaryKey("Uom", UtilMisc.toMap("uomId", product.getString("weightUomId")));
+ GenericValue uom = delegator.findOne("Uom", UtilMisc.toMap("uomId", product.getString("weightUomId")), false);
String shippingWeight = product.getString("weight") + " " + uom.getString("description");
UtilXml.addChildElementNSValue(entryElem, "g:shipping_weight", shippingWeight, feedDocument, googleBaseNSUrl);
}
Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy?rev=1337678&r1=1337677&r2=1337678&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy (original)
+++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy Sat May 12 21:21:16 2012
@@ -42,7 +42,7 @@ if (UtilValidate.isNotEmpty(productIds)
if (UtilValidate.isNotEmpty(productCategoryMember)) {
if ("Y".equals(active) && "Y".equals(notSynced)) {
thruDate = productCategoryMember.get("thruDate");
- goodIdentification = delegator.findByPrimaryKey("GoodIdentification", [productId : productId, goodIdentificationTypeId : "GOOGLE_ID_" + defaultLocaleString]);
+ goodIdentification = delegator.findOne("GoodIdentification", [productId : productId, goodIdentificationTypeId : "GOOGLE_ID_" + defaultLocaleString], false);
if (UtilValidate.isEmpty(thruDate) && UtilValidate.isEmpty(goodIdentification)) {
productList.add(productId);
}
@@ -53,7 +53,7 @@ if (UtilValidate.isNotEmpty(productIds)
}
parameters.GOOGLE_SYNCED = "N"
} else if ("Y".equals(notSynced)) {
- goodIdentification = delegator.findByPrimaryKey("GoodIdentification", [productId : productId, goodIdentificationTypeId : "GOOGLE_ID_" + defaultLocaleString]);
+ goodIdentification = delegator.findOne("GoodIdentification", [productId : productId, goodIdentificationTypeId : "GOOGLE_ID_" + defaultLocaleString], false);
if (UtilValidate.isEmpty(goodIdentification)) {
productList.add(productId);
}
@@ -72,7 +72,7 @@ def notDiscontProdList = []
if(parameters.DISCONTINUED_PRODUCT == 'Y'){
productIds.each { value ->
def stockIsZero = dispatcher.runSync("isStoreInventoryAvailable", ["productId": value, "productStoreId": parameters.productStoreId, "quantity": BigDecimal.valueOf(1.00)]);
- def thisProduct = delegator.findByPrimaryKey("Product", [productId : value]);
+ def thisProduct = delegator.findOne("Product", [productId : value], false);
if (stockIsZero.get("available") == 'Y'){
notDiscontProdList.add(value);
}else {
Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl?rev=1337678&r1=1337677&r2=1337678&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl (original)
+++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl Sat May 12 21:21:16 2012
@@ -291,7 +291,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">