Class ExportConfigurationEditorPresentation

java.lang.Object
de.hybris.platform.integrationbackoffice.widgets.configuration.data.ExportConfigurationEditorPresentation
All Implemented Interfaces:
Serializable

public class ExportConfigurationEditorPresentation extends Object implements Serializable
Class that encapsulates a map where the keys are integration object codes and the values are sets of the root item's selected ItemModel instances. Represents what instances are selected in the export configuration editor. Can generate ConfigurationBundleEntity from the map.
See Also:
  • Constructor Details

    • ExportConfigurationEditorPresentation

      public ExportConfigurationEditorPresentation(com.hybris.cockpitng.util.notifications.NotificationService notificationService)
      Instantiate this export configuration presentation.
      Parameters:
      notificationService - service to display notifications in backoffice.
  • Method Details

    • getSelectedEntity

      public IntegrationObjectModel getSelectedEntity()
      Get currently selected entity.
      Returns:
      the IntegrationObjectModel representing the selected entity, or null if no entity has been selected yet.
      See Also:
    • isSelectedEntity

      public boolean isSelectedEntity(IntegrationObjectModel integrationObjectModel)
      Determine if the given IntegrationObjectModel equals selectedEntity
    • setSelectedEntity

      public void setSelectedEntity(@NotNull @NotNull IntegrationObjectModel selectedEntity)
      Set currently selected entity.
      Parameters:
      selectedEntity - the IntegrationObjectModel representing the selected entity. Can't be null.
    • getSelectedEntityRoot

      public String getSelectedEntityRoot()
      Get selected entity's root type code. The selected entity must be set first.
      Returns:
      the code of the selected entity's root item type, or an empty string if no entity has been selected yet.
      See Also:
    • getSelectedEntityInstances

      public Set<ItemModel> getSelectedEntityInstances()
      Get a copy of the set of selected instances for currently selected entity. The selected entity must be set first.
      Returns:
      a set of ItemModel representing selected entity's selected instances, or an empty set if no entity has been selected yet.
      See Also:
    • setSelectedEntityInstances

      public void setSelectedEntityInstances(Set<ItemModel> selectedEntityInstances)
      Update the set of selected instances with a copy of the argument for currently selected entity. The selected entity must be set first.
      Parameters:
      selectedEntityInstances - the updated set of ItemModel
      See Also:
    • clearSelection

      public void clearSelection()
      Clear the encapsulated map of entity instances and set selected entity to null.
    • isAnyInstanceSelected

      public boolean isAnyInstanceSelected()
      Check if map has any entries with a non-empty set of selected instances.
      Returns:
      if any instance selected
    • generateConfigurationBundleEntity

      public ConfigurationBundleEntity generateConfigurationBundleEntity()
      Copy the map of selected entity instances, remove entries with no selected instances, and generate a ConfigurationBundleEntity.
      Returns:
      a ConfigurationBundleEntity ready for export
    • getSelectedInstancesCountForEntity

      public int getSelectedInstancesCountForEntity(String entityType)
      Retrieves the current number of selected instances for a given entity type. Returns 0 if entry not present in map. The code lookup is based off of the IntegrationObjectModel's code.
      Parameters:
      entityType - Entity type to retrieve count on
      Returns:
      Number of selected instances