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 PageContentSlotComponentData
addComponentToContentSlot(PageContentSlotComponentData pageContentSlotComponent)
Add an existing component item into a specific index position of an existing content slot.protected PageContentSlotComponentData
buildPageContentSlotComponent(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 PageContentSlotComponentData
buildPageContentSlotComponentValidationDto(java.lang.String slotId, PageContentSlotComponentData pageContentSlotComponentData)
Build a new DTO for validating adding existing component to content slot.protected AbstractCMSComponentModel
fetchComponent(java.lang.String componentId)
protected ContentSlotModel
fetchContentSlot(java.lang.String slotId)
protected CMSAdminComponentService
getAdminComponentService()
protected CMSAdminContentSlotService
getAdminContentSlotService()
protected CMSAdminPageService
getAdminPageService()
protected CatalogVersionService
getCatalogVersionService()
org.springframework.validation.Validator
getComponentExistsInSlotValidator()
protected org.springframework.validation.Validator
getCreatePageContentSlotComponentCompositeValidator()
protected FacadeValidationService
getFacadeValidationService()
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 SessionSearchRestrictionsDisabler
getSessionSearchRestrictionsDisabler()
org.springframework.transaction.PlatformTransactionManager
getTransactionManager()
protected UniqueItemIdentifierService
getUniqueItemIdentifierService()
protected org.springframework.validation.Validator
getUpdatePageContentSlotComponentValidator()
PageContentSlotComponentData
moveComponent(java.lang.String pageUid, java.lang.String componentUid, java.lang.String originSlotUid, PageContentSlotComponentData pageContentSlotComponentData)
Moves a component within a slot or between slots.void
removeComponentFromContentSlot(java.lang.String slotId, java.lang.String componentId)
Remove a component item from a content slot.void
setAdminComponentService(CMSAdminComponentService adminComponentService)
void
setAdminContentSlotService(CMSAdminContentSlotService adminContentSlotService)
void
setAdminPageService(CMSAdminPageService adminPageService)
void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setComponentExistsInSlotValidator(org.springframework.validation.Validator componentExistsInSlotValidator)
void
setCreatePageContentSlotComponentCompositeValidator(org.springframework.validation.Validator createPageContentSlotComponentCompositeValidator)
void
setFacadeValidationService(FacadeValidationService facadeValidationService)
void
setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler)
void
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
void
setUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService)
void
setUpdatePageContentSlotComponentValidator(org.springframework.validation.Validator updatePageContentSlotComponentValidator)
-
-
-
Method Detail
-
getPageContentSlotComponentsByPageId
public java.util.List<PageContentSlotComponentData> getPageContentSlotComponentsByPageId(java.lang.String pageId) throws CMSItemNotFoundException
Description copied from interface:PageContentSlotComponentFacade
Get a list of content slot with their components and their position in the slots for a given page.- Specified by:
getPageContentSlotComponentsByPageId
in 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:PageContentSlotComponentFacade
Add 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:
addComponentToContentSlot
in 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 CMSItemNotFoundException
Description copied from interface:PageContentSlotComponentFacade
Remove a component item from a content slot.- Specified by:
removeComponentFromContentSlot
in 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:PageContentSlotComponentFacade
Moves a component within a slot or between slots.- Specified by:
moveComponent
in interfacePageContentSlotComponentFacade
- Parameters:
pageUid
- Page UIDcomponentUid
- UID of the component to moveoriginSlotUid
- The UID of the content slot that contains the origin content slotpageContentSlotComponentData
-PageContentSlotComponentData
The 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)
-
-