Class ProductSearchSession

java.lang.Object
org.apache.ofbiz.product.product.ProductSearchSession

public class ProductSearchSession extends Object
Utility class with methods to prepare and perform ProductSearch operations in the content of an HttpSession
  • Constructor Details

    • ProductSearchSession

      public ProductSearchSession()
  • Method Details

    • getProductSearchOptions

      public static ProductSearchSession.ProductSearchOptions getProductSearchOptions(HttpSession session)
    • checkSaveSearchOptionsHistory

      public static void checkSaveSearchOptionsHistory(HttpSession session)
    • getSearchOptionsHistoryList

      public static List<ProductSearchSession.ProductSearchOptions> getSearchOptionsHistoryList(HttpSession session)
    • clearSearchOptionsHistoryList

      public static void clearSearchOptionsHistoryList(HttpSession session)
    • setCurrentSearchFromHistory

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

      public static String clearSearchOptionsHistoryList(HttpServletRequest request, HttpServletResponse response)
    • setCurrentSearchFromHistory

      public static String setCurrentSearchFromHistory(HttpServletRequest request, HttpServletResponse response)
    • checkDoKeywordOverride

      public static final 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 ArrayList<String> searchDo(HttpSession session, Delegator delegator, String prodCatalogId)
    • searchClear

      public static void searchClear(HttpSession session)
    • searchGetConstraintStrings

      public static List<String> searchGetConstraintStrings(boolean detailed, HttpSession session, Delegator delegator)
    • searchGetSortOrderString

      public static String searchGetSortOrderString(boolean detailed, HttpServletRequest request)
    • searchSetSortOrder

      public static void searchSetSortOrder(ProductSearch.ResultSortOrder resultSortOrder, HttpSession session)
    • searchAddFeatureIdConstraints

      public static void searchAddFeatureIdConstraints(Collection<String> featureIds, Boolean exclude, HttpServletRequest request)
    • searchAddConstraint

      public static void searchAddConstraint(ProductSearch.ProductSearchConstraint productSearchConstraint, HttpSession session)
    • searchRemoveConstraint

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

      public static void processSearchParameters(Map<String,Object> parameters, HttpServletRequest request)
    • getProductSearchResult

      public static Map<String,Object> getProductSearchResult(HttpServletRequest request, Delegator delegator, String prodCatalogId)
    • makeSearchParametersString

      public static String makeSearchParametersString(HttpSession session)
    • makeSearchParametersString

      public static String makeSearchParametersString(ProductSearchSession.ProductSearchOptions productSearchOptions)
    • listCountByFeatureForType

      public static List<Map<String,String>> listCountByFeatureForType(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(BigDecimal priceLow, 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(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.