Class CMSItemCatalogLevelComparator<T extends CMSItemModel>

  • All Implemented Interfaces:
    java.util.Comparator<T>

    public class CMSItemCatalogLevelComparator<T extends CMSItemModel>
    extends java.lang.Object
    implements java.util.Comparator<T>
    Compare CMSItemModel by catalog level where the cms item was defined. This is used in the context of multi-country.
    • Constructor Detail

      • CMSItemCatalogLevelComparator

        public CMSItemCatalogLevelComparator()
    • Method Detail

      • compareItemsByCatalogVersions

        protected int compareItemsByCatalogVersions​(CMSItemModel item1,
                                                    CMSItemModel item2)
        Determines the ordering of the given cms items by comparing the catalog versions where the items are defined. The item defined in the active catalog takes precedence.
        Parameters:
        item1 - - the first catalog version to be compared
        item2 - - the second catalog version to be compared
        Returns:
        The ordering of the cms item based on their catalog versions
      • setCmsCatalogLevelService

        public void setCmsCatalogLevelService​(CatalogLevelService cmsCatalogLevelService)