Class StockToAdjustController

java.lang.Object
org.zkoss.zk.ui.event.GenericEventListener
org.zkoss.zk.ui.util.GenericComposer<T>
org.zkoss.zk.ui.util.GenericAutowireComposer<T>
org.zkoss.zk.ui.util.GenericForwardComposer<org.zkoss.zk.ui.Component>
com.hybris.cockpitng.util.ViewAnnotationAwareComposer
com.hybris.cockpitng.util.DefaultWidgetController
de.hybris.platform.warehousingbackoffice.widgets.stocks.StockToAdjustController
All Implemented Interfaces:
com.hybris.cockpitng.core.WidgetController, com.hybris.cockpitng.dnd.WidgetDragAndDropAware, com.hybris.cockpitng.engine.WidgetInstanceManagerAware, Serializable, org.zkoss.zk.ui.event.EventListener, org.zkoss.zk.ui.event.SerializableEventListener, org.zkoss.zk.ui.util.ComponentActivationListener, org.zkoss.zk.ui.util.ComponentCloneListener, org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>, org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>

public class StockToAdjustController extends com.hybris.cockpitng.util.DefaultWidgetController
This controller creates a pop-up to create one or several stock level adjustment(s).
See Also:
  • Field Details

  • Constructor Details

    • StockToAdjustController

      public StockToAdjustController()
  • Method Details

    • initStockLevelAdjustmentForm

      public void initStockLevelAdjustmentForm(StockLevelModel inputObject)
      Initialize the popup to create stock level adjustment(s)
      Parameters:
      inputObject - the StockLevelModel for which we want to create one or several stock level adjustment(s)
    • addAdjustment

      public void addAdjustment()
      Add a new row of stock adjustment reason.
    • reset

      public void reset()
      Reinitialize the popup.
    • refreshGrid

      protected void refreshGrid()
      Refresh the rendering of the grid of stock adjustment to create
    • addListeners

      protected void addListeners()
      Add listeners on Intbox, Combobox and Textbox so that when a change happens on one of these components, we are catching it.
    • addListComponentListeners

      protected void addListComponentListeners(org.zkoss.zk.ui.Component component)
      Adds a listener according to the type of component inside a vertical box
      Parameters:
      component - the vertical box component containing the element to target to add a listener
    • handleIndividualReason

      protected void handleIndividualReason(org.zkoss.zk.ui.event.Event event)
      Updates an individual entry with the selected reason
      Parameters:
      event - the event that triggered the change
    • matchingComboboxStockAdjustmentReason

      protected Optional<StockLevelAdjustmentReason> matchingComboboxStockAdjustmentReason(String stockAdjustmentReasonLabel)
      Retrieve the StockLevelAdjustmentReason according to the selected label in the combobox
      Parameters:
      stockAdjustmentReasonLabel - a String
      Returns:
      the StockLevelAdjustmentReason corresponding to the label
    • addButtonListeners

      protected void addButtonListeners(org.zkoss.zk.ui.Component myComponent)
      Add listeners on the buttons for each line
      Parameters:
      myComponent - the initial component
    • addStockAdjustment

      protected void addStockAdjustment(org.zkoss.zk.ui.event.Event event)
      Adds an individual stock adjustment.
      Parameters:
      event - the click event triggered by the user
    • removeStockAdjustment

      protected void removeStockAdjustment(org.zkoss.zk.ui.event.Event event)
      Removes an individual stock adjustment.
      Parameters:
      event - the click event triggered by the user
    • editStockAdjustment

      protected void editStockAdjustment(org.zkoss.zk.ui.event.Event event)
      Edits an individual stock adjustment.
      Parameters:
      event - the click event triggered by the user
    • manageFieldsVisibility

      protected void manageFieldsVisibility(org.zkoss.zul.Row myRow, StockAdjustmentDto stockAdjustmentDto)
      Handles buttons visibility
      Parameters:
      myRow - the row for which the visibility change is requested
      stockAdjustmentDto - the stock adjustment dto containing informations about the reason selected
    • manageButtonsVisibility

      protected void manageButtonsVisibility(boolean isEditable, org.zkoss.zk.ui.Component myComponent)
      Handles the display of the buttons according to the situation (editable or not)
      Parameters:
      isEditable - the line is editable or not
      myComponent - the component containing the buttons
    • confirmStockAdjustmentCreation

      public void confirmStockAdjustmentCreation() throws InterruptedException
      Confirm the creation of the listed stock level adjustments
      Throws:
      InterruptedException
    • validateStockAdjustmentCreation

      protected void validateStockAdjustmentCreation()
      Check if the data provided by the form are compliant with the validation rules
    • getStockLevelAdjustmentData

      protected StockLevelAdjustmentData getStockLevelAdjustmentData(StockAdjustmentDto stockAdjustmentDto)
      Instantiate a StockLevelAdjustmentData and populate it from the given StockAdjustmentDto
      Parameters:
      stockAdjustmentDto - the stock adjustment DTO to use for population
      Returns:
      the new instance of StockLevelAdjustmentData
    • getLocale

      protected Locale getLocale()
    • getStockLevel

      protected StockLevelModel getStockLevel()
    • setStockLevel

      public void setStockLevel(StockLevelModel stockLevel)
    • getCockpitLocaleService

      protected BackofficeLocaleService getCockpitLocaleService()
    • getEnumerationService

      protected EnumerationService getEnumerationService()
    • getModelService

      protected ModelService getModelService()
    • getStockAdjustments

      public org.zkoss.zul.Grid getStockAdjustments()
    • getWarehousingStockLevelFacade

      public DefaultWarehousingStockLevelFacade getWarehousingStockLevelFacade()
    • getNotificationService

      protected com.hybris.backoffice.widgets.notificationarea.NotificationService getNotificationService()