Class BreadcrumbRetriever
- java.lang.Object
-
- com.adobe.cq.commerce.core.components.models.retriever.AbstractRetriever
-
- com.adobe.cq.commerce.core.components.internal.models.v1.breadcrumb.BreadcrumbRetriever
-
public class BreadcrumbRetriever extends AbstractRetriever
-
-
Field Summary
-
Fields inherited from class com.adobe.cq.commerce.core.components.models.retriever.AbstractRetriever
client, query
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.adobe.cq.commerce.graphql.client.GraphqlResponse<com.adobe.cq.commerce.magento.graphql.Query,com.adobe.cq.commerce.magento.graphql.gson.Error>
executeQuery()
Execute the GraphQL query with the GraphQL client.protected List<? extends com.adobe.cq.commerce.magento.graphql.CategoryInterface>
fetchCategoriesBreadcrumbs()
Executes the GraphQL query and returns an array of categories with breadcrumbs information.protected String
fetchProductName()
Executes the GraphQL query and returns the name of the product.protected String
generateCategoryQuery()
Generate a complete breadcrumbs GraphQL query with a filter for the category identifier.protected String
generateProductQuery()
Generate a complete breadcrumbs GraphQL query with a filter for the product identifier.protected void
populate()
Executes the query and parses the response.protected void
setCategoryIdentifier(UrlProvider.CategoryIdentifierType categoryIdentifierType, String categoryIdentifier)
Set the identifier and the identifier type of the category that should be fetched.protected void
setProductIdentifier(UrlProvider.ProductIdentifierType productIdentifierType, String productIdentifier)
Set the identifier and the identifier type of the product that should be fetched.-
Methods inherited from class com.adobe.cq.commerce.core.components.models.retriever.AbstractRetriever
setQuery
-
-
-
-
Method Detail
-
fetchCategoriesBreadcrumbs
protected List<? extends com.adobe.cq.commerce.magento.graphql.CategoryInterface> fetchCategoriesBreadcrumbs()
Executes the GraphQL query and returns an array of categories with breadcrumbs information. For subsequent calls of this method, a cached response is returned.- Returns:
- The list of categories with breadcrumbs information.
-
fetchProductName
protected String fetchProductName()
Executes the GraphQL query and returns the name of the product. This assumes thatsetProductIdentifier(ProductIdentifierType, String)
has been called before. For subsequent calls of this method, a cached response is returned.- Returns:
- The product name.
-
setProductIdentifier
protected void setProductIdentifier(UrlProvider.ProductIdentifierType productIdentifierType, String productIdentifier)
Set the identifier and the identifier type of the product that should be fetched. Setting the identifier, removes any cached data.- Parameters:
productIdentifierType
- The product identifier type.productIdentifier
- The product identifier.
-
setCategoryIdentifier
protected void setCategoryIdentifier(UrlProvider.CategoryIdentifierType categoryIdentifierType, String categoryIdentifier)
Set the identifier and the identifier type of the category that should be fetched. Setting the identifier, removes any cached data.- Parameters:
categoryIdentifierType
- The category identifier type.categoryIdentifier
- The category identifier.
-
populate
protected void populate()
Description copied from class:AbstractRetriever
Executes the query and parses the response.- Specified by:
populate
in classAbstractRetriever
-
executeQuery
protected com.adobe.cq.commerce.graphql.client.GraphqlResponse<com.adobe.cq.commerce.magento.graphql.Query,com.adobe.cq.commerce.magento.graphql.gson.Error> executeQuery()
Description copied from class:AbstractRetriever
Execute the GraphQL query with the GraphQL client.- Specified by:
executeQuery
in classAbstractRetriever
- Returns:
- GraphqlResponse object
-
generateProductQuery
protected String generateProductQuery()
Generate a complete breadcrumbs GraphQL query with a filter for the product identifier.- Returns:
- GraphQL query as string
-
generateCategoryQuery
protected String generateCategoryQuery()
Generate a complete breadcrumbs GraphQL query with a filter for the category identifier.- Returns:
- GraphQL query as string
-
-