Class FullTextSearchController
- 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
-
- com.hybris.backoffice.widgets.advancedsearch.AbstractSearchController
-
- com.hybris.backoffice.widgets.fulltextsearch.FullTextSearchController
-
- All Implemented Interfaces:
WidgetController,WidgetDragAndDropAware,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 FullTextSearchController extends AbstractSearchController
Widget controller of thefull text searchwidget.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_CONTEXT_STRATEGYprotected static java.lang.BooleanDEFAULT_VALUE_FIELD_QUERY_ENABLEDprotected static java.lang.StringDEFAULT_VALUE_FULLTEXT_SEARCH_CONFIG_CTX_CODEstatic java.lang.StringEVENT_ON_APPLY_FILTERSprotected static java.lang.StringFIELD_QUERY_POPUPprotected static java.lang.StringMODEL_DATA_TYPEprotected static java.lang.StringMODEL_FIELD_QUERIESstatic java.lang.StringMODEL_FIELD_QUERY_POPUP_FILTERSprotected static java.lang.StringMODEL_FILTERS_COUNTERprotected static java.lang.StringMODEL_KEY_FULLTEXTSEARCH_IS_EXPANDEDprotected static java.lang.StringMODEL_KEY_MOUSE_OVER_SEARCH_BUTTONprotected static java.lang.StringMODEL_KEY_SELECTED_FACETSprotected static java.lang.StringMODEL_KEY_SELECTED_TYPEstatic java.lang.StringMODEL_PREFERRED_STRATEGYstatic java.lang.StringNOTIFICATION_EVENT_TYPE_FILTER_INVALIDprotected static java.lang.StringSELECTED_FACETSDeprecated, for removal: This API element is subject to removal in a future version.since 6.7 - not used anymoreprotected static java.lang.StringSETTING_FIELD_QUERY_ENABLEDprotected static java.lang.StringSETTING_FULLTEXT_SEARCH_CONFIG_CTX_CODEprotected static java.lang.StringSETTING_PREFERRED_SEARCH_STRATEGYstatic java.lang.StringSOCKET_IN_AUTO_SUGGESTIONSstatic java.lang.StringSOCKET_IN_CLEARstatic java.lang.StringSOCKET_IN_FULL_TEXT_SEARCH_DATAstatic java.lang.StringSOCKET_IN_INIT_CONTEXTstatic java.lang.StringSOCKET_IN_RESETstatic java.lang.StringSOCKET_IN_TYPEstatic java.lang.StringSOCKET_OUT_SEARCH_CONTEXT_CHANGED-
Fields inherited from class com.hybris.backoffice.widgets.advancedsearch.AbstractSearchController
MODEL_INIT_CONTEXT, MODEL_INITIALIZED_FROM_INIT_CTX, permissionFacade, SEARCH_MODEL, searchBox, SETTING_ACTION_SLOT_COMPONENT_CTX, SETTING_ADVANCED_SEARCH_CONFIG_CTX_CODE, SETTING_DISABLE_AUTO_SEARCH, SETTING_MIN_AUTO_SUGGESTIONS_QUERY_LENGTH, SETTING_SIMPLE_SEARCH_CONFIG_CTX_CODE, SIMPLE_SEARCH_MODE_ACTIVE, SIMPLE_SEARCH_TEXT_QUERY, SOCKET_OUT_AUTO_SUGGESTION_DATA, SOCKET_OUT_SEARCH_DATA, typeFacade
-
-
Constructor Summary
Constructors Constructor Description FullTextSearchController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjustFieldQuery()protected voidadjustWidgetModel(AdvancedSearch advancedSearch, AdvancedSearchData searchData, boolean rootTypeChanged, DataType dataType)protected voidapplyFilters(AdvancedSearchData queryData)protected java.util.List<SearchConditionData>buildSearchConditionData(java.util.Map<java.lang.String,FullTextSearchFilter> filters)protected booleancanProcessFilterChangeEvent(org.zkoss.zk.ui.event.Event event)voidchangeSearchContext(java.lang.String strategy)voidchangeType(java.lang.String typeCode)voidclear()protected voidclearAppliedFilters()protected voidclearLocalizedValues(java.lang.Object value, java.util.Locale locale)protected AdvancedSearchDatacreateAdvancedSearchDataWithInitContext()Creates a new instance ofAdvancedSearchData.protected booleandoSearch()protected booleandoSimpleSearch()protected voidextractAndRememberSelectedFacets(java.util.Collection<FacetData> allFacets)org.zkoss.zul.ButtongetClearButton()protected DataTypegetCurrentDataType()protected org.zkoss.zul.ButtongetFieldQueryButton()protected org.zkoss.zul.LabelgetFieldQueryFiltersCounterLabel()protected org.zkoss.zul.PopupgetFieldQueryPopup()protected WidgetComponentRenderer<org.zkoss.zul.Popup,FulltextSearch,AdvancedSearchData>getFieldQueryPopupRenderer()protected org.zkoss.zul.DivgetFullTextSearchBox()protected org.zkoss.zul.DivgetFullTextSearchContainer()protected java.util.Set<FullTextSearchFilter>getInvalidFilters(java.lang.String typeCode)protected NotificationServicegetNotificationService()protected java.lang.StringgetPreferredSearchStrategy()protected org.zkoss.zul.ButtongetSearchButton()protected SearchFilterValidationStrategygetSearchFilterValidationStrategy(java.lang.String typeCode)protected SearchFilterValidationStrategyRegistrygetSearchFilterValidationStrategyRegistry()protected voidhandleInvalidFilters(java.util.Collection<FullTextSearchFilter> invalidFilters)protected ValueComparisonOperatorhandlePreferredGlobalOperator(AdvancedSearchData searchData)protected voidhandlePreferredSearchStrategy(AdvancedSearchData searchData)voidinitialize(org.zkoss.zk.ui.Component comp)Override this method to do initialization stuff for your widget, like initialize widget settings, restore view state from viewmodel, etc.protected voidinitializeFieldQueryComponents()protected voidinitializeFieldQueryFiltersCounterLabel()voidinitializeWithContext(AdvancedSearchInitContext initContext)protected booleanisFieldQueryEnabled()protected FulltextSearchloadFullTextConfiguration(java.lang.String type)voidonApplyFilters(org.zkoss.zk.ui.event.Event event)voidonAutoSuggestions(java.util.Map<java.lang.String,java.util.Collection> autoSuggestions)protected voidonClearButtonClick(org.zkoss.zk.ui.event.Event event)voidonFullTextSearchData(FullTextSearchData fullTextSearchData)protected voidonSearchBoxBlur(org.zkoss.zk.ui.event.Event event)protected booleanonSearchBoxOk(org.zkoss.zk.ui.event.Event event)protected voidonSearchBoxValueChange(org.zkoss.zk.ui.event.Event event)protected voidonSearchButtonClick(org.zkoss.zk.ui.event.Event event)protected voidonSearchButtonMouseOut(org.zkoss.zk.ui.event.Event event)protected voidonSearchButtonMouseOver(org.zkoss.zk.ui.event.Event event)voidreset()protected voidsaveFiltersCounterInModel(org.zkoss.zk.ui.event.Event event)protected voidsaveFiltersCounterModelValue(int numberOfFilters)voidsetClearButton(org.zkoss.zul.Button clearButton)voidsetFieldQueryButton(org.zkoss.zul.Button fieldQueryButton)voidsetFieldQueryFiltersCounterLabel(org.zkoss.zul.Label fieldQueryFiltersCounterLabel)voidsetFieldQueryPopup(org.zkoss.zul.Popup fieldQueryPopup)voidsetFieldQueryPopupRenderer(WidgetComponentRenderer<org.zkoss.zul.Popup,FulltextSearch,AdvancedSearchData> fieldQueryPopupRenderer)protected voidsetFiltersCounterLabelValue(int numberOfFilters)voidsetFullTextSearchBox(org.zkoss.zul.Div fullTextSearchBox)voidsetFullTextSearchContainer(org.zkoss.zul.Div fullTextSearchContainer)voidsetNotificationService(NotificationService notificationService)protected voidsetPreferredSearchStrategy(java.lang.String strategy)voidsetSearchButton(org.zkoss.zul.Button searchButton)voidsetSearchFilterValidationStrategyRegistry(SearchFilterValidationStrategyRegistry searchFilterValidationStrategyRegistry)protected voidupdateFilterCounter(java.util.Map<java.lang.String,FullTextSearchFilter> filters)protected voidupdateFiltersCounterLabel(org.zkoss.zk.ui.event.Event event)-
Methods inherited from class com.hybris.backoffice.widgets.advancedsearch.AbstractSearchController
applySimpleSearchConfiguration, buildQueryData, canReadType, clearSearchBoxAndRelatedViews, createListenerForBandPopup, getActionSlot, getAutosuggestionBandpopup, getAutosuggestionListbox, getCompleteSuggestion, getPermissionFacade, getSearchText, getTypeFacade, initAutoSuggestionAndAutoCorrectionComponents, isApplicableForSimpleSearch, isSearchBoxOrRelatedViewsNull, isSimpleSearchActive, loadConfiguration, loadConfiguration, loadDataTypeForCode, loadSimpleConfiguration, openSearchBoxWithBandPopup, populateAutoSuggestions, processAutoSuggestions, processFullTextSearchData, requestAutoSuggestions, setActionSlot, setActionSlotTypeCode, setAutosuggestionBandpopup, setAutosuggestionListbox, setPermissionFacade, setTypeFacade, shouldPopulateAutoSuggestions
-
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_INIT_CONTEXT
public static final java.lang.String SOCKET_IN_INIT_CONTEXT
- See Also:
- Constant Field Values
-
SOCKET_IN_FULL_TEXT_SEARCH_DATA
public static final java.lang.String SOCKET_IN_FULL_TEXT_SEARCH_DATA
- See Also:
- Constant Field Values
-
SOCKET_IN_TYPE
public static final java.lang.String SOCKET_IN_TYPE
- See Also:
- Constant Field Values
-
SOCKET_IN_AUTO_SUGGESTIONS
public static final java.lang.String SOCKET_IN_AUTO_SUGGESTIONS
- See Also:
- Constant Field Values
-
SOCKET_IN_RESET
public static final java.lang.String SOCKET_IN_RESET
- See Also:
- Constant Field Values
-
SOCKET_IN_CLEAR
public static final java.lang.String SOCKET_IN_CLEAR
- See Also:
- Constant Field Values
-
SOCKET_OUT_SEARCH_CONTEXT_CHANGED
public static final java.lang.String SOCKET_OUT_SEARCH_CONTEXT_CHANGED
- See Also:
- Constant Field Values
-
MODEL_PREFERRED_STRATEGY
public static final java.lang.String MODEL_PREFERRED_STRATEGY
- See Also:
- Constant Field Values
-
CONFIG_CONTEXT_STRATEGY
public static final java.lang.String CONFIG_CONTEXT_STRATEGY
- See Also:
- Constant Field Values
-
MODEL_FIELD_QUERY_POPUP_FILTERS
public static final java.lang.String MODEL_FIELD_QUERY_POPUP_FILTERS
- See Also:
- Constant Field Values
-
EVENT_ON_APPLY_FILTERS
public static final java.lang.String EVENT_ON_APPLY_FILTERS
- See Also:
- Constant Field Values
-
NOTIFICATION_EVENT_TYPE_FILTER_INVALID
public static final java.lang.String NOTIFICATION_EVENT_TYPE_FILTER_INVALID
- See Also:
- Constant Field Values
-
MODEL_KEY_FULLTEXTSEARCH_IS_EXPANDED
protected static final java.lang.String MODEL_KEY_FULLTEXTSEARCH_IS_EXPANDED
- See Also:
- Constant Field Values
-
MODEL_KEY_MOUSE_OVER_SEARCH_BUTTON
protected static final java.lang.String MODEL_KEY_MOUSE_OVER_SEARCH_BUTTON
- See Also:
- Constant Field Values
-
MODEL_DATA_TYPE
protected static final java.lang.String MODEL_DATA_TYPE
- See Also:
- Constant Field Values
-
MODEL_KEY_SELECTED_TYPE
protected static final java.lang.String MODEL_KEY_SELECTED_TYPE
- See Also:
- Constant Field Values
-
MODEL_FILTERS_COUNTER
protected static final java.lang.String MODEL_FILTERS_COUNTER
- See Also:
- Constant Field Values
-
FIELD_QUERY_POPUP
protected static final java.lang.String FIELD_QUERY_POPUP
- See Also:
- Constant Field Values
-
MODEL_FIELD_QUERIES
protected static final java.lang.String MODEL_FIELD_QUERIES
- See Also:
- Constant Field Values
-
SETTING_FULLTEXT_SEARCH_CONFIG_CTX_CODE
protected static final java.lang.String SETTING_FULLTEXT_SEARCH_CONFIG_CTX_CODE
- See Also:
- Constant Field Values
-
DEFAULT_VALUE_FULLTEXT_SEARCH_CONFIG_CTX_CODE
protected static final java.lang.String DEFAULT_VALUE_FULLTEXT_SEARCH_CONFIG_CTX_CODE
- See Also:
- Constant Field Values
-
SETTING_FIELD_QUERY_ENABLED
protected static final java.lang.String SETTING_FIELD_QUERY_ENABLED
- See Also:
- Constant Field Values
-
SETTING_PREFERRED_SEARCH_STRATEGY
protected static final java.lang.String SETTING_PREFERRED_SEARCH_STRATEGY
- See Also:
- Constant Field Values
-
DEFAULT_VALUE_FIELD_QUERY_ENABLED
protected static final java.lang.Boolean DEFAULT_VALUE_FIELD_QUERY_ENABLED
-
SELECTED_FACETS
@Deprecated(since="6.7", forRemoval=true) protected static final java.lang.String SELECTED_FACETSDeprecated, for removal: This API element is subject to removal in a future version.since 6.7 - not used anymore- See Also:
- Constant Field Values
-
MODEL_KEY_SELECTED_FACETS
protected static final java.lang.String MODEL_KEY_SELECTED_FACETS
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(org.zkoss.zk.ui.Component comp)
Description copied from class:DefaultWidgetControllerOverride this method to do initialization stuff for your widget, like initialize widget settings, restore view state from viewmodel, etc. This method will be invoked byDefaultWidgetController.doAfterCompose(Component)everytime your widget view is created. SeeGenericForwardComposer.doAfterCompose(Component)for more details.- Overrides:
initializein classDefaultWidgetController
-
onApplyFilters
public void onApplyFilters(org.zkoss.zk.ui.event.Event event)
-
clearAppliedFilters
protected void clearAppliedFilters()
-
updateFilterCounter
protected void updateFilterCounter(java.util.Map<java.lang.String,FullTextSearchFilter> filters)
-
setFiltersCounterLabelValue
protected void setFiltersCounterLabelValue(int numberOfFilters)
-
saveFiltersCounterModelValue
protected void saveFiltersCounterModelValue(int numberOfFilters)
-
buildSearchConditionData
protected java.util.List<SearchConditionData> buildSearchConditionData(java.util.Map<java.lang.String,FullTextSearchFilter> filters)
-
clearLocalizedValues
protected void clearLocalizedValues(java.lang.Object value, java.util.Locale locale)
-
isFieldQueryEnabled
protected boolean isFieldQueryEnabled()
-
initializeFieldQueryComponents
protected void initializeFieldQueryComponents()
-
changeSearchContext
public void changeSearchContext(java.lang.String strategy)
-
getPreferredSearchStrategy
protected java.lang.String getPreferredSearchStrategy()
-
setPreferredSearchStrategy
protected void setPreferredSearchStrategy(java.lang.String strategy)
-
initializeWithContext
public void initializeWithContext(AdvancedSearchInitContext initContext)
-
handlePreferredSearchStrategy
protected void handlePreferredSearchStrategy(AdvancedSearchData searchData)
-
initializeFieldQueryFiltersCounterLabel
protected void initializeFieldQueryFiltersCounterLabel()
-
adjustFieldQuery
protected void adjustFieldQuery()
-
loadFullTextConfiguration
protected FulltextSearch loadFullTextConfiguration(java.lang.String type)
-
onFullTextSearchData
public void onFullTextSearchData(FullTextSearchData fullTextSearchData)
-
changeType
public void changeType(java.lang.String typeCode)
-
onAutoSuggestions
public void onAutoSuggestions(java.util.Map<java.lang.String,java.util.Collection> autoSuggestions)
-
reset
public void reset()
-
clear
public void clear()
-
updateFiltersCounterLabel
protected void updateFiltersCounterLabel(org.zkoss.zk.ui.event.Event event)
-
saveFiltersCounterInModel
protected void saveFiltersCounterInModel(org.zkoss.zk.ui.event.Event event)
-
canProcessFilterChangeEvent
protected boolean canProcessFilterChangeEvent(org.zkoss.zk.ui.event.Event event)
-
onSearchButtonMouseOut
protected void onSearchButtonMouseOut(org.zkoss.zk.ui.event.Event event)
-
onSearchButtonMouseOver
protected void onSearchButtonMouseOver(org.zkoss.zk.ui.event.Event event)
-
onClearButtonClick
protected void onClearButtonClick(org.zkoss.zk.ui.event.Event event)
-
onSearchBoxValueChange
protected void onSearchBoxValueChange(org.zkoss.zk.ui.event.Event event)
-
onSearchBoxOk
protected boolean onSearchBoxOk(org.zkoss.zk.ui.event.Event event)
-
onSearchBoxBlur
protected void onSearchBoxBlur(org.zkoss.zk.ui.event.Event event)
-
onSearchButtonClick
protected void onSearchButtonClick(org.zkoss.zk.ui.event.Event event)
-
doSearch
protected boolean doSearch()
-
adjustWidgetModel
protected void adjustWidgetModel(AdvancedSearch advancedSearch, AdvancedSearchData searchData, boolean rootTypeChanged, DataType dataType)
- Specified by:
adjustWidgetModelin classAbstractSearchController
-
createAdvancedSearchDataWithInitContext
protected AdvancedSearchData createAdvancedSearchDataWithInitContext()
Description copied from class:AbstractSearchControllerCreates a new instance ofAdvancedSearchData. IfAbstractSearchController.MODEL_INIT_CONTEXTin widgetModel is not null then a copy of itsAdvancedSearchInitContext.getAdvancedSearchData()is returned- Overrides:
createAdvancedSearchDataWithInitContextin classAbstractSearchController- Returns:
- the new instance of
AdvancedSearchData.
-
handlePreferredGlobalOperator
protected ValueComparisonOperator handlePreferredGlobalOperator(AdvancedSearchData searchData)
-
doSimpleSearch
protected boolean doSimpleSearch()
- Specified by:
doSimpleSearchin classAbstractSearchController
-
applyFilters
protected void applyFilters(AdvancedSearchData queryData)
-
getInvalidFilters
protected java.util.Set<FullTextSearchFilter> getInvalidFilters(java.lang.String typeCode)
-
getSearchFilterValidationStrategy
protected SearchFilterValidationStrategy getSearchFilterValidationStrategy(java.lang.String typeCode)
-
handleInvalidFilters
protected void handleInvalidFilters(java.util.Collection<FullTextSearchFilter> invalidFilters)
-
getCurrentDataType
protected DataType getCurrentDataType()
-
getFieldQueryPopupRenderer
protected WidgetComponentRenderer<org.zkoss.zul.Popup,FulltextSearch,AdvancedSearchData> getFieldQueryPopupRenderer()
-
setFieldQueryPopupRenderer
public void setFieldQueryPopupRenderer(WidgetComponentRenderer<org.zkoss.zul.Popup,FulltextSearch,AdvancedSearchData> fieldQueryPopupRenderer)
-
getSearchButton
protected org.zkoss.zul.Button getSearchButton()
-
setSearchButton
public void setSearchButton(org.zkoss.zul.Button searchButton)
-
getFieldQueryButton
protected org.zkoss.zul.Button getFieldQueryButton()
-
setFieldQueryButton
public void setFieldQueryButton(org.zkoss.zul.Button fieldQueryButton)
-
getFullTextSearchContainer
protected org.zkoss.zul.Div getFullTextSearchContainer()
-
setFullTextSearchContainer
public void setFullTextSearchContainer(org.zkoss.zul.Div fullTextSearchContainer)
-
getFullTextSearchBox
protected org.zkoss.zul.Div getFullTextSearchBox()
-
setFullTextSearchBox
public void setFullTextSearchBox(org.zkoss.zul.Div fullTextSearchBox)
-
getFieldQueryFiltersCounterLabel
protected org.zkoss.zul.Label getFieldQueryFiltersCounterLabel()
-
setFieldQueryFiltersCounterLabel
public void setFieldQueryFiltersCounterLabel(org.zkoss.zul.Label fieldQueryFiltersCounterLabel)
-
getFieldQueryPopup
protected org.zkoss.zul.Popup getFieldQueryPopup()
-
setFieldQueryPopup
public void setFieldQueryPopup(org.zkoss.zul.Popup fieldQueryPopup)
-
getClearButton
public org.zkoss.zul.Button getClearButton()
-
setClearButton
public void setClearButton(org.zkoss.zul.Button clearButton)
-
getNotificationService
protected NotificationService getNotificationService()
-
setNotificationService
public void setNotificationService(NotificationService notificationService)
-
getSearchFilterValidationStrategyRegistry
protected SearchFilterValidationStrategyRegistry getSearchFilterValidationStrategyRegistry()
-
setSearchFilterValidationStrategyRegistry
public void setSearchFilterValidationStrategyRegistry(SearchFilterValidationStrategyRegistry searchFilterValidationStrategyRegistry)
-
extractAndRememberSelectedFacets
protected void extractAndRememberSelectedFacets(java.util.Collection<FacetData> allFacets)
-
-