Class ProductListImpl
- java.lang.Object
-
- com.adobe.cq.commerce.core.components.internal.datalayer.DataLayerComponent
-
- com.adobe.cq.commerce.core.components.internal.models.v1.productcollection.ProductCollectionImpl
-
- com.adobe.cq.commerce.core.components.internal.models.v1.productlist.ProductListImpl
-
- All Implemented Interfaces:
PageMetadata
,ProductCollection
,ProductList
,com.adobe.cq.export.json.ComponentExporter
,com.adobe.cq.wcm.core.components.models.Component
@Model(adaptables=org.apache.sling.api.SlingHttpServletRequest.class, adapters=ProductList.class, resourceType="core/cif/components/commerce/productlist/v1/productlist", cache=true) public class ProductListImpl extends ProductCollectionImpl implements ProductList
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
PLACEHOLDER_DATA
static String
RESOURCE_TYPE
-
Fields inherited from class com.adobe.cq.commerce.core.components.internal.models.v1.productcollection.ProductCollectionImpl
currentPage, currentStyle, externalizer, LOAD_CLIENT_PRICE_DEFAULT, loadClientPrice, navPageSize, PAGINATION_TYPE_DEFAULT, paginationType, productPage, properties, request, searchOptions, searchResultsService, searchResultsSet, 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
-
Fields inherited from interface com.adobe.cq.commerce.core.components.models.productlist.ProductList
PN_SHOW_IMAGE, PN_SHOW_TITLE
-
-
Constructor Summary
Constructors Constructor Description ProductListImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCanonicalUrl()
protected com.adobe.cq.commerce.magento.graphql.CategoryInterface
getCategory()
AbstractCategoryRetriever
getCategoryRetriever()
Returns in instance of the category retriever for fetching category data via GraphQL.String
getImage()
String
getMetaDescription()
String
getMetaKeywords()
String
getMetaTitle()
Although this method refers to "metaTitle", this is used to set the title tag of the HTML page.Collection<ProductListItem>
getProducts()
Returns the product list's items collection, asProductListItem
s elements.SearchResultsSet
getSearchResultsSet()
Get the search result set.String
getTitle()
Returns the title of thisProductList
.String
getUrlPath()
boolean
showImage()
boolean
showTitle()
Returnstrue
if the category / product list title should be rendered.-
Methods inherited from class com.adobe.cq.commerce.core.components.internal.models.v1.productcollection.ProductCollectionImpl
calculateCurrentPageCursor, createFilterMap, getPaginationType, loadClientPrice
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adobe.cq.wcm.core.components.models.Component
getData, getExportedType, getId
-
Methods inherited from interface com.adobe.cq.commerce.core.components.models.productcollection.ProductCollection
getPaginationType, loadClientPrice
-
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
PLACEHOLDER_DATA
protected static final String PLACEHOLDER_DATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTitle
@Nullable public String getTitle()
Description copied from interface:ProductList
Returns the title of thisProductList
.- Specified by:
getTitle
in interfaceProductList
- Returns:
- the title of this list item or
null
-
showTitle
public boolean showTitle()
Description copied from interface:ProductList
Returnstrue
if the category / product list title should be rendered.- Specified by:
showTitle
in interfaceProductList
- Returns:
true
if category / product list title should be shown,false
otherwise
-
getUrlPath
public String getUrlPath()
-
getImage
public String getImage()
- Specified by:
getImage
in interfaceProductList
-
showImage
public boolean showImage()
- Specified by:
showImage
in interfaceProductList
-
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
- Overrides:
getProducts
in classProductCollectionImpl
- 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
- Overrides:
getSearchResultsSet
in classProductCollectionImpl
- Returns:
- the result of the search
-
getCategory
protected com.adobe.cq.commerce.magento.graphql.CategoryInterface getCategory()
-
getCategoryRetriever
public AbstractCategoryRetriever getCategoryRetriever()
Description copied from interface:ProductList
Returns in instance of the category retriever for fetching category data via GraphQL.- Specified by:
getCategoryRetriever
in interfaceProductList
- Returns:
- category retriever instance
-
getMetaDescription
public String getMetaDescription()
- Specified by:
getMetaDescription
in interfacePageMetadata
- Returns:
- The content for the meta description tag of the HTML page.
-
getMetaKeywords
public String getMetaKeywords()
- Specified by:
getMetaKeywords
in interfacePageMetadata
- Returns:
- The content for the meta keywords tag of the HTML page.
-
getMetaTitle
public String getMetaTitle()
Description copied from interface:PageMetadata
Although this method refers to "metaTitle", this is used to set the title tag of the HTML page. The method is not calledgetTitle()
to avoid confusion withProductList.getTitle()
- Specified by:
getMetaTitle
in interfacePageMetadata
- Returns:
- The content for the title tag of the HTML page.
-
getCanonicalUrl
public String getCanonicalUrl()
- Specified by:
getCanonicalUrl
in interfacePageMetadata
- Returns:
- The fully-qualified canonical url, to set the canonical link element of the HTML page.
-
-