Package org.apache.ofbiz.product.config
Class ProductConfigWorker
- java.lang.Object
-
- org.apache.ofbiz.product.config.ProductConfigWorker
-
public final class ProductConfigWorker extends java.lang.Object
Product Config Worker class to reduce code in templates.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
fillProductConfigWrapper(ProductConfigWrapper configWrapper, HttpServletRequest request)
static ProductConfigWrapper
getProductConfigWrapper(java.lang.String productId, java.lang.String currencyUomId, HttpServletRequest request)
static ProductConfigWrapper
loadProductConfigWrapper(Delegator delegator, LocalDispatcher dispatcher, java.lang.String configId, java.lang.String productId, java.lang.String productStoreId, java.lang.String catalogId, java.lang.String webSiteId, java.lang.String currencyUomId, java.util.Locale locale, GenericValue autoUserLogin)
Creates a new ProductConfigWrapper for productId and configures it according to ProductConfigConfig entity with configId ProductConfigConfig entity stores only the selected options, and the product price is calculated from input paramsstatic void
storeProductConfigWrapper(ProductConfigWrapper configWrapper, Delegator delegator)
First search persisted configurations and update configWrapper.configId if found.
-
-
-
Method Detail
-
getProductConfigWrapper
public static ProductConfigWrapper getProductConfigWrapper(java.lang.String productId, java.lang.String currencyUomId, HttpServletRequest request)
-
fillProductConfigWrapper
public static void fillProductConfigWrapper(ProductConfigWrapper configWrapper, HttpServletRequest request)
-
storeProductConfigWrapper
public static void storeProductConfigWrapper(ProductConfigWrapper configWrapper, Delegator delegator)
First search persisted configurations and update configWrapper.configId if found. Otherwise store ProductConfigWrapper to ProductConfigConfig entity and updates configWrapper.configId with new configId This method persists only the selected options, price data is lost.- Parameters:
configWrapper
- the ProductConfigWrapper objectdelegator
- the delegator
-
loadProductConfigWrapper
public static ProductConfigWrapper loadProductConfigWrapper(Delegator delegator, LocalDispatcher dispatcher, java.lang.String configId, java.lang.String productId, java.lang.String productStoreId, java.lang.String catalogId, java.lang.String webSiteId, java.lang.String currencyUomId, java.util.Locale locale, GenericValue autoUserLogin)
Creates a new ProductConfigWrapper for productId and configures it according to ProductConfigConfig entity with configId ProductConfigConfig entity stores only the selected options, and the product price is calculated from input params- Parameters:
delegator
-dispatcher
-configId
- configuration IdproductId
- AGGRAGATED productIdproductStoreId
- needed for price calculationscatalogId
- needed for price calculationswebSiteId
- needed for price calculationscurrencyUomId
- needed for price calculationslocale
-autoUserLogin
-- Returns:
- ProductConfigWrapper
-
-