Class ProductEvents


  • public class ProductEvents
    extends java.lang.Object
    Product Information Related Events
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
      static java.lang.String resource  
    • Constructor Summary

      Constructors 
      Constructor Description
      ProductEvents()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.String addProductFeatures​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String addProductTags​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Event add product tags
      static java.lang.String addProductToCategories​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String addProductToComparisonList​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String checkStoreCustomerRole​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      If ProductStore.requireCustomerRole == Y then the loggedin user must be associated with the store in the customer role.
      protected static void checkUpdateFeatureApplByDescription​(java.lang.String productId, GenericValue product, java.lang.String description, java.lang.String productFeatureTypeId, GenericValue productFeatureType, java.lang.String productFeatureApplTypeId, java.sql.Timestamp nowTimestamp, Delegator delegator, java.util.Set<java.lang.String> descriptionsToRemove, java.util.Set<java.lang.String> descriptionsRemoved)  
      static java.lang.String clearAllLastViewed​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Event to clear the last viewed history (products/categories/searchs)
      static java.lang.String clearLastViewedCategories​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Event to clear the last viewed categories
      static java.lang.String clearLastViewedProducts​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Event to clear the last vieweed products
      static java.lang.String clearProductComparisonList​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.util.List<GenericValue> getProductCompareList​(javax.servlet.http.HttpServletRequest request)  
      static java.math.BigDecimal parseBigDecimalForEntity​(java.lang.String bigDecimalString)
      Return nulls for empty strings, as the entity engine can deal with nulls.
      static java.lang.Double parseDoubleForEntity​(java.lang.String doubleString)
      Deprecated.
      static java.lang.String removeFeatureApplsByFeatureTypeId​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String removeProductFeatureAppl​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String removeProductFromComparisonList​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String setDefaultStoreSettings​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Simple event to set the users initial locale and currency Uom based on website product store
      static java.lang.String tellAFriend​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String updateAllKeywords​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Updates/adds keywords for all products
      static java.lang.String updateProductAssoc​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Updates ProductAssoc information according to UPDATE_MODE parameter
      static java.lang.String updateProductCategoryMember​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String updateProductQuickAdminSelFeat​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      static java.lang.String updateProductQuickAdminShipping​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      • 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
    • Constructor Detail

      • ProductEvents

        public ProductEvents()
    • Method Detail

      • updateAllKeywords

        public static java.lang.String updateAllKeywords​(javax.servlet.http.HttpServletRequest request,
                                                         javax.servlet.http.HttpServletResponse response)
        Updates/adds keywords for all products
        Parameters:
        request - HTTPRequest object for the current request
        response - HTTPResponse object for the current request
        Returns:
        String specifying the exit status of this event
      • updateProductAssoc

        public static java.lang.String updateProductAssoc​(javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
        Updates ProductAssoc information according to UPDATE_MODE parameter
        Parameters:
        request - The HTTPRequest object for the current request
        response - The HTTPResponse object for the current request
        Returns:
        String specifying the exit status of this event
      • clearLastViewedCategories

        public static java.lang.String clearLastViewedCategories​(javax.servlet.http.HttpServletRequest request,
                                                                 javax.servlet.http.HttpServletResponse response)
        Event to clear the last viewed categories
      • clearLastViewedProducts

        public static java.lang.String clearLastViewedProducts​(javax.servlet.http.HttpServletRequest request,
                                                               javax.servlet.http.HttpServletResponse response)
        Event to clear the last vieweed products
      • clearAllLastViewed

        public static java.lang.String clearAllLastViewed​(javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
        Event to clear the last viewed history (products/categories/searchs)
      • updateProductQuickAdminShipping

        public static java.lang.String updateProductQuickAdminShipping​(javax.servlet.http.HttpServletRequest request,
                                                                       javax.servlet.http.HttpServletResponse response)
      • updateProductQuickAdminSelFeat

        public static java.lang.String updateProductQuickAdminSelFeat​(javax.servlet.http.HttpServletRequest request,
                                                                      javax.servlet.http.HttpServletResponse response)
      • checkUpdateFeatureApplByDescription

        protected static void checkUpdateFeatureApplByDescription​(java.lang.String productId,
                                                                  GenericValue product,
                                                                  java.lang.String description,
                                                                  java.lang.String productFeatureTypeId,
                                                                  GenericValue productFeatureType,
                                                                  java.lang.String productFeatureApplTypeId,
                                                                  java.sql.Timestamp nowTimestamp,
                                                                  Delegator delegator,
                                                                  java.util.Set<java.lang.String> descriptionsToRemove,
                                                                  java.util.Set<java.lang.String> descriptionsRemoved)
                                                           throws GenericEntityException
        Throws:
        GenericEntityException
      • removeFeatureApplsByFeatureTypeId

        public static java.lang.String removeFeatureApplsByFeatureTypeId​(javax.servlet.http.HttpServletRequest request,
                                                                         javax.servlet.http.HttpServletResponse response)
      • removeProductFeatureAppl

        public static java.lang.String removeProductFeatureAppl​(javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response)
      • addProductToCategories

        public static java.lang.String addProductToCategories​(javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
      • updateProductCategoryMember

        public static java.lang.String updateProductCategoryMember​(javax.servlet.http.HttpServletRequest request,
                                                                   javax.servlet.http.HttpServletResponse response)
      • addProductFeatures

        public static java.lang.String addProductFeatures​(javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
      • setDefaultStoreSettings

        public static java.lang.String setDefaultStoreSettings​(javax.servlet.http.HttpServletRequest request,
                                                               javax.servlet.http.HttpServletResponse response)
        Simple event to set the users initial locale and currency Uom based on website product store
      • checkStoreCustomerRole

        public static java.lang.String checkStoreCustomerRole​(javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
        If ProductStore.requireCustomerRole == Y then the loggedin user must be associated with the store in the customer role. This event method is called from the ProductEvents.storeCheckLogin and ProductEvents.storeLogin
        Parameters:
        request -
        response -
        Returns:
        String with response, maybe "success" or "error" if logged in user is not associated with the ProductStore in the CUSTOMER role.
      • tellAFriend

        public static java.lang.String tellAFriend​(javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
      • parseDoubleForEntity

        @Deprecated
        public static java.lang.Double parseDoubleForEntity​(java.lang.String doubleString)
                                                     throws java.lang.NumberFormatException
        Deprecated.
        Throws:
        java.lang.NumberFormatException
      • getProductCompareList

        public static java.util.List<GenericValue> getProductCompareList​(javax.servlet.http.HttpServletRequest request)
      • addProductToComparisonList

        public static java.lang.String addProductToComparisonList​(javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
      • removeProductFromComparisonList

        public static java.lang.String removeProductFromComparisonList​(javax.servlet.http.HttpServletRequest request,
                                                                       javax.servlet.http.HttpServletResponse response)
      • clearProductComparisonList

        public static java.lang.String clearProductComparisonList​(javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
      • parseBigDecimalForEntity

        public static java.math.BigDecimal parseBigDecimalForEntity​(java.lang.String bigDecimalString)
                                                             throws java.lang.NumberFormatException
        Return nulls for empty strings, as the entity engine can deal with nulls. This will provide blanks in fields where BigDecimal display. Blank meaning null, vs. 0 which means 0
        Parameters:
        bigDecimalString -
        Returns:
        a BigDecimal for the parsed value
        Throws:
        java.lang.NumberFormatException
      • addProductTags

        public static java.lang.String addProductTags​(javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
        Event add product tags