Search in sources :

Example 1 with CategoryUrlFormat

use of com.adobe.cq.commerce.core.components.services.urls.CategoryUrlFormat in project aem-core-cif-components by adobe.

the class UrlProviderImpl method toCategoryUrl.

@Override
public String toCategoryUrl(SlingHttpServletRequest request, @Nullable Page page, CategoryUrlFormat.Params params) {
    CategoryUrlFormat categoryUrlFormat = getCategoryUrlFormatFromContext(request, page);
    if (page != null) {
        String pageParam = getPageParam(page, categoryUrlFormat, params, specificPageStrategy::getSpecificPage);
        if (!pageParam.equals(params.getPage())) {
            params = new CategoryUrlFormat.Params(params);
            params.setPage(pageParam);
        }
    }
    return categoryUrlFormat.format(params);
}
Also used : CategoryUrlFormat(com.adobe.cq.commerce.core.components.services.urls.CategoryUrlFormat)

Example 2 with CategoryUrlFormat

use of com.adobe.cq.commerce.core.components.services.urls.CategoryUrlFormat in project aem-core-cif-components by adobe.

the class UrlProviderImpl method parseCategoryUrlFormatParameters.

@Override
public CategoryUrlFormat.Params parseCategoryUrlFormatParameters(SlingHttpServletRequest request) {
    Page page = getCurrentPage(request);
    CategoryUrlFormat categoryUrlFormat = getCategoryUrlFormatFromContext(request, page);
    return categoryUrlFormat.parse(request.getRequestPathInfo(), request.getRequestParameterMap());
}
Also used : Page(com.day.cq.wcm.api.Page) CategoryUrlFormat(com.adobe.cq.commerce.core.components.services.urls.CategoryUrlFormat)

Aggregations

CategoryUrlFormat (com.adobe.cq.commerce.core.components.services.urls.CategoryUrlFormat)2 Page (com.day.cq.wcm.api.Page)1