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 TypeMethodDescriptionreadAllByCategoryIdIn
(Collection<String> categoryIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads a list ofCategoryAssets
by ID.readAllPrimaryAssetsByCategoryIdsExcludeAssetIds
(Iterable<String> categoryIds, Iterable<String> assetIdsToExclude, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all the primaryCategoryAsset
for the given category IDs excluding given asset IDs.readByCategoryId
(String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of theCategoryAssets
for aCategory
by ID.readByCategoryIdAndPrimaryTrue
(String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the primaryCategoryAsset
for the givenCategoryAsset.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 allCategoryAssets
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 allCategoryAssets
for the given category ID, optionally filtering by additional search/filter arguments.If
searchString
is provided, then this method will search for assets whoseEntityAsset.url
,EntityAsset.title
,EntityAsset.altText
, orEntityAsset.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 againstisSorted
- (optional) if not-null, will restrict results to only includeCategoryAssets
whereCategoryAsset.sorted
has the given valuesearchString
- (optional) a string which should be found inEntityAsset.url
,EntityAsset.title
,EntityAsset.altText
, orEntityAsset.tags
filters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.page
- the requested page of results from the databasecontextInfo
- 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 primaryCategoryAsset
for the givenCategoryAsset.categoryId
.- Parameters:
categoryId
- the value to match againstCategoryAsset.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 primaryCategoryAsset
for the given category IDs excluding given asset IDs.- Parameters:
categoryIds
- IDs of the categories for which to find primary assetsassetIdsToExclude
- IDs of the assets to excludecontextInfo
- 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 theCategoryAssets
for aCategory
by ID.- Parameters:
categoryId
- Id of the category which's assets to readcontextInfo
- context information around sandboxing and multitenant state- Returns:
- all of the
CategoryAssets
for aCategory
by ID.
-
readAllByCategoryIdIn
List<P> readAllByCategoryIdIn(Collection<String> categoryIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads a list ofCategoryAssets
by ID.- Parameters:
categoryIds
-Category
IDs to match againstcontextInfo
- context surrounding sandboxing and multitenant state- Returns:
- A list of
CategoryAssets
by ID.
-
getRepositoryDomain
-