Interface AssetService<P extends Asset>
- All Superinterfaces:
- com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,- com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
- All Known Implementing Classes:
- DefaultAssetService
public interface AssetService<P extends Asset>
extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Base service API for 
Asset. Backed by a AssetRepository.- Author:
- Nathan Moore (nathanmoore)., Samarth Dhruva (samarthd)
- 
Method SummaryModifier and TypeMethodDescriptionbooleanexistsByFolderId(String folderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns whether or not there are any assets withfolderIdas theirAsset.folderId.org.springframework.data.domain.Page<Asset>readAllAssetsInFolder(String folderId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the assets in the given folder.org.springframework.data.domain.Page<P>readAllByContextIds(List<String> assetIds, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all asset with IDs in the supplied list.readByUrlAndStorageType(String url, String storageType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the asset whose url and storage type (optional) match the provided values.readByUrlStartsWithAndStorageType(String prefix, String storageType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the assets whose URL begins with a given string and whose storage type matches the given value.org.springframework.data.domain.Page<P>searchAll(String searchString, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) IfsearchStringis provided, then this method will search for assets whoseAsset.url,Asset.title,Asset.altText, orAsset.tagscontain it.Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityServicecreate, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityServicereadAll, readAll, readAll, readAll
- 
Method Details- 
searchAllorg.springframework.data.domain.Page<P> searchAll(@Nullable String searchString, cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) IfsearchStringis provided, then this method will search for assets whoseAsset.url,Asset.title,Asset.altText, orAsset.tagscontain it.If no searchStringis provided, then this method will simply return all assets.This method also supports RSQL filtration via filters.- Parameters:
- searchString- (optional) a string which should be found in- Asset.url,- Asset.title,- Asset.altText, or- Asset.tags
- filters- additional filters to apply in the query. Should be- EmptyNodeif no additional filters should be applied.
- pageInfo- information about which page of results to return from the database
- contextInfo- context information surrounding sandboxing/multitenant state
- Returns:
- the assets matching the given search/filter arguments if provided, otherwise all assets
 
- 
readByUrlAndStorageTypeOptional<P> readByUrlAndStorageType(String url, @Nullable String storageType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the asset whose url and storage type (optional) match the provided values.- Parameters:
- url- the url which should match with- Asset.url
- storageType- (optional) the storage type which should match with- Asset.storageType. If left null, results will not be filtered by storage type.
- contextInfo- context information around sandboxing and multitenant state
- Returns:
- an optional containing the asset whose url and storage type (optional) match the provided values, empty otherwise
 
- 
readByUrlStartsWithAndStorageTypeList<P> readByUrlStartsWithAndStorageType(String prefix, String storageType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the assets whose URL begins with a given string and whose storage type matches the given value.- Parameters:
- prefix- the string which each- Asset.urlshould start with
- storageType- the storage type which should match with- Asset.storageType
- contextInfo- context information around sandbox and multitenant state
- Returns:
- a list of Assetswhoseurlsstart with the given prefix and whosestorage typeshave the given value
 
- 
readAllByContextIdsorg.springframework.data.domain.Page<P> readAllByContextIds(List<String> assetIds, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all asset with IDs in the supplied list.- Parameters:
- assetIds- the asset context IDs to search for
- pageInfo- pagination information
- contextInfo- the context to perform the operation in
- Returns:
- the asset that matched with the IDs in the given list
 
- 
readAllAssetsInFolderorg.springframework.data.domain.Page<Asset> readAllAssetsInFolder(@Nullable String folderId, cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the assets in the given folder.- Parameters:
- folderId- the context ID of the folder whose children asset should be returned. If null, this will return all assets that are not in a folder.
- filters- additional filters to apply in the query. Should be- EmptyNodeif no additional filters should be applied.
- pageInfo- pagination information
- contextInfo- the context to perform the operation in
- Returns:
- all of the assets in the given folder. Throws EntityMissingExceptionif no folder was found with the given folderId.
 
- 
existsByFolderIdboolean existsByFolderId(String folderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns whether or not there are any assets withfolderIdas theirAsset.folderId. Essentially, this determines if there are any child assets directly in the given folder.- Parameters:
- folderId- the context ID of the folder whose assets should be found
- contextInfo- the context surrounding sandboxing and mulitenant state
- Returns:
- whether or not there are any assets with folderIdas theirAsset.folderId
 
 
-