Class DefaultAdvancedSearchModel
- java.lang.Object
-
- de.hybris.platform.cockpit.model.advancedsearch.impl.AbstractAdvancedSearchModel
-
- de.hybris.platform.cockpit.model.advancedsearch.impl.DefaultAdvancedSearchModel
-
- All Implemented Interfaces:
AdvancedSearchModel
public class DefaultAdvancedSearchModel extends AbstractAdvancedSearchModel
-
-
Constructor Summary
Constructors Constructor Description DefaultAdvancedSearchModel(AdvancedSearchConfiguration config, java.lang.String configCode)DefaultAdvancedSearchModel(AdvancedSearchConfiguration config, java.lang.String configCode, AdvancedSearchParameterContainer parameterContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddSortableProperty(PropertyDescriptor sortProp)UIEditorgetEditor(SearchField searchField)Returns theeditorfor a specificsearch field.protected EditorFactorygetEditorFactory()java.lang.StringgetEditorMode(SearchField searchField, PropertyDescriptor propDescr)java.util.List<SearchField>getHiddenSearchFields()Returns all the available hidden search fields.AdvancedSearchParameterContainergetParameterContainer()java.util.Map<java.lang.String,java.lang.String>getParametersForSearchField(SearchField searchField)PropertyDescriptorgetPropertyDescriptor(SearchField field)SearchFieldGroupgetRootSearchFieldGroup()Returns the rootsearch field group.protected SearchTypegetRootSearchType(PropertyDescriptor propDescr)SearchFieldgetSearchField(PropertyDescriptor descriptor)java.util.List<SearchField>getSearchFields()Returns all the available search fields.ObjectTemplategetSelectedType()Returns the currently selected type i.e.java.util.List<PropertyDescriptor>getSortableProperties()Returns all the properties which can currently be used for sorting.PropertyDescriptorgetSortedByProperty()Returns the property by which search result should be sorted.java.util.List<ObjectTemplate>getTypes()Returns all the types supported by this advanced search.protected TypeServicegetTypeService()java.util.List<SearchField>getVisibleSearchFields()Returns all the available visible search fields.protected booleanhideFieldDirectly(SearchField field)protected booleanhideGroupDirectly(SearchFieldGroup group)booleanhideSearchField(SearchField field)booleanhideSearchFieldGroup(SearchFieldGroup group)booleanisExcludeRootType()booleanisIncludeSubTypes()booleanisIncludeSubTypesForRelatedTypes()booleanisSortAscending()Returns whether search result is sorted ascending or not.booleanremoveSortableProperty(PropertyDescriptor sortProp)voidresetToInitialSearchParameters()Method cleans search fields and sets type as rootTypevoidsetExcludeRootType(boolean excludeRootType)voidsetIncludeSubTypes(boolean includeSubTypes)voidsetIncludeSubTypesForRelatedTypes(boolean includeSubTypesForRelatedTypes)voidsetParameterContainer(AdvancedSearchParameterContainer paramContainer)voidsetSelectedType(ObjectTemplate type)voidsetSortableProperties(java.util.List<PropertyDescriptor> sortProps)voidsetSortAscending(boolean asc)voidsetSortCriterion(PropertyDescriptor sortProperty, boolean asc)voidsetSortedByProperty(PropertyDescriptor sortProperty)voidsetTypes(java.util.Collection<ObjectTemplate> types)voidsetVisibleSearchFieldGroups(java.util.List<SearchFieldGroup> groups)voidsetVisibleSearchFields(java.util.List<SearchField> searchFields)protected booleanshowFieldDirectly(SearchField field)protected booleanshowGroupDirectly(SearchFieldGroup group)booleanshowSearchField(SearchField field)booleanshowSearchFieldGroup(SearchFieldGroup group)protected voidstoreAdvancedSearchConfiguration()-
Methods inherited from class de.hybris.platform.cockpit.model.advancedsearch.impl.AbstractAdvancedSearchModel
addAdvancedSearchModelListener, fireChanged, fireSearchFieldChanged, fireSearchFieldGroupVisibilityChanged, fireSearchFieldVisibilityChanged, fireSelectedTypeChanged, fireSortSearchFieldsChanged, fireTypesChanged, removeAdvancedSearchModelListener
-
-
-
-
Constructor Detail
-
DefaultAdvancedSearchModel
public DefaultAdvancedSearchModel(AdvancedSearchConfiguration config, java.lang.String configCode)
-
DefaultAdvancedSearchModel
public DefaultAdvancedSearchModel(AdvancedSearchConfiguration config, java.lang.String configCode, AdvancedSearchParameterContainer parameterContainer)
-
-
Method Detail
-
resetToInitialSearchParameters
public void resetToInitialSearchParameters()
Method cleans search fields and sets type as rootType
-
setSelectedType
public void setSelectedType(ObjectTemplate type)
-
setTypes
public void setTypes(java.util.Collection<ObjectTemplate> types)
-
setParameterContainer
public void setParameterContainer(AdvancedSearchParameterContainer paramContainer)
-
getParameterContainer
public AdvancedSearchParameterContainer getParameterContainer()
-
setVisibleSearchFieldGroups
public void setVisibleSearchFieldGroups(java.util.List<SearchFieldGroup> groups)
-
hideSearchFieldGroup
public boolean hideSearchFieldGroup(SearchFieldGroup group)
-
hideGroupDirectly
protected boolean hideGroupDirectly(SearchFieldGroup group)
-
showSearchFieldGroup
public boolean showSearchFieldGroup(SearchFieldGroup group)
-
setVisibleSearchFields
public void setVisibleSearchFields(java.util.List<SearchField> searchFields)
-
hideSearchField
public boolean hideSearchField(SearchField field)
-
hideFieldDirectly
protected boolean hideFieldDirectly(SearchField field)
-
showSearchField
public boolean showSearchField(SearchField field)
-
setSortableProperties
public void setSortableProperties(java.util.List<PropertyDescriptor> sortProps)
-
addSortableProperty
public boolean addSortableProperty(PropertyDescriptor sortProp)
-
removeSortableProperty
public boolean removeSortableProperty(PropertyDescriptor sortProp)
-
setSortCriterion
public void setSortCriterion(PropertyDescriptor sortProperty, boolean asc)
-
setSortedByProperty
public void setSortedByProperty(PropertyDescriptor sortProperty)
-
setSortAscending
public void setSortAscending(boolean asc)
-
getEditor
public UIEditor getEditor(SearchField searchField)
Description copied from interface:AdvancedSearchModelReturns theeditorfor a specificsearch field.- Parameters:
searchField- the search field, for which the corresponding editor is to be returned- Returns:
- the editor corresponding to the specified search field
-
getEditorMode
public java.lang.String getEditorMode(SearchField searchField, PropertyDescriptor propDescr)
-
getParametersForSearchField
public java.util.Map<java.lang.String,java.lang.String> getParametersForSearchField(SearchField searchField)
- Returns:
- parameters for search field
-
getHiddenSearchFields
public java.util.List<SearchField> getHiddenSearchFields()
Description copied from interface:AdvancedSearchModelReturns all the available hidden search fields.- Returns:
- all the available search fields which are currently hidden
- See Also:
AdvancedSearchModel.getSearchFields(),AdvancedSearchModel.getVisibleSearchFields()
-
getRootSearchFieldGroup
public SearchFieldGroup getRootSearchFieldGroup()
Description copied from interface:AdvancedSearchModelReturns the rootsearch field group.- Returns:
- the root group containing
search fieldsand other groups in a hierarchical structure.
-
getSearchFields
public java.util.List<SearchField> getSearchFields()
Description copied from interface:AdvancedSearchModelReturns all the available search fields.- Returns:
- all the available search fields
- See Also:
AdvancedSearchModel.getRootSearchFieldGroup(),AdvancedSearchModel.getVisibleSearchFields(),AdvancedSearchModel.getHiddenSearchFields()
-
getSelectedType
public ObjectTemplate getSelectedType()
Description copied from interface:AdvancedSearchModelReturns the currently selected type i.e. the type of the items which are being searched for.- Returns:
- the active type
-
getSortableProperties
public java.util.List<PropertyDescriptor> getSortableProperties()
Description copied from interface:AdvancedSearchModelReturns all the properties which can currently be used for sorting.- Returns:
- all the available properties which can be used for sorting
-
getTypes
public java.util.List<ObjectTemplate> getTypes()
Description copied from interface:AdvancedSearchModelReturns all the types supported by this advanced search.- Returns:
- list containing all the available search types
-
getVisibleSearchFields
public java.util.List<SearchField> getVisibleSearchFields()
Description copied from interface:AdvancedSearchModelReturns all the available visible search fields.- Returns:
- all the available search fields which are currently visible
- See Also:
AdvancedSearchModel.getSearchFields(),AdvancedSearchModel.getHiddenSearchFields()
-
getSortedByProperty
public PropertyDescriptor getSortedByProperty()
Description copied from interface:AdvancedSearchModelReturns the property by which search result should be sorted.- Returns:
- the property to be used for sorting
-
isSortAscending
public boolean isSortAscending()
Description copied from interface:AdvancedSearchModelReturns whether search result is sorted ascending or not.- Returns:
trueif ascending,falseif descending
-
getPropertyDescriptor
public PropertyDescriptor getPropertyDescriptor(SearchField field)
-
getSearchField
public SearchField getSearchField(PropertyDescriptor descriptor)
-
showGroupDirectly
protected boolean showGroupDirectly(SearchFieldGroup group)
-
showFieldDirectly
protected boolean showFieldDirectly(SearchField field)
-
getRootSearchType
protected SearchType getRootSearchType(PropertyDescriptor propDescr)
-
setExcludeRootType
public void setExcludeRootType(boolean excludeRootType)
-
isExcludeRootType
public boolean isExcludeRootType()
-
setIncludeSubTypes
public void setIncludeSubTypes(boolean includeSubTypes)
-
isIncludeSubTypes
public boolean isIncludeSubTypes()
-
setIncludeSubTypesForRelatedTypes
public void setIncludeSubTypesForRelatedTypes(boolean includeSubTypesForRelatedTypes)
-
isIncludeSubTypesForRelatedTypes
public boolean isIncludeSubTypesForRelatedTypes()
-
storeAdvancedSearchConfiguration
protected void storeAdvancedSearchConfiguration()
-
getTypeService
protected TypeService getTypeService()
-
getEditorFactory
protected EditorFactory getEditorFactory()
-
-