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

All Superinterfaces:
CustomizedContentItemRepository<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:
JpaContentItemRepository<D>

@NoRepositoryBean public interface ContentItemRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable> extends CustomizedContentItemRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
Repository for persistent counter-parts of ContentItem.
Author:
Jon Fleschler (jfleschler)
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    existsByModelContextId(String modelContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    findAllByContextIdIn(Collection<String> ids, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Reads all ContentItems matching the given ids.
    org.springframework.data.domain.Page<D>
    findAllByContextIdIn(Collection<String> ids, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Reads all ContentItems matching the given ids.
    findAllByContextIdIn(List<String> contentItemIdList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Find all content for a given list of ids
    findAllByModelContextId(String contextId, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Find all content for a specific model.
    org.springframework.data.domain.Page<D>
    findAllByModelContextId(String modelId, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Read all content for a specific model.
    org.springframework.data.domain.Page<D>
    findAllByNameContainingIgnoreCase(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Find all content models, filtered by name.
    findAllByNameIn(Collection<String> names, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Reads all ContentItems matching the given names.
    org.springframework.data.domain.Page<D>
    findAllByNameIn(Collection<String> names, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Reads all ContentItems matching the given names.
    findAllByTagsIsNotNull(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Find all content where tags is not null
    org.springframework.data.domain.Page<D>
    findAllByUriIsNotNullAndUriNot(String uri, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Read all ContentItems whose ContentItem.getUri() is not equal to the value specified by the uri parameter
    findByModelContextIdAndUri(String modelContextId, String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Retrieves the ContentItem by matching modelContextId and uri.
    default Optional<D>
    findByName(String contentName, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 2.1.3.
    findByNameAndEmbeddedFalse(String contentName, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Find the non-embedded content item with the given name.

    Methods inherited from interface com.broadleafcommerce.content.repository.CustomizedContentItemRepository

    findAllActiveByName, findAllByQuery, findAllInactiveByName, findByCombinedModelAndItemUris

    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

    • findAllByNameContainingIgnoreCase

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByNameContainingIgnoreCase(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find all content models, filtered by name.
      Parameters:
      nameQuery - the content name to filter by
      page - the requested page of results from the database
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      all content, filtered by name
    • findAllByNameIn

      @Policy(operationTypes=READ) List<D> findAllByNameIn(Collection<String> names, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all ContentItems matching the given names.
      Parameters:
      names - Names of the ContentItems to retrieve.
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      context - context information surrounding sandboxing and multitenant state
      Returns:
      All ContentItems matching the given names.
    • findAllByNameIn

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByNameIn(Collection<String> names, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all ContentItems matching the given names.
      Parameters:
      names - Names of the ContentItems to retrieve.
      page - the requested page of results from the database
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      context - context information surrounding sandboxing and multitenant state
      Returns:
      A page of all ContentItems matching the given names.
    • findAllByContextIdIn

      @Policy(operationTypes=READ) List<D> findAllByContextIdIn(Collection<String> ids, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all ContentItems matching the given ids.
      Parameters:
      ids - Names of the ContentItems to retrieve.
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      context - context information surrounding sandboxing and multitenant state
      Returns:
      All ContentItems matching the given ids.
    • findAllByContextIdIn

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByContextIdIn(Collection<String> ids, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads all ContentItems matching the given ids.
      Parameters:
      ids - Names of the ContentItems to retrieve.
      page - the requested page of results from the database
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      context - context information surrounding sandboxing and multitenant state
      Returns:
      A page of all ContentItems matching the given ids.
    • findByName

      @Deprecated(since="2.1.3.", forRemoval=true) @Policy(operationTypes=READ) default Optional<D> findByName(String contentName, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.1.3. Content names are not unique for all content, they are only unique for non-embedded content. Use findByNameAndEmbeddedFalse(String, ContextInfo) instead.
      Find the content item with the given name. There should only be one result, as content names are unique.
      Parameters:
      contentName - the name of the content to retrieve
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      an Optional containing the content that was found, empty otherwise
    • findByNameAndEmbeddedFalse

      @Policy(operationTypes=READ) Optional<D> findByNameAndEmbeddedFalse(String contentName, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find the non-embedded content item with the given name. There should only be one result, as content names are unique in all non-embedded items (ContentItem.getEmbedded() is `false`).
      Parameters:
      contentName - the name of the content to retrieve
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      an Optional containing the content that was found, empty otherwise
    • findAllByModelContextId

      @Policy(operationTypes=READ) List<D> findAllByModelContextId(String contextId, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find all content for a specific model.
      Parameters:
      contextId - the content's model id
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      a list of content items associated with a model
    • findAllByModelContextId

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByModelContextId(String modelId, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Read all content for a specific model.
      Parameters:
      modelId - the content's model id
      page - the requested page of results from the database
      filters - additional filters to apply in the query, can be null
      context - context information surrounding sandboxing and multitenant state
      Returns:
      a page of content items associated with a model
    • findAllByUriIsNotNullAndUriNot

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByUriIsNotNullAndUriNot(String uri, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read all ContentItems whose ContentItem.getUri() is not equal to the value specified by the uri parameter
      Parameters:
      uri - the uri value which should not be to be included in the result
      page - the requested page of results from the database
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      a page of non-null content items
    • findByModelContextIdAndUri

      @Policy(operationTypes=READ) Optional<D> findByModelContextIdAndUri(String modelContextId, String uri, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Retrieves the ContentItem by matching modelContextId and uri.
      Parameters:
      modelContextId - ID of the model the item belongs to
      uri - URI of the item
      contextInfo - Context information surrounding sandboxing and multitenant state
      Returns:
      The ContentItem by matching modelContextId and uri.
    • findAllByContextIdIn

      List<D> findAllByContextIdIn(List<String> contentItemIdList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find all content for a given list of ids
      Parameters:
      contentItemIdList - the list of content model ids
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      a list of content items
    • findAllByTagsIsNotNull

      List<D> findAllByTagsIsNotNull(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Find all content where tags is not null
      Parameters:
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      a list of content items
    • existsByModelContextId

      boolean existsByModelContextId(String modelContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Parameters:
      modelContextId - modelContextId ID of the model the item belongs to
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      true if there is a content item for a given parameters