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:
-
Field Summary
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, spaceScopeFields inherited from class org.zkoss.zk.ui.util.GenericComposer
_applied -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidThis method will create event listener on add baggage type button to add baggage typeprotected voidaddNewBaggageTypeRow(org.zkoss.zul.Rows baggageTypeRows, org.zkoss.zul.Grid baggageTypeGrid, BaggageTypeData freeBaggageType) This method will add baggage type row to baggage type gridprotected voidaddNewOsiRow(org.zkoss.zul.Rows osiRows, org.zkoss.zul.Grid osiGrid, OSIData osiData) This method will create row and will add it to osi gridprotected voidaddOSI()This method will add listener to add osi buttonprotected voidaddSelectedApplicabilityCondition(ConditionData conditionData, AncillaryProduct ancillaryProductFromModel) protected voidaddSelectedBaggageCondition(ConditionData conditionData, AncillaryProduct ancillaryProductFromModel) protected voidaddSelectedServicePriceCondition(ConditionData conditionData, AncillaryProduct ancillaryProductFromModel) protected voidprotected voidThis method will populate all required data applicability section on widgetvoidvoidprotected voidThis method will populate all required data baggage and baggage condition section on widget e.g.voidvoidprotected voidcreateAddBaggageTypeGridColumns(org.zkoss.zul.Grid baggageTypeGrid) This method will create columns for baggageTypeGridprotected voidcreateAddOsiGridColumns(org.zkoss.zul.Grid osiGrid) This method will create columns for osi gridprotected voidcreateAncillaryProduct(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 eventprotected voidThis method will be responsible for creating and updating applicability popupprotected voidThis method will be responsible for creating and updating baggage popupprotected voidThis method will be responsible for creating and updating service price popupprotected org.zkoss.zul.ColumncreateColumn(String labelKey) This method will create Column objectprotected com.hybris.cockpitng.components.EditorcreateEditor(String type, String attribute) This method will create Editor objectprotected org.zkoss.zul.IntboxcreateIntBox(String name) This method will create Intbox objectvoidcreateOrEditAncillaryProductRequest(AncillaryProduct ancillaryProduct) protected org.zkoss.zul.TextboxcreateTextBox(String name) This method will create Textbox objectprotected voidemptyComboBox(org.zkoss.zul.Combobox comboBox) This method will remove all combo items from the comboboxprotected voidenableDisableRefundReuseFeeByRefundType(org.zkoss.zul.Combobox refundTypeComboBox, org.zkoss.zul.Doublebox refundReuseFee) This method will enable and disable refund fee doublebox by refund typeprotected voidThis method will populate all required data general section on widget e.g.protected voidgetConditions(String modelAttributeName, AncillaryConditionType ancillaryConditionType, int requestedPage, Map<String, Object> searchFilterMap) This method will call pros service to get condition based on basic filterprotected List<ServiceKey>getServiceKeysFromPros(String serviceTypeCode, List<String> carriersList) This method will call get service keys from prosprotected voidThis method will hide and show whether to display service code and service name as combo box or text boxvoidinitialize(org.zkoss.zk.ui.Component comp) protected voidThis method will call all methods to populate section with default valuesprotected voidThis method will initialize pagination event on popupprotected voidThis method will populate all required data optional settings section on widget e.g.protected DateparseDateInStringToDate(String dateInString) This method will parse string date in date objectprotected voidpopulateAncillaryData(AncillaryProduct ancillaryProduct) This method will populate widget component from ancillaryProduct dataprotected AncillaryProductThis method will populate ancillary data from widgetprotected voidpopulateApplicabilityConditions(AncillaryProduct ancillaryProduct) This method will populate applicability condition in list viewprotected voidpopulateBaggageType(AncillaryProduct ancillaryProduct) This method will populate baggage type from baggage type grid and will assign it to ancillaryProductprotected voidpopulateConditionPriority(AncillaryProduct ancillaryProduct) This method will sort all condition e.g.protected voidpopulateConditions(List<String> conditions, org.zkoss.zul.Rows priceOrBaggageConditionGridRows, int sequence) This method will populate conditionprotected voidpopulateFeeApplicationComboBox(String serviceTypeCode) This method will set fee application combobox based on service type codeprotected voidpopulateOSI(AncillaryProduct ancillaryProduct) This method will populate osi from osi grid and will assign it to ancillaryProductprotected voidpopulateServiceCodeAndServiceName(List<ServiceKey> serviceKeys, String serviceTypeCode) This method will populate service code and service name combo box from serviceKeysprotected voidpopulateSubcategory(String categoryCode) This method will populate subGroup in combobox based on categoryCode selectedprotected ConditionDataprepareSanitizedConditionData(ConditionData conditionData, String serviceId) This method will clone conditionData and will assign service id to cloned conditionvoidrefresh()protected voidremoveAllRows(org.zkoss.zul.Rows gridRows) protected voidremoveCondition(ConditionData conditionData) voidsave()protected voidselectComboBoxItem(org.zkoss.zul.Combobox combobox, String value) This method will select the value from the combo box based on valueprotected voidselectRadiogroupItem(org.zkoss.zul.Radiogroup radiogroup, String value) This method will select the value from the Radio group based on valueprotected voidThis method will populate all required data service price and price condition section on widget e.g.voidvoidprotected voidshowOrHideOptionalSettingAttribute(String serviceTypeCode) this method will show or hide some optional attributes based on service typeprotected voidupdateAncillaryProduct(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 eventprotected booleanValidate mandatory form element are not emptyprotected booleanThis method will validate priority of all conditions as well populate the condition priority mapMethods 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, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, invokeListenerMethod, onSocketInput, preInitialize, sendOutput, sendOutputAfterOperation, sendOutputAfterOperation, sendOutputAfterOperation, setValue, setWidgetInstanceManager, setWidgetTitleMethods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer
scanEventListenersMethods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
alert, didActivate, getPage, willClone, willPassivateMethods inherited from class org.zkoss.zk.ui.util.GenericComposer
doCatch, doFinallyMethods inherited from class org.zkoss.zk.ui.event.GenericEventListener
bindComponent, getController, onEvent, unbindComponent
-
Constructor Details
-
CreateOrEditAncillaryProductController
public CreateOrEditAncillaryProductController()
-
-
Method Details
-
initialize
public void initialize(org.zkoss.zk.ui.Component comp) - Overrides:
initializein classcom.hybris.cockpitng.util.DefaultWidgetController
-
createOrEditAncillaryProductRequest
-
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
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
This method will populate applicability condition in list view- Parameters:
ancillaryProduct-
-
removeCondition
-
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 codecarriersList- 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 serviceKeysserviceTypeCode- the serviceTypeCode
-
showOrHideOptionalSettingAttribute
this method will show or hide some optional attributes based on service type- Parameters:
serviceTypeCode-
-
populateFeeApplicationComboBox
This method will set fee application combobox based on service type code- Parameters:
serviceTypeCode-
-
populateAncillaryProduct
This method will populate ancillary data from widget- Returns:
-
populateConditionPriority
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
This method will populate baggage type from baggage type grid and will assign it to ancillaryProduct- Parameters:
ancillaryProduct-
-
populateOSI
This method will populate osi from osi grid and will assign it to ancillaryProduct- Parameters:
ancillaryProduct-
-
createAncillaryProduct
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
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
This method will select the value from the combo box based on value- Parameters:
combobox- the comboboxvalue- the value
-
selectRadiogroupItem
This method will select the value from the Radio group based on value- Parameters:
radiogroup- the radiogroupvalue- the value
-
populateSubcategory
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 objectserviceId- 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
This method will create Intbox object- Parameters:
name- the name- Returns:
- the Intbox
-
createTextBox
This method will create Textbox object- Parameters:
name- the name- Returns:
- the Textbox
-
createEditor
This method will create Editor object- Parameters:
type- the item typeattribute- the attribute- Returns:
- the Editor
-
createColumn
This method will create Column object- Parameters:
labelKey- the labelKey from labels properties- Returns:
- the Column
-
parseDateInStringToDate
This method will parse string date in date object- Parameters:
dateInString- the dateInString- Returns:
- the date
-