Class CMSItemsPropertiesModelToDataRenderingPopulator
java.lang.Object
de.hybris.platform.cmsfacades.rendering.populators.CMSItemsPropertiesModelToDataRenderingPopulator
- All Implemented Interfaces:
Populator<CMSItemModel,Map<String, Object>>
public class CMSItemsPropertiesModelToDataRenderingPopulator
extends Object
implements Populator<CMSItemModel,Map<String,Object>>
Populator used to add "properties" attribute to the result data object.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CMSItemPropertiesSupplierProviderprotected CollectionHelpergetGroupProperties(CMSItemPropertiesSupplier supplier, CMSItemModel itemModel) Returns aMapof group name as a key and a Map of properties as a value.getProperties(List<CMSItemPropertiesSupplier> suppliers, CMSItemModel itemModel) Returns the list of properties provided by suppliers.Groups the list of properties by group name.Merges grouped properties usingCollectionHelper.mergeMaps(List).voidpopulate(CMSItemModel itemModel, Map<String, Object> resultData) Populate the target instance with values from the source instance.voidsetCmsItemPropertiesSupplierProvider(CMSItemPropertiesSupplierProvider cmsItemPropertiesSupplierProvider) voidsetCollectionHelper(CollectionHelper collectionHelper)
-
Field Details
-
PROPERTIES_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
CMSItemsPropertiesModelToDataRenderingPopulator
public CMSItemsPropertiesModelToDataRenderingPopulator()
-
-
Method Details
-
populate
public void populate(CMSItemModel itemModel, Map<String, Object> resultData) throws ConversionExceptionDescription copied from interface:PopulatorPopulate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<CMSItemModel,Map<String, Object>> - Parameters:
itemModel- the source objectresultData- the target to fill- Throws:
ConversionException- if an error occurs
-
groupProperties
protected Map<String,List<Map<String, groupPropertiesObject>>> (List<Map<String, Map<String, Object>>> properties) Groups the list of properties by group name.- Parameters:
properties- the list of properties in the format List<Map<groupName, Map<propertyKey, propertyValue>>>- Returns:
- the grouped list of properties in the format: Map<groupName, List<Map<propertyKey, propertyValue>>>
-
getProperties
protected List<Map<String,Map<String, getPropertiesObject>>> (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<Map<groupName, Map<propertyKey, propertyValue>>>
-
mergeGroupedProperties
protected Map<String,Object> mergeGroupedProperties(Map<String, List<Map<String, Object>>> groupedProperties) Merges grouped properties usingCollectionHelper.mergeMaps(List).- Parameters:
groupedProperties- the grouped properties to merge- Returns:
- the resulted Map<groupName, groupedProperties>
-
getGroupProperties
protected Map<String,Map<String, getGroupPropertiesObject>> (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
-
setCollectionHelper
-
getCmsItemPropertiesSupplierProvider
-
setCmsItemPropertiesSupplierProvider
public void setCmsItemPropertiesSupplierProvider(CMSItemPropertiesSupplierProvider cmsItemPropertiesSupplierProvider)
-