Class DefaultComponentTypeFacade
- java.lang.Object
-
- de.hybris.platform.cmsfacades.types.impl.DefaultComponentTypeFacade
-
- All Implemented Interfaces:
ComponentTypeFacade
public class DefaultComponentTypeFacade extends java.lang.Object implements ComponentTypeFacade
This implementation of theComponentTypeFacadewill get theComposedTypeModelitems and convert them to DTOs.The types available are determined by using the
ComponentTypeStructureServiceto get all registered component types.
-
-
Constructor Summary
Constructors Constructor Description DefaultComponentTypeFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.util.Optional<ComponentTypeData>convertComponentStructure(ComponentTypeStructure structure)ConvertsComponentTypeStructuretoComponentTypeData.java.util.List<ComponentTypeData>getAllCmsItemTypes(java.util.List<StructureTypeCategory> categories, boolean readOnly)Find all cms item types by category.java.util.List<ComponentTypeData>getAllComponentTypes()Deprecated, for removal: This API element is subject to removal in a future version.java.util.List<ComponentTypeData>getAllComponentTypes(java.lang.String category)Deprecated, for removal: This API element is subject to removal in a future version.protected CMSAdminSiteServicegetCmsAdminSiteService()ComponentTypeDatagetCmsItemTypeByCodeAndMode(java.lang.String code, java.lang.String mode, boolean readOnly)Get a single cms item type structure.ComponentTypeDatagetComponentTypeByCode(java.lang.String code)Deprecated, for removal: This API element is subject to removal in a future version.ComponentTypeDatagetComponentTypeByCodeAndMode(java.lang.String code, java.lang.String mode)Deprecated, for removal: This API element is subject to removal in a future version.protected ComponentTypeStructuregetComponentTypeStructureByCode(java.lang.String code)Returns aComponentTypeStructureby its code.protected Converter<ComponentTypeStructure,ComponentTypeData>getComponentTypeStructureConverter()protected ComponentTypeStructureServicegetComponentTypeStructureService()protected StructureTypeModeServicegetStructureTypeModeService()protected TypeServicegetTypeService()voidsetCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)voidsetComponentTypeStructureConverter(Converter<ComponentTypeStructure,ComponentTypeData> componentTypeStructureConverter)voidsetComponentTypeStructureService(ComponentTypeStructureService componentTypeStructureService)protected voidsetStructureTypeContext(boolean readOnly)Sets the type structure context.voidsetStructureTypeModeService(StructureTypeModeService structureTypeModeService)voidsetTypeService(TypeService typeService)
-
-
-
Method Detail
-
getAllComponentTypes
@Deprecated(since="1905", forRemoval=true) public java.util.List<ComponentTypeData> 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 java.util.List<ComponentTypeData> getAllComponentTypes(java.lang.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 java.util.List<ComponentTypeData> getAllCmsItemTypes(java.util.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.
-
getComponentTypeByCode
@Deprecated(since="1905", forRemoval=true) public ComponentTypeData getComponentTypeByCode(java.lang.String code) throws ComponentTypeNotFoundExceptionDeprecated, 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(java.lang.String code, java.lang.String mode) throws ComponentTypeNotFoundExceptionDeprecated, 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(java.lang.String code, java.lang.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.- 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.
-
getComponentTypeStructureByCode
protected ComponentTypeStructure getComponentTypeStructureByCode(java.lang.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
protected java.util.Optional<ComponentTypeData> convertComponentStructure(ComponentTypeStructure structure)
ConvertsComponentTypeStructuretoComponentTypeData. Returns null in case ofTypePermissionException.- Parameters:
structure- theComponentTypeStructure- Returns:
- the
ComponentTypeData
-
getComponentTypeStructureService
protected ComponentTypeStructureService getComponentTypeStructureService()
-
setComponentTypeStructureService
public void setComponentTypeStructureService(ComponentTypeStructureService componentTypeStructureService)
-
getComponentTypeStructureConverter
protected Converter<ComponentTypeStructure,ComponentTypeData> getComponentTypeStructureConverter()
-
setComponentTypeStructureConverter
public void setComponentTypeStructureConverter(Converter<ComponentTypeStructure,ComponentTypeData> componentTypeStructureConverter)
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getStructureTypeModeService
protected StructureTypeModeService getStructureTypeModeService()
-
setStructureTypeModeService
public void setStructureTypeModeService(StructureTypeModeService structureTypeModeService)
-
getCmsAdminSiteService
protected CMSAdminSiteService getCmsAdminSiteService()
-
setCmsAdminSiteService
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
-
-