Class ProductCollectionImpl
- java.lang.Object
-
- com.adobe.cq.commerce.core.components.internal.datalayer.DataLayerComponent
-
- com.adobe.cq.commerce.core.components.internal.models.v1.productcollection.ProductCollectionImpl
-
- All Implemented Interfaces:
ProductCollection
- Direct Known Subclasses:
ProductListImpl
,SearchResultsImpl
@Model(adaptables=org.apache.sling.api.SlingHttpServletRequest.class, adapters=ProductCollection.class, resourceType="core/cif/components/commerce/productcollection/v1/productcollection") public class ProductCollectionImpl extends DataLayerComponent implements ProductCollection
-
-
Field Summary
Fields Modifier and Type Field Description protected com.day.cq.wcm.api.Page
currentPage
protected com.day.cq.wcm.api.designer.Style
currentStyle
protected com.day.cq.commons.Externalizer
externalizer
protected static boolean
LOAD_CLIENT_PRICE_DEFAULT
protected boolean
loadClientPrice
protected int
navPageSize
protected static String
PAGINATION_TYPE_DEFAULT
protected String
paginationType
protected com.day.cq.wcm.api.Page
productPage
protected org.apache.sling.api.resource.ValueMap
properties
protected org.apache.sling.api.SlingHttpServletRequest
request
protected static String
RESOURCE_TYPE
protected SearchOptionsImpl
searchOptions
protected SearchResultsService
searchResultsService
protected SearchResultsSet
searchResultsSet
protected UrlProvider
urlProvider
-
Fields inherited from class com.adobe.cq.commerce.core.components.internal.datalayer.DataLayerComponent
ID_SEPARATOR, resource
-
Fields inherited from interface com.adobe.cq.commerce.core.components.models.productcollection.ProductCollection
PN_LOAD_CLIENT_PRICE, PN_PAGE_SIZE, PN_PAGINATION_TYPE
-
-
Constructor Summary
Constructors Constructor Description ProductCollectionImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
calculateCurrentPageCursor(String currentPageIndexCandidate)
protected Map<String,String>
createFilterMap(Map<String,String[]> parameterMap)
String
getPaginationType()
Returns the type of pagination that should be displayed.Collection<ProductListItem>
getProducts()
Returns the product list's items collection, asProductListItem
s elements.SearchResultsSet
getSearchResultsSet()
Get the search result set.boolean
loadClientPrice()
Should prices be re-loaded client-side.-
Methods inherited from class com.adobe.cq.commerce.core.components.internal.datalayer.DataLayerComponent
generateId, getComponentData, getData, getDataLayerAssetResource, getDataLayerAssets, getDataLayerCategories, getDataLayerCurrency, getDataLayerDescription, getDataLayerLanguage, getDataLayerLinkUrl, getDataLayerPrice, getDataLayerShownItems, getDataLayerSKU, getDataLayerTags, getDataLayerTemplatePath, getDataLayerText, getDataLayerTitle, getDataLayerType, getDataLayerUrl, getId
-
-
-
-
Field Detail
-
RESOURCE_TYPE
protected static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
LOAD_CLIENT_PRICE_DEFAULT
protected static final boolean LOAD_CLIENT_PRICE_DEFAULT
- See Also:
- Constant Field Values
-
PAGINATION_TYPE_DEFAULT
protected static final String PAGINATION_TYPE_DEFAULT
- See Also:
- Constant Field Values
-
productPage
protected com.day.cq.wcm.api.Page productPage
-
loadClientPrice
protected boolean loadClientPrice
-
navPageSize
protected int navPageSize
-
paginationType
protected String paginationType
-
request
protected org.apache.sling.api.SlingHttpServletRequest request
-
properties
protected org.apache.sling.api.resource.ValueMap properties
-
currentStyle
protected com.day.cq.wcm.api.designer.Style currentStyle
-
currentPage
@Inject protected com.day.cq.wcm.api.Page currentPage
-
searchResultsService
@Inject protected SearchResultsService searchResultsService
-
urlProvider
@Inject protected UrlProvider urlProvider
-
externalizer
@Inject protected com.day.cq.commons.Externalizer externalizer
-
searchOptions
protected SearchOptionsImpl searchOptions
-
searchResultsSet
protected SearchResultsSet searchResultsSet
-
-
Method Detail
-
calculateCurrentPageCursor
public Integer calculateCurrentPageCursor(String currentPageIndexCandidate)
-
loadClientPrice
public boolean loadClientPrice()
Description copied from interface:ProductCollection
Should prices be re-loaded client-side.- Specified by:
loadClientPrice
in interfaceProductCollection
- Returns:
- true if prices should be loaded client side
-
getPaginationType
public String getPaginationType()
Description copied from interface:ProductCollection
Returns the type of pagination that should be displayed.- Specified by:
getPaginationType
in interfaceProductCollection
- Returns:
- The pagination type.
-
getProducts
@Nonnull public Collection<ProductListItem> getProducts()
Description copied from interface:ProductCollection
Returns the product list's items collection, asProductListItem
s elements.- Specified by:
getProducts
in interfaceProductCollection
- Returns:
Collection
ofProductListItem
s
-
getSearchResultsSet
@Nonnull public SearchResultsSet getSearchResultsSet()
Description copied from interface:ProductCollection
Get the search result set. This is the actual search result data.- Specified by:
getSearchResultsSet
in interfaceProductCollection
- Returns:
- the result of the search
-
-