Package org.ametys.cms.search.model
Class DefaultSearchModel
- java.lang.Object
-
- org.ametys.cms.search.model.DefaultSearchModel
-
- All Implemented Interfaces:
SearchModel
public class DefaultSearchModel extends Object implements SearchModel
Default implementation of aSearchModel
.
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>
_cTypes
The content types of this search model.protected Set<String>
_excludedCTypes
The content types excluded from this search model.protected Map<String,SearchCriterion>
_facetedCriteria
The faceted search criteria, indexed by ID.protected Map<String,ResultField>
_resultFields
The simple search criteria, indexed by ID.protected Map<String,SearchCriterion>
_searchCriteria
The simple search criteria, indexed by ID.
-
Constructor Summary
Constructors Constructor Description DefaultSearchModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getContentTypes(Map<String,Object> contextualParameters)
Get the list of content types.Map<String,? extends SearchCriterion>
getCriteria(Map<String,Object> contextualParameters)
Get the list of search criteria in simple modeSet<String>
getExcludedContentTypes(Map<String,Object> contextualParameters)
Get the list of excluded content types.Map<String,? extends SearchCriterion>
getFacetedCriteria(Map<String,Object> contextualParameters)
Get the list of faceted search criteria.Map<String,? extends ResultField>
getResultFields(Map<String,Object> contextualParameters)
Get the column for resultsvoid
setContentTypes(Set<String> cTypes)
Set the content types of the modelsvoid
setCriteria(Collection<? extends SearchCriterion> criteria)
Set the criteriavoid
setExcludedContentTypes(Set<String> cTypes)
Set the content types to excludevoid
setFacetedCriteria(Collection<? extends SearchCriterion> criteria)
Set the faceted criteriavoid
setResultFields(Collection<? extends ResultField> fields)
Set the result fields-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.cms.search.model.SearchModel
getCriterion, getFacetedCriterion, getResultField
-
-
-
-
Field Detail
-
_excludedCTypes
protected Set<String> _excludedCTypes
The content types excluded from this search model.
-
_searchCriteria
protected Map<String,SearchCriterion> _searchCriteria
The simple search criteria, indexed by ID.
-
_facetedCriteria
protected Map<String,SearchCriterion> _facetedCriteria
The faceted search criteria, indexed by ID.
-
_resultFields
protected Map<String,ResultField> _resultFields
The simple search criteria, indexed by ID.
-
-
Constructor Detail
-
DefaultSearchModel
public DefaultSearchModel()
-
-
Method Detail
-
getContentTypes
public Set<String> getContentTypes(Map<String,Object> contextualParameters)
Description copied from interface:SearchModel
Get the list of content types.- Specified by:
getContentTypes
in interfaceSearchModel
- Parameters:
contextualParameters
- the contextual parameters.- Returns:
- The list of content types.
-
setContentTypes
public void setContentTypes(Set<String> cTypes)
Set the content types of the models- Parameters:
cTypes
- The content types.
-
getExcludedContentTypes
public Set<String> getExcludedContentTypes(Map<String,Object> contextualParameters)
Description copied from interface:SearchModel
Get the list of excluded content types.- Specified by:
getExcludedContentTypes
in interfaceSearchModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- The list of excluded content types.
-
setExcludedContentTypes
public void setExcludedContentTypes(Set<String> cTypes)
Set the content types to exclude- Parameters:
cTypes
- The content types to exclude
-
getCriteria
public Map<String,? extends SearchCriterion> getCriteria(Map<String,Object> contextualParameters)
Description copied from interface:SearchModel
Get the list of search criteria in simple mode- Specified by:
getCriteria
in interfaceSearchModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
setCriteria
public void setCriteria(Collection<? extends SearchCriterion> criteria)
Set the criteria- Parameters:
criteria
- The criterion list
-
getFacetedCriteria
public Map<String,? extends SearchCriterion> getFacetedCriteria(Map<String,Object> contextualParameters)
Description copied from interface:SearchModel
Get the list of faceted search criteria.- Specified by:
getFacetedCriteria
in interfaceSearchModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of faceted search criteria.
-
setFacetedCriteria
public void setFacetedCriteria(Collection<? extends SearchCriterion> criteria)
Set the faceted criteria- Parameters:
criteria
- The list of faceted criterion
-
getResultFields
public Map<String,? extends ResultField> getResultFields(Map<String,Object> contextualParameters)
Description copied from interface:SearchModel
Get the column for results- Specified by:
getResultFields
in interfaceSearchModel
- Parameters:
contextualParameters
- the contextual parameters. Can be null.- Returns:
- the column for results
-
setResultFields
public void setResultFields(Collection<? extends ResultField> fields)
Set the result fields- Parameters:
fields
- The list of result field
-
-