Class CustomerSupportRefineByController
- 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.omsbackoffice.widgets.customersupportrefineby.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.DefaultWidgetControllerController allowing to filter a collection browser based combine with advanced search logic.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTEXTstatic java.lang.StringCURRENT_SEARCHstatic java.lang.StringCURRENT_SEARCH_SEPARATORstatic java.lang.StringCUSTOMERSUPPORTBACKOFFICE_REFINE_BYstatic java.lang.StringGET_NAMEstatic java.lang.StringGROUP_VALUES_SEPARATORstatic java.lang.StringREFINE_BY_CONTAINERstatic java.lang.StringSOCKET_IN_ADVANCED_SEARCH_INIT_CONTEXTstatic java.lang.StringSOCKET_IN_NODE_SELECTEDstatic java.lang.StringSOCKET_OUT_OUTPUT_CONTEXTstatic java.lang.StringTYPE_CODE
-
Constructor Summary
Constructors Constructor Description CustomerSupportRefineByController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddConditionList(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 voidaddSearchCondition(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 selectedCheckboxprotected FlexibleSearchQuerybuildSearchQuery(java.lang.String typeCode, java.lang.String searchValue)Builds aFlexibleSearchQueryvoidcompleteAdvancedSearchInitContext(com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchInitContext context)Adds refine by filters to the initial givenAdvancedSearchInitContext.protected org.zkoss.zul.DivgetCustomerSupportFilterContainer()protected org.zkoss.zul.LabelgetEmptyFilters()protected EnumerationServicegetEnumerationService()protected FlexibleSearchServicegetFlexibleSearchService()protected RefineBygetRefineByConfig()protected com.hybris.cockpitng.dataaccess.facades.type.TypeFacadegetTypeFacade()voidinitialize(org.zkoss.zk.ui.Component comp)protected com.hybris.cockpitng.dataaccess.facades.type.DataTypeloadDataTypeForCode(java.lang.String typeCode)Loads aDataTypeby its code.protected RefineByloadRefineByConfiguration(java.lang.String typeCode)Loads the configuration of the refine by according to the given type.voidonNodeSelected(com.hybris.backoffice.navigation.NavigationNode nodeSelected)Resets the refine by widget onNavigationNodeselection.protected voidrenderCheckbox(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 hiddenLabelwhich contains the search value.protected voidrenderRefineByFromConfig(java.lang.String typeCode)Renders the filters based on customersupportbackoffice-refine-by configuration.protected voidresetWidget()Resets the content of the filter container.voidsetCustomerSupportFilterContainer(org.zkoss.zul.Div customersupportFilterContainer)voidsetEmptyFilters(org.zkoss.zul.Label emptyFilters)voidsetEnumerationService(EnumerationService enumerationService)voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)voidsetRefineByConfig(RefineBy refineByConfig)voidsetTypeFacade(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade)protected voidsubmitFilter(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
-
-
-
-
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
-
GET_NAME
public static final java.lang.String GET_NAME
- 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
public static final java.lang.String CURRENT_SEARCH
- See Also:
- Constant Field Values
-
TYPE_CODE
public static final java.lang.String TYPE_CODE
- See Also:
- Constant Field Values
-
CONTEXT
public static final java.lang.String CONTEXT
- See Also:
- Constant Field Values
-
CURRENT_SEARCH_SEPARATOR
public static final java.lang.String CURRENT_SEARCH_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
onNodeSelected
public void onNodeSelected(com.hybris.backoffice.navigation.NavigationNode nodeSelected)
Resets the refine by widget onNavigationNodeselection.- Parameters:
nodeSelected- the selectedNavigationNode
-
initialize
public void initialize(org.zkoss.zk.ui.Component comp)
- Overrides:
initializein classcom.hybris.cockpitng.util.DefaultWidgetController
-
completeAdvancedSearchInitContext
public void completeAdvancedSearchInitContext(com.hybris.backoffice.widgets.advancedsearch.impl.AdvancedSearchInitContext context)
Adds refine by filters to the initial givenAdvancedSearchInitContext.- Parameters:
context- theAdvancedSearchInitContextinput
-
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 selectedCheckbox- Parameters:
checkbox- the selectedCheckboxsearchFieldConditions- theMapcontaining all the search conditionsadvancedSearchData- theAdvancedSearchData
-
buildSearchQuery
protected FlexibleSearchQuery buildSearchQuery(java.lang.String typeCode, java.lang.String searchValue)
Builds aFlexibleSearchQuery- Parameters:
typeCode- theDataType.codesearchValue- the search value- Returns:
- the created
FlexibleSearchQuery
-
loadDataTypeForCode
protected com.hybris.cockpitng.dataaccess.facades.type.DataType loadDataTypeForCode(java.lang.String typeCode)
Loads aDataTypeby its code.- Parameters:
typeCode- theDataType.code- Returns:
- the
DataTyperetrieved
-
loadRefineByConfiguration
protected RefineBy loadRefineByConfiguration(java.lang.String typeCode)
Loads the configuration of the refine by according to the given type.- Parameters:
typeCode- theDataType.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 hiddenLabelwhich contains the search value.- Parameters:
searchFieldName- the name of the field to search onsearchFieldPossibleValues- the list of search expressions to searchtypeCode- theDataType.codesearchFieldValue- the value of the field to searchsearchFieldDiv- theDivto 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- theDataType.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)
-
getFlexibleSearchService
protected FlexibleSearchService getFlexibleSearchService()
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
getEnumerationService
protected EnumerationService getEnumerationService()
-
setEnumerationService
public void setEnumerationService(EnumerationService enumerationService)
-
-