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,java.io.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
ContentSlotForPageModelrepresenting the relation between the page and the content slot. Then, we get theContentSlotNameModelfromContentSlotForPageModel.POSITION. From there, we can get the type restrictions fromContentSlotNameModel.COMPTYPEGROUP.- See Also:
- Serialized Form
-
-
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_CONTEXT
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSAdminTypeRestrictionsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CMSAdminSiteServicegetCmsAdminSiteService()protected java.util.Set<CMSComponentTypeModel>getCmsComponentTypesFromContentSlotNameComponentTypeGroup(ContentSlotNameModel contentSlotName)Get all component types from the content slot name's component type group.protected java.util.Set<CMSComponentTypeModel>getCmsComponentTypesFromContentSlotNameValidComponentTypes(ContentSlotNameModel contentSlotName)Get all component types from the content slot "valid component types".protected CMSContentSlotDaogetCmsContentSlotDao()protected java.util.Set<CMSComponentTypeModel>getMergedTypeRestrictionForContentSlot(java.util.List<ContentSlotNameModel> availableContentSlots, java.lang.String contentSlotForNamePosition)Merge the restrictions for a content slots fromContentSlotNameModel.getValidComponentTypes()andComponentTypeGroupModel.getCmsComponentTypes()java.util.Set<CMSComponentTypeModel>getTypeRestrictionsContentSlotForPage(AbstractPageModel page, ContentSlotModel contentSlot)Get all component type restrictions for a given page and content slot.java.util.Set<CMSComponentTypeModel>getTypeRestrictionsContentSlotForTemplate(PageTemplateModel pageTemplate, ContentSlotModel contentSlot)Get all component type restrictions for a given template and content slot.java.util.Set<CMSComponentTypeModel>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.voidsetCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)voidsetCmsContentSlotDao(CMSContentSlotDao contentSlotDao)-
Methods inherited from class de.hybris.platform.cms2.servicelayer.services.admin.impl.AbstractCMSAdminService
getActiveCatalogVersion, getActiveSite, getBaseSiteService, getUserService, setBaseSiteService, setUserService
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
getTypeRestrictionsContentSlotForTemplate
public java.util.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 java.util.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 java.util.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
-
getMergedTypeRestrictionForContentSlot
protected java.util.Set<CMSComponentTypeModel> getMergedTypeRestrictionForContentSlot(java.util.List<ContentSlotNameModel> availableContentSlots, java.lang.String contentSlotForNamePosition) throws CMSItemNotFoundException
Merge the restrictions for a content slots fromContentSlotNameModel.getValidComponentTypes()andComponentTypeGroupModel.getCmsComponentTypes()- Throws:
CMSItemNotFoundException
-
getCmsComponentTypesFromContentSlotNameComponentTypeGroup
protected java.util.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 java.util.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
protected CMSContentSlotDao getCmsContentSlotDao()
-
setCmsContentSlotDao
public void setCmsContentSlotDao(CMSContentSlotDao contentSlotDao)
-
getCmsAdminSiteService
protected CMSAdminSiteService getCmsAdminSiteService()
-
setCmsAdminSiteService
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
-
-