Class DefaultPageContentSlotComponentFacade
- java.lang.Object
-
- de.hybris.platform.cmsfacades.pagescontentslotscomponents.impl.DefaultPageContentSlotComponentFacade
-
- All Implemented Interfaces:
PageContentSlotComponentFacade
public class DefaultPageContentSlotComponentFacade extends java.lang.Object implements PageContentSlotComponentFacade
Default implementation ofPageContentSlotComponentFacade. This implementation will expect that a catalog version has been placed into a local session.
-
-
Constructor Summary
Constructors Constructor Description DefaultPageContentSlotComponentFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageContentSlotComponentDataaddComponentToContentSlot(PageContentSlotComponentData pageContentSlotComponent)Add an existing component item into a specific index position of an existing content slot.protected PageContentSlotComponentDatabuildPageContentSlotComponent(java.lang.String pageId, java.lang.String slotId, java.lang.Integer position, AbstractCMSComponentModel component)Build a singlePageContentSlotComponentData.protected java.util.stream.Stream<PageContentSlotComponentData>buildPageContentSlotComponentStream(java.lang.String pageId, ContentSlotData contentSlot)Build a stream ofPageContentSlotComponentData.protected PageContentSlotComponentDatabuildPageContentSlotComponentValidationDto(java.lang.String slotId, PageContentSlotComponentData pageContentSlotComponentData)Build a new DTO for validating adding existing component to content slot.protected AbstractCMSComponentModelfetchComponent(java.lang.String componentId)protected ContentSlotModelfetchContentSlot(java.lang.String slotId)protected CMSAdminComponentServicegetAdminComponentService()protected CMSAdminContentSlotServicegetAdminContentSlotService()protected CMSAdminPageServicegetAdminPageService()protected CatalogVersionServicegetCatalogVersionService()org.springframework.validation.ValidatorgetComponentExistsInSlotValidator()protected org.springframework.validation.ValidatorgetCreatePageContentSlotComponentCompositeValidator()protected FacadeValidationServicegetFacadeValidationService()java.util.List<PageContentSlotComponentData>getPageContentSlotComponentsByPageId(java.lang.String pageId)Get a list of content slot with their components and their position in the slots for a given page.protected SessionSearchRestrictionsDisablergetSessionSearchRestrictionsDisabler()org.springframework.transaction.PlatformTransactionManagergetTransactionManager()protected UniqueItemIdentifierServicegetUniqueItemIdentifierService()protected org.springframework.validation.ValidatorgetUpdatePageContentSlotComponentValidator()PageContentSlotComponentDatamoveComponent(java.lang.String pageUid, java.lang.String componentUid, java.lang.String originSlotUid, PageContentSlotComponentData pageContentSlotComponentData)Moves a component within a slot or between slots.voidremoveComponentFromContentSlot(java.lang.String slotId, java.lang.String componentId)Remove a component item from a content slot.voidsetAdminComponentService(CMSAdminComponentService adminComponentService)voidsetAdminContentSlotService(CMSAdminContentSlotService adminContentSlotService)voidsetAdminPageService(CMSAdminPageService adminPageService)voidsetCatalogVersionService(CatalogVersionService catalogVersionService)voidsetComponentExistsInSlotValidator(org.springframework.validation.Validator componentExistsInSlotValidator)voidsetCreatePageContentSlotComponentCompositeValidator(org.springframework.validation.Validator createPageContentSlotComponentCompositeValidator)voidsetFacadeValidationService(FacadeValidationService facadeValidationService)voidsetSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler)voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)voidsetUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService)voidsetUpdatePageContentSlotComponentValidator(org.springframework.validation.Validator updatePageContentSlotComponentValidator)
-
-
-
Method Detail
-
getPageContentSlotComponentsByPageId
public java.util.List<PageContentSlotComponentData> getPageContentSlotComponentsByPageId(java.lang.String pageId) throws CMSItemNotFoundException
Description copied from interface:PageContentSlotComponentFacadeGet a list of content slot with their components and their position in the slots for a given page.- Specified by:
getPageContentSlotComponentsByPageIdin interfacePageContentSlotComponentFacade- Parameters:
pageId- - the page for which to look up the content slots for- Returns:
- list of content slot ids with the component ids in each slot; never null
- Throws:
CMSItemNotFoundException- when the page cannot be found
-
buildPageContentSlotComponentStream
protected java.util.stream.Stream<PageContentSlotComponentData> buildPageContentSlotComponentStream(java.lang.String pageId, ContentSlotData contentSlot)
Build a stream ofPageContentSlotComponentData.- Parameters:
pageId- - the page idcontentSlot- - the content slot- Returns:
- a new stream of DTOs
-
buildPageContentSlotComponent
protected PageContentSlotComponentData buildPageContentSlotComponent(java.lang.String pageId, java.lang.String slotId, java.lang.Integer position, AbstractCMSComponentModel component)
Build a singlePageContentSlotComponentData.- Parameters:
pageId- - the page idslotId- - the slot idposition- - the position of the component in the slotcomponent- - the CMS component model- Returns:
- a new DTO
-
addComponentToContentSlot
@Transactional public PageContentSlotComponentData addComponentToContentSlot(PageContentSlotComponentData pageContentSlotComponent) throws CMSItemNotFoundException
Description copied from interface:PageContentSlotComponentFacadeAdd an existing component item into a specific index position of an existing content slot.If the index provided is larger than or equal to the next available component index in the slot, then the component will be added into the next available index.
- Specified by:
addComponentToContentSlotin interfacePageContentSlotComponentFacade- Parameters:
pageContentSlotComponent- - DTO holding required attributes; never null- Returns:
- the pageContentSlotComponent holding the componentId added to the slot and the pageId, slotId and slot position of the targeted content slot.
- Throws:
CMSItemNotFoundException- when the component or slot cannot be found
-
removeComponentFromContentSlot
public void removeComponentFromContentSlot(java.lang.String slotId, java.lang.String componentId) throws CMSItemNotFoundExceptionDescription copied from interface:PageContentSlotComponentFacadeRemove a component item from a content slot.- Specified by:
removeComponentFromContentSlotin interfacePageContentSlotComponentFacade- Parameters:
slotId- - the unique identifier of the content slot; never nullcomponentId- - the unique identifier of the component item; never null- Throws:
CMSItemNotFoundException- when the component or slot cannot be found
-
moveComponent
public PageContentSlotComponentData moveComponent(java.lang.String pageUid, java.lang.String componentUid, java.lang.String originSlotUid, PageContentSlotComponentData pageContentSlotComponentData) throws CMSItemNotFoundException
Description copied from interface:PageContentSlotComponentFacadeMoves a component within a slot or between slots.- Specified by:
moveComponentin interfacePageContentSlotComponentFacade- Parameters:
pageUid- Page UIDcomponentUid- UID of the component to moveoriginSlotUid- The UID of the content slot that contains the origin content slotpageContentSlotComponentData-PageContentSlotComponentDataThe component which contains all information of it's final destination- Returns:
- the pageContentSlotComponent holding the componentId moved to the slot and the pageId, slotId and slot position of the targeted content slot.
- Throws:
CMSItemNotFoundException- when the component or slot cannot be found
-
fetchComponent
protected AbstractCMSComponentModel fetchComponent(java.lang.String componentId) throws CMSItemNotFoundException
- Throws:
CMSItemNotFoundException
-
fetchContentSlot
protected ContentSlotModel fetchContentSlot(java.lang.String slotId) throws CMSItemNotFoundException
- Throws:
CMSItemNotFoundException
-
buildPageContentSlotComponentValidationDto
protected PageContentSlotComponentData buildPageContentSlotComponentValidationDto(java.lang.String slotId, PageContentSlotComponentData pageContentSlotComponentData)
Build a new DTO for validating adding existing component to content slot.- Parameters:
slotId-pageContentSlotComponentData-- Returns:
- the new DTO
-
getAdminPageService
protected CMSAdminPageService getAdminPageService()
-
setAdminPageService
public void setAdminPageService(CMSAdminPageService adminPageService)
-
getAdminContentSlotService
protected CMSAdminContentSlotService getAdminContentSlotService()
-
setAdminContentSlotService
public void setAdminContentSlotService(CMSAdminContentSlotService adminContentSlotService)
-
getAdminComponentService
protected CMSAdminComponentService getAdminComponentService()
-
setAdminComponentService
public void setAdminComponentService(CMSAdminComponentService adminComponentService)
-
getCreatePageContentSlotComponentCompositeValidator
protected org.springframework.validation.Validator getCreatePageContentSlotComponentCompositeValidator()
-
setCreatePageContentSlotComponentCompositeValidator
public void setCreatePageContentSlotComponentCompositeValidator(org.springframework.validation.Validator createPageContentSlotComponentCompositeValidator)
-
getFacadeValidationService
protected FacadeValidationService getFacadeValidationService()
-
setFacadeValidationService
public void setFacadeValidationService(FacadeValidationService facadeValidationService)
-
getUpdatePageContentSlotComponentValidator
protected org.springframework.validation.Validator getUpdatePageContentSlotComponentValidator()
-
setUpdatePageContentSlotComponentValidator
public void setUpdatePageContentSlotComponentValidator(org.springframework.validation.Validator updatePageContentSlotComponentValidator)
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
-
getComponentExistsInSlotValidator
public org.springframework.validation.Validator getComponentExistsInSlotValidator()
-
setComponentExistsInSlotValidator
public void setComponentExistsInSlotValidator(org.springframework.validation.Validator componentExistsInSlotValidator)
-
getUniqueItemIdentifierService
protected UniqueItemIdentifierService getUniqueItemIdentifierService()
-
setUniqueItemIdentifierService
public void setUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getSessionSearchRestrictionsDisabler
protected SessionSearchRestrictionsDisabler getSessionSearchRestrictionsDisabler()
-
setSessionSearchRestrictionsDisabler
public void setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler)
-
-