Interface CategoryAssetService<P extends CategoryAsset>

All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
All Known Implementing Classes:
DefaultCategoryAssetService

public interface CategoryAssetService<P extends CategoryAsset> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Service API for CategoryAssets. Supported by CategoryAssetRepository.
Author:
Samarth Dhruva (samarthd)
  • Method Summary

    Modifier and Type
    Method
    Description
     
    readAllByCategoryIdIn(Collection<String> categoryIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads a list of CategoryAssets by ID.
    readAllPrimaryAssetsByCategoryIdsExcludeAssetIds(Iterable<String> categoryIds, Iterable<String> assetIdsToExclude, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all the primary CategoryAsset for the given category IDs excluding given asset IDs.
    readByCategoryId(String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds all of the CategoryAssets for a Category by ID.
    readByCategoryIdAndPrimaryTrue(String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds the primary CategoryAsset for the given CategoryAsset.categoryId.
    org.springframework.data.domain.Page<P>
    searchAllWithCategoryId(String categoryId, Boolean isSorted, String searchString, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds all CategoryAssets for the given category ID, optionally filtering by additional search/filter arguments.

    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

    • searchAllWithCategoryId

      org.springframework.data.domain.Page<P> searchAllWithCategoryId(String categoryId, @Nullable Boolean isSorted, @Nullable String searchString, cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds all CategoryAssets for the given category ID, optionally filtering by additional search/filter arguments.

      If searchString is provided, then this method will search for assets whose EntityAsset.url, EntityAsset.title, EntityAsset.altText, or EntityAsset.tags contain it.

      If no searchString is provided, then this method will simply return all assets for the given category.

      This method also supports RSQL filtration via filters.

      Parameters:
      categoryId - the value which the category ID should match against
      isSorted - (optional) if not-null, will restrict results to only include CategoryAssets where CategoryAsset.sorted has the given value
      searchString - (optional) a string which should be found in EntityAsset.url, EntityAsset.title, EntityAsset.altText, or EntityAsset.tags
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      page - the requested page of results from the database
      contextInfo - the context to query within
      Returns:
      the assets in the database with the given category ID, optionally filtered by the given search/filter arguments (if provided)
    • readByCategoryIdAndPrimaryTrue

      Optional<P> readByCategoryIdAndPrimaryTrue(String categoryId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds the primary CategoryAsset for the given CategoryAsset.categoryId.
      Parameters:
      categoryId - the value to match against CategoryAsset.categoryId
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      an optional containing the primary asset for a category, empty otherwise
    • readAllPrimaryAssetsByCategoryIdsExcludeAssetIds

      List<P> readAllPrimaryAssetsByCategoryIdsExcludeAssetIds(Iterable<String> categoryIds, Iterable<String> assetIdsToExclude, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads all the primary CategoryAsset for the given category IDs excluding given asset IDs.
      Parameters:
      categoryIds - IDs of the categories for which to find primary assets
      assetIdsToExclude - IDs of the assets to exclude
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      the primary CategoryAsset for the given category IDs excluding given asset IDs.
    • readByCategoryId

      List<P> readByCategoryId(String categoryId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds all of the CategoryAssets for a Category by ID.
      Parameters:
      categoryId - Id of the category which's assets to read
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      all of the CategoryAssets for a Category by ID.
    • readAllByCategoryIdIn

      List<P> readAllByCategoryIdIn(Collection<String> categoryIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads a list of CategoryAssets by ID.
      Parameters:
      categoryIds - Category IDs to match against
      contextInfo - context surrounding sandboxing and multitenant state
      Returns:
      A list of CategoryAssets by ID.
    • getRepositoryDomain

      @NonNull String getRepositoryDomain()