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 boolean
addSortableProperty(PropertyDescriptor sortProp)
UIEditor
getEditor(SearchField searchField)
Returns theeditor
for a specificsearch field
.protected EditorFactory
getEditorFactory()
java.lang.String
getEditorMode(SearchField searchField, PropertyDescriptor propDescr)
java.util.List<SearchField>
getHiddenSearchFields()
Returns all the available hidden search fields.AdvancedSearchParameterContainer
getParameterContainer()
java.util.Map<java.lang.String,java.lang.String>
getParametersForSearchField(SearchField searchField)
PropertyDescriptor
getPropertyDescriptor(SearchField field)
SearchFieldGroup
getRootSearchFieldGroup()
Returns the rootsearch field group
.protected SearchType
getRootSearchType(PropertyDescriptor propDescr)
SearchField
getSearchField(PropertyDescriptor descriptor)
java.util.List<SearchField>
getSearchFields()
Returns all the available search fields.ObjectTemplate
getSelectedType()
Returns the currently selected type i.e.java.util.List<PropertyDescriptor>
getSortableProperties()
Returns all the properties which can currently be used for sorting.PropertyDescriptor
getSortedByProperty()
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 TypeService
getTypeService()
java.util.List<SearchField>
getVisibleSearchFields()
Returns all the available visible search fields.protected boolean
hideFieldDirectly(SearchField field)
protected boolean
hideGroupDirectly(SearchFieldGroup group)
boolean
hideSearchField(SearchField field)
boolean
hideSearchFieldGroup(SearchFieldGroup group)
boolean
isExcludeRootType()
boolean
isIncludeSubTypes()
boolean
isIncludeSubTypesForRelatedTypes()
boolean
isSortAscending()
Returns whether search result is sorted ascending or not.boolean
removeSortableProperty(PropertyDescriptor sortProp)
void
resetToInitialSearchParameters()
Method cleans search fields and sets type as rootTypevoid
setExcludeRootType(boolean excludeRootType)
void
setIncludeSubTypes(boolean includeSubTypes)
void
setIncludeSubTypesForRelatedTypes(boolean includeSubTypesForRelatedTypes)
void
setParameterContainer(AdvancedSearchParameterContainer paramContainer)
void
setSelectedType(ObjectTemplate type)
void
setSortableProperties(java.util.List<PropertyDescriptor> sortProps)
void
setSortAscending(boolean asc)
void
setSortCriterion(PropertyDescriptor sortProperty, boolean asc)
void
setSortedByProperty(PropertyDescriptor sortProperty)
void
setTypes(java.util.Collection<ObjectTemplate> types)
void
setVisibleSearchFieldGroups(java.util.List<SearchFieldGroup> groups)
void
setVisibleSearchFields(java.util.List<SearchField> searchFields)
protected boolean
showFieldDirectly(SearchField field)
protected boolean
showGroupDirectly(SearchFieldGroup group)
boolean
showSearchField(SearchField field)
boolean
showSearchFieldGroup(SearchFieldGroup group)
protected void
storeAdvancedSearchConfiguration()
-
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:AdvancedSearchModel
Returns theeditor
for 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:AdvancedSearchModel
Returns 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:AdvancedSearchModel
Returns the rootsearch field group
.- Returns:
- the root group containing
search fields
and other groups in a hierarchical structure.
-
getSearchFields
public java.util.List<SearchField> getSearchFields()
Description copied from interface:AdvancedSearchModel
Returns 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:AdvancedSearchModel
Returns 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:AdvancedSearchModel
Returns 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:AdvancedSearchModel
Returns 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:AdvancedSearchModel
Returns 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:AdvancedSearchModel
Returns 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:AdvancedSearchModel
Returns whether search result is sorted ascending or not.- Returns:
true
if ascending,false
if 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()
-
-