Class AbstractSearchController
- 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
-
- 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>
- Direct Known Subclasses:
AdvancedSearchController,FullTextSearchController
public abstract class AbstractSearchController extends DefaultWidgetController
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMODEL_INIT_CONTEXTstatic java.lang.StringMODEL_INITIALIZED_FROM_INIT_CTXprotected PermissionFacadepermissionFacadestatic java.lang.StringSEARCH_MODELprotected org.zkoss.zul.BandboxsearchBoxprotected static java.lang.StringSETTING_ACTION_SLOT_COMPONENT_CTXprotected static java.lang.StringSETTING_ADVANCED_SEARCH_CONFIG_CTX_CODEprotected static java.lang.StringSETTING_DISABLE_AUTO_SEARCHprotected static java.lang.StringSETTING_MIN_AUTO_SUGGESTIONS_QUERY_LENGTHprotected static java.lang.StringSETTING_SIMPLE_SEARCH_CONFIG_CTX_CODEprotected static java.lang.StringSIMPLE_SEARCH_MODE_ACTIVEstatic java.lang.StringSIMPLE_SEARCH_TEXT_QUERYstatic java.lang.StringSOCKET_OUT_AUTO_SUGGESTION_DATAstatic java.lang.StringSOCKET_OUT_SEARCH_DATAprotected TypeFacadetypeFacade
-
Constructor Summary
Constructors Constructor Description AbstractSearchController()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidadjustWidgetModel(AdvancedSearch advancedSearch, AdvancedSearchData searchData, boolean rootTypeChanged, DataType dataType)protected voidapplySimpleSearchConfiguration(java.lang.String searchText, java.lang.String typeCode, AdvancedSearchData queryData)protected AdvancedSearchDatabuildQueryData(java.lang.String searchText, java.lang.String typeCode)protected booleancanReadType(java.lang.String typeCode)protected voidclearSearchBoxAndRelatedViews()protected AdvancedSearchDatacreateAdvancedSearchDataWithInitContext()Creates a new instance ofAdvancedSearchData.protected voidcreateListenerForBandPopup()protected abstract booleandoSimpleSearch()protected ActionsgetActionSlot()protected org.zkoss.zul.BandpopupgetAutosuggestionBandpopup()protected org.zkoss.zul.ListboxgetAutosuggestionListbox()protected java.lang.StringgetCompleteSuggestion(java.lang.String searchedPhraseWithoutLastWord, java.lang.String suggestion)protected PermissionFacadegetPermissionFacade()protected java.lang.StringgetSearchText()protected TypeFacadegetTypeFacade()protected voidinitAutoSuggestionAndAutoCorrectionComponents()protected booleanisApplicableForSimpleSearch(java.lang.String typeCode, java.lang.String fieldName)protected booleanisSearchBoxOrRelatedViewsNull()protected booleanisSimpleSearchActive()protected <T> TloadConfiguration(ConfigContext configurationContext, java.lang.Class<T> configurationClass)protected <T> TloadConfiguration(java.lang.String type, java.lang.String configurationContextCode, java.lang.Class<T> configurationClass)protected DataTypeloadDataTypeForCode(java.lang.String typeCode)protected SimpleSearchloadSimpleConfiguration(java.lang.String type)protected voidopenSearchBoxWithBandPopup()protected voidpopulateAutoSuggestions(java.lang.String query)protected voidprocessAutoSuggestions(java.util.Map<java.lang.String,java.util.Collection> autoSuggestions)protected voidprocessFullTextSearchData(FullTextSearchData fullTextSearchData)voidrequestAutoSuggestions()protected voidsetActionSlot(Actions actionSlot)protected voidsetActionSlotTypeCode(java.lang.String typeCode)protected voidsetAutosuggestionBandpopup(org.zkoss.zul.Bandpopup autosuggestionBandpopup)protected voidsetAutosuggestionListbox(org.zkoss.zul.Listbox autosuggestionListbox)voidsetPermissionFacade(PermissionFacade permissionFacade)voidsetTypeFacade(TypeFacade typeFacade)protected booleanshouldPopulateAutoSuggestions(java.lang.String query)-
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, initialize, 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
-
SEARCH_MODEL
public static final java.lang.String SEARCH_MODEL
- See Also:
- Constant Field Values
-
MODEL_INIT_CONTEXT
public static final java.lang.String MODEL_INIT_CONTEXT
- See Also:
- Constant Field Values
-
SIMPLE_SEARCH_TEXT_QUERY
public static final java.lang.String SIMPLE_SEARCH_TEXT_QUERY
- See Also:
- Constant Field Values
-
MODEL_INITIALIZED_FROM_INIT_CTX
public static final java.lang.String MODEL_INITIALIZED_FROM_INIT_CTX
- See Also:
- Constant Field Values
-
SOCKET_OUT_AUTO_SUGGESTION_DATA
public static final java.lang.String SOCKET_OUT_AUTO_SUGGESTION_DATA
- See Also:
- Constant Field Values
-
SOCKET_OUT_SEARCH_DATA
public static final java.lang.String SOCKET_OUT_SEARCH_DATA
- See Also:
- Constant Field Values
-
SETTING_DISABLE_AUTO_SEARCH
protected static final java.lang.String SETTING_DISABLE_AUTO_SEARCH
- See Also:
- Constant Field Values
-
SETTING_SIMPLE_SEARCH_CONFIG_CTX_CODE
protected static final java.lang.String SETTING_SIMPLE_SEARCH_CONFIG_CTX_CODE
- See Also:
- Constant Field Values
-
SIMPLE_SEARCH_MODE_ACTIVE
protected static final java.lang.String SIMPLE_SEARCH_MODE_ACTIVE
- See Also:
- Constant Field Values
-
SETTING_ACTION_SLOT_COMPONENT_CTX
protected static final java.lang.String SETTING_ACTION_SLOT_COMPONENT_CTX
- See Also:
- Constant Field Values
-
SETTING_ADVANCED_SEARCH_CONFIG_CTX_CODE
protected static final java.lang.String SETTING_ADVANCED_SEARCH_CONFIG_CTX_CODE
- See Also:
- Constant Field Values
-
SETTING_MIN_AUTO_SUGGESTIONS_QUERY_LENGTH
protected static final java.lang.String SETTING_MIN_AUTO_SUGGESTIONS_QUERY_LENGTH
- See Also:
- Constant Field Values
-
typeFacade
protected transient TypeFacade typeFacade
-
permissionFacade
protected transient PermissionFacade permissionFacade
-
searchBox
protected org.zkoss.zul.Bandbox searchBox
-
-
Method Detail
-
requestAutoSuggestions
public void requestAutoSuggestions()
-
shouldPopulateAutoSuggestions
protected boolean shouldPopulateAutoSuggestions(java.lang.String query)
-
populateAutoSuggestions
protected void populateAutoSuggestions(java.lang.String query)
-
initAutoSuggestionAndAutoCorrectionComponents
protected void initAutoSuggestionAndAutoCorrectionComponents()
-
getAutosuggestionBandpopup
protected org.zkoss.zul.Bandpopup getAutosuggestionBandpopup()
-
setAutosuggestionBandpopup
protected void setAutosuggestionBandpopup(org.zkoss.zul.Bandpopup autosuggestionBandpopup)
-
getAutosuggestionListbox
protected org.zkoss.zul.Listbox getAutosuggestionListbox()
-
setAutosuggestionListbox
protected void setAutosuggestionListbox(org.zkoss.zul.Listbox autosuggestionListbox)
-
processAutoSuggestions
protected void processAutoSuggestions(java.util.Map<java.lang.String,java.util.Collection> autoSuggestions)
-
canReadType
protected boolean canReadType(java.lang.String typeCode)
-
isSearchBoxOrRelatedViewsNull
protected boolean isSearchBoxOrRelatedViewsNull()
-
clearSearchBoxAndRelatedViews
protected void clearSearchBoxAndRelatedViews()
-
getCompleteSuggestion
protected java.lang.String getCompleteSuggestion(java.lang.String searchedPhraseWithoutLastWord, java.lang.String suggestion)
-
createListenerForBandPopup
protected void createListenerForBandPopup()
-
openSearchBoxWithBandPopup
protected void openSearchBoxWithBandPopup()
-
loadDataTypeForCode
protected DataType loadDataTypeForCode(java.lang.String typeCode)
-
processFullTextSearchData
protected void processFullTextSearchData(FullTextSearchData fullTextSearchData)
-
setActionSlotTypeCode
protected void setActionSlotTypeCode(java.lang.String typeCode)
-
adjustWidgetModel
protected abstract void adjustWidgetModel(AdvancedSearch advancedSearch, AdvancedSearchData searchData, boolean rootTypeChanged, DataType dataType)
-
doSimpleSearch
protected abstract boolean doSimpleSearch()
-
getSearchText
protected java.lang.String getSearchText()
-
isSimpleSearchActive
protected boolean isSimpleSearchActive()
-
buildQueryData
protected AdvancedSearchData buildQueryData(java.lang.String searchText, java.lang.String typeCode)
-
applySimpleSearchConfiguration
protected void applySimpleSearchConfiguration(java.lang.String searchText, java.lang.String typeCode, AdvancedSearchData queryData)
-
isApplicableForSimpleSearch
protected boolean isApplicableForSimpleSearch(java.lang.String typeCode, java.lang.String fieldName)
-
loadSimpleConfiguration
protected SimpleSearch loadSimpleConfiguration(java.lang.String type)
-
createAdvancedSearchDataWithInitContext
protected AdvancedSearchData createAdvancedSearchDataWithInitContext()
Creates a new instance ofAdvancedSearchData. IfMODEL_INIT_CONTEXTin widgetModel is not null then a copy of itsAdvancedSearchInitContext.getAdvancedSearchData()is returned- Returns:
- the new instance of
AdvancedSearchData.
-
loadConfiguration
protected <T> T loadConfiguration(java.lang.String type, java.lang.String configurationContextCode, java.lang.Class<T> configurationClass)
-
loadConfiguration
protected <T> T loadConfiguration(ConfigContext configurationContext, java.lang.Class<T> configurationClass)
-
getActionSlot
protected Actions getActionSlot()
-
setActionSlot
protected void setActionSlot(Actions actionSlot)
-
getTypeFacade
protected TypeFacade getTypeFacade()
-
setTypeFacade
public void setTypeFacade(TypeFacade typeFacade)
-
getPermissionFacade
protected PermissionFacade getPermissionFacade()
-
setPermissionFacade
public void setPermissionFacade(PermissionFacade permissionFacade)
-
-