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​(javax.servlet.http.HttpSession session)
      • clearSearchOptionsHistoryList

        public static void clearSearchOptionsHistoryList​(javax.servlet.http.HttpSession session)
      • setCurrentSearchFromHistory

        public static void setCurrentSearchFromHistory​(int index,
                                                       boolean removeOld,
                                                       javax.servlet.http.HttpSession session)
      • clearSearchOptionsHistoryList

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

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

        public static final java.lang.String checkDoKeywordOverride​(javax.servlet.http.HttpServletRequest request,
                                                                    javax.servlet.http.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​(javax.servlet.http.HttpSession session,
                                                                     Delegator delegator,
                                                                     java.lang.String prodCatalogId)
      • searchClear

        public static void searchClear​(javax.servlet.http.HttpSession session)
      • searchGetConstraintStrings

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

        public static java.lang.String searchGetSortOrderString​(boolean detailed,
                                                                javax.servlet.http.HttpServletRequest request)
      • searchSetSortOrder

        public static void searchSetSortOrder​(ProductSearch.ResultSortOrder resultSortOrder,
                                              javax.servlet.http.HttpSession session)
      • searchAddFeatureIdConstraints

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

        public static void searchRemoveConstraint​(int index,
                                                  javax.servlet.http.HttpSession session)
      • processSearchParameters

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

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

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

        public static java.util.List<java.util.Map<java.lang.String,​java.lang.String>> listCountByFeatureForType​(java.lang.String productFeatureTypeId,
                                                                                                                       javax.servlet.http.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​(javax.servlet.http.HttpSession session)
      • getCountForListPriceRange

        public static long getCountForListPriceRange​(java.math.BigDecimal priceLow,
                                                     java.math.BigDecimal priceHigh,
                                                     javax.servlet.http.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,
                                                      javax.servlet.http.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.