Class ProductUtilServices


  • public final class ProductUtilServices
    extends java.lang.Object
    Product Services
    • 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 attachProductFeaturesToCategory​(java.lang.String productCategoryId, java.util.Set<java.lang.String> productFeatureTypeIdsToInclude, java.util.Set<java.lang.String> productFeatureTypeIdsToExclude, Delegator delegator, boolean doSubCategories, java.sql.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 too
      static java.util.Map<java.lang.String,​java.lang.Object> attachProductFeaturesToCategory​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> clearAllVirtualProductImageNames​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> discVirtualsWithDiscVariants​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      First expire all ProductAssocs for all disc variants, then disc all virtuals that have all expired variant ProductAssocs
      protected static void duplicateRelated​(GenericValue product, java.lang.String title, java.lang.String relatedEntityName, java.lang.String productIdField, java.lang.String variantProductId, java.sql.Timestamp nowTimestamp, boolean removeOld, Delegator delegator, boolean test)  
      static java.util.Map<java.lang.String,​java.lang.Object> makeStandAloneFromSingleVariantVirtuals​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> mergeVirtualWithSingleVariant​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> removeCategoryMembersOfDiscProducts​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      for all disc products, remove from category memberships
      static java.util.Map<java.lang.String,​java.lang.Object> removeDuplicateOpenEndedCategoryMembers​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> setAllProductImageNames​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • discVirtualsWithDiscVariants

        public static java.util.Map<java.lang.String,​java.lang.Object> discVirtualsWithDiscVariants​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        First expire all ProductAssocs for all disc variants, then disc all virtuals that have all expired variant ProductAssocs
      • removeCategoryMembersOfDiscProducts

        public static java.util.Map<java.lang.String,​java.lang.Object> removeCategoryMembersOfDiscProducts​(DispatchContext dctx,
                                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        for all disc products, remove from category memberships
      • removeDuplicateOpenEndedCategoryMembers

        public static java.util.Map<java.lang.String,​java.lang.Object> removeDuplicateOpenEndedCategoryMembers​(DispatchContext dctx,
                                                                                                                     java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • makeStandAloneFromSingleVariantVirtuals

        public static java.util.Map<java.lang.String,​java.lang.Object> makeStandAloneFromSingleVariantVirtuals​(DispatchContext dctx,
                                                                                                                     java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • mergeVirtualWithSingleVariant

        public static java.util.Map<java.lang.String,​java.lang.Object> mergeVirtualWithSingleVariant​(DispatchContext dctx,
                                                                                                           java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • duplicateRelated

        protected static void duplicateRelated​(GenericValue product,
                                               java.lang.String title,
                                               java.lang.String relatedEntityName,
                                               java.lang.String productIdField,
                                               java.lang.String variantProductId,
                                               java.sql.Timestamp nowTimestamp,
                                               boolean removeOld,
                                               Delegator delegator,
                                               boolean test)
                                        throws GenericEntityException
        Throws:
        GenericEntityException
      • setAllProductImageNames

        public static java.util.Map<java.lang.String,​java.lang.Object> setAllProductImageNames​(DispatchContext dctx,
                                                                                                     java.util.Map<java.lang.String,​? extends java.lang.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

        public static java.util.Map<java.lang.String,​java.lang.Object> clearAllVirtualProductImageNames​(DispatchContext dctx,
                                                                                                              java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • attachProductFeaturesToCategory

        public static java.util.Map<java.lang.String,​java.lang.Object> attachProductFeaturesToCategory​(DispatchContext dctx,
                                                                                                             java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • attachProductFeaturesToCategory

        public static void attachProductFeaturesToCategory​(java.lang.String productCategoryId,
                                                           java.util.Set<java.lang.String> productFeatureTypeIdsToInclude,
                                                           java.util.Set<java.lang.String> productFeatureTypeIdsToExclude,
                                                           Delegator delegator,
                                                           boolean doSubCategories,
                                                           java.sql.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