Class DefaultCMSPageSlotComponentService
java.lang.Object
de.hybris.platform.acceleratorcms.component.slot.impl.DefaultCMSPageSlotComponentService
- All Implemented Interfaces:
CMSComponentRenderer<AbstractCMSComponentModel>,CMSPageSlotComponentService
public class DefaultCMSPageSlotComponentService
extends Object
implements CMSPageSlotComponentService
Default implementation of
CMSPageSlotComponentService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddVisibleComponents(CmsPageRequestContextData cmsPageRequestContextData, boolean evaluateRestrictions, int limit, List<AbstractCMSComponentModel> ret, List<AbstractCMSComponentModel> replacementComponents) protected booleanprotected List<AbstractCMSComponentModel>flattenComponentContainerHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentContainerModel container, boolean evaluateRestrictions, int limit) protected List<AbstractCMSComponentModel>flattenComponentHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions, int limit) protected CMSComponentContainerRegistryprotected CMSComponentRendererprotected CMSComponentServicegetCMSComponentsForComponent(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions, int limit) Get the CMS components for a CMS component.getCMSComponentsForContentSlot(CmsPageRequestContextData cmsPageRequestContextData, ContentSlotModel contentSlot, boolean evaluateRestrictions, int limit) Get the CMS components in a Content Slot.protected CMSContentSlotServiceprotected CMSRestrictionServiceLookup a Component given its ID.protected List<AbstractCMSComponentModel>Lookup a Content Slot given its ID.getContentSlotForPosition(CmsPageRequestContextData cmsPageRequestContextData, String position) Lookup the Content Slot data on the current page in the specified position.booleanisComponentVisible(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions) Checks whether component should be displayed.voidrenderComponent(javax.servlet.jsp.PageContext pageContext, AbstractCMSComponentModel component) Render a CMS Component into the page at the current location.voidsetCmsComponentContainerRegistry(CMSComponentContainerRegistry cmsComponentContainerRegistry) voidsetCmsComponentRenderer(CMSComponentRenderer cmsComponentRenderer) voidsetCmsComponentService(CMSComponentService cmsComponentService) voidsetCmsContentSlotService(CMSContentSlotService cmsContentSlotService) voidsetCmsRestrictionService(CMSRestrictionService cmsRestrictionService)
-
Constructor Details
-
DefaultCMSPageSlotComponentService
public DefaultCMSPageSlotComponentService()
-
-
Method Details
-
getCmsRestrictionService
-
setCmsRestrictionService
-
getCmsContentSlotService
-
setCmsContentSlotService
-
getCmsComponentService
-
setCmsComponentService
-
getCmsComponentRenderer
-
setCmsComponentRenderer
-
getCmsComponentContainerRegistry
-
setCmsComponentContainerRegistry
public void setCmsComponentContainerRegistry(CMSComponentContainerRegistry cmsComponentContainerRegistry) -
getContentSlotForId
Description copied from interface:CMSPageSlotComponentServiceLookup a Content Slot given its ID.- Specified by:
getContentSlotForIdin interfaceCMSPageSlotComponentService- Parameters:
id- the ID of the content slot- Returns:
- the content slot
-
getContentSlotForPosition
public ContentSlotData getContentSlotForPosition(CmsPageRequestContextData cmsPageRequestContextData, String position) Description copied from interface:CMSPageSlotComponentServiceLookup the Content Slot data on the current page in the specified position. The current page is looked up in the CmsPageRequestContextData.- Specified by:
getContentSlotForPositionin interfaceCMSPageSlotComponentService- Parameters:
cmsPageRequestContextData- The CMS context data for the current requestposition- The position in the page- Returns:
- the content slot data
-
getCMSComponentsForContentSlot
public List<AbstractCMSComponentModel> getCMSComponentsForContentSlot(CmsPageRequestContextData cmsPageRequestContextData, ContentSlotModel contentSlot, boolean evaluateRestrictions, int limit) Description copied from interface:CMSPageSlotComponentServiceGet the CMS components in a Content Slot.- Specified by:
getCMSComponentsForContentSlotin interfaceCMSPageSlotComponentService- Parameters:
cmsPageRequestContextData- The CMS context data for the current requestcontentSlot- The Content SlotevaluateRestrictions- Flag set to true to indicate that restrictions should be evaluated on the componentslimit- A limit on the number of components to return, set to -1 for unlimited- Returns:
- the list of components in the slot
-
flattenComponentHierarchy
protected List<AbstractCMSComponentModel> flattenComponentHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions, int limit) -
flattenComponentContainerHierarchy
protected List<AbstractCMSComponentModel> flattenComponentContainerHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentContainerModel container, boolean evaluateRestrictions, int limit) -
addVisibleComponents
protected void addVisibleComponents(CmsPageRequestContextData cmsPageRequestContextData, boolean evaluateRestrictions, int limit, List<AbstractCMSComponentModel> ret, List<AbstractCMSComponentModel> replacementComponents) -
getComponentsForContainer
protected List<AbstractCMSComponentModel> getComponentsForContainer(AbstractCMSComponentContainerModel container) -
getCMSComponentsForComponent
public List<AbstractCMSComponentModel> getCMSComponentsForComponent(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions, int limit) Description copied from interface:CMSPageSlotComponentServiceGet the CMS components for a CMS component. Some CMS components are actually containers of other components. Depending on the specific component the container may be replaced with some of the child components.- Specified by:
getCMSComponentsForComponentin interfaceCMSPageSlotComponentService- Parameters:
cmsPageRequestContextData- The CMS context data for the current requestcomponent- The componentevaluateRestrictions- Flag set to true to indicate that restrictions should be evaluated on the componentslimit- A limit on the number of components to return, set to -1 for unlimited- Returns:
- the list of components
-
getComponentForId
Description copied from interface:CMSPageSlotComponentServiceLookup a Component given its ID.- Specified by:
getComponentForIdin interfaceCMSPageSlotComponentService- Parameters:
id- the ID of the component- Returns:
- the component
-
isComponentVisible
public boolean isComponentVisible(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions) Checks whether component should be displayed.
Note: Computation takes into account:- Checks whether component is visible
- If component is restricted checks whether we should display it
- Specified by:
isComponentVisiblein interfaceCMSPageSlotComponentService- Parameters:
cmsPageRequestContextData- The CMS context data for the current requestcomponent- The componentevaluateRestrictions- Flag set to true to indicate that restrictions should be evaluated on the component- Returns:
- true if the Component should be shown for this request
-
doesComponentHaveRestrictions
-
renderComponent
public void renderComponent(javax.servlet.jsp.PageContext pageContext, AbstractCMSComponentModel component) throws javax.servlet.ServletException, IOException Description copied from interface:CMSComponentRendererRender a CMS Component into the page at the current location.- Specified by:
renderComponentin interfaceCMSComponentRenderer<AbstractCMSComponentModel>- Parameters:
pageContext- The page context to render intocomponent- The component to render- Throws:
javax.servlet.ServletExceptionIOException
-