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 Type
    Method
    Description
    hydrateContentFields(@NonNull List<P> models, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Hydrates the ContentFields for each ContentModel in the passed-in collection
    org.springframework.data.domain.Page<P>
    hydrateContentFields(@NonNull org.springframework.data.domain.Page<P> paginated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Hydrates the ContentFields for each ContentModel in the passed-in Page object
    hydrateContentFields(P model, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Hydrates the ContentFields for a ContentModel
    readAllByContextIds(Collection<String> modelIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all the models with the given modelIds.
    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).
    readByUri(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads the model by the given uri.

    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, updateSort

    Methods 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 by
      page - the requested page of results from the database
      filters - additional filters to apply in the query, can be null
      context - 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 retrieved
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      an Optional containing 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 given modelIds.
      Parameters:
      modelIds - Ids of the models to fetch
      contextInfo - 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 given uri. uri cannot be null.
      Parameters:
      uri - URI of the model to fetch
      contextInfo - 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 the ContentFields for a ContentModel
      Parameters:
      model - content model to update
      contextInfo - 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)
      Hydrates the ContentFields for each ContentModel in the passed-in Page object
      Parameters:
      paginated - paginated content models to update
      contextInfo - 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 the ContentFields for each ContentModel in the passed-in collection
      Parameters:
      models - collection of content models to update
      contextInfo - information surrounding sandboxing and multitenant state