Class DefaultComponentTypeFacade
java.lang.Object
de.hybris.platform.cmsfacades.types.impl.DefaultComponentTypeFacade
- All Implemented Interfaces:
ComponentTypeFacade
This implementation of the
ComponentTypeFacade will get the
ComposedTypeModel items and convert them to DTOs.
The types available are determined by using the ComponentTypeStructureService to get all registered component
types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<ComponentTypeData>convertComponentStructure(ComponentTypeStructure structure) ConvertsComponentTypeStructuretoComponentTypeData.getAllCmsItemTypes(List<StructureTypeCategory> categories, boolean readOnly) Find all cms item types by category.Deprecated, for removal: This API element is subject to removal in a future version.getAllComponentTypes(String category) Deprecated, for removal: This API element is subject to removal in a future version.protected List<ComponentTypeData>getAllComponentTypes(List<String> requiredFields, boolean isReadOnly) Gets all component types.getAllComponentTypesForPage(CMSComponentTypesForPageSearchData searchData, PageableData pageableData) A paged Search for ComponentTypes that are valid to be used in a given page.protected CMSAdminSiteServiceprotected DefaultComponentTypeMatchingServicegetCmsItemTypeByCodeAndMode(String code, String mode, boolean readOnly) Get a single cms item type structure.getComponentTypeByCode(String code) Deprecated, for removal: This API element is subject to removal in a future version.getComponentTypeByCodeAndMode(String code, String mode) Deprecated, for removal: This API element is subject to removal in a future version.protected ComponentTypeStructureReturns aComponentTypeStructureby its code.protected Converter<ComponentTypeStructure,ComponentTypeData> protected ComponentTypeStructureServiceprotected StructureTypeModeServicegetTypeRestrictionsForPage(String pageId) This method retrieves the codes of the component types applicable (type restrictions) on the given page.protected TypeServicevoidsetCmsAdminPageService(CMSAdminPageService cmsAdminPageService) voidsetCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService) voidsetCmsAdminTypeRestrictionsService(CMSAdminTypeRestrictionsService cmsAdminTypeRestrictionsService) voidsetCmsComponentTypeForPageSearchValidator(ComponentTypeForPageSearchValidator cmsComponentTypeForPageSearchValidator) voidsetCmsComponentTypeMatchingService(DefaultComponentTypeMatchingService cmsComponentTypeMatchingService) voidsetComponentTypeStructureConverter(Converter<ComponentTypeStructure, ComponentTypeData> componentTypeStructureConverter) voidsetComponentTypeStructureService(ComponentTypeStructureService componentTypeStructureService) voidsetFacadeValidationService(FacadeValidationService facadeValidationService) voidsetSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) protected voidsetStructureTypeContext(boolean readOnly) Sets the type structure context.protected voidsetStructureTypeContext(String key, Object value) Adds a new key and value pair to the type structure context.voidsetStructureTypeModeService(StructureTypeModeService structureTypeModeService) voidsetTypeService(TypeService typeService)
-
Constructor Details
-
DefaultComponentTypeFacade
public DefaultComponentTypeFacade()
-
-
Method Details
-
getAllComponentTypes
Deprecated, for removal: This API element is subject to removal in a future version.Find all cms component types. This does not include abstract component types nor action component types.- Specified by:
getAllComponentTypesin interfaceComponentTypeFacade- Returns:
- list of component types; never null
-
getAllComponentTypes
@Deprecated(since="1905", forRemoval=true) public List<ComponentTypeData> getAllComponentTypes(String category) Deprecated, for removal: This API element is subject to removal in a future version.Find all component types by category. This does not include abstract component types nor action component types.- Specified by:
getAllComponentTypesin interfaceComponentTypeFacade- Parameters:
category- - the category of the component type to retrieve- Returns:
- list of types; never null
-
getAllCmsItemTypes
public List<ComponentTypeData> getAllCmsItemTypes(List<StructureTypeCategory> categories, boolean readOnly) Description copied from interface:ComponentTypeFacadeFind all cms item types by category. This does not include abstract component types nor action component types.- Specified by:
getAllCmsItemTypesin interfaceComponentTypeFacade- Parameters:
categories- - the list of categories for the cms item type to retrievereadOnly- - make all attributes read only (editable=false)- Returns:
- list of types; never null. Empty result is returned if the list of categories is empty.
-
getAllComponentTypesForPage
public SearchResult<ComponentTypeData> getAllComponentTypesForPage(CMSComponentTypesForPageSearchData searchData, PageableData pageableData) throws CMSItemNotFoundException Description copied from interface:ComponentTypeFacadeA paged Search for ComponentTypes that are valid to be used in a given page. Optionally filter by name/type code.- Specified by:
getAllComponentTypesForPagein interfaceComponentTypeFacade- Parameters:
searchData- - The page and filter datapageableData- - The paging information- Returns:
- A SearchResult containing the paging information and the results
- Throws:
CMSItemNotFoundException- When the expected page is not found.
-
getTypeRestrictionsForPage
This method retrieves the codes of the component types applicable (type restrictions) on the given page.- Parameters:
pageId- The id of the page whose type restrictions to retrieve.- Returns:
- A set including the code of the component types allowed in the given page.
- Throws:
CMSItemNotFoundException- when the page for the given pageId is not found.
-
getAllComponentTypes
protected List<ComponentTypeData> getAllComponentTypes(List<String> requiredFields, boolean isReadOnly) Gets all component types. It uses the requiredFields to see if there are some fields that are not needed and avoid wasting time calculating things that are not needed.- Parameters:
requiredFields- The list of fields that must be returned.isReadOnly- Whether attributes must be returned in readOnly mode or not. Is only important if the attributes field is returned.- Returns:
- the list of
ComponentTypeDataretrieved.
-
getComponentTypeByCode
@Deprecated(since="1905", forRemoval=true) public ComponentTypeData getComponentTypeByCode(String code) throws ComponentTypeNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.Get a single cms component type.- Specified by:
getComponentTypeByCodein interfaceComponentTypeFacade- Parameters:
code- - the type code of the component type to retrieve- Returns:
- the cms component type
- Throws:
ComponentTypeNotFoundException- when the code provided does not match any existing types
-
getComponentTypeByCodeAndMode
@Deprecated(since="1905", forRemoval=true) public ComponentTypeData getComponentTypeByCodeAndMode(String code, String mode) throws ComponentTypeNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.Get a single component type structure for a given structure type mode.- Specified by:
getComponentTypeByCodeAndModein interfaceComponentTypeFacade- Parameters:
code- - the type code of the component type to retrievemode- - the mode of the structure type- Returns:
- the component type structure or null when the code and mode provided do not match any existing types
- Throws:
ComponentTypeNotFoundException- when the code provided does not match any existing types
-
getCmsItemTypeByCodeAndMode
public ComponentTypeData getCmsItemTypeByCodeAndMode(String code, String mode, boolean readOnly) throws ComponentTypeNotFoundException Description copied from interface:ComponentTypeFacadeGet a single cms item type structure.- Specified by:
getCmsItemTypeByCodeAndModein interfaceComponentTypeFacade- Parameters:
code- - the type code of the cms item type to retrievemode- - the optional mode of the structure type, can be null.readOnly- - define if read only node for attributes- Returns:
- the cms item type structure or null when the code and mode provided do not match any existing types
- Throws:
ComponentTypeNotFoundException- when the code provided does not match any existing types
-
setStructureTypeContext
protected void setStructureTypeContext(boolean readOnly) Sets the type structure context. The context contains information about whether all attributes for a given type should be editable or not. In read-only mode, all attributes will have their editable property set to FALSE.- Parameters:
readOnly- defines whether all attributes will have their editable property set to FALSE.
-
setStructureTypeContext
Adds a new key and value pair to the type structure context.- Parameters:
key- The key of the item to add into the structure context.value- The value of the item to add into the structure context.
-
getComponentTypeStructureByCode
protected ComponentTypeStructure getComponentTypeStructureByCode(String code) throws ComponentTypeNotFoundException Returns aComponentTypeStructureby its code.- Parameters:
code- - the code of the cms item type.- Returns:
- the
ComponentTypeStructure - Throws:
ComponentTypeNotFoundException- if cms item type can not be found by its code.
-
convertComponentStructure
ConvertsComponentTypeStructuretoComponentTypeData. Returns null in case ofTypePermissionException.- Parameters:
structure- theComponentTypeStructure- Returns:
- the
ComponentTypeData
-
getComponentTypeStructureService
-
setComponentTypeStructureService
public void setComponentTypeStructureService(ComponentTypeStructureService componentTypeStructureService) -
getComponentTypeStructureConverter
-
setComponentTypeStructureConverter
public void setComponentTypeStructureConverter(Converter<ComponentTypeStructure, ComponentTypeData> componentTypeStructureConverter) -
getTypeService
-
setTypeService
-
getStructureTypeModeService
-
setStructureTypeModeService
-
getCmsAdminSiteService
-
setCmsAdminSiteService
-
getCmsAdminTypeRestrictionsService
-
setCmsAdminTypeRestrictionsService
public void setCmsAdminTypeRestrictionsService(CMSAdminTypeRestrictionsService cmsAdminTypeRestrictionsService) -
getCmsAdminPageService
-
setCmsAdminPageService
-
getSessionSearchRestrictionsDisabler
-
setSessionSearchRestrictionsDisabler
public void setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) -
getFacadeValidationService
-
setFacadeValidationService
-
getCmsComponentTypeForPageSearchValidator
-
setCmsComponentTypeForPageSearchValidator
public void setCmsComponentTypeForPageSearchValidator(ComponentTypeForPageSearchValidator cmsComponentTypeForPageSearchValidator) -
getCmsComponentTypeMatchingService
-
setCmsComponentTypeMatchingService
public void setCmsComponentTypeMatchingService(DefaultComponentTypeMatchingService cmsComponentTypeMatchingService)
-