Class CustomerSupportRefineByController

  • 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 CustomerSupportRefineByController
    extends com.hybris.cockpitng.util.DefaultWidgetController
    Controller allowing to filter a collection browser based combine with advanced search logic.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addConditionList​(com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchData searchData, java.util.Map<java.lang.String,​java.util.List<com.hybris.backoffice.widgets.advancedsearch.impl.SearchConditionData>> searchExpressions)
      Adds refine by filters conditions to the existing ones.
      protected void addSearchCondition​(org.zkoss.zul.Checkbox checkbox, java.util.Map<java.lang.String,​java.util.List<com.hybris.backoffice.widgets.advancedsearch.impl.SearchConditionData>> searchFieldConditions, com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchData advancedSearchData)
      Adds the search conditions associated to the selected Checkbox
      protected FlexibleSearchQuery buildSearchQuery​(java.lang.String typeCode, java.lang.String searchValue)
      void completeAdvancedSearchInitContext​(com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchInitContext context)
      Adds refine by filters to the initial given AdvancedSearchInitContext.
      protected org.zkoss.zul.Div getCustomerSupportFilterContainer()  
      protected org.zkoss.zul.Label getEmptyFilters()  
      protected EnumerationService getEnumerationService()  
      protected FlexibleSearchService getFlexibleSearchService()  
      protected RefineBy getRefineByConfig()  
      protected com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade()  
      void initialize​(org.zkoss.zk.ui.Component comp)  
      protected com.hybris.cockpitng.dataaccess.facades.type.DataType loadDataTypeForCode​(java.lang.String typeCode)
      Loads a DataType by its code.
      protected RefineBy loadRefineByConfiguration​(java.lang.String typeCode)
      Loads the configuration of the refine by according to the given type.
      void onNodeSelected​(com.hybris.backoffice.navigation.NavigationNode nodeSelected)
      Resets the refine by widget on NavigationNode selection.
      protected void renderCheckbox​(java.lang.String searchFieldName, java.util.ArrayList searchFieldPossibleValues, java.lang.String typeCode, SearchValue searchFieldValue, org.zkoss.zul.Div searchFieldDiv)
      Render a checkbox with her associated hidden Label which contains the search value.
      protected void renderRefineByFromConfig​(java.lang.String typeCode)
      Renders the filters based on customersupportbackoffice-refine-by configuration.
      protected void resetWidget()
      Resets the content of the filter container.
      void setCustomerSupportFilterContainer​(org.zkoss.zul.Div customersupportFilterContainer)  
      void setEmptyFilters​(org.zkoss.zul.Label emptyFilters)  
      void setEnumerationService​(EnumerationService enumerationService)  
      void setFlexibleSearchService​(FlexibleSearchService flexibleSearchService)  
      void setRefineByConfig​(RefineBy refineByConfig)  
      void setTypeFacade​(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade)  
      protected void submitFilter​(org.zkoss.zk.ui.event.Event event)
      Submits a new search on checkbox selection.
      • 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, 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

      • SOCKET_IN_NODE_SELECTED

        public static final java.lang.String SOCKET_IN_NODE_SELECTED
        See Also:
        Constant Field Values
      • SOCKET_IN_ADVANCED_SEARCH_INIT_CONTEXT

        public static final java.lang.String SOCKET_IN_ADVANCED_SEARCH_INIT_CONTEXT
        See Also:
        Constant Field Values
      • SOCKET_OUT_OUTPUT_CONTEXT

        public static final java.lang.String SOCKET_OUT_OUTPUT_CONTEXT
        See Also:
        Constant Field Values
      • CUSTOMERSUPPORTBACKOFFICE_REFINE_BY

        public static final java.lang.String CUSTOMERSUPPORTBACKOFFICE_REFINE_BY
        See Also:
        Constant Field Values
      • GROUP_VALUES_SEPARATOR

        public static final java.lang.String GROUP_VALUES_SEPARATOR
        See Also:
        Constant Field Values
      • REFINE_BY_CONTAINER

        public static final java.lang.String REFINE_BY_CONTAINER
        See Also:
        Constant Field Values
      • CURRENT_SEARCH_SEPARATOR

        public static final java.lang.String CURRENT_SEARCH_SEPARATOR
        See Also:
        Constant Field Values
    • Constructor Detail

      • CustomerSupportRefineByController

        public CustomerSupportRefineByController()
    • Method Detail

      • onNodeSelected

        public void onNodeSelected​(com.hybris.backoffice.navigation.NavigationNode nodeSelected)
        Resets the refine by widget on NavigationNode selection.
        Parameters:
        nodeSelected - the selected NavigationNode
      • initialize

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

        public void completeAdvancedSearchInitContext​(com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchInitContext context)
        Adds refine by filters to the initial given AdvancedSearchInitContext.
        Parameters:
        context - the AdvancedSearchInitContext input
      • addConditionList

        protected void addConditionList​(com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchData searchData,
                                        java.util.Map<java.lang.String,​java.util.List<com.hybris.backoffice.widgets.advancedsearch.impl.SearchConditionData>> searchExpressions)
        Adds refine by filters conditions to the existing ones.
        Parameters:
        searchData - the original {link AdvancedSearchData}
        searchExpressions - the search expressions defined in the configuration
      • addSearchCondition

        protected void addSearchCondition​(org.zkoss.zul.Checkbox checkbox,
                                          java.util.Map<java.lang.String,​java.util.List<com.hybris.backoffice.widgets.advancedsearch.impl.SearchConditionData>> searchFieldConditions,
                                          com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchData advancedSearchData)
        Adds the search conditions associated to the selected Checkbox
        Parameters:
        checkbox - the selected Checkbox
        searchFieldConditions - the Map containing all the search conditions
        advancedSearchData - the AdvancedSearchData
      • loadDataTypeForCode

        protected com.hybris.cockpitng.dataaccess.facades.type.DataType loadDataTypeForCode​(java.lang.String typeCode)
        Loads a DataType by its code.
        Parameters:
        typeCode - the DataType.code
        Returns:
        the DataType retrieved
      • loadRefineByConfiguration

        protected RefineBy loadRefineByConfiguration​(java.lang.String typeCode)
        Loads the configuration of the refine by according to the given type.
        Parameters:
        typeCode - the DataType.code
        Returns:
        the completed RefineBy
      • renderCheckbox

        protected void renderCheckbox​(java.lang.String searchFieldName,
                                      java.util.ArrayList searchFieldPossibleValues,
                                      java.lang.String typeCode,
                                      SearchValue searchFieldValue,
                                      org.zkoss.zul.Div searchFieldDiv)
        Render a checkbox with her associated hidden Label which contains the search value.
        Parameters:
        searchFieldName - the name of the field to search on
        searchFieldPossibleValues - the list of search expressions to search
        typeCode - the DataType.code
        searchFieldValue - the value of the field to search
        searchFieldDiv - the Div to which the checkbox will be added
      • renderRefineByFromConfig

        protected void renderRefineByFromConfig​(java.lang.String typeCode)
        Renders the filters based on customersupportbackoffice-refine-by configuration.
        Parameters:
        typeCode - the DataType.code
      • resetWidget

        protected void resetWidget()
        Resets the content of the filter container.
      • submitFilter

        protected void submitFilter​(org.zkoss.zk.ui.event.Event event)
        Submits a new search on checkbox selection.
        Parameters:
        event - the click event on one of the checkboxes
      • getRefineByConfig

        protected RefineBy getRefineByConfig()
      • setRefineByConfig

        public void setRefineByConfig​(RefineBy refineByConfig)
      • getCustomerSupportFilterContainer

        protected org.zkoss.zul.Div getCustomerSupportFilterContainer()
      • setCustomerSupportFilterContainer

        public void setCustomerSupportFilterContainer​(org.zkoss.zul.Div customersupportFilterContainer)
      • getEmptyFilters

        protected org.zkoss.zul.Label getEmptyFilters()
      • setEmptyFilters

        public void setEmptyFilters​(org.zkoss.zul.Label emptyFilters)
      • getTypeFacade

        protected com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade()
      • setTypeFacade

        public void setTypeFacade​(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade)
      • setFlexibleSearchService

        public void setFlexibleSearchService​(FlexibleSearchService flexibleSearchService)
      • setEnumerationService

        public void setEnumerationService​(EnumerationService enumerationService)