Package org.apache.ofbiz.product.product
Class ProductUtilServices
java.lang.Object
org.apache.ofbiz.product.product.ProductUtilServices
Product Services
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
attachProductFeaturesToCategory
(String productCategoryId, Set<String> productFeatureTypeIdsToInclude, Set<String> productFeatureTypeIdsToExclude, Delegator delegator, boolean doSubCategories, Timestamp nowTimestamp) Get all features associated with products and associate them with a feature group attached to the category for each feature type; includes products associated with this category only, but will also associate all feature groups of sub-categories with this category, optionally calls this method for all sub-categories tooattachProductFeaturesToCategory
(DispatchContext dctx, Map<String, ? extends Object> context) clearAllVirtualProductImageNames
(DispatchContext dctx, Map<String, ? extends Object> context) discVirtualsWithDiscVariants
(DispatchContext dctx, Map<String, ? extends Object> context) First expire all ProductAssocs for all disc variants, then disc all virtuals that have all expired variant ProductAssocsprotected static void
duplicateRelated
(GenericValue product, String title, String relatedEntityName, String productIdField, String variantProductId, Timestamp nowTimestamp, boolean removeOld, Delegator delegator, boolean test) makeStandAloneFromSingleVariantVirtuals
(DispatchContext dctx, Map<String, ? extends Object> context) mergeVirtualWithSingleVariant
(DispatchContext dctx, Map<String, ? extends Object> context) removeCategoryMembersOfDiscProducts
(DispatchContext dctx, Map<String, ? extends Object> context) for all disc products, remove from category membershipsremoveDuplicateOpenEndedCategoryMembers
(DispatchContext dctx, Map<String, ? extends Object> context) setAllProductImageNames
(DispatchContext dctx, Map<String, ? extends Object> context) reset all product image names with a certain pattern, ex: /images/products/${size}/${productId}.jpg NOTE: only works on fields of Product right now
-
Method Details
-
discVirtualsWithDiscVariants
public static Map<String,Object> discVirtualsWithDiscVariants(DispatchContext dctx, Map<String, ? extends Object> context) First expire all ProductAssocs for all disc variants, then disc all virtuals that have all expired variant ProductAssocs -
removeCategoryMembersOfDiscProducts
public static Map<String,Object> removeCategoryMembersOfDiscProducts(DispatchContext dctx, Map<String, ? extends Object> context) for all disc products, remove from category memberships -
removeDuplicateOpenEndedCategoryMembers
-
makeStandAloneFromSingleVariantVirtuals
-
mergeVirtualWithSingleVariant
-
duplicateRelated
protected static void duplicateRelated(GenericValue product, String title, String relatedEntityName, String productIdField, String variantProductId, Timestamp nowTimestamp, boolean removeOld, Delegator delegator, boolean test) throws GenericEntityException - Throws:
GenericEntityException
-
setAllProductImageNames
public static Map<String,Object> setAllProductImageNames(DispatchContext dctx, Map<String, ? extends Object> context) reset all product image names with a certain pattern, ex: /images/products/${size}/${productId}.jpg NOTE: only works on fields of Product right now -
clearAllVirtualProductImageNames
-
attachProductFeaturesToCategory
-
attachProductFeaturesToCategory
public static void attachProductFeaturesToCategory(String productCategoryId, Set<String> productFeatureTypeIdsToInclude, Set<String> productFeatureTypeIdsToExclude, Delegator delegator, boolean doSubCategories, Timestamp nowTimestamp) throws GenericEntityException Get all features associated with products and associate them with a feature group attached to the category for each feature type; includes products associated with this category only, but will also associate all feature groups of sub-categories with this category, optionally calls this method for all sub-categories too- Throws:
GenericEntityException
-