Interface AssetRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>

All Superinterfaces:
CustomizedAssetRepository<D>, com.broadleafcommerce.common.extension.DomainTypeAware, com.broadleafcommerce.common.messaging.notification.NotificationStateRepository, org.springframework.data.repository.Repository<D,String>, com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
All Known Subinterfaces:
JpaAssetRepository<D>

@NoRepositoryBean public interface AssetRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable> extends com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, CustomizedAssetRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
Repository for persistent counter-parts of Asset
Author:
Nathan Moore (nathanmoore)., Samarth Dhruva (samarthd)
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    existsByFolderContextId(String folderContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns whether or not there are any assets with folderId as their Asset.folderId.
    org.springframework.data.domain.Page<D>
    findAllByContextIdIn(List<String> assetContextIdList, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Retrieves a paged list of asset whose context IDs match any of the given IDs.
    org.springframework.data.domain.Page<D>
    findAllByFolderContextId(String folderContextId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns the children asset of the given folder by finding all of the assets whose folder context ID matches the given ID.
    org.springframework.data.domain.Page<D>
    findAllByFolderContextIdIsNull(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all asset in root folders.
    findByUrlStartsWithAndStorageType(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.

    Methods inherited from interface com.broadleafcommerce.asset.repository.CustomizedAssetRepository

    findByUrlAndStorageType, searchAll

    Methods inherited from interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository

    findNotificationReadyMembers, setFailedNotificationAttempt, setNotificationAcknowledged

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.TrackableRepository

    archive, existsByContextId, findAll, findAll, findAll, findAll, findAll, findAll, findAllByContextId, findByContextId, findByContextIdAndCatalog, findByNativeId, findDeployable, findMaxSortMember, findMinSortMember, findOriginal, findPromotable, findPromoteOrientedItems, findRebasable, findRejectable, findRevertable, findTarget, getDomainType, getEntityInformation, getTrackableBehaviorUtil, getTypesToRegisterInMappingContext, pruneChangeDetails, pruneRestingNotificationStates, purgeObsoleteSandboxData, save, saveAll, setTrackableBehaviorUtil

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor

    exists, findAll, findAll, findAll, findAll
  • Method Details

    • findByUrlStartsWithAndStorageType

      @Policy(operationTypes=READ) List<D> findByUrlStartsWithAndStorageType(@NonNull String prefix, @NonNull 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.url should start with
      storageType - the storage type which should match with Asset.storageType
      contextInfo - context information around sandbox and multitenant state
      Returns:
      a list of assets whose urls start with the given prefix and whose storage types have the given value
    • findAllByContextIdIn

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByContextIdIn(@NonNull List<String> assetContextIdList, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Retrieves a paged list of asset whose context IDs match any of the given IDs.
      Parameters:
      assetContextIdList - the context IDs to query for
      pageInfo - pagination information
      contextInfo - the context to perform the operation in
      Returns:
      a paged list of asset whose context IDs match any of the given IDs
    • findAllByFolderContextId

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByFolderContextId(@NonNull String folderContextId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Returns the children asset of the given folder by finding all of the assets whose folder context ID matches the given ID.
      Parameters:
      folderContextId - the context ID of the folder whose assets should be found
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      pageInfo - pagination information
      contextInfo - the context to perform the operation in
      Returns:
      the assets of the folder with the given context ID
    • existsByFolderContextId

      @Policy(operationTypes=READ) boolean existsByFolderContextId(@NonNull String folderContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Returns whether or not there are any assets with folderId as their Asset.folderId. Essentially, this determines if there are any assets directly in the given folder.
      Parameters:
      folderContextId - 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 folderId as their Asset.folderId
    • findAllByFolderContextIdIsNull

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByFolderContextIdIsNull(@Nullable 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 asset in root folders.
      Parameters:
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      pageInfo - pagination information
      contextInfo - the context to perform the operation in
      Returns:
      all assets in root folders