Class DefaultComponentRenderingService
java.lang.Object
de.hybris.platform.cmsfacades.rendering.impl.DefaultComponentRenderingService
- All Implemented Interfaces:
ComponentRenderingService
Default implementation of
ComponentRenderingService.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllComponents(String categoryCode, String productCode, String catalogCode, SearchPageData searchPageData) Returns the list of allAbstractCMSComponentDatafound inSearchPageData.protected CMSComponentServiceprotected CMSDataFactorygetComponentById(String componentId, String categoryCode, String productCode, String catalogCode) Returns theAbstractCMSComponentDataobject by component id restricted by categoryCode or productCode or catalogCode.protected Optional<AbstractCMSComponentData>getComponentData(AbstractCMSComponentModel componentModel, RestrictionData restrictionData) getComponentsByIds(Collection<String> componentIds, String categoryCode, String productCode, String catalogCode, SearchPageData searchPageData) Returns the list of foundAbstractCMSComponentDatainSearchPageData.protected SearchPageData<AbstractCMSComponentData>getComponentsData(SearchPageData<AbstractCMSComponentModel> componentsSearchData, RestrictionData restrictionData) Returns the list of foundAbstractCMSComponentDatainSearchPageDatabased onRestrictionDataobject.protected FacadeValidationServiceprotected org.springframework.validation.Validatorprotected RenderingVisibilityServiceprotected RestrictionAwareServicevoidsetCmsComponentService(CMSComponentService cmsComponentService) voidsetCmsDataFactory(CMSDataFactory cmsDataFactory) voidsetComponentRenderingConverter(Converter<AbstractCMSComponentModel, AbstractCMSComponentData> componentRenderingConverter) voidsetFacadeValidationService(FacadeValidationService facadeValidationService) voidsetRenderingCacheService(RenderingCacheService<AbstractCMSComponentData> renderingCacheService) voidsetRenderingComponentValidator(org.springframework.validation.Validator renderingComponentValidator) voidsetRenderingVisibilityService(RenderingVisibilityService renderingVisibilityService) voidsetRestrictionAwareService(RestrictionAwareService restrictionAwareService) protected voidvalidateParameters(String categoryCode, String productCode, String catalogCode)
-
Constructor Details
-
DefaultComponentRenderingService
public DefaultComponentRenderingService()
-
-
Method Details
-
getComponentById
public AbstractCMSComponentData getComponentById(String componentId, String categoryCode, String productCode, String catalogCode) throws CMSItemNotFoundException Description copied from interface:ComponentRenderingServiceReturns theAbstractCMSComponentDataobject by component id restricted by categoryCode or productCode or catalogCode. The result of the method is retrieved from the cache if theRenderingCacheServiceis enabled.- Specified by:
getComponentByIdin interfaceComponentRenderingService- Parameters:
componentId- the component idcategoryCode- the optional category codeproductCode- the optional product codecatalogCode- the optional catalog code- Returns:
- the
AbstractCMSComponentDataobject - Throws:
CMSItemNotFoundException- if the component is restricted or not visible.
-
getComponentsByIds
public SearchPageData<AbstractCMSComponentData> getComponentsByIds(Collection<String> componentIds, String categoryCode, String productCode, String catalogCode, SearchPageData searchPageData) Description copied from interface:ComponentRenderingServiceReturns the list of foundAbstractCMSComponentDatainSearchPageData. The result is restricted by categoryCode or productCode or catalogCode. The result of the method is retrieved from the cache if theRenderingCacheServiceis enabled.- Specified by:
getComponentsByIdsin interfaceComponentRenderingService- Parameters:
componentIds- the list of component idcategoryCode- the optional category codeproductCode- the optional product codecatalogCode- the optional catalog codesearchPageData- the searchPageData contains requested pagination and sorting information- Returns:
- the list of found
AbstractCMSComponentDatainSearchPageData. If nothing is found the empty list is returned.
-
getAllComponents
public SearchPageData<AbstractCMSComponentData> getAllComponents(String categoryCode, String productCode, String catalogCode, SearchPageData searchPageData) Description copied from interface:ComponentRenderingServiceReturns the list of allAbstractCMSComponentDatafound inSearchPageData. The result is restricted by categoryCode or productCode or catalogCode. The result of the method is retrieved from the cache if theRenderingCacheServiceis enabled.- Specified by:
getAllComponentsin interfaceComponentRenderingService- Parameters:
categoryCode- the optional category codeproductCode- the optional product codecatalogCode- the optional catalog codesearchPageData- the searchPageData contains requested pagination and sorting information- Returns:
- the list of found
AbstractCMSComponentDatainSearchPageData. If nothing is found the empty list is returned.
-
validateParameters
-
getComponentsData
protected SearchPageData<AbstractCMSComponentData> getComponentsData(SearchPageData<AbstractCMSComponentModel> componentsSearchData, RestrictionData restrictionData) Returns the list of foundAbstractCMSComponentDatainSearchPageDatabased onRestrictionDataobject. If nothing is found then the empty list is returned.- Parameters:
componentsSearchData-restrictionData-- Returns:
- the list of found
AbstractCMSComponentDatainSearchPageData.
-
getComponentData
protected Optional<AbstractCMSComponentData> getComponentData(AbstractCMSComponentModel componentModel, RestrictionData restrictionData) Returns theAbstractCMSComponentDatadto based onAbstractCMSComponentModelandRestrictionData. When the component is not visible based on the restriction, an empty Optional is returned.- Parameters:
componentModel- theAbstractCMSComponentModelobject.restrictionData- theRestrictionDataobject determining whether the component is visible or not.- Returns:
- the
OptionalofAbstractCMSComponentDataobject; returnOptional#empty()when the component is not visible
-
getCmsDataFactory
-
setCmsDataFactory
-
getCmsComponentService
-
setCmsComponentService
-
getComponentRenderingConverter
protected Converter<AbstractCMSComponentModel,AbstractCMSComponentData> getComponentRenderingConverter() -
setComponentRenderingConverter
public void setComponentRenderingConverter(Converter<AbstractCMSComponentModel, AbstractCMSComponentData> componentRenderingConverter) -
getRestrictionAwareService
-
setRestrictionAwareService
-
getFacadeValidationService
-
setFacadeValidationService
-
getRenderingComponentValidator
protected org.springframework.validation.Validator getRenderingComponentValidator() -
setRenderingComponentValidator
public void setRenderingComponentValidator(org.springframework.validation.Validator renderingComponentValidator) -
getRenderingVisibilityService
-
setRenderingVisibilityService
-
getRenderingCacheService
-
setRenderingCacheService
public void setRenderingCacheService(RenderingCacheService<AbstractCMSComponentData> renderingCacheService)
-