Package org.apache.ofbiz.product.product
Class ProductSearchSession
java.lang.Object
org.apache.ofbiz.product.product.ProductSearchSession
Utility class with methods to prepare and perform ProductSearch operations in the content of an HttpSession
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 searchstatic void
checkSaveSearchOptionsHistory
(HttpSession session) static String
clearSearchOptionsHistoryList
(HttpServletRequest request, HttpServletResponse response) static void
clearSearchOptionsHistoryList
(HttpSession session) static int
getCategoryCostraintIndex
(HttpSession session) 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.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.getProductSearchOptions
(HttpSession session) getProductSearchResult
(HttpServletRequest request, Delegator delegator, String prodCatalogId) getSearchOptionsHistoryList
(HttpSession session) 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.static String
makeSearchParametersString
(HttpSession session) static String
makeSearchParametersString
(ProductSearchSession.ProductSearchOptions productSearchOptions) static void
processSearchParameters
(Map<String, Object> parameters, HttpServletRequest request) static void
searchAddConstraint
(ProductSearch.ProductSearchConstraint productSearchConstraint, HttpSession session) static void
searchAddFeatureIdConstraints
(Collection<String> featureIds, Boolean exclude, HttpServletRequest request) static void
searchClear
(HttpSession session) searchDo
(HttpSession session, Delegator delegator, String prodCatalogId) searchGetConstraintStrings
(boolean detailed, HttpSession session, Delegator delegator) static String
searchGetSortOrderString
(boolean detailed, HttpServletRequest request) static void
searchRemoveConstraint
(int index, HttpSession session) static void
searchSetSortOrder
(ProductSearch.ResultSortOrder resultSortOrder, HttpSession session) static void
setCurrentSearchFromHistory
(int index, boolean removeOld, HttpSession session) static String
setCurrentSearchFromHistory
(HttpServletRequest request, HttpServletResponse response)
-
Constructor Details
-
ProductSearchSession
public ProductSearchSession()
-
-
Method Details
-
getProductSearchOptions
public static ProductSearchSession.ProductSearchOptions getProductSearchOptions(HttpSession session) -
checkSaveSearchOptionsHistory
-
getSearchOptionsHistoryList
public static List<ProductSearchSession.ProductSearchOptions> getSearchOptionsHistoryList(HttpSession session) -
clearSearchOptionsHistoryList
-
setCurrentSearchFromHistory
-
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
-
searchGetConstraintStrings
public static List<String> searchGetConstraintStrings(boolean detailed, HttpSession session, Delegator delegator) -
searchGetSortOrderString
-
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
-
processSearchParameters
public static void processSearchParameters(Map<String, Object> parameters, HttpServletRequest request) -
getProductSearchResult
-
makeSearchParametersString
-
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
-
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.
-