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 allAbstractCMSComponentData
found inSearchPageData
.protected CMSComponentService
getCmsComponentService()
protected CMSDataFactory
getCmsDataFactory()
AbstractCMSComponentData
getComponentById(java.lang.String componentId, java.lang.String categoryCode, java.lang.String productCode, java.lang.String catalogCode)
Returns theAbstractCMSComponentData
object 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 foundAbstractCMSComponentData
inSearchPageData
.protected SearchPageData<AbstractCMSComponentData>
getComponentsData(SearchPageData<AbstractCMSComponentModel> componentsSearchData, RestrictionData restrictionData)
Returns the list of foundAbstractCMSComponentData
inSearchPageData
based onRestrictionData
object.protected FacadeValidationService
getFacadeValidationService()
protected org.springframework.validation.Validator
getRenderingComponentValidator()
protected RenderingVisibilityService
getRenderingVisibilityService()
protected RestrictionAwareService
getRestrictionAwareService()
void
setCmsComponentService(CMSComponentService cmsComponentService)
void
setCmsDataFactory(CMSDataFactory cmsDataFactory)
void
setComponentRenderingConverter(Converter<AbstractCMSComponentModel,AbstractCMSComponentData> componentRenderingConverter)
void
setFacadeValidationService(FacadeValidationService facadeValidationService)
void
setRenderingComponentValidator(org.springframework.validation.Validator renderingComponentValidator)
void
setRenderingVisibilityService(RenderingVisibilityService renderingVisibilityService)
void
setRestrictionAwareService(RestrictionAwareService restrictionAwareService)
protected void
validateParameters(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:ComponentRenderingService
Returns theAbstractCMSComponentData
object by component id restricted by categoryCode or productCode or catalogCode.- Specified by:
getComponentById
in interfaceComponentRenderingService
- Parameters:
componentId
- the component idcategoryCode
- the optional category codeproductCode
- the optional product codecatalogCode
- the optional catalog code- Returns:
- the
AbstractCMSComponentData
object - 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:ComponentRenderingService
Returns the list of foundAbstractCMSComponentData
inSearchPageData
. The result is restricted by categoryCode or productCode or catalogCode.- Specified by:
getComponentsByIds
in 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
AbstractCMSComponentData
inSearchPageData
. 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:ComponentRenderingService
Returns the list of allAbstractCMSComponentData
found inSearchPageData
. The result is restricted by categoryCode or productCode or catalogCode.- Specified by:
getAllComponents
in 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
AbstractCMSComponentData
inSearchPageData
. 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 foundAbstractCMSComponentData
inSearchPageData
based onRestrictionData
object. If nothing is found then the empty list is returned.- Parameters:
componentsSearchData
-restrictionData
-- Returns:
- the list of found
AbstractCMSComponentData
inSearchPageData
.
-
getComponentData
protected java.util.Optional<AbstractCMSComponentData> getComponentData(AbstractCMSComponentModel componentModel, RestrictionData restrictionData)
Returns theAbstractCMSComponentData
dto based onAbstractCMSComponentModel
andRestrictionData
. When the component is not visible based on the restriction, an empty Optional is returned.- Parameters:
componentModel
- theAbstractCMSComponentModel
object.restrictionData
- theRestrictionData
object determining whether the component is visible or not.- Returns:
- the
Optional
ofAbstractCMSComponentData
object; 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)
-
-