Class DefaultFieldDefinitionService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.search.core.service.DefaultFieldDefinitionService<P>
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>, FieldDefinitionService<P>

public class DefaultFieldDefinitionService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements FieldDefinitionService<P>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultFieldDefinitionService(FieldDefinitionRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected org.springframework.context.ApplicationEventPublisher
     
    protected FacetGroupFacetService<com.broadleafcommerce.search.api.domain.FacetGroupFacet>
     
    protected FacetService<com.broadleafcommerce.search.api.domain.Facet>
     
    protected FieldDefinitionRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
    Returns the name of the repository domain corresponding to the projection domain.
    protected String
    getSandboxRecordValidationError(@NonNull String entityType, @NonNull String fieldDefinitionIdToDelete)
     
    protected SortGroupSortOptionService<com.broadleafcommerce.search.api.domain.SortGroupSortOption>
     
    protected SortOptionService<com.broadleafcommerce.search.api.domain.SortOption>
     
    org.springframework.data.domain.Page<P>
    readAllByLabel(String label, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    readAllFieldsById(Collection<String> ids, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    readFieldsForIndexableType(com.broadleafcommerce.search.api.type.IndexableType indexableType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Return all of the fields with the given type.
    void
    setEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
     
    void
    setFacetGroupFacetService(FacetGroupFacetService<com.broadleafcommerce.search.api.domain.FacetGroupFacet> facetGroupFacetService)
     
    void
    setFacetService(FacetService<com.broadleafcommerce.search.api.domain.Facet> facetService)
     
    void
    setSortGroupSortOptionService(SortGroupSortOptionService<com.broadleafcommerce.search.api.domain.SortGroupSortOption> sortGroupSortOptionService)
     
    void
    setSortOptionService(SortOptionService<com.broadleafcommerce.search.api.domain.SortOption> sortOptionService)
     
    protected void
    throwIfHasRecords(@NonNull BiFunction<Collection<String>,com.broadleafcommerce.data.tracking.core.context.ContextInfo,Boolean> checkRecordsFn, @NonNull String entityType, @NonNull String fieldDefinitionIdToDelete, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected void
    validateNoNonProductionRecordsForRelatedEntities(@NonNull String fieldDefinitionIdToDelete, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService

    getRsqlHelper, readAll, readAll, readAll, readAll

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService

    convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

    create, createAll, createAllAllowingPartialSuccess, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
  • Field Details

  • Constructor Details

    • DefaultFieldDefinitionService

      public DefaultFieldDefinitionService(FieldDefinitionRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
  • Method Details

    • readAllByLabel

      public org.springframework.data.domain.Page<P> readAllByLabel(@Nullable String label, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      readAllByLabel in interface FieldDefinitionService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>
    • readFieldsForIndexableType

      public List<P> readFieldsForIndexableType(com.broadleafcommerce.search.api.type.IndexableType indexableType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: FieldDefinitionService
      Return all of the fields with the given type.
      Specified by:
      readFieldsForIndexableType in interface FieldDefinitionService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>
      Parameters:
      indexableType - the type to search for
      contextInfo - The context information surrounding sandboxing/multitenant state
      Returns:
      the fields matching the given type
    • readAllFieldsById

      public List<P> readAllFieldsById(Collection<String> ids, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      readAllFieldsById in interface FieldDefinitionService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>
    • delete

      public void delete(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      delete in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>
      Overrides:
      delete in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>
    • validateNoNonProductionRecordsForRelatedEntities

      protected void validateNoNonProductionRecordsForRelatedEntities(@NonNull @NonNull String fieldDefinitionIdToDelete, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • throwIfHasRecords

      protected void throwIfHasRecords(@NonNull @NonNull BiFunction<Collection<String>,com.broadleafcommerce.data.tracking.core.context.ContextInfo,Boolean> checkRecordsFn, @NonNull @NonNull String entityType, @NonNull @NonNull String fieldDefinitionIdToDelete, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • getSandboxRecordValidationError

      protected String getSandboxRecordValidationError(@NonNull @NonNull String entityType, @NonNull @NonNull String fieldDefinitionIdToDelete)
    • getRepositoryDomain

      public String getRepositoryDomain()
      Description copied from interface: FieldDefinitionService
      Returns the name of the repository domain corresponding to the projection domain.
      Specified by:
      getRepositoryDomain in interface FieldDefinitionService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>
      Returns:
      The name of the repository domain corresponding to the projection domain.
    • getRepository

      protected FieldDefinitionRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>
    • getEventPublisher

      @Nullable protected org.springframework.context.ApplicationEventPublisher getEventPublisher()
    • setEventPublisher

      @Autowired(required=false) public void setEventPublisher(@Nullable org.springframework.context.ApplicationEventPublisher eventPublisher)
    • getFacetService

      protected FacetService<com.broadleafcommerce.search.api.domain.Facet> getFacetService()
    • setFacetService

      @Autowired @Lazy public void setFacetService(FacetService<com.broadleafcommerce.search.api.domain.Facet> facetService)
    • getSortOptionService

      protected SortOptionService<com.broadleafcommerce.search.api.domain.SortOption> getSortOptionService()
    • setSortOptionService

      @Autowired @Lazy public void setSortOptionService(SortOptionService<com.broadleafcommerce.search.api.domain.SortOption> sortOptionService)
    • getFacetGroupFacetService

      protected FacetGroupFacetService<com.broadleafcommerce.search.api.domain.FacetGroupFacet> getFacetGroupFacetService()
    • setFacetGroupFacetService

      @Autowired public void setFacetGroupFacetService(FacetGroupFacetService<com.broadleafcommerce.search.api.domain.FacetGroupFacet> facetGroupFacetService)
    • getSortGroupSortOptionService

      protected SortGroupSortOptionService<com.broadleafcommerce.search.api.domain.SortGroupSortOption> getSortGroupSortOptionService()
    • setSortGroupSortOptionService

      @Autowired public void setSortGroupSortOptionService(SortGroupSortOptionService<com.broadleafcommerce.search.api.domain.SortGroupSortOption> sortGroupSortOptionService)