Class ReturnCancellationController

  • All Implemented Interfaces:
    com.hybris.cockpitng.core.WidgetController, com.hybris.cockpitng.dnd.WidgetDragAndDropAware, com.hybris.cockpitng.engine.WidgetInstanceManagerAware, java.io.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 ReturnCancellationController
    extends com.hybris.cockpitng.util.DefaultWidgetController
    Controller for the cancellation return pop up
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.Object COMPLETED  
      protected static java.lang.String IN_SOCKET  
      protected static java.lang.String OUT_CONFIRM  
      • Fields inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer

        _separator, application, applicationScope, arg, componentScope, desktop, desktopScope, execution, page, pageScope, param, requestScope, self, session, sessionScope, spaceOwner, spaceScope
      • Fields inherited from class org.zkoss.zk.ui.util.GenericComposer

        _applied
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void confirmCancelReturn()
      Confirm the return approval request
      protected com.hybris.cockpitng.core.events.CockpitEventQueue getCockpitEventQueue()  
      protected BackofficeLocaleService getCockpitLocaleService()  
      org.zkoss.zul.Textbox getCustomerName()  
      protected EnumerationService getEnumerationService()  
      protected com.hybris.cockpitng.util.notifications.NotificationService getNotificationService()  
      protected ReturnCallbackService getReturnCallbackService()  
      protected ReturnRequestModel getReturnRequest()  
      org.zkoss.zul.Textbox getReturnRequestCode()  
      protected java.util.Optional<CancelReason> getSelectedCancelReason​(org.zkoss.zk.ui.event.Event event)
      Gets the label for the selected cancel reason in case the event has a target of Combobox
      protected void handleGlobalCancelReason​(org.zkoss.zk.ui.event.Event event)
      Applies a global reason to all individual entries after an event is triggered
      void initCancelReturnForm​(ReturnRequestModel inputObject)
      Initialize the popup to choose cancellation reason
      protected java.util.Optional<CancelReason> matchingComboboxCancelReason​(java.lang.String cancelReasonLabel)
      Retrieve the CancelReason according to the selected label in the combobox
      protected void processCancellation​(org.zkoss.zk.ui.event.Event event)
      Process the cancellation only if the user confirmed it
      void setReturnRequest​(ReturnRequestModel returnRequest)  
      void undoCancelReturn()
      Reinitialize the popup.
      protected void validateRequest()
      Check if the data provided by the form are compliant with the validation rules
      • Methods inherited from class com.hybris.cockpitng.util.DefaultWidgetController

        doAfterCompose, doBeforeCompose, doBeforeComposeChildren, executeOperation, getDragAndDropStrategy, getLabel, getLabel, getModel, getValue, getWidgetDragAndDropStrategyRepository, getWidgetInstanceManager, getWidgetRoot, getWidgetSettings, getWidgetslot, getWidgetTitle, getWidgetUtils, initDragAndDropAwareness, initialize, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, invokeListenerMethod, onSocketInput, preInitialize, sendOutput, sendOutputAfterOperation, sendOutputAfterOperation, sendOutputAfterOperation, setValue, setWidgetInstanceManager, setWidgetTitle
      • Methods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer

        scanEventListeners
      • Methods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer

        alert, didActivate, getPage, willClone, willPassivate
      • Methods inherited from class org.zkoss.zk.ui.util.GenericComposer

        doCatch, doFinally
      • Methods inherited from class org.zkoss.zk.ui.event.GenericEventListener

        bindComponent, getController, onEvent, unbindComponent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMPLETED

        protected static final java.lang.Object COMPLETED
    • Constructor Detail

      • ReturnCancellationController

        public ReturnCancellationController()
    • Method Detail

      • initCancelReturnForm

        public void initCancelReturnForm​(ReturnRequestModel inputObject)
        Initialize the popup to choose cancellation reason
        Parameters:
        inputObject - the return request for which we want set the cancellation reason
      • handleGlobalCancelReason

        protected void handleGlobalCancelReason​(org.zkoss.zk.ui.event.Event event)
        Applies a global reason to all individual entries after an event is triggered
        Parameters:
        event - the on select event that was triggered by the user
      • matchingComboboxCancelReason

        protected java.util.Optional<CancelReason> matchingComboboxCancelReason​(java.lang.String cancelReasonLabel)
        Retrieve the CancelReason according to the selected label in the combobox
        Parameters:
        cancelReasonLabel - a String representation of the reason
        Returns:
        the CancelReason corresponding to the label
      • getSelectedCancelReason

        protected java.util.Optional<CancelReason> getSelectedCancelReason​(org.zkoss.zk.ui.event.Event event)
        Gets the label for the selected cancel reason in case the event has a target of Combobox
        Parameters:
        event - the event that was fired
        Returns:
        the CancelReason corresponding to the label.
      • undoCancelReturn

        public void undoCancelReturn()
        Reinitialize the popup.
      • confirmCancelReturn

        public void confirmCancelReturn()
        Confirm the return approval request
      • processCancellation

        protected void processCancellation​(org.zkoss.zk.ui.event.Event event)
        Process the cancellation only if the user confirmed it
        Parameters:
        event - the confirmation event coming from the user
      • validateRequest

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

        protected com.hybris.cockpitng.core.events.CockpitEventQueue getCockpitEventQueue()
      • getNotificationService

        protected com.hybris.cockpitng.util.notifications.NotificationService getNotificationService()
      • getCustomerName

        public org.zkoss.zul.Textbox getCustomerName()
      • getReturnRequestCode

        public org.zkoss.zul.Textbox getReturnRequestCode()