Interface ProductAssetService<P extends ProductAsset>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
- All Known Implementing Classes:
DefaultProductAssetService
public interface ProductAssetService<P extends ProductAsset>
extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Service API for
ProductAssets
. Supported by ProductAssetRepository
.- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptionlong
countNonProductionRecordsByProductIdsInTenant
(Collection<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the count of non-production records that match the givenproductContextIds
and the given tenant context.readAllByProductIdIn
(Collection<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads all of the product assets which are associated with any of the givenproductIds
.readAllByProductIdIn
(Collection<String> productIds, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads all of the product assets which are associated with any of the givenproductIds
.readAllPrimaryAssetsByProductIds
(Iterable<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the primaryProductAssets
for the given product IDs.readAllPrimaryAssetsByProductIdsExcludeAssetIds
(Iterable<String> productIds, Iterable<String> assetIdsToExclude, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all the primaryProductAssets
for the given product IDs excluding given asset IDs.readByProductIdAndPrimaryTrue
(String productId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the primaryProductAsset
for the givenProductAsset.productId
.org.springframework.data.domain.Page<P>
searchAllWithProductId
(String productId, 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 allProductAssets
for the given product 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
-
searchAllWithProductId
org.springframework.data.domain.Page<P> searchAllWithProductId(String productId, @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 allProductAssets
for the given product 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 product.This method also supports RSQL filtration via
filters
.- Parameters:
productId
- the value which the product ID should match againstisSorted
- (optional) if not-null, will restrict results to only includeProductAssets
whereProductAsset.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 product ID, optionally filtered by the given search/filter arguments (if provided)
-
readAllByProductIdIn
List<P> readAllByProductIdIn(Collection<String> productIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads all of the product assets which are associated with any of the givenproductIds
.- Parameters:
productIds
- a collection of product IDs which the results must be associated withcontext
- context information surrounding sandboxing and multitenant state- Returns:
- all of the product assets which are associated with any of the given
productIds
-
readAllByProductIdIn
List<P> readAllByProductIdIn(Collection<String> productIds, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads all of the product assets which are associated with any of the givenproductIds
.- Parameters:
productIds
- a collection of product IDs which the results must be associated withfilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.context
- context information surrounding sandboxing and multitenant state- Returns:
- all of the product assets which are associated with any of the given
productIds
-
readByProductIdAndPrimaryTrue
Optional<P> readByProductIdAndPrimaryTrue(String productId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the primaryProductAsset
for the givenProductAsset.productId
.- Parameters:
productId
- the value to match againstProductAsset.productId
contextInfo
- context information around sandboxing and multitenant state- Returns:
- an optional containing the primary asset for a product, empty otherwise
-
readAllPrimaryAssetsByProductIds
List<P> readAllPrimaryAssetsByProductIds(Iterable<String> productIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the primaryProductAssets
for the given product IDs.- Parameters:
productIds
- IDs of the products for which to read primary assetscontextInfo
- context information around sandboxing and multitenant state- Returns:
- all of the primary
ProductAssets
for the given product IDs.
-
readAllPrimaryAssetsByProductIdsExcludeAssetIds
List<P> readAllPrimaryAssetsByProductIdsExcludeAssetIds(Iterable<String> productIds, Iterable<String> assetIdsToExclude, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all the primaryProductAssets
for the given product IDs excluding given asset IDs.- Parameters:
productIds
- IDs of the products for which to find primary assetsassetIdsToExclude
- IDs of the assets to excludecontextInfo
- context information around sandboxing and multitenant state- Returns:
- the primary
ProductAssets
for the given product IDs excluding given asset IDs.
-
countNonProductionRecordsByProductIdsInTenant
long countNonProductionRecordsByProductIdsInTenant(@NonNull Collection<String> productIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the count of non-production records that match the givenproductContextIds
and the given tenant context.- Parameters:
productIds
- IDs of parent Products to match againstcontext
- Request context information around sandbox and multitenant state- Returns:
- the count of non-production records that match the given
productContextIds
and the given tenant context
-
getRepositoryDomain
-