Interface UrlProvider
-
@ProviderType public interface UrlProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
UrlProvider.ParamsBuilder
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description static String
PAGE_PARAM
Deprecated.static String
SKU_PARAM
Deprecated.static String
UID_PARAM
Deprecated.static String
URL_KEY_PARAM
Deprecated.static String
URL_PATH_PARAM
Deprecated.static String
VARIANT_SKU_PARAM
Deprecated.static String
VARIANT_URL_KEY_PARAM
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description UnaryOperator<com.adobe.cq.commerce.magento.graphql.CategoryFilterInput>
getCategoryFilterHook(org.apache.sling.api.SlingHttpServletRequest request)
Returns a hook that replaces a givenCategoryFilterInput
with a new instance constructed from the identifiers available by the given request.String
getCategoryIdentifier(org.apache.sling.api.SlingHttpServletRequest request)
Returns the category identifier used in the given Sling HTTP request.UnaryOperator<com.adobe.cq.commerce.magento.graphql.ProductAttributeFilterInput>
getProductFilterHook(org.apache.sling.api.SlingHttpServletRequest request)
Returns a hook that replaces a givenProductAttributeFilterInput
with a new instance constructed from the identifiers available by the given request.String
getProductIdentifier(org.apache.sling.api.SlingHttpServletRequest request)
Returns the product identifier (sku) used in the given Sling HTTP request.CategoryUrlFormat.Params
parseCategoryUrlFormatParameters(org.apache.sling.api.SlingHttpServletRequest request)
Parses and returns theCategoryUrlFormat.Params
used in the given Sling HTTP request based on the URLProvider configuration for category page URLs.ProductUrlFormat.Params
parseProductUrlFormatParameters(org.apache.sling.api.SlingHttpServletRequest request)
Parses and returns theProductUrlFormat.Params
used in the givenSlingHttpServletRequest
based on the URLProvider configuration for product page URLs.String
toCategoryUrl(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.Page page, CategoryUrlFormat.Params params)
Returns the category page URL.String
toCategoryUrl(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.Page page, String categoryIdentifier)
Returns the category page URL.String
toCategoryUrl(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.Page page, Map<String,String> params)
Deprecated.String
toProductUrl(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.Page page, ProductUrlFormat.Params params)
Returns the product page URL.String
toProductUrl(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.Page page, String productIdentifier)
Returns the product page URL.String
toProductUrl(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.Page page, Map<String,String> params)
Deprecated.
-
-
-
Field Detail
-
URL_KEY_PARAM
@Deprecated static final String URL_KEY_PARAM
Deprecated.Theurl_key
parameter of the product or category. In the case of aConfigurableProduct
, this must hold the url_key of the configurable product and the variant url_key must be set with thevariant_url_key
parameter.- See Also:
- Constant Field Values
-
URL_PATH_PARAM
@Deprecated static final String URL_PATH_PARAM
Deprecated.Theurl_path
parameter of the product or category.- See Also:
- Constant Field Values
-
SKU_PARAM
@Deprecated static final String SKU_PARAM
Deprecated.Thesku
parameter of the product. In the case of aConfigurableProduct
, this must hold the sku of the configurable product and the variant sku must be set with thevariant_sku
parameter.- See Also:
- Constant Field Values
-
VARIANT_SKU_PARAM
@Deprecated static final String VARIANT_SKU_PARAM
Deprecated.In the case of aConfigurableProduct
, thevariant_sku
parameter must be set to the sku of the currently selected/chosen variant.- See Also:
- Constant Field Values
-
VARIANT_URL_KEY_PARAM
@Deprecated static final String VARIANT_URL_KEY_PARAM
Deprecated.In the case of aConfigurableProduct
, thevariant_url_key
parameter must be set to the url_key of the currently selected/chosen variant.- See Also:
- Constant Field Values
-
UID_PARAM
@Deprecated static final String UID_PARAM
Deprecated.Theuid
of the category.- See Also:
- Constant Field Values
-
PAGE_PARAM
@Deprecated static final String PAGE_PARAM
Deprecated.Use this parameter name to set the page part of the URL. This ensures that implementations of the UrlProvider can easily "find out" if the page part of the URL is being statically set.- See Also:
- Constant Field Values
-
-
Method Detail
-
toProductUrl
@Deprecated String toProductUrl(@Nullable org.apache.sling.api.SlingHttpServletRequest request, @Nullable com.day.cq.wcm.api.Page page, Map<String,String> params)
Deprecated.Returns the product page URL. All required attributes to generate a valid category page URL must be provided via theparams
parameter.This method should be used if the component already loaded the URL attributes.
Either
request
orpage
parameter can benull
but not both. If both are null anIllegalArgumentException
is thrown.- Parameters:
request
- The current Sling HTTP request.page
- This parameter can be null if the URL template does set a {{page}} parameter and a request is given.params
- The parameters used in the URL template.- Returns:
- The product URL.
-
toProductUrl
String toProductUrl(@Nullable org.apache.sling.api.SlingHttpServletRequest request, @Nullable com.day.cq.wcm.api.Page page, ProductUrlFormat.Params params)
Returns the product page URL. All required attributes to generate a valid category page URL must be provided via theparams
parameter.This method should be used if the component already loaded the URL attributes.
Either
request
orpage
parameter can benull
but not both. If both are null anIllegalArgumentException
is thrown.- Parameters:
request
- The current Sling HTTP request.page
- This parameter can be null if the URL template does set a {{page}} parameter and a request is given.params
- The parameters used in the URL template.- Returns:
- The product URL.
-
toProductUrl
String toProductUrl(@Nullable org.apache.sling.api.SlingHttpServletRequest request, @Nullable com.day.cq.wcm.api.Page page, String productIdentifier)
Returns the product page URL. Only the product identifier must be provided, the implementation will query the needed URL attributes to generate a complete URL based on the configuration.This method should be used if the component only can provide the product identifier.
Either
request
orpage
parameter can benull
but not both. If both are null anIllegalArgumentException
is thrown.- Parameters:
request
- The current Sling HTTP request.page
- This parameter can be null if the URL template does set a {{page}} parameter and a request is given.productIdentifier
- The product identifier.- Returns:
- The product URL.
-
toCategoryUrl
@Deprecated String toCategoryUrl(@Nullable org.apache.sling.api.SlingHttpServletRequest request, @Nullable com.day.cq.wcm.api.Page page, Map<String,String> params)
Deprecated.Returns the category page URL. All required attributes to generate a valid category page URL must be provided via theparams
parameter.This method should be used if the component already loaded the URL attributes.
Either
request
orpage
parameter can benull
but not both. If both are null anIllegalArgumentException
is thrown.- Parameters:
request
- The current Sling HTTP request.page
- This parameter can be null if the URL template does set a {{page}} parameter and a request is given.params
- The parameters used in the URL template.- Returns:
- The category URL.
-
toCategoryUrl
String toCategoryUrl(@Nullable org.apache.sling.api.SlingHttpServletRequest request, @Nullable com.day.cq.wcm.api.Page page, CategoryUrlFormat.Params params)
Returns the category page URL. All required attributes to generate a valid category page URL must be provided via theparams
parameter.This method should be used if the component already loaded the URL attributes.
Either
request
orpage
parameter can benull
but not both. If both are null anIllegalArgumentException
is thrown.- Parameters:
request
- The current Sling HTTP request.page
- This parameter can be null if the URL template does set a {{page}} parameter and a request is given.params
- The parameters used in the URL template.- Returns:
- The category URL.
-
toCategoryUrl
String toCategoryUrl(@Nullable org.apache.sling.api.SlingHttpServletRequest request, @Nullable com.day.cq.wcm.api.Page page, String categoryIdentifier)
Returns the category page URL. Only the category identifier must be provided, the implementation will query the needed URL attributes to generate a complete URL based on the configuration.This method should be used if the component only can provide the category identifier.
Either
request
orpage
parameter can benull
but not both. If both are null anIllegalArgumentException
is thrown.- Parameters:
request
- The current Sling HTTP request.page
- This parameter can be null if the URL template does set a {{page}} parameter and a request is given.categoryIdentifier
- The category identifier.- Returns:
- The category URL.
-
getProductIdentifier
String getProductIdentifier(org.apache.sling.api.SlingHttpServletRequest request)
Returns the product identifier (sku) used in the given Sling HTTP request. The product identifier can be used to load product data.- Parameters:
request
- The current Sling HTTP request.- Returns:
- The product sku identifier.
-
getProductFilterHook
UnaryOperator<com.adobe.cq.commerce.magento.graphql.ProductAttributeFilterInput> getProductFilterHook(org.apache.sling.api.SlingHttpServletRequest request)
Returns a hook that replaces a givenProductAttributeFilterInput
with a new instance constructed from the identifiers available by the given request.The hook can be passed to
AbstractProductRetriever.extendProductFilterWith(Function)
orAbstractProductsRetriever.extendProductFilterWith(Function)
.- Parameters:
request
- the current request- Returns:
- a unary operator that excepts a
ProductAttributeFilterInput
and returns a new instance to replace it
-
parseProductUrlFormatParameters
ProductUrlFormat.Params parseProductUrlFormatParameters(org.apache.sling.api.SlingHttpServletRequest request)
Parses and returns theProductUrlFormat.Params
used in the givenSlingHttpServletRequest
based on the URLProvider configuration for product page URLs.- Parameters:
request
- The current Sling HTTP request.- Returns:
- the parsed
ProductUrlFormat.Params
-
getCategoryIdentifier
String getCategoryIdentifier(org.apache.sling.api.SlingHttpServletRequest request)
Returns the category identifier used in the given Sling HTTP request. The category identifier can be used to load category data.- Parameters:
request
- The current Sling HTTP request.- Returns:
- The category uid identifier.
-
getCategoryFilterHook
UnaryOperator<com.adobe.cq.commerce.magento.graphql.CategoryFilterInput> getCategoryFilterHook(org.apache.sling.api.SlingHttpServletRequest request)
Returns a hook that replaces a givenCategoryFilterInput
with a new instance constructed from the identifiers available by the given request.The hook can be passed to
AbstractCategoryRetriever.extendCategoryFilterWith(Function)
orAbstractCategoriesRetriever.extendCategoryFilterWith(Function)
.- Parameters:
request
- the current request- Returns:
- a unary operator that excepts a
ProductAttributeFilterInput
and returns a new instance to replace it
-
parseCategoryUrlFormatParameters
CategoryUrlFormat.Params parseCategoryUrlFormatParameters(org.apache.sling.api.SlingHttpServletRequest request)
Parses and returns theCategoryUrlFormat.Params
used in the given Sling HTTP request based on the URLProvider configuration for category page URLs.- Parameters:
request
- The current Sling HTTP request.- Returns:
- parsed
CategoryUrlFormat.Params
-
-