Class AbstractCollectionPageSearchProcessor
java.lang.Object
com.broadleafcommerce.advancedcms.search.AbstractCollectionPageSearchProcessor
- All Implemented Interfaces:
CollectionPageSearchProcessor
- Direct Known Subclasses:
DefaultCollectionPageSearchProcessor
public abstract class AbstractCollectionPageSearchProcessor
extends Object
implements CollectionPageSearchProcessor
This class is a useful starting point for Search Processors that need to retrieve all of the collection pages
of a given type while applying the rules they are attached to.
- Author:
- Jerry Ocanas (jocanas), Phillip Verheyden (phillipuniverse)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AdvancedPageServiceprotected static final Stringprotected static final org.apache.commons.logging.Logprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildMvelParameters(jakarta.servlet.http.HttpServletRequest request) MVEL is used to process the content targeting rules.protected SearchResultconstructSearchResultObject(List<org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria> originalCriteria, List<org.broadleafcommerce.common.page.dto.PageDTO> results) Convenience method for constructing the return object.protected List<org.broadleafcommerce.common.page.dto.PageDTO>fetchAllPagesAssociatedWithType(com.broadleafcommerce.theme.domain.page.PageType type) Fetches all the Structured Content of the StructuredContentType passed in.List<org.broadleafcommerce.common.page.dto.PageDTO>sortResults(List<org.broadleafcommerce.common.page.dto.PageDTO> pageList, List<org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria> criteriaList) Returns a new, sorted list ofPageDTObased on the criteria list being based in.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.advancedcms.search.CollectionPageSearchProcessor
search
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
REQUEST_DTO
- See Also:
-
BLC_RULE_MAP_PARAM
- See Also:
-
advancedPageService
-
-
Constructor Details
-
AbstractCollectionPageSearchProcessor
public AbstractCollectionPageSearchProcessor()
-
-
Method Details
-
constructSearchResultObject
protected SearchResult constructSearchResultObject(List<org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria> originalCriteria, List<org.broadleafcommerce.common.page.dto.PageDTO> results) Convenience method for constructing the return object. This will also take care of sorting the list ofPageDTOthat is passed in.- Parameters:
originalQuery-results-- Returns:
-
fetchAllPagesAssociatedWithType
protected List<org.broadleafcommerce.common.page.dto.PageDTO> fetchAllPagesAssociatedWithType(com.broadleafcommerce.theme.domain.page.PageType type) Fetches all the Structured Content of the StructuredContentType passed in.The results are filtered by the rules of the given Structured Content item.
- Parameters:
type-- Returns:
-
sortResults
public List<org.broadleafcommerce.common.page.dto.PageDTO> sortResults(List<org.broadleafcommerce.common.page.dto.PageDTO> pageList, List<org.broadleafcommerce.openadmin.dto.FilterAndSortCriteria> criteriaList) Returns a new, sorted list ofPageDTObased on the criteria list being based in. The original pageList parameter is left unsorted.- Parameters:
pageList- the list of content to sortcriteriaList- the criteria that contains the properties to sort on as well as their sort directions- Returns:
- a new list based on pageList but sorted according to criteriaList
-
buildMvelParameters
MVEL is used to process the content targeting rules.- Parameters:
request-- Returns:
-