Interface ContentModelService<P extends ContentModel>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
- All Known Implementing Classes:
DefaultContentModelService
public interface ContentModelService<P extends ContentModel>
extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
This service is responsible for handling all CRUD operations on
ContentModels.- Author:
- Jon Fleschler (jfleschler)
-
Method Summary
Modifier and TypeMethodDescriptionhydrateContentFields(@NonNull List<P> models, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates theContentFieldsfor eachContentModelin the passed-in collectionorg.springframework.data.domain.Page<P>hydrateContentFields(@NonNull org.springframework.data.domain.Page<P> paginated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) hydrateContentFields(P model, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates theContentFieldsfor aContentModelreadAllByContextIds(Collection<String> modelIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all the models with the givenmodelIds.org.springframework.data.domain.Page<P>readAllByName(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read all content types, optionally filtered by name.readByName(String modelName, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the content type with the given name (should only be one result, as content type names are unique).Reads the model by the givenuri.Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Method Details
-
readAllByName
org.springframework.data.domain.Page<P> readAllByName(@Nullable String nameQuery, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read all content types, optionally filtered by name.- Parameters:
nameQuery- (optional) the content type name to filter bypage- the requested page of results from the databasefilters- additional filters to apply in the query, can be nullcontext- context information surrounding sandboxing and multitenant state- Returns:
- all models, optionally filtered by name
-
readByName
Optional<P> readByName(@NonNull String modelName, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the content type with the given name (should only be one result, as content type names are unique).- Parameters:
modelName- the name of the content type that should be retrievedcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- an
Optionalcontaining the content type with the given name, empty if not found
-
readAllByContextIds
List<P> readAllByContextIds(@NonNull Collection<String> modelIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all the models with the givenmodelIds.- Parameters:
modelIds- Ids of the models to fetchcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- All the models with the given
modelIds.
-
readByUri
Optional<P> readByUri(String uri, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the model by the givenuri.uricannot be null.- Parameters:
uri- URI of the model to fetchcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- The model by the given
uri.
-
hydrateContentFields
P hydrateContentFields(@NonNull P model, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates theContentFieldsfor aContentModel- Parameters:
model- content model to updatecontextInfo- information surrounding sandboxing and multitenant state- Returns:
- The updated paginated content models
-
hydrateContentFields
org.springframework.data.domain.Page<P> hydrateContentFields(@NonNull @NonNull org.springframework.data.domain.Page<P> paginated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Parameters:
paginated- paginated content models to updatecontextInfo- information surrounding sandboxing and multitenant state- Returns:
- The updated paginated content models
-
hydrateContentFields
List<P> hydrateContentFields(@NonNull @NonNull List<P> models, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates theContentFieldsfor eachContentModelin the passed-in collection- Parameters:
models- collection of content models to updatecontextInfo- information surrounding sandboxing and multitenant state
-