Class UrlProviderImpl

    • Constructor Detail

      • UrlProviderImpl

        public UrlProviderImpl()
    • Method Detail

      • toProductUrl

        public String toProductUrl​(org.apache.sling.api.SlingHttpServletRequest request,
                                   com.day.cq.wcm.api.Page page,
                                   Map<String,​String> params)
        Description copied from interface: UrlProvider
        Returns the product page URL.
        Specified by:
        toProductUrl in interface UrlProvider
        Parameters:
        request - The current Sling HTTP request.
        page - The target page, if any. This parameter can be null if the URL template does not use the ${page} parameter.
        params - The parameters used in the URL template.
        Returns:
        The product URL.
      • toCategoryUrl

        public String toCategoryUrl​(org.apache.sling.api.SlingHttpServletRequest request,
                                    com.day.cq.wcm.api.Page page,
                                    Map<String,​String> params)
        Description copied from interface: UrlProvider
        Returns the category page URL.
        Specified by:
        toCategoryUrl in interface UrlProvider
        Parameters:
        request - The current Sling HTTP request.
        page - The target page, if any. This parameter can be null if the URL template does not use the ${page} parameter.
        params - The parameters used in the URL template.
        Returns:
        The category URL.
      • toSpecificPage

        public static org.apache.sling.api.resource.Resource toSpecificPage​(org.apache.sling.api.resource.Resource page,
                                                                            Set<String> selectors)
        This method checks if any of the children of the given page resource is a page with a selectorFilter property set with the value of the given selector.
        Parameters:
        page - The page resource, from where children pages will be checked.
        selectors - The searched value for the selectorFilter property.
        Returns:
        If found, a child page resource that contains the given selectorFilter value. If not found, this method returns null.
      • toSpecificPage

        public static org.apache.sling.api.resource.Resource toSpecificPage​(org.apache.sling.api.resource.Resource page,
                                                                            Set<String> selectors,
                                                                            org.apache.sling.api.SlingHttpServletRequest request)
        This method checks if any of the children of the given page resource is a page with a selectorFilter property set with the value of the given selector.
        Parameters:
        page - The page resource, from where children pages will be checked.
        selectors - The searched value for the selectorFilter property.
        request - The current Sling HTTP Servlet request.
        Returns:
        If found, a child page resource that contains the given selectorFilter value. If not found, this method returns null.
      • getProductIdentifier

        public org.apache.commons.lang3.tuple.Pair<UrlProvider.ProductIdentifierType,​String> getProductIdentifier​(org.apache.sling.api.SlingHttpServletRequest request)
        Description copied from interface: UrlProvider
        Returns the type and value of the product identifier used in the given Sling HTTP request.
        Specified by:
        getProductIdentifier in interface UrlProvider
        Parameters:
        request - The current Sling HTTP request.
        Returns:
        The type and value of the product identifier.
      • getCategoryIdentifier

        public org.apache.commons.lang3.tuple.Pair<UrlProvider.CategoryIdentifierType,​String> getCategoryIdentifier​(org.apache.sling.api.SlingHttpServletRequest request)
        Description copied from interface: UrlProvider
        Returns the type and value of the category identifier used in the given Sling HTTP request.
        Specified by:
        getCategoryIdentifier in interface UrlProvider
        Parameters:
        request - The current Sling HTTP request.
        Returns:
        The type and value of the category identifier.