Class CMSItemDropdownComponentTypeAttributePopulator
java.lang.Object
de.hybris.platform.cmsfacades.types.populator.CMSItemDropdownComponentTypeAttributePopulator
- All Implemented Interfaces:
Populator<AttributeDescriptorModel,ComponentTypeAttributeData>
- Direct Known Subclasses:
CMSNavigationEntryItemPopulator
public class CMSItemDropdownComponentTypeAttributePopulator
extends Object
implements Populator<AttributeDescriptorModel,ComponentTypeAttributeData>
Populator aimed at setting all necessary information for the receiving end to build a cms item dropdown widget:
- identifies the cmsStructureType as
CMS_ITEM_DROPDOWN - marks the dropdown to use
ID_ATTRIBUTEas idAttribute
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeDescriptorModelHelperServicegetComponentParams(Class<?> type, ComponentTypeAttributeData target) getComponentSubTypes(Class<?> type) This method retrieves a map of concrete subtypes of the provided type.protected org.springframework.beans.factory.ObjectFactory<ComponentTypeData>protected StringgetComponentTypeI18nKey(ComposedTypeModel typeModel) This method retrieves the i18n key of the provided component type.protected I18nComponentTypePopulatorprotected Stringprotected Stringprotected TypeServicevoidpopulate(AttributeDescriptorModel source, ComponentTypeAttributeData target) Populate the target instance with values from the source instance.voidsetAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService) voidsetComponentTypeDataFactory(org.springframework.beans.factory.ObjectFactory<ComponentTypeData> componentTypeDataFactory) voidsetI18nComponentTypePopulator(I18nComponentTypePopulator i18nComponentTypePopulator) protected voidSets placeholder for a dropdown if it's not empty.voidsetPlaceholder(String placeholder) voidsetSearchParams(String searchParams) If searchParams is set, the value will be added to the "params" map for the "itemSearchParams" key.voidsetTypeService(TypeService typeService)
-
Constructor Details
-
CMSItemDropdownComponentTypeAttributePopulator
public CMSItemDropdownComponentTypeAttributePopulator()
-
-
Method Details
-
populate
public void populate(AttributeDescriptorModel source, ComponentTypeAttributeData target) throws ConversionException Description copied from interface:PopulatorPopulate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<AttributeDescriptorModel,ComponentTypeAttributeData> - Parameters:
source- the source objecttarget- the target to fill- Throws:
ConversionException- if an error occurs
-
setPlaceholder
Sets placeholder for a dropdown if it's not empty.- Parameters:
target- theComponentTypeAttributeData
-
getComponentParams
-
getComponentSubTypes
This method retrieves a map of concrete subtypes of the provided type. (If the provided type is concrete it will also be included in the map).- Parameters:
type- The type for which to retrieve its map of subtypes.- Returns:
- map Map of concrete component subtypes. The key is the code of the sub-type and the value is its i18n key.
-
getComponentTypeI18nKey
This method retrieves the i18n key of the provided component type.- Parameters:
typeModel- The type for which to retrieve its map of subtypes.- Returns:
- String The i18n key of the provided component type.
-
setAttributeDescriptorModelHelperService
public void setAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService) -
getAttributeDescriptorModelHelperService
-
setTypeService
-
getTypeService
-
setI18nComponentTypePopulator
-
getI18nComponentTypePopulator
-
setComponentTypeDataFactory
public void setComponentTypeDataFactory(org.springframework.beans.factory.ObjectFactory<ComponentTypeData> componentTypeDataFactory) -
getComponentTypeDataFactory
protected org.springframework.beans.factory.ObjectFactory<ComponentTypeData> getComponentTypeDataFactory() -
setSearchParams
If searchParams is set, the value will be added to the "params" map for the "itemSearchParams" key. This is useful when the "itemSearchParams" query-parameter needs to be set when calling the CMS Item Search API. Example of usage of this setter:<property name="searchParams" value="pageStatus:active" />- Parameters:
searchParams- the searchParams value
-
getSearchParams
-
getPlaceholder
-
setPlaceholder
-