diff --git a/applications/product/src/org/ofbiz/product/product/ProductWorker.java b/applications/product/src/org/ofbiz/product/product/ProductWorker.java index 207a82d5c6..89389fa66d 100644 --- a/applications/product/src/org/ofbiz/product/product/ProductWorker.java +++ b/applications/product/src/org/ofbiz/product/product/ProductWorker.java @@ -62,12 +62,6 @@ public class ProductWorker { public static final MathContext generalRounding = new MathContext(10); - /** @deprecated */ - @Deprecated - public static void getProduct(PageContext pageContext, String attributeName) { - getProduct(pageContext, attributeName, null); - } - public static boolean shippingApplies(GenericValue product) { String errMsg = ""; if (product != null) { @@ -153,30 +147,6 @@ public class ProductWorker { } } - /** @deprecated */ - @Deprecated - public static void getProduct(PageContext pageContext, String attributeName, String productId) { - Delegator delegator = (Delegator) pageContext.getRequest().getAttribute("delegator"); - ServletRequest request = pageContext.getRequest(); - - if (productId == null) - productId = UtilFormatOut.checkNull(request.getParameter("product_id"), request.getParameter("PRODUCT_ID")); - - if (productId.equals("")) - return; - - GenericValue product = null; - - try { - product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)); - } catch (GenericEntityException e) { - Debug.logWarning(e.getMessage(), module); - product = null; - } - if (product != null) - pageContext.setAttribute(attributeName, product); - } - public static String getInstanceAggregatedId(Delegator delegator, String instanceProductId) throws GenericEntityException { GenericValue instanceProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", instanceProductId)); @@ -295,46 +265,6 @@ public class ProductWorker { return available; } - /** @deprecated */ - @Deprecated - public static void getAssociatedProducts(PageContext pageContext, String productAttributeName, String assocPrefix) { - GenericValue product = (GenericValue) pageContext.getAttribute(productAttributeName); - - if (product == null) - return; - - try { - List upgradeProducts = product.getRelatedByAndCache("MainProductAssoc", - UtilMisc.toMap("productAssocTypeId", "PRODUCT_UPGRADE")); - - List complementProducts = product.getRelatedByAndCache("MainProductAssoc", - UtilMisc.toMap("productAssocTypeId", "PRODUCT_COMPLEMENT")); - - List obsolescenceProducts = product.getRelatedByAndCache("AssocProductAssoc", - UtilMisc.toMap("productAssocTypeId", "PRODUCT_OBSOLESCENCE")); - - List obsoleteByProducts = product.getRelatedByAndCache("MainProductAssoc", - UtilMisc.toMap("productAssocTypeId", "PRODUCT_OBSOLESCENCE")); - - // since ProductAssoc records have a fromDate and thruDate, we can filter by now so that only assocs in the date range are included - upgradeProducts = EntityUtil.filterByDate(upgradeProducts); - complementProducts = EntityUtil.filterByDate(complementProducts); - obsolescenceProducts = EntityUtil.filterByDate(obsolescenceProducts); - obsoleteByProducts = EntityUtil.filterByDate(obsoleteByProducts); - - if (UtilValidate.isNotEmpty(upgradeProducts)) - pageContext.setAttribute(assocPrefix + "upgrade", upgradeProducts); - if (UtilValidate.isNotEmpty(complementProducts)) - pageContext.setAttribute(assocPrefix + "complement", complementProducts); - if (UtilValidate.isNotEmpty(obsolescenceProducts)) - pageContext.setAttribute(assocPrefix + "obsolescence", obsolescenceProducts); - if (UtilValidate.isNotEmpty(obsoleteByProducts)) - pageContext.setAttribute(assocPrefix + "obsoleteby", obsoleteByProducts); - } catch (GenericEntityException e) { - Debug.logWarning(e, module); - } - } - /** * Gets ProductFeature GenericValue for all distinguishing features of a variant product. * Distinguishing means all features that are selectable on the corresponding virtual product and standard on the variant plus all DISTINGUISHING_FEAT assoc type features on the variant.