Class CreateOrEditAncillaryProductController

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.unifieduibackoffice.widgets.merchandising.CreateOrEditAncillaryProductController
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 CreateOrEditAncillaryProductController extends com.hybris.cockpitng.util.DefaultWidgetController
This controller will handle events for creating and editing ancillary product
See Also:
  • Constructor Details

    • CreateOrEditAncillaryProductController

      public CreateOrEditAncillaryProductController()
  • Method Details

    • initialize

      public void initialize(org.zkoss.zk.ui.Component comp)
      Overrides:
      initialize in class com.hybris.cockpitng.util.DefaultWidgetController
    • createOrEditAncillaryProductRequest

      public void createOrEditAncillaryProductRequest(AncillaryProduct ancillaryProduct)
    • refresh

      public void refresh()
    • save

      public void save()
    • baggageSearch

      public void baggageSearch()
    • baggageSearchClear

      public void baggageSearchClear()
    • applicabilitySearch

      public void applicabilitySearch()
    • applicabilitySearchClear

      public void applicabilitySearchClear()
    • servicePriceSearch

      public void servicePriceSearch()
    • servicePriceSearchClear

      public void servicePriceSearchClear()
    • populateAncillaryData

      protected void populateAncillaryData(AncillaryProduct ancillaryProduct)
      This method will populate widget component from ancillaryProduct data
      Parameters:
      ancillaryProduct -
    • populateConditions

      protected void populateConditions(List<String> conditions, org.zkoss.zul.Rows priceOrBaggageConditionGridRows, int sequence)
      This method will populate condition
      Parameters:
      conditions -
      priceOrBaggageConditionGridRows -
      sequence -
    • populateApplicabilityConditions

      protected void populateApplicabilityConditions(AncillaryProduct ancillaryProduct)
      This method will populate applicability condition in list view
      Parameters:
      ancillaryProduct -
    • removeCondition

      protected void removeCondition(ConditionData conditionData)
    • initializeAncillaryProductWidgetData

      protected void initializeAncillaryProductWidgetData()
      This method will call all methods to populate section with default values
    • generalDataSectionPopulation

      protected void generalDataSectionPopulation()
      This method will populate all required data general section on widget e.g. dropdowns
    • getServiceKeysFromPros

      protected List<ServiceKey> getServiceKeysFromPros(String serviceTypeCode, List<String> carriersList)
      This method will call get service keys from pros
      Parameters:
      serviceTypeCode - the service type code
      carriersList - the carriers list
      Returns:
      the service key list
    • optionalSettingSectionDataPopulation

      protected void optionalSettingSectionDataPopulation()
      This method will populate all required data optional settings section on widget e.g. dropdowns
    • baggageAndBaggageConditionSectionDataPopulation

      protected void baggageAndBaggageConditionSectionDataPopulation()
      This method will populate all required data baggage and baggage condition section on widget e.g. dropdowns
    • servicePriceAndPriceConditionSectionDataPopulation

      protected void servicePriceAndPriceConditionSectionDataPopulation()
      This method will populate all required data service price and price condition section on widget e.g. dropdowns
    • applicabilityConditionsSectionDataPopulation

      protected void applicabilityConditionsSectionDataPopulation()
      This method will populate all required data applicability section on widget
    • populateServiceCodeAndServiceName

      protected void populateServiceCodeAndServiceName(List<ServiceKey> serviceKeys, String serviceTypeCode)
      This method will populate service code and service name combo box from serviceKeys
      Parameters:
      serviceKeys - the serviceKeys
      serviceTypeCode - the serviceTypeCode
    • showOrHideOptionalSettingAttribute

      protected void showOrHideOptionalSettingAttribute(String serviceTypeCode)
      this method will show or hide some optional attributes based on service type
      Parameters:
      serviceTypeCode -
    • populateFeeApplicationComboBox

      protected void populateFeeApplicationComboBox(String serviceTypeCode)
      This method will set fee application combobox based on service type code
      Parameters:
      serviceTypeCode -
    • populateAncillaryProduct

      protected AncillaryProduct populateAncillaryProduct()
      This method will populate ancillary data from widget
      Returns:
    • populateConditionPriority

      protected void populateConditionPriority(AncillaryProduct ancillaryProduct)
      This method will sort all condition e.g. applicability,baggage and price with respect to priority and will populate the same on ancillaryProduct
      Parameters:
      ancillaryProduct - the ancillaryProduct
    • populateBaggageType

      protected void populateBaggageType(AncillaryProduct ancillaryProduct)
      This method will populate baggage type from baggage type grid and will assign it to ancillaryProduct
      Parameters:
      ancillaryProduct -
    • populateOSI

      protected void populateOSI(AncillaryProduct ancillaryProduct)
      This method will populate osi from osi grid and will assign it to ancillaryProduct
      Parameters:
      ancillaryProduct -
    • createAncillaryProduct

      protected void createAncillaryProduct(AncillaryProduct ancillaryProduct)
      This method will call create ancillary product method, will handle the exception and accordingly notify, show message box to user and send socket event
      Parameters:
      ancillaryProduct - the ancillaryProduct
    • updateAncillaryProduct

      protected void updateAncillaryProduct(AncillaryProduct ancillaryProduct)
      This method will call update ancillary product method, will handle the exception and accordingly notify, show message box to user and send socket event
      Parameters:
      ancillaryProduct - the ancillaryProduct
    • validateAncillaryData

      protected boolean validateAncillaryData()
      Validate mandatory form element are not empty
      Returns:
      the boolean,returns true if validation success else return false
    • validateAndPopulateConditionPriorityMap

      protected boolean validateAndPopulateConditionPriorityMap()
      This method will validate priority of all conditions as well populate the condition priority map
      Returns:
      the boolean,returns true if validation success else return false
    • hideOrShowExistingServiceCodeAndServiceNameElement

      protected void hideOrShowExistingServiceCodeAndServiceNameElement()
      This method will hide and show whether to display service code and service name as combo box or text box
    • enableDisableRefundReuseFeeByRefundType

      protected void enableDisableRefundReuseFeeByRefundType(org.zkoss.zul.Combobox refundTypeComboBox, org.zkoss.zul.Doublebox refundReuseFee)
      This method will enable and disable refund fee doublebox by refund type
    • selectComboBoxItem

      protected void selectComboBoxItem(org.zkoss.zul.Combobox combobox, String value)
      This method will select the value from the combo box based on value
      Parameters:
      combobox - the combobox
      value - the value
    • selectRadiogroupItem

      protected void selectRadiogroupItem(org.zkoss.zul.Radiogroup radiogroup, String value)
      This method will select the value from the Radio group based on value
      Parameters:
      radiogroup - the radiogroup
      value - the value
    • populateSubcategory

      protected void populateSubcategory(String categoryCode)
      This method will populate subGroup in combobox based on categoryCode selected
      Parameters:
      categoryCode - the categoryCode
    • emptyComboBox

      protected void emptyComboBox(org.zkoss.zul.Combobox comboBox)
      This method will remove all combo items from the combobox
      Parameters:
      comboBox - the comboBox
    • addOSI

      protected void addOSI()
      This method will add listener to add osi button
    • addServicePriceCondition

      protected void addServicePriceCondition()
    • addApplicabilityCondition

      protected void addApplicabilityCondition()
    • addBaggageConditions

      protected void addBaggageConditions()
    • createAndUpdateBaggagePopup

      protected void createAndUpdateBaggagePopup()
      This method will be responsible for creating and updating baggage popup
    • createAndUpdateApplicabilityPopup

      protected void createAndUpdateApplicabilityPopup()
      This method will be responsible for creating and updating applicability popup
    • createAndUpdateServicePricePopup

      protected void createAndUpdateServicePricePopup()
      This method will be responsible for creating and updating service price popup
    • initializePaginationEventOnPopup

      protected void initializePaginationEventOnPopup()
      This method will initialize pagination event on popup
    • getConditions

      protected void getConditions(String modelAttributeName, AncillaryConditionType ancillaryConditionType, int requestedPage, Map<String,Object> searchFilterMap)
      This method will call pros service to get condition based on basic filter
      Parameters:
      ancillaryConditionType -
      requestedPage -
      searchFilterMap -
    • addSelectedServicePriceCondition

      protected void addSelectedServicePriceCondition(ConditionData conditionData, AncillaryProduct ancillaryProductFromModel)
    • addSelectedApplicabilityCondition

      protected void addSelectedApplicabilityCondition(ConditionData conditionData, AncillaryProduct ancillaryProductFromModel)
    • addSelectedBaggageCondition

      protected void addSelectedBaggageCondition(ConditionData conditionData, AncillaryProduct ancillaryProductFromModel)
    • prepareSanitizedConditionData

      protected ConditionData prepareSanitizedConditionData(ConditionData conditionData, String serviceId)
      This method will clone conditionData and will assign service id to cloned condition
      Parameters:
      conditionData - the condition data object
      serviceId - the service id
      Returns:
      the cloned condition data object
    • createAddOsiGridColumns

      protected void createAddOsiGridColumns(org.zkoss.zul.Grid osiGrid)
      This method will create columns for osi grid
      Parameters:
      osiGrid -
    • addNewOsiRow

      protected void addNewOsiRow(org.zkoss.zul.Rows osiRows, org.zkoss.zul.Grid osiGrid, OSIData osiData)
      This method will create row and will add it to osi grid
      Parameters:
      osiRows -
      osiGrid -
      osiData -
    • addBaggageType

      protected void addBaggageType()
      This method will create event listener on add baggage type button to add baggage type
    • removeAllRows

      protected void removeAllRows(org.zkoss.zul.Rows gridRows)
    • createAddBaggageTypeGridColumns

      protected void createAddBaggageTypeGridColumns(org.zkoss.zul.Grid baggageTypeGrid)
      This method will create columns for baggageTypeGrid
      Parameters:
      baggageTypeGrid - the baggageTypeGrid
    • addNewBaggageTypeRow

      protected void addNewBaggageTypeRow(org.zkoss.zul.Rows baggageTypeRows, org.zkoss.zul.Grid baggageTypeGrid, BaggageTypeData freeBaggageType)
      This method will add baggage type row to baggage type grid
      Parameters:
      baggageTypeRows -
      baggageTypeGrid -
      freeBaggageType -
    • createIntBox

      protected org.zkoss.zul.Intbox createIntBox(String name)
      This method will create Intbox object
      Parameters:
      name - the name
      Returns:
      the Intbox
    • createTextBox

      protected org.zkoss.zul.Textbox createTextBox(String name)
      This method will create Textbox object
      Parameters:
      name - the name
      Returns:
      the Textbox
    • createEditor

      protected com.hybris.cockpitng.components.Editor createEditor(String type, String attribute)
      This method will create Editor object
      Parameters:
      type - the item type
      attribute - the attribute
      Returns:
      the Editor
    • createColumn

      protected org.zkoss.zul.Column createColumn(String labelKey)
      This method will create Column object
      Parameters:
      labelKey - the labelKey from labels properties
      Returns:
      the Column
    • parseDateInStringToDate

      protected Date parseDateInStringToDate(String dateInString)
      This method will parse string date in date object
      Parameters:
      dateInString - the dateInString
      Returns:
      the date