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
Generic implementation of
SearchUIModel
for reference tables
The search tool model automatically declares simple first level metadatas as criteria and columns.-
Field Summary
Modifier and TypeFieldDescriptionprotected HierarchicalReferenceTablesHelper
The helper component for hierarchical reference tablesprotected ThreadSafeComponentManager<SearchUIColumn>
ComponentManager forSearchUIColumn
s.The search column roles.protected ThreadSafeComponentManager<SearchUICriterion>
ComponentManager forSearchUICriterion
s.The 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, DEFAULT_EXPORT_CSV_URL, DEFAULT_EXPORT_DOC_URL, DEFAULT_EXPORT_XML_URL, DEFAULT_PRINT_URL, DEFAULT_SEARCH_URL, DEFAULT_URL_PLUGIN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
_filterModelItemForColumn
(ModelItem modelItem) Returnstrue
if model item can be used as column search UIprotected boolean
_filterModelItemForCriteria
(ModelItem modelItem) Returnstrue
if the model item can be used as criteriaprotected void
addAttributeColumnComponent
(ContentType contentType, String attributePath) Add an attribute column component to the manager.protected void
addAttributeCriterionComponent
(ContentType contentType, String attributePath, Query.Operator operator) Add an attribute criterion component to the manager.protected void
addColumnComponents
(ContentType cType) Add column components to the manager.protected void
addColumnComponents
(ContentType cType, ViewItemContainer viewContainer) Add column components to the manager.protected void
addCriteriaComponents
(ContentType cType) Add criteria components to the manager.protected void
addCriteriaComponents
(ContentType cType, ViewItemContainer viewContainer) Add criteria components to the manager.protected void
Add criteria component to exclude the candidatesprotected void
addLikeTitleCriterionComponent
(ContentType contentType, String attributePath) Add the title attribute criterion component to the manager, with a 'LIKE' operator and an hidden widgetprotected void
addSystemColumnComponent
(ContentType contentType, String property) Add a system column component to the manager.protected void
addSystemCriterionComponent
(ContentType contentType, String property) Add a system criterion component to the manager.void
configure
(Configuration configuration) getAdvancedCriteria
(Map<String, Object> contextualParameters) Get the list of search criteria in advanced modeprotected List<SearchUIColumn>
Lookup all the columns.getCriteria
(Map<String, Object> contextualParameters) Get the list of search criteria in simple modegetExcludedContentTypes
(Map<String, Object> contextualParameters) Get the list of excluded content types.getFacetedCriteria
(Map<String, Object> contextualParameters) Get the list of faceted search criteria.getResultFields
(Map<String, Object> contextualParameters) Get the column for resultsprotected List<SearchUICriterion>
getSearchUICriteria
(ContentType cType) Lookup all the criteria.void
service
(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 Details
-
_searchCriteriaManager
ComponentManager forSearchUICriterion
s. -
_searchColumnManager
ComponentManager forSearchUIColumn
s. -
_searchCriteriaRoles
The search criteria roles. -
_searchColumnRoles
The search column roles. -
_hierarchicalReferenceTableContentsHelper
The helper component for hierarchical reference tables
-
-
Constructor Details
-
ReferenceTableSearchUIModel
public ReferenceTableSearchUIModel()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSearchUIModel
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getExcludedContentTypes
Description copied from interface:SearchModel
Get the list of excluded content types.- Specified by:
getExcludedContentTypes
in interfaceSearchModel
- Overrides:
getExcludedContentTypes
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- The list of excluded content types.
-
getCriteria
Description copied from interface:SearchModel
Get the list of search criteria in simple mode- Specified by:
getCriteria
in interfaceSearchModel
- Specified by:
getCriteria
in interfaceSearchUIModel
- Overrides:
getCriteria
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
getFacetedCriteria
Description copied from interface:SearchModel
Get the list of faceted search criteria.- Specified by:
getFacetedCriteria
in interfaceSearchModel
- Specified by:
getFacetedCriteria
in interfaceSearchUIModel
- Overrides:
getFacetedCriteria
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of faceted search criteria.
-
getAdvancedCriteria
Description copied from interface:SearchUIModel
Get the list of search criteria in advanced mode- Specified by:
getAdvancedCriteria
in interfaceSearchUIModel
- Overrides:
getAdvancedCriteria
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of search criteria in advanced mode
-
getResultFields
Description copied from interface:SearchModel
Get the column for results- Specified by:
getResultFields
in interfaceSearchModel
- Specified by:
getResultFields
in interfaceSearchUIModel
- Overrides:
getResultFields
in 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.
-
addCriteriaComponents
protected void addCriteriaComponents(ContentType cType, ViewItemContainer viewContainer) throws ConfigurationException, ComponentException Add criteria components to the manager.- Parameters:
cType
- the simple content type.viewContainer
- the view item container- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
addExcludeCandidateSystemCriterionComponent
Add criteria component to exclude the candidates- Parameters:
cType
- the simple content type
-
_filterModelItemForCriteria
Returnstrue
if the model item can be used as criteria- Parameters:
modelItem
- the model item- Returns:
true
if the model item can be used as criteria
-
_filterModelItemForColumn
Returnstrue
if model item can be used as column search UI- Parameters:
modelItem
- the model item- Returns:
true
if model item can be used as column search UI
-
addLikeTitleCriterionComponent
protected void addLikeTitleCriterionComponent(ContentType contentType, String attributePath) 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.attributePath
- the attribute path.- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
addAttributeCriterionComponent
protected void addAttributeCriterionComponent(ContentType contentType, String attributePath, Query.Operator operator) throws ConfigurationException, ComponentException Add an attribute criterion component to the manager.- Parameters:
contentType
- the simple content type.attributePath
- the attribute path.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
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.
-
addColumnComponents
protected void addColumnComponents(ContentType cType, ViewItemContainer viewContainer) throws ConfigurationException, ComponentException Add column components to the manager.- Parameters:
cType
- the simple content type.viewContainer
- the view item container- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
addAttributeColumnComponent
protected void addAttributeColumnComponent(ContentType contentType, String attributePath) throws ConfigurationException, ComponentException Add an attribute column component to the manager.- Parameters:
contentType
- the simple content type.attributePath
- the attribute path.- 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
Lookup all the columns.- Returns:
- the search column list.
- Throws:
ComponentException
- if a component cannot be looked up.
-