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 java.lang.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 Constructor Description CMSItemDropdownComponentTypeAttributePopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AttributeDescriptorModelHelperServicegetAttributeDescriptorModelHelperService()protected java.util.Map<java.lang.String,java.lang.String>getComponentParams(java.lang.Class<?> type, ComponentTypeAttributeData target)protected java.util.Map<java.lang.String,java.lang.String>getComponentSubTypes(java.lang.Class<?> type)This method retrieves a map of concrete subtypes of the provided type.protected org.springframework.beans.factory.ObjectFactory<ComponentTypeData>getComponentTypeDataFactory()protected java.lang.StringgetComponentTypeI18nKey(ComposedTypeModel typeModel)This method retrieves the i18n key of the provided component type.protected I18nComponentTypePopulatorgetI18nComponentTypePopulator()protected java.lang.StringgetPlaceholder()protected java.lang.StringgetSearchParams()protected TypeServicegetTypeService()voidpopulate(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 voidsetPlaceholder(ComponentTypeAttributeData target)Sets placeholder for a dropdown if it's not empty.voidsetPlaceholder(java.lang.String placeholder)voidsetSearchParams(java.lang.String searchParams)If searchParams is set, the value will be added to the "params" map for the "itemSearchParams" key.voidsetTypeService(TypeService typeService)
-
-
-
Method Detail
-
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
protected void setPlaceholder(ComponentTypeAttributeData target)
Sets placeholder for a dropdown if it's not empty.- Parameters:
target- theComponentTypeAttributeData
-
getComponentParams
protected java.util.Map<java.lang.String,java.lang.String> getComponentParams(java.lang.Class<?> type, ComponentTypeAttributeData target)
-
getComponentSubTypes
protected java.util.Map<java.lang.String,java.lang.String> getComponentSubTypes(java.lang.Class<?> type)
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
protected java.lang.String getComponentTypeI18nKey(ComposedTypeModel typeModel)
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
protected AttributeDescriptorModelHelperService getAttributeDescriptorModelHelperService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getTypeService
protected TypeService getTypeService()
-
setI18nComponentTypePopulator
public void setI18nComponentTypePopulator(I18nComponentTypePopulator i18nComponentTypePopulator)
-
getI18nComponentTypePopulator
protected I18nComponentTypePopulator getI18nComponentTypePopulator()
-
setComponentTypeDataFactory
public void setComponentTypeDataFactory(org.springframework.beans.factory.ObjectFactory<ComponentTypeData> componentTypeDataFactory)
-
getComponentTypeDataFactory
protected org.springframework.beans.factory.ObjectFactory<ComponentTypeData> getComponentTypeDataFactory()
-
setSearchParams
public void setSearchParams(java.lang.String searchParams)
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
protected java.lang.String getSearchParams()
-
getPlaceholder
protected java.lang.String getPlaceholder()
-
setPlaceholder
public void setPlaceholder(java.lang.String placeholder)
-
-