Package org.ametys.cms.search.ui.model
Class ReferenceTableSearchUIModel
- java.lang.Object
-
- org.ametys.cms.search.ui.model.AbstractSearchUIModel
-
- org.ametys.cms.search.ui.model.ReferenceTableSearchUIModel
-
- All Implemented Interfaces:
SearchModel,SearchUIModel,LogEnabled,Configurable,Contextualizable,Serviceable
public class ReferenceTableSearchUIModel extends AbstractSearchUIModel implements Configurable
Generic implementation ofSearchUIModelfor reference tables The search tool model automatically declares simple first level metadatas as criteria and columns.
-
-
Field Summary
Fields Modifier and Type Field Description protected HierarchicalReferenceTablesHelper_hierarchicalReferenceTableContentsHelperThe helper component for hierarchical reference tablesprotected ThreadSafeComponentManager<SearchUIColumn>_searchColumnManagerComponentManager forSearchUIColumns.protected List<String>_searchColumnRolesThe search column roles.protected ThreadSafeComponentManager<SearchUICriterion>_searchCriteriaManagerComponentManager forSearchUICriterions.protected List<String>_searchCriteriaRolesThe search criteria roles.-
Fields inherited from class org.ametys.cms.search.ui.model.AbstractSearchUIModel
_advancedSearchCriteria, _columns, _context, _cTypeEP, _cTypes, _excludedCTypes, _facetedCriteria, _logger, _manager, _searchCriteria, _searchModelHelper
-
-
Constructor Summary
Constructors Constructor Description ReferenceTableSearchUIModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean_filterModelItemForColumn(ModelItem modelItem)Returnstrueif model item can be used as column search UIprotected boolean_filterModelItemForCriteria(ModelItem modelItem)Returnstrueif the model item can be used as criteriaprotected voidaddAttributeColumnComponent(ContentType contentType, String attributeName)Add an attribute column component to the manager.protected voidaddAttributeCriterionComponent(ContentType contentType, String attributeName, Query.Operator operator)Add an attribute criterion component to the manager.protected voidaddColumnComponents(ContentType cType)Add column components to the manager.protected voidaddCriteriaComponents(ContentType cType)Add criteria components to the manager.protected voidaddExcludeCandidateSystemCriterionComponent(ContentType cType)Add criteria component to exclude the candidatesprotected voidaddLikeTitleCriterionComponent(ContentType contentType)Add the title attribute criterion component to the manager, with a 'LIKE' operator and an hidden widgetprotected voidaddSystemColumnComponent(ContentType contentType, String property)Add a system column component to the manager.protected voidaddSystemCriterionComponent(ContentType contentType, String property)Add a system criterion component to the manager.voidconfigure(Configuration configuration)Map<String,SearchUICriterion>getAdvancedCriteria(Map<String,Object> contextualParameters)Get the list of search criteria in advanced modeprotected List<SearchUIColumn>getColumns(ContentType cType)Lookup all the columns.Map<String,SearchUICriterion>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,SearchUICriterion>getFacetedCriteria(Map<String,Object> contextualParameters)Get the list of faceted search criteria.Map<String,SearchUIColumn>getResultFields(Map<String,Object> contextualParameters)Get the column for resultsprotected List<SearchUICriterion>getSearchUICriteria(ContentType cType)Lookup all the criteria.voidservice(ServiceManager smanager)-
Methods inherited from class org.ametys.cms.search.ui.model.AbstractSearchUIModel
addContentTypesConfiguration, contextualize, getContentTypes, getCustomCriteriaConfiguration, getExportCSVUrl, getExportCSVUrlPlugin, getExportDOCUrl, getExportDOCUrlPlugin, getExportXMLUrl, getExportXMLUrlPlugin, getIndexingFieldCriteriaConfiguration, getIndexingFieldCriteriaConfiguration, getIndexingFieldCriteriaConfiguration, getLogger, getMetadataColumnConfiguration, getMetadataColumnConfiguration, getPageSize, getPrintUrl, getPrintUrlPlugin, getSearchUrl, getSearchUrlPlugin, getSummaryView, getSystemColumnConfiguration, getSystemColumnConfiguration, getSystemCriteriaConfiguration, getSystemCriteriaConfiguration, getSystemCriteriaConfiguration, getWorkspace, setAdvancedCriteria, setContentTypes, setCriteria, setExcludedContentTypes, setFacetedCriteria, setLogger, setResultFields
-
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.ui.model.SearchUIModel
allowSortOnMultipleJoin, getAdvancedCriterion, getCriterion, getFacetedCriterion, getResultField
-
-
-
-
Field Detail
-
_searchCriteriaManager
protected ThreadSafeComponentManager<SearchUICriterion> _searchCriteriaManager
ComponentManager forSearchUICriterions.
-
_searchColumnManager
protected ThreadSafeComponentManager<SearchUIColumn> _searchColumnManager
ComponentManager forSearchUIColumns.
-
_searchCriteriaRoles
protected List<String> _searchCriteriaRoles
The search criteria roles.
-
_searchColumnRoles
protected List<String> _searchColumnRoles
The search column roles.
-
_hierarchicalReferenceTableContentsHelper
protected HierarchicalReferenceTablesHelper _hierarchicalReferenceTableContentsHelper
The helper component for hierarchical reference tables
-
-
Constructor Detail
-
ReferenceTableSearchUIModel
public ReferenceTableSearchUIModel()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSearchUIModel- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getExcludedContentTypes
public Set<String> getExcludedContentTypes(Map<String,Object> contextualParameters)
Description copied from interface:SearchModelGet the list of excluded content types.- Specified by:
getExcludedContentTypesin interfaceSearchModel- Overrides:
getExcludedContentTypesin classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- The list of excluded content types.
-
getCriteria
public Map<String,SearchUICriterion> getCriteria(Map<String,Object> contextualParameters)
Description copied from interface:SearchModelGet the list of search criteria in simple mode- Specified by:
getCriteriain interfaceSearchModel- Specified by:
getCriteriain interfaceSearchUIModel- Overrides:
getCriteriain classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
getFacetedCriteria
public Map<String,SearchUICriterion> getFacetedCriteria(Map<String,Object> contextualParameters)
Description copied from interface:SearchModelGet the list of faceted search criteria.- Specified by:
getFacetedCriteriain interfaceSearchModel- Specified by:
getFacetedCriteriain interfaceSearchUIModel- Overrides:
getFacetedCriteriain classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of faceted search criteria.
-
getAdvancedCriteria
public Map<String,SearchUICriterion> getAdvancedCriteria(Map<String,Object> contextualParameters)
Description copied from interface:SearchUIModelGet the list of search criteria in advanced mode- Specified by:
getAdvancedCriteriain interfaceSearchUIModel- Overrides:
getAdvancedCriteriain classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of search criteria in advanced mode
-
getResultFields
public Map<String,SearchUIColumn> getResultFields(Map<String,Object> contextualParameters)
Description copied from interface:SearchModelGet the column for results- Specified by:
getResultFieldsin interfaceSearchModel- Specified by:
getResultFieldsin interfaceSearchUIModel- Overrides:
getResultFieldsin classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters. Can be null.- Returns:
- the column for results
-
addCriteriaComponents
protected void addCriteriaComponents(ContentType cType) throws ConfigurationException, ComponentException
Add criteria components to the manager.- Parameters:
cType- the simple content type.- Throws:
ConfigurationException- if a configuration error occurs.ComponentException- if a component cannot be initialized.
-
addExcludeCandidateSystemCriterionComponent
protected void addExcludeCandidateSystemCriterionComponent(ContentType cType)
Add criteria component to exclude the candidates- Parameters:
cType- the simple content type
-
_filterModelItemForCriteria
protected boolean _filterModelItemForCriteria(ModelItem modelItem)
Returnstrueif the model item can be used as criteria- Parameters:
modelItem- the model item- Returns:
trueif the model item can be used as criteria
-
_filterModelItemForColumn
protected boolean _filterModelItemForColumn(ModelItem modelItem)
Returnstrueif model item can be used as column search UI- Parameters:
modelItem- the model item- Returns:
trueif model item can be used as column search UI
-
addLikeTitleCriterionComponent
protected void addLikeTitleCriterionComponent(ContentType contentType) throws ConfigurationException, ComponentException
Add the title attribute criterion component to the manager, with a 'LIKE' operator and an hidden widget- Parameters:
contentType- the simple content type.- Throws:
ConfigurationException- if a configuration error occurs.ComponentException- if a component cannot be initialized.
-
addAttributeCriterionComponent
protected void addAttributeCriterionComponent(ContentType contentType, String attributeName, Query.Operator operator) throws ConfigurationException, ComponentException
Add an attribute criterion component to the manager.- Parameters:
contentType- the simple content type.attributeName- the attribute name.operator- the criterion operator.- Throws:
ConfigurationException- if a configuration error occurs.ComponentException- if a component cannot be initialized.
-
addSystemCriterionComponent
protected void addSystemCriterionComponent(ContentType contentType, String property) throws ConfigurationException, ComponentException
Add a system criterion component to the manager.- Parameters:
contentType- the simple content type.property- the system property.- Throws:
ConfigurationException- if a configuration error occurs.ComponentException- if a component cannot be initialized.
-
getSearchUICriteria
protected List<SearchUICriterion> getSearchUICriteria(ContentType cType) throws ComponentException
Lookup all the criteria.- Parameters:
cType- the simple content type.- Returns:
- the search criteria list.
- Throws:
ComponentException- if a component cannot be looked up.
-
addColumnComponents
protected void addColumnComponents(ContentType cType) throws ConfigurationException, ComponentException
Add column components to the manager.- Parameters:
cType- the simple content type.- Throws:
ConfigurationException- if a configuration error occurs.ComponentException- if a component cannot be initialized.
-
addAttributeColumnComponent
protected void addAttributeColumnComponent(ContentType contentType, String attributeName) throws ConfigurationException, ComponentException
Add an attribute column component to the manager.- Parameters:
contentType- the simple content type.attributeName- the attribute name.- Throws:
ConfigurationException- if a configuration error occurs.ComponentException- if a component cannot be initialized.
-
addSystemColumnComponent
protected void addSystemColumnComponent(ContentType contentType, String property) throws ConfigurationException, ComponentException
Add a system column component to the manager.- Parameters:
contentType- the simple content type.property- the system property.- Throws:
ConfigurationException- if a configuration error occurs.ComponentException- if a component cannot be initialized.
-
getColumns
protected List<SearchUIColumn> getColumns(ContentType cType) throws ComponentException
Lookup all the columns.- Parameters:
cType- the simple content type.- Returns:
- the search column list.
- Throws:
ComponentException- if a component cannot be looked up.
-
-