Class 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 Detail

      • PROPERTIES_ATTRIBUTE

        public static final java.lang.String PROPERTIES_ATTRIBUTE
        See Also:
        Constant Field Values
    • Constructor Detail

      • CMSItemsPropertiesModelToDataRenderingPopulator

        public CMSItemsPropertiesModelToDataRenderingPopulator()
    • Method Detail

      • populate

        public void populate​(CMSItemModel itemModel,
                             java.util.Map<java.lang.String,​java.lang.Object> resultData)
                      throws ConversionException
        Description copied from interface: Populator
        Populate the target instance with values from the source instance.
        Specified by:
        populate in interface Populator<CMSItemModel,​java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        itemModel - the source object
        resultData - 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 of CMSItemPropertiesSupplier.
        itemModel - the CMSItemModel for 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 using CollectionHelper.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 a Map of 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 - the CMSItemPropertiesSupplier that returns a group name and properties.
        itemModel - the CMSItemModel to get the properties for.
        Returns:
        a Map of group name as a key and a Map of properties as a value.
      • setCollectionHelper

        public void setCollectionHelper​(CollectionHelper collectionHelper)