Class CMSItemCatalogLevelComparator<T extends CMSItemModel>

java.lang.Object
de.hybris.platform.cms2.multicountry.comparator.CMSItemCatalogLevelComparator<T>
All Implemented Interfaces:
Comparator<T>

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

    • CMSItemCatalogLevelComparator

      public CMSItemCatalogLevelComparator()
  • Method Details

    • compare

      public int compare(CMSItemModel item1, CMSItemModel item2)
      Specified by:
      compare in interface Comparator<T extends CMSItemModel>
    • 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
    • getCmsCatalogLevelService

      protected CatalogLevelService getCmsCatalogLevelService()
    • setCmsCatalogLevelService

      public void setCmsCatalogLevelService(CatalogLevelService cmsCatalogLevelService)