Class ProductSearchSession


  • public class ProductSearchSession
    extends java.lang.Object
    Utility class with methods to prepare and perform ProductSearch operations in the content of an HttpSession
    • Field Detail

      • module

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

      • ProductSearchSession

        public ProductSearchSession()
    • Method Detail

      • checkSaveSearchOptionsHistory

        public static void checkSaveSearchOptionsHistory​(HttpSession session)
      • clearSearchOptionsHistoryList

        public static void clearSearchOptionsHistoryList​(HttpSession session)
      • setCurrentSearchFromHistory

        public static void setCurrentSearchFromHistory​(int index,
                                                       boolean removeOld,
                                                       HttpSession session)
      • checkDoKeywordOverride

        public static final java.lang.String checkDoKeywordOverride​(HttpServletRequest request,
                                                                    HttpServletResponse response)
        A ControlServlet event method used to check to see if there is an override for any of the current keywords in the search
      • searchDo

        public static java.util.ArrayList<java.lang.String> searchDo​(HttpSession session,
                                                                     Delegator delegator,
                                                                     java.lang.String prodCatalogId)
      • searchClear

        public static void searchClear​(HttpSession session)
      • searchGetConstraintStrings

        public static java.util.List<java.lang.String> searchGetConstraintStrings​(boolean detailed,
                                                                                  HttpSession session,
                                                                                  Delegator delegator)
      • searchGetSortOrderString

        public static java.lang.String searchGetSortOrderString​(boolean detailed,
                                                                HttpServletRequest request)
      • searchAddFeatureIdConstraints

        public static void searchAddFeatureIdConstraints​(java.util.Collection<java.lang.String> featureIds,
                                                         java.lang.Boolean exclude,
                                                         HttpServletRequest request)
      • searchRemoveConstraint

        public static void searchRemoveConstraint​(int index,
                                                  HttpSession session)
      • processSearchParameters

        public static void processSearchParameters​(java.util.Map<java.lang.String,​java.lang.Object> parameters,
                                                   HttpServletRequest request)
      • getProductSearchResult

        public static java.util.Map<java.lang.String,​java.lang.Object> getProductSearchResult​(HttpServletRequest request,
                                                                                                    Delegator delegator,
                                                                                                    java.lang.String prodCatalogId)
      • makeSearchParametersString

        public static java.lang.String makeSearchParametersString​(HttpSession session)
      • listCountByFeatureForType

        public static java.util.List<java.util.Map<java.lang.String,​java.lang.String>> listCountByFeatureForType​(java.lang.String productFeatureTypeId,
                                                                                                                       HttpSession session,
                                                                                                                       Delegator delegator)
        This method returns a list of productId counts grouped by productFeatureId's of input productFeatureTypeId, the constraint being applied on current ProductSearchConstraint list in session.
        Parameters:
        productFeatureTypeId - The productFeatureTypeId, productFeatureId's of which should be considered.
        session - Current session.
        delegator - The delegator object.
        Returns:
        List of Maps containing productFeatureId, productFeatureTypeId, description, featureCount.
      • getCategoryCostraintIndex

        public static int getCategoryCostraintIndex​(HttpSession session)
      • getCountForListPriceRange

        public static long getCountForListPriceRange​(java.math.BigDecimal priceLow,
                                                     java.math.BigDecimal priceHigh,
                                                     HttpSession session,
                                                     Delegator delegator)
        This method returns count of products within a given price range, the constraint being applied on current ProductSearchConstraint list in session.
        Parameters:
        priceLow - The low price.
        priceHigh - The high price.
        session - Current session.
        delegator - The delegator object.
        Returns:
        The long value of count of products.
      • getCountForProductCategory

        public static long getCountForProductCategory​(java.lang.String productCategoryId,
                                                      HttpSession session,
                                                      Delegator delegator)
        This method returns count of products in a given category (including all sub categories), the constraint being applied on current ProductSearchConstraint list in session.
        Parameters:
        productCategoryId - productCategoryId for which the count should be returned.
        session - Current session.
        delegator - The delegator object.
        Returns:
        The long value of count of products.