Class DefaultCMSAdminTypeRestrictionsService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
de.hybris.platform.cms2.servicelayer.services.admin.impl.DefaultCMSAdminTypeRestrictionsService
- All Implemented Interfaces:
CMSAdminTypeRestrictionsService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCMSAdminTypeRestrictionsService
extends AbstractCMSAdminService
implements CMSAdminTypeRestrictionsService
Default implementation of the type restrictions service.
To get the type restrictions for a given page and content slot, first we get the ContentSlotForPageModel
representing the relation between the page and the content slot. Then, we get the ContentSlotNameModel from
ContentSlotForPageModel.POSITION. From there, we can get the type restrictions from
ContentSlotNameModel.COMPTYPEGROUP.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
ACTIVECATALOGVERSION, ACTIVESITE, CLONE_CONTEXT, ORIGINAL_ITEM_CONTEXT, RESTORE_CONTEXT, TYPE_CONTEXTFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CMSAdminSiteServiceprotected Set<CMSComponentTypeModel>Get all component types from the content slot name's component type group.protected Set<CMSComponentTypeModel>Get all component types from the content slot "valid component types".protected CMSContentSlotDaoprotected Set<CMSComponentTypeModel>getMergedTypeRestrictionForContentSlot(List<ContentSlotNameModel> availableContentSlots, String contentSlotForNamePosition) Merge the restrictions for a content slots fromContentSlotNameModel.getValidComponentTypes()andComponentTypeGroupModel.getCmsComponentTypes()getTypeRestrictionsContentSlotForPage(AbstractPageModel page, ContentSlotModel contentSlot) Get all component type restrictions for a given page and content slot.getTypeRestrictionsContentSlotForTemplate(PageTemplateModel pageTemplate, ContentSlotModel contentSlot) Get all component type restrictions for a given template and content slot.getTypeRestrictionsForContentSlot(AbstractPageModel page, ContentSlotModel contentSlot) Get all component type restrictions for a given content slot from two sources of the given page and its master template.Get all type restrictions (component types) that are allowed for a given page.voidsetCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService) voidsetCmsContentSlotDao(CMSContentSlotDao contentSlotDao) voidsetCmsTypeRestrictionDao(CMSTypeRestrictionDao cmsTypeRestrictionDao) Methods inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserServiceMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultCMSAdminTypeRestrictionsService
public DefaultCMSAdminTypeRestrictionsService()
-
-
Method Details
-
getTypeRestrictionsContentSlotForTemplate
public Set<CMSComponentTypeModel> getTypeRestrictionsContentSlotForTemplate(PageTemplateModel pageTemplate, ContentSlotModel contentSlot) throws CMSItemNotFoundException Description copied from interface:CMSAdminTypeRestrictionsServiceGet all component type restrictions for a given template and content slot.- Specified by:
getTypeRestrictionsContentSlotForTemplatein interfaceCMSAdminTypeRestrictionsService- Parameters:
pageTemplate- - the template that contains the content slot for which we want the type restrictionscontentSlot- - the content slot for which we want the type restrictions- Returns:
- a set of component types representing the type restrictions for the content slot or an empty set
- Throws:
CMSItemNotFoundException- when a required CMS item could not be found
-
getTypeRestrictionsContentSlotForPage
public Set<CMSComponentTypeModel> getTypeRestrictionsContentSlotForPage(AbstractPageModel page, ContentSlotModel contentSlot) throws CMSItemNotFoundException Description copied from interface:CMSAdminTypeRestrictionsServiceGet all component type restrictions for a given page and content slot.- Specified by:
getTypeRestrictionsContentSlotForPagein interfaceCMSAdminTypeRestrictionsService- Parameters:
page- - the page that contains the content slot for which we want the type restrictionscontentSlot- - the content slot for which we want the type restrictions- Returns:
- a set of component types representing the type restrictions for the content slot or an empty set
- Throws:
CMSItemNotFoundException- when a required CMS item could not be found
-
getTypeRestrictionsForContentSlot
public Set<CMSComponentTypeModel> getTypeRestrictionsForContentSlot(AbstractPageModel page, ContentSlotModel contentSlot) throws CMSItemNotFoundException Description copied from interface:CMSAdminTypeRestrictionsServiceGet all component type restrictions for a given content slot from two sources of the given page and its master template.- Specified by:
getTypeRestrictionsForContentSlotin interfaceCMSAdminTypeRestrictionsService- Parameters:
page- - the page that contains the content slot for which we want the type restrictionscontentSlot- - the content slot for which we want the type restrictions- Returns:
- a set of component types representing the type restrictions for the content slot or an empty set
- Throws:
CMSItemNotFoundException- when a required CMS item could not be found
-
getTypeRestrictionsForPage
Description copied from interface:CMSAdminTypeRestrictionsServiceGet all type restrictions (component types) that are allowed for a given page. It considers the given page and its master template.- Specified by:
getTypeRestrictionsForPagein interfaceCMSAdminTypeRestrictionsService- Parameters:
page- - the page for which to retrieve its type restrictions (allowed component types)- Returns:
- a set of component types representing the type restrictions for the given page
-
getMergedTypeRestrictionForContentSlot
protected Set<CMSComponentTypeModel> getMergedTypeRestrictionForContentSlot(List<ContentSlotNameModel> availableContentSlots, String contentSlotForNamePosition) throws CMSItemNotFoundException Merge the restrictions for a content slots fromContentSlotNameModel.getValidComponentTypes()andComponentTypeGroupModel.getCmsComponentTypes()- Throws:
CMSItemNotFoundException
-
getCmsComponentTypesFromContentSlotNameComponentTypeGroup
protected Set<CMSComponentTypeModel> getCmsComponentTypesFromContentSlotNameComponentTypeGroup(ContentSlotNameModel contentSlotName) Get all component types from the content slot name's component type group.- Parameters:
contentSlotName- - the content slot name- Returns:
- set of component types or empty set
-
getCmsComponentTypesFromContentSlotNameValidComponentTypes
protected Set<CMSComponentTypeModel> getCmsComponentTypesFromContentSlotNameValidComponentTypes(ContentSlotNameModel contentSlotName) Get all component types from the content slot "valid component types".- Parameters:
contentSlotName- - the content slot name- Returns:
- set of component types or empty set
-
getCmsContentSlotDao
-
setCmsContentSlotDao
-
getCmsAdminSiteService
-
setCmsAdminSiteService
-
getCmsTypeRestrictionDao
-
setCmsTypeRestrictionDao
-