Interface ContentItemResolverService<I extends ContentItem>

All Known Implementing Classes:
DefaultContentItemResolverService

public interface ContentItemResolverService<I extends ContentItem>
This service is responsible for resolving ContentItems for commerce-facing clients. It should support resolving content through a number of means whether by parent ContentModel URI, name, or id, or by ContentItem names or ids.
Author:
Nathan Moore (nathandmoore)
  • Method Details

    • getContentForRequest

      Optional<ContentResolverResponse<I>> getContentForRequest(ContentResolverRequest request, org.springframework.data.domain.Pageable page, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Resolves ContentItems for the given request. This accepts a Pageable and RSQL filters.

      If the Pageable is a DefaultPageRequest, then it will be ignored since that type of pagination is not supported by ContentItems. The correct type would be NarrowedPageable or UnnumberedPageable. It will also be considered to mean that no pagination information was in the original request, but instead the PageableDefault annotation was used to provide defaults.

      Parameters:
      request - All relevant information for retrieving the desired ContentItems.
      page - Pagination information. This will be ignored if not a NarrowedPageable or UnnumberedPageable, DefaultPageRequest should only indicate that the original request did not include any pagination parameters and was created by the PageableDefault annotation on an endpoint.
      filters - RSQL filters to be applied to the result set.
      contextInfo - Additional sandbox and multitenant information.
      Returns:
      ContentItems for the given request.
    • evaluateDisplayRulesForResponse

      void evaluateDisplayRulesForResponse(@NonNull @NonNull ContentResolverResponse<I> response, ContentContext request)
      Recursively evaluates the display rules for the given response to filter out any ContentItems that should not be displayed.
      Parameters:
      response - The response to evaluate.
      request - The context of the request.