Class DefaultPageContentSlotComponentFacade
java.lang.Object
de.hybris.platform.cmsfacades.pagescontentslotscomponents.impl.DefaultPageContentSlotComponentFacade
- All Implemented Interfaces:
PageContentSlotComponentFacade
public class DefaultPageContentSlotComponentFacade
extends Object
implements PageContentSlotComponentFacade
Default implementation of
PageContentSlotComponentFacade. This implementation will expect that a catalog
version has been placed into a local session.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddComponentToContentSlot(PageContentSlotComponentData pageContentSlotComponent) Add an existing component item into a specific index position of an existing content slot.protected PageContentSlotComponentDatabuildPageContentSlotComponent(String pageId, String slotId, Integer position, AbstractCMSComponentModel component) Build a singlePageContentSlotComponentData.protected Stream<PageContentSlotComponentData>buildPageContentSlotComponentStream(String pageId, ContentSlotData contentSlot) Build a stream ofPageContentSlotComponentData.protected PageContentSlotComponentDatabuildPageContentSlotComponentValidationDto(String slotId, PageContentSlotComponentData pageContentSlotComponentData) Build a new DTO for validating adding existing component to content slot.protected TypePermissionExceptioncreateTypePermissionException(String permissionName, String itemType) Creates a newTypePermissionExceptionwith a localized error messageprotected AbstractCMSComponentModelfetchComponent(String componentId) protected ContentSlotModelfetchContentSlot(String slotId) protected CMSAdminComponentServiceprotected CMSAdminContentSlotServiceprotected CMSAdminPageServiceprotected CatalogVersionServiceorg.springframework.validation.Validatorprotected org.springframework.validation.Validatorprotected FacadeValidationServiceGet a list of content slot with their components and their position in the slots for a given page.protected PermissionCRUDServiceprotected SessionSearchRestrictionsDisablerorg.springframework.transaction.PlatformTransactionManagerprotected UniqueItemIdentifierServiceprotected org.springframework.validation.ValidatormoveComponent(String pageUid, String componentUid, String originSlotUid, PageContentSlotComponentData pageContentSlotComponentData) Moves a component within a slot or between slots.voidremoveComponentFromContentSlot(String slotId, 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) voidsetPermissionCRUDService(PermissionCRUDService permissionCRUDService) voidsetSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) voidsetUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService) voidsetUpdatePageContentSlotComponentValidator(org.springframework.validation.Validator updatePageContentSlotComponentValidator)
-
Constructor Details
-
DefaultPageContentSlotComponentFacade
public DefaultPageContentSlotComponentFacade()
-
-
Method Details
-
getPageContentSlotComponentsByPageId
public List<PageContentSlotComponentData> getPageContentSlotComponentsByPageId(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 Stream<PageContentSlotComponentData> buildPageContentSlotComponentStream(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(String pageId, String slotId, 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(String slotId, String componentId) throws CMSItemNotFoundException Description 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(String pageUid, String componentUid, 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(String componentId) throws CMSItemNotFoundException - Throws:
CMSItemNotFoundException
-
fetchContentSlot
- Throws:
CMSItemNotFoundException
-
buildPageContentSlotComponentValidationDto
protected PageContentSlotComponentData buildPageContentSlotComponentValidationDto(String slotId, PageContentSlotComponentData pageContentSlotComponentData) Build a new DTO for validating adding existing component to content slot.- Parameters:
slotId-pageContentSlotComponentData-- Returns:
- the new DTO
-
createTypePermissionException
protected TypePermissionException createTypePermissionException(String permissionName, String itemType) Creates a newTypePermissionExceptionwith a localized error message- Parameters:
permissionName- The permission name defined byPermissionsConstantsitemType- The type code of the item- Returns:
- a new
TypePermissionException
-
getAdminPageService
-
setAdminPageService
-
getAdminContentSlotService
-
setAdminContentSlotService
-
getAdminComponentService
-
setAdminComponentService
-
getCreatePageContentSlotComponentCompositeValidator
protected org.springframework.validation.Validator getCreatePageContentSlotComponentCompositeValidator() -
setCreatePageContentSlotComponentCompositeValidator
public void setCreatePageContentSlotComponentCompositeValidator(org.springframework.validation.Validator createPageContentSlotComponentCompositeValidator) -
getFacadeValidationService
-
setFacadeValidationService
-
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
-
setUniqueItemIdentifierService
-
getCatalogVersionService
-
setCatalogVersionService
-
getSessionSearchRestrictionsDisabler
-
setSessionSearchRestrictionsDisabler
public void setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) -
getPermissionCRUDService
-
setPermissionCRUDService
-