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 -
Constructor Summary
ConstructorsConstructorDescriptionDefaultFieldDefinitionService(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 TypeMethodDescriptionvoidprotected org.springframework.context.ApplicationEventPublisherprotected 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 StringgetSandboxRecordValidationError(@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.voidsetEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher) voidsetFacetGroupFacetService(FacetGroupFacetService<com.broadleafcommerce.search.api.domain.FacetGroupFacet> facetGroupFacetService) voidsetFacetService(FacetService<com.broadleafcommerce.search.api.domain.Facet> facetService) voidsetSortGroupSortOptionService(SortGroupSortOptionService<com.broadleafcommerce.search.api.domain.SortGroupSortOption> sortGroupSortOptionService) voidsetSortOptionService(SortOptionService<com.broadleafcommerce.search.api.domain.SortOption> sortOptionService) protected voidthrowIfHasRecords(@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 voidvalidateNoNonProductionRecordsForRelatedEntities(@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, readAllMethods 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, updateSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
CACHE_BY_INDEXABLE_TYPE
- See Also:
-
-
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:
readAllByLabelin interfaceFieldDefinitionService<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:FieldDefinitionServiceReturn all of the fields with the given type.- Specified by:
readFieldsForIndexableTypein interfaceFieldDefinitionService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>- Parameters:
indexableType- the type to search forcontextInfo- 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:
readAllFieldsByIdin interfaceFieldDefinitionService<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:
deletein interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends com.broadleafcommerce.search.api.domain.FieldDefinition>- Overrides:
deletein classcom.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
-
getRepositoryDomain
Description copied from interface:FieldDefinitionServiceReturns the name of the repository domain corresponding to the projection domain.- Specified by:
getRepositoryDomainin interfaceFieldDefinitionService<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:
getRepositoryin classcom.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
-
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)
-