Class DefaultComponentRenderingService
- java.lang.Object
-
- de.hybris.platform.cmsfacades.rendering.impl.DefaultComponentRenderingService
-
- All Implemented Interfaces:
ComponentRenderingService
public class DefaultComponentRenderingService extends java.lang.Object implements ComponentRenderingService
Default implementation ofComponentRenderingService.
-
-
Constructor Summary
Constructors Constructor Description DefaultComponentRenderingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchPageData<AbstractCMSComponentData>getAllComponents(java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode, SearchPageData searchPageData)Returns the list of allAbstractCMSComponentDatafound inSearchPageData.protected CMSComponentServicegetCmsComponentService()protected CMSDataFactorygetCmsDataFactory()AbstractCMSComponentDatagetComponentById(java.lang.String componentId, java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode)Returns theAbstractCMSComponentDataobject by component id restricted by categoryCode or productCode or catalogCode.protected java.util.Optional<AbstractCMSComponentData>getComponentData(AbstractCMSComponentModel componentModel, RestrictionData restrictionData)protected Converter<AbstractCMSComponentModel,AbstractCMSComponentData>getComponentRenderingConverter()SearchPageData<AbstractCMSComponentData>getComponentsByIds(java.util.Collection<java.lang.String> componentIds, java.lang.String categoryCode, java.lang.String productCode, java.lang.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 FacadeValidationServicegetFacadeValidationService()protected org.springframework.validation.ValidatorgetRenderingComponentValidator()protected RenderingVisibilityServicegetRenderingVisibilityService()protected RestrictionAwareServicegetRestrictionAwareService()voidsetCmsComponentService(CMSComponentService cmsComponentService)voidsetCmsDataFactory(CMSDataFactory cmsDataFactory)voidsetComponentRenderingConverter(Converter<AbstractCMSComponentModel,AbstractCMSComponentData> componentRenderingConverter)voidsetFacadeValidationService(FacadeValidationService facadeValidationService)voidsetRenderingComponentValidator(org.springframework.validation.Validator renderingComponentValidator)voidsetRenderingVisibilityService(RenderingVisibilityService renderingVisibilityService)voidsetRestrictionAwareService(RestrictionAwareService restrictionAwareService)protected voidvalidateParameters(java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode)
-
-
-
Method Detail
-
getComponentById
public AbstractCMSComponentData getComponentById(java.lang.String componentId, java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode) throws CMSItemNotFoundException
Description copied from interface:ComponentRenderingServiceReturns theAbstractCMSComponentDataobject by component id restricted by categoryCode or productCode or catalogCode.- 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(java.util.Collection<java.lang.String> componentIds, java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode, SearchPageData searchPageData)
Description copied from interface:ComponentRenderingServiceReturns the list of foundAbstractCMSComponentDatainSearchPageData. The result is restricted by categoryCode or productCode or catalogCode.- 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(java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode, SearchPageData searchPageData)
Description copied from interface:ComponentRenderingServiceReturns the list of allAbstractCMSComponentDatafound inSearchPageData. The result is restricted by categoryCode or productCode or catalogCode.- 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
protected void validateParameters(java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode)
-
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 java.util.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
protected CMSDataFactory getCmsDataFactory()
-
setCmsDataFactory
public void setCmsDataFactory(CMSDataFactory cmsDataFactory)
-
getCmsComponentService
protected CMSComponentService getCmsComponentService()
-
setCmsComponentService
public void setCmsComponentService(CMSComponentService cmsComponentService)
-
getComponentRenderingConverter
protected Converter<AbstractCMSComponentModel,AbstractCMSComponentData> getComponentRenderingConverter()
-
setComponentRenderingConverter
public void setComponentRenderingConverter(Converter<AbstractCMSComponentModel,AbstractCMSComponentData> componentRenderingConverter)
-
getRestrictionAwareService
protected RestrictionAwareService getRestrictionAwareService()
-
setRestrictionAwareService
public void setRestrictionAwareService(RestrictionAwareService restrictionAwareService)
-
getFacadeValidationService
protected FacadeValidationService getFacadeValidationService()
-
setFacadeValidationService
public void setFacadeValidationService(FacadeValidationService facadeValidationService)
-
getRenderingComponentValidator
protected org.springframework.validation.Validator getRenderingComponentValidator()
-
setRenderingComponentValidator
public void setRenderingComponentValidator(org.springframework.validation.Validator renderingComponentValidator)
-
getRenderingVisibilityService
protected RenderingVisibilityService getRenderingVisibilityService()
-
setRenderingVisibilityService
public void setRenderingVisibilityService(RenderingVisibilityService renderingVisibilityService)
-
-