Class CMSItemsPropertiesModelToDataRenderingPopulator
- java.lang.Object
-
- de.hybris.platform.cmsfacades.rendering.populators.CMSItemsPropertiesModelToDataRenderingPopulator
-
- All Implemented Interfaces:
Populator<CMSItemModel,java.util.Map<java.lang.String,java.lang.Object>>
public class CMSItemsPropertiesModelToDataRenderingPopulator extends java.lang.Object implements Populator<CMSItemModel,java.util.Map<java.lang.String,java.lang.Object>>
Populator used to add "properties" attribute to the result data object.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTIES_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description CMSItemsPropertiesModelToDataRenderingPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CMSItemPropertiesSupplierProvidergetCmsItemPropertiesSupplierProvider()protected CollectionHelpergetCollectionHelper()protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>getGroupProperties(CMSItemPropertiesSupplier supplier, CMSItemModel itemModel)Returns aMapof group name as a key and a Map of properties as a value.protected java.util.List<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>>getProperties(java.util.List<CMSItemPropertiesSupplier> suppliers, CMSItemModel itemModel)Returns the list of properties provided by suppliers.protected java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>groupProperties(java.util.List<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> properties)Groups the list of properties by group name.protected java.util.Map<java.lang.String,java.lang.Object>mergeGroupedProperties(java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.Object>>> groupedProperties)Merges grouped properties usingCollectionHelper.mergeMaps(List).voidpopulate(CMSItemModel itemModel, java.util.Map<java.lang.String,java.lang.Object> resultData)Populate the target instance with values from the source instance.voidsetCmsItemPropertiesSupplierProvider(CMSItemPropertiesSupplierProvider cmsItemPropertiesSupplierProvider)voidsetCollectionHelper(CollectionHelper collectionHelper)
-
-
-
Field Detail
-
PROPERTIES_ATTRIBUTE
public static final java.lang.String PROPERTIES_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
populate
public void populate(CMSItemModel itemModel, java.util.Map<java.lang.String,java.lang.Object> resultData) throws ConversionException
Description copied from interface:PopulatorPopulate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<CMSItemModel,java.util.Map<java.lang.String,java.lang.Object>>- Parameters:
itemModel- the source objectresultData- the target to fill- Throws:
ConversionException- if an error occurs
-
groupProperties
protected java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.Object>>> groupProperties(java.util.List<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> properties)
Groups the list of properties by group name.- Parameters:
properties- the list of properties in the format List- Returns:
- the grouped list of properties in the format: Map
>>
-
getProperties
protected java.util.List<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> getProperties(java.util.List<CMSItemPropertiesSupplier> suppliers, CMSItemModel itemModel)
Returns the list of properties provided by suppliers.- Parameters:
suppliers- the list ofCMSItemPropertiesSupplier.itemModel- theCMSItemModelfor which the properties are returned.- Returns:
- the list of properties in the format List
-
mergeGroupedProperties
protected java.util.Map<java.lang.String,java.lang.Object> mergeGroupedProperties(java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.Object>>> groupedProperties)
Merges grouped properties usingCollectionHelper.mergeMaps(List).- Parameters:
groupedProperties- the grouped properties to merge- Returns:
- the resulted Map
-
getGroupProperties
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getGroupProperties(CMSItemPropertiesSupplier supplier, CMSItemModel itemModel)
Returns aMapof group name as a key and a Map of properties as a value. The group name represents a standalone group of properties. For example, the group of properties for SmartEdit application will have a group name "smartedit".- Parameters:
supplier- theCMSItemPropertiesSupplierthat returns a group name and properties.itemModel- theCMSItemModelto get the properties for.- Returns:
- a
Mapof group name as a key and aMapof properties as a value.
-
getCollectionHelper
protected CollectionHelper getCollectionHelper()
-
setCollectionHelper
public void setCollectionHelper(CollectionHelper collectionHelper)
-
getCmsItemPropertiesSupplierProvider
protected CMSItemPropertiesSupplierProvider getCmsItemPropertiesSupplierProvider()
-
setCmsItemPropertiesSupplierProvider
public void setCmsItemPropertiesSupplierProvider(CMSItemPropertiesSupplierProvider cmsItemPropertiesSupplierProvider)
-
-