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 Summary
Modifier and TypeMethodDescriptionvoid
evaluateDisplayRulesForResponse
(@NonNull ContentResolverResponse<I> response, ContentContext request) Recursively evaluates the display rules for the givenresponse
to filter out anyContentItems
that should not be displayed.getContentForRequest
(ContentResolverRequest request, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) ResolvesContentItems
for the givenrequest
.
-
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) ResolvesContentItems
for the givenrequest
. This accepts aPageable
and RSQL filters.If the
Pageable
is aDefaultPageRequest
, then it will be ignored since that type of pagination is not supported byContentItems
. The correct type would beNarrowedPageable
orUnnumberedPageable
. It will also be considered to mean that no pagination information was in the original request, but instead thePageableDefault
annotation was used to provide defaults.- Parameters:
request
- All relevant information for retrieving the desiredContentItems
.page
- Pagination information. This will be ignored if not aNarrowedPageable
orUnnumberedPageable
,DefaultPageRequest
should only indicate that the original request did not include any pagination parameters and was created by thePageableDefault
annotation on an endpoint.filters
- RSQL filters to be applied to the result set.contextInfo
- Additional sandbox and multitenant information.- Returns:
ContentItems
for the givenrequest
.
-
evaluateDisplayRulesForResponse
void evaluateDisplayRulesForResponse(@NonNull @NonNull ContentResolverResponse<I> response, ContentContext request) Recursively evaluates the display rules for the givenresponse
to filter out anyContentItems
that should not be displayed.- Parameters:
response
- The response to evaluate.request
- The context of the request.
-