Class DefaultDataDrivenEnumDetailsService
java.lang.Object
com.broadleafcommerce.catalog.service.enumeration.commerce.DefaultDataDrivenEnumDetailsService
- All Implemented Interfaces:
DataDrivenEnumDetailsService
public class DefaultDataDrivenEnumDetailsService
extends Object
implements DataDrivenEnumDetailsService
-
Constructor Summary
ConstructorDescriptionDefaultDataDrivenEnumDetailsService
(com.broadleafcommerce.common.extension.TypeFactory typeFactory, DataDrivenEnumService<DataDrivenEnum> dataDrivenEnumService, CategoryService<Category> categoryService) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<DataDrivenEnumDetails>
buildDetails
(Collection<DataDrivenEnum> dataDrivenEnums, DataDrivenEnumDetailsRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected String
buildExpectedCategoryUrl
(DataDrivenEnumDetails dataDrivenEnumDetails) Builds a category URL that is expected for the givenDataDrivenEnumDetails
.boolean
checkAssociatedCategoryExists
(DataDrivenEnumDetails dataDrivenEnumDetails, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Checks if an associated category exists based on the expected category url for the givenDataDrivenEnumDetails.getValue()
.protected CategoryService<Category>
getDataDrivenEnumDetailsForRequest
(DataDrivenEnumDetailsRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets aDataDrivenEnumDetails
for theDataDrivenEnumDetailsRequest
.protected DataDrivenEnumService<DataDrivenEnum>
protected com.broadleafcommerce.common.extension.TypeFactory
protected Set<DataDrivenEnum>
resolveDataDrivenEnums
(DataDrivenEnumDetailsRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
-
Constructor Details
-
DefaultDataDrivenEnumDetailsService
public DefaultDataDrivenEnumDetailsService(com.broadleafcommerce.common.extension.TypeFactory typeFactory, DataDrivenEnumService<DataDrivenEnum> dataDrivenEnumService, CategoryService<Category> categoryService)
-
-
Method Details
-
getDataDrivenEnumDetailsForRequest
public Optional<DataDrivenEnumDetailsList> getDataDrivenEnumDetailsForRequest(DataDrivenEnumDetailsRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataDrivenEnumDetailsService
Gets aDataDrivenEnumDetails
for theDataDrivenEnumDetailsRequest
.- Specified by:
getDataDrivenEnumDetailsForRequest
in interfaceDataDrivenEnumDetailsService
- Parameters:
request
- theDataDrivenEnumDetailsRequest
with additional request context for identifying the data driven enum for which to retrieve details and defining the how much detail to go into.contextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- a
DataDrivenEnumDetails
for theDataDrivenEnumDetailsRequest
.
-
validateRequest
-
resolveDataDrivenEnums
protected Set<DataDrivenEnum> resolveDataDrivenEnums(DataDrivenEnumDetailsRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
buildDetails
protected Collection<DataDrivenEnumDetails> buildDetails(Collection<DataDrivenEnum> dataDrivenEnums, DataDrivenEnumDetailsRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
checkAssociatedCategoryExists
public boolean checkAssociatedCategoryExists(DataDrivenEnumDetails dataDrivenEnumDetails, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataDrivenEnumDetailsService
Checks if an associated category exists based on the expected category url for the givenDataDrivenEnumDetails.getValue()
.- Specified by:
checkAssociatedCategoryExists
in interfaceDataDrivenEnumDetailsService
- Parameters:
dataDrivenEnumDetails
-DataDrivenEnumDetails
to check the associated category forcontextInfo
- context information surrounding sandboxing/multitenant state
-
buildExpectedCategoryUrl
Builds a category URL that is expected for the givenDataDrivenEnumDetails
.For example, if
DataDrivenEnumDetails.getValue()
isSOME_BRAND_NAME
, the expected category url for thisDataDrivenEnumDetails
would be/some-brand-name
.- Parameters:
dataDrivenEnumDetails
-DataDrivenEnumDetails
to build the expected category url for- Returns:
- expected category url for the given
DataDrivenEnumDetails
-
getCategoryUrlPrefix
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getDataDrivenEnumService
-
getCategoryService
-