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 ofCategoryAssetsby ID.readAllPrimaryAssetsByCategoryIdsExcludeAssetIds(Iterable<String> categoryIds, Iterable<String> assetIdsToExclude, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all the primaryCategoryAssetfor the given category IDs excluding given asset IDs.readByCategoryId(String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of theCategoryAssetsfor aCategoryby ID.readByCategoryIdAndPrimaryTrue(String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the primaryCategoryAssetfor 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 allCategoryAssetsfor 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, updateSortMethods 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 allCategoryAssetsfor the given category ID, optionally filtering by additional search/filter arguments.If
searchStringis provided, then this method will search for assets whoseEntityAsset.url,EntityAsset.title,EntityAsset.altText, orEntityAsset.tagscontain it.If no
searchStringis 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 includeCategoryAssetswhereCategoryAsset.sortedhas the given valuesearchString- (optional) a string which should be found inEntityAsset.url,EntityAsset.title,EntityAsset.altText, orEntityAsset.tagsfilters- additional filters to apply in the query. Should beEmptyNodeif 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 primaryCategoryAssetfor the givenCategoryAsset.categoryId.- Parameters:
categoryId- the value to match againstCategoryAsset.categoryIdcontextInfo- 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 primaryCategoryAssetfor 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
CategoryAssetfor 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 theCategoryAssetsfor aCategoryby ID.- Parameters:
categoryId- Id of the category which's assets to readcontextInfo- context information around sandboxing and multitenant state- Returns:
- all of the
CategoryAssetsfor aCategoryby ID.
-
readAllByCategoryIdIn
List<P> readAllByCategoryIdIn(Collection<String> categoryIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads a list ofCategoryAssetsby ID.- Parameters:
categoryIds-CategoryIDs to match againstcontextInfo- context surrounding sandboxing and multitenant state- Returns:
- A list of
CategoryAssetsby ID.
-
getRepositoryDomain
-