Class DefaultCMSPageSlotComponentService
- java.lang.Object
-
- de.hybris.platform.acceleratorcms.component.slot.impl.DefaultCMSPageSlotComponentService
-
- All Implemented Interfaces:
CMSComponentRenderer<AbstractCMSComponentModel>,CMSPageSlotComponentService
public class DefaultCMSPageSlotComponentService extends java.lang.Object implements CMSPageSlotComponentService
Default implementation ofCMSPageSlotComponentService
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSPageSlotComponentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddVisibleComponents(CmsPageRequestContextData cmsPageRequestContextData, boolean evaluateRestrictions, int limit, java.util.List<AbstractCMSComponentModel> ret, java.util.List<AbstractCMSComponentModel> replacementComponents)protected booleandoesComponentHaveRestrictions(AbstractCMSComponentModel component)protected java.util.List<AbstractCMSComponentModel>flattenComponentContainerHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentContainerModel container, boolean evaluateRestrictions, int limit)protected java.util.List<AbstractCMSComponentModel>flattenComponentHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions, int limit)protected CMSComponentContainerRegistrygetCmsComponentContainerRegistry()protected CMSComponentRenderergetCmsComponentRenderer()protected CMSComponentServicegetCmsComponentService()java.util.List<AbstractCMSComponentModel>getCMSComponentsForComponent(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions, int limit)Get the CMS components for a CMS component.java.util.List<AbstractCMSComponentModel>getCMSComponentsForContentSlot(CmsPageRequestContextData cmsPageRequestContextData, ContentSlotModel contentSlot, boolean evaluateRestrictions, int limit)Get the CMS components in a Content Slot.protected CMSContentSlotServicegetCmsContentSlotService()protected CMSRestrictionServicegetCmsRestrictionService()AbstractCMSComponentModelgetComponentForId(java.lang.String id)Lookup a Component given its ID.protected java.util.List<AbstractCMSComponentModel>getComponentsForContainer(AbstractCMSComponentContainerModel container)ContentSlotModelgetContentSlotForId(java.lang.String id)Lookup a Content Slot given its ID.ContentSlotDatagetContentSlotForPosition(CmsPageRequestContextData cmsPageRequestContextData, java.lang.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)
-
-
-
Method Detail
-
getCmsRestrictionService
protected CMSRestrictionService getCmsRestrictionService()
-
setCmsRestrictionService
public void setCmsRestrictionService(CMSRestrictionService cmsRestrictionService)
-
getCmsContentSlotService
protected CMSContentSlotService getCmsContentSlotService()
-
setCmsContentSlotService
public void setCmsContentSlotService(CMSContentSlotService cmsContentSlotService)
-
getCmsComponentService
protected CMSComponentService getCmsComponentService()
-
setCmsComponentService
public void setCmsComponentService(CMSComponentService cmsComponentService)
-
getCmsComponentRenderer
protected CMSComponentRenderer getCmsComponentRenderer()
-
setCmsComponentRenderer
public void setCmsComponentRenderer(CMSComponentRenderer cmsComponentRenderer)
-
getCmsComponentContainerRegistry
protected CMSComponentContainerRegistry getCmsComponentContainerRegistry()
-
setCmsComponentContainerRegistry
public void setCmsComponentContainerRegistry(CMSComponentContainerRegistry cmsComponentContainerRegistry)
-
getContentSlotForId
public ContentSlotModel getContentSlotForId(java.lang.String id)
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, java.lang.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 java.util.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 java.util.List<AbstractCMSComponentModel> flattenComponentHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentModel component, boolean evaluateRestrictions, int limit)
-
flattenComponentContainerHierarchy
protected java.util.List<AbstractCMSComponentModel> flattenComponentContainerHierarchy(CmsPageRequestContextData cmsPageRequestContextData, AbstractCMSComponentContainerModel container, boolean evaluateRestrictions, int limit)
-
addVisibleComponents
protected void addVisibleComponents(CmsPageRequestContextData cmsPageRequestContextData, boolean evaluateRestrictions, int limit, java.util.List<AbstractCMSComponentModel> ret, java.util.List<AbstractCMSComponentModel> replacementComponents)
-
getComponentsForContainer
protected java.util.List<AbstractCMSComponentModel> getComponentsForContainer(AbstractCMSComponentContainerModel container)
-
getCMSComponentsForComponent
public java.util.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
public AbstractCMSComponentModel getComponentForId(java.lang.String id)
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
protected boolean doesComponentHaveRestrictions(AbstractCMSComponentModel component)
-
renderComponent
public void renderComponent(javax.servlet.jsp.PageContext pageContext, AbstractCMSComponentModel component) throws javax.servlet.ServletException, java.io.IOExceptionDescription 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.ServletExceptionjava.io.IOException
-
-