Package org.ametys.cms.search.ui.model
Class AbstractSearchUIModel
java.lang.Object
org.ametys.cms.search.ui.model.AbstractSearchUIModel
- All Implemented Interfaces:
SearchModel
,SearchUIModel
,LogEnabled
,Contextualizable
,Serviceable
- Direct Known Subclasses:
CriteriaSearchUIModelWrapper
,ReferenceTableSearchUIModel
,ReferencingContentsWithSameValuesSearchUIModel
,StaticSearchUIModel
public abstract class AbstractSearchUIModel
extends Object
implements SearchUIModel, LogEnabled, Serviceable, Contextualizable
Abstract class for SearchUIModel.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
SearchUICriterion> The search criteria in advanced mode, indexed by ID.protected Map<String,
SearchUIColumn> The result columns, indexed by ID.protected Context
The context.protected ContentTypeExtensionPoint
The content type extension pointThe content types of this search model.The content types excluded from this search model.protected Map<String,
SearchUICriterion> The search criteria used as facets, indexed by ID.protected Logger
The logger.protected ServiceManager
The service managerprotected Map<String,
SearchUICriterion> The search criteria in simple mode, indexed by ID.protected SearchUIModelHelper
The search model helper.protected static final String
The default URL for CSV exportprotected static final String
The default URL for DOC exportprotected static final String
The default URL for XML exportprotected static final String
The URL for print resultsprotected static final String
The default URL for searchprotected static final String
The default plugin name for URLs -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addContentTypesConfiguration
(DefaultConfiguration conf, Set<String> baseContentTypeIds) Add the content types configuration.void
contextualize
(Context context) getAdvancedCriteria
(Map<String, Object> contextualParameters) Get the list of search criteria in advanced modegetContentTypes
(Map<String, Object> contextualParameters) Get the list of content types.getCriteria
(Map<String, Object> contextualParameters) Get the list of search criteria in simple modeprotected Configuration
getCustomCriteriaConfiguration
(Configuration originalConf, Set<String> baseContentTypeIds, String customCriterionId, I18nizableText group) Get the configuration of a custom criteria component.getExcludedContentTypes
(Map<String, Object> contextualParameters) Get the list of excluded content types.getExportCSVUrl
(Map<String, Object> contextualParameters) Get the URL for CSV export of resultsgetExportCSVUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for CSV export of resultsgetExportDOCUrl
(Map<String, Object> contextualParameters) Get the URL for DOC export of resultsgetExportDOCUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for DOC export of resultsgetExportXMLUrl
(Map<String, Object> contextualParameters) Get the URL for XML export of resultsgetExportXMLUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for XML export of resultsgetFacetedCriteria
(Map<String, Object> contextualParameters) Get the list of faceted search criteria.protected Configuration
getIndexingFieldCriteriaConfiguration
(Set<String> baseContentTypeIds, String path, Query.Operator operator) Get the configuration of a metadata criteria component.protected Configuration
getIndexingFieldCriteriaConfiguration
(Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) Get the configuration of a metadata criteria component.protected Configuration
getIndexingFieldCriteriaConfiguration
(Configuration originalConf, Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) Get the configuration of a metadata criteria component.protected final Logger
Get the logger.protected Configuration
getMetadataColumnConfiguration
(Set<String> baseContentTypeIds, String metadataPath) Get the configuration of a metadata column component.protected Configuration
getMetadataColumnConfiguration
(Configuration originalConf, Set<String> baseContentTypeIds, String metadataPath) Get the configuration of a metadata column component.int
getPageSize
(Map<String, Object> contextualParameters) Get the page size.getPrintUrl
(Map<String, Object> contextualParameters) Get the URL for print resultsgetPrintUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for print resultsgetResultFields
(Map<String, Object> contextualParameters) Get the column for resultsgetSearchUrl
(Map<String, Object> contextualParameters) Get the URL for searchgetSearchUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for searchGet the name of the view to use for summary of the content.protected Configuration
getSystemColumnConfiguration
(Set<String> baseContentTypeIds, String property) Get the configuration of a system column component.protected Configuration
getSystemColumnConfiguration
(Configuration originalConf, Set<String> baseContentTypeIds, String property) Get the configuration of a system column component.protected Configuration
getSystemCriteriaConfiguration
(Set<String> baseContentTypeIds, String property) Get the configuration of a system criteria component.protected Configuration
getSystemCriteriaConfiguration
(Set<String> baseContentTypeIds, String property, I18nizableText group) Get the configuration of a system criteria component.protected Configuration
getSystemCriteriaConfiguration
(Configuration originalConf, Set<String> baseContentTypeIds, String property, I18nizableText group) Get the configuration of a system criteria component.getWorkspace
(Map<String, Object> contextualParameters) Get the specific workspace to use.void
service
(ServiceManager manager) void
setAdvancedCriteria
(Collection<SearchUICriterion> criteria) Set the criteria in advanced mode.void
setContentTypes
(Set<String> cTypes) Set the content types.void
setCriteria
(Collection<SearchUICriterion> criteria) Set the criteria in simple mode.void
setExcludedContentTypes
(Set<String> cTypes) Set the excluded content types.void
setFacetedCriteria
(Collection<SearchCriterion> criteria) Set the criteria to use as facets.void
Called at creation time to provide aLogger
.void
setResultFields
(Collection<SearchUIColumn> fields) Set the result columns.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
-
DEFAULT_URL_PLUGIN
The default plugin name for URLs- See Also:
-
DEFAULT_SEARCH_URL
The default URL for search- See Also:
-
DEFAULT_EXPORT_CSV_URL
The default URL for CSV export- See Also:
-
DEFAULT_EXPORT_DOC_URL
The default URL for DOC export- See Also:
-
DEFAULT_EXPORT_XML_URL
The default URL for XML export- See Also:
-
DEFAULT_PRINT_URL
The URL for print results- See Also:
-
_cTypeEP
The content type extension point -
_searchModelHelper
The search model helper. -
_logger
The logger. -
_manager
The service manager -
_context
The context. -
_cTypes
The content types of this search model. -
_excludedCTypes
The content types excluded from this search model. -
_searchCriteria
The search criteria in simple mode, indexed by ID. -
_advancedSearchCriteria
The search criteria in advanced mode, indexed by ID. -
_facetedCriteria
The search criteria used as facets, indexed by ID. -
_columns
The result columns, indexed by ID.
-
-
Constructor Details
-
AbstractSearchUIModel
public AbstractSearchUIModel()
-
-
Method Details
-
setLogger
Description copied from interface:LogEnabled
Called at creation time to provide aLogger
.- Specified by:
setLogger
in interfaceLogEnabled
- Parameters:
logger
- aLogger
for messages.
-
getLogger
Get the logger.- Returns:
- the logger.
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getContentTypes
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
Set the content types.- Parameters:
cTypes
- The content types.
-
getExcludedContentTypes
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
Set the excluded content types.- Parameters:
cTypes
- The 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
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
setCriteria
Set the criteria in simple mode.- Parameters:
criteria
- A collection of search criteria.
-
getAdvancedCriteria
Description copied from interface:SearchUIModel
Get the list of search criteria in advanced mode- Specified by:
getAdvancedCriteria
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of search criteria in advanced mode
-
setAdvancedCriteria
Set the criteria in advanced mode.- Parameters:
criteria
- A collection of search criteria.
-
getFacetedCriteria
Description copied from interface:SearchModel
Get the list of faceted search criteria.- Specified by:
getFacetedCriteria
in interfaceSearchModel
- Specified by:
getFacetedCriteria
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of faceted search criteria.
-
setFacetedCriteria
Set the criteria to use as facets.- Parameters:
criteria
- A collection of search criteria.
-
getResultFields
Description copied from interface:SearchModel
Get the column for results- Specified by:
getResultFields
in interfaceSearchModel
- Specified by:
getResultFields
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters. Can be null.- Returns:
- the column for results
-
setResultFields
Set the result columns.- Parameters:
fields
- A collection of search columns.
-
getPageSize
Description copied from interface:SearchUIModel
Get the page size.- Specified by:
getPageSize
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters.- Returns:
- The page size, unlimited or default used when negative or 0.
-
getWorkspace
Description copied from interface:SearchUIModel
Get the specific workspace to use.- Specified by:
getWorkspace
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters.- Returns:
- the workspace to use when searching, or null to use the default workspace.
-
getSearchUrl
Description copied from interface:SearchUIModel
Get the URL for search- Specified by:
getSearchUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for search
-
getSearchUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for search- Specified by:
getSearchUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for search
-
getExportCSVUrl
Description copied from interface:SearchUIModel
Get the URL for CSV export of results- Specified by:
getExportCSVUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for CSV export
-
getExportCSVUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for CSV export of results- Specified by:
getExportCSVUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for CSV export
-
getExportDOCUrl
Description copied from interface:SearchUIModel
Get the URL for DOC export of results- Specified by:
getExportDOCUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for DOC export
-
getExportDOCUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for DOC export of results- Specified by:
getExportDOCUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for DOC export
-
getExportXMLUrl
Description copied from interface:SearchUIModel
Get the URL for XML export of results- Specified by:
getExportXMLUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for XML export
-
getExportXMLUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for XML export of results- Specified by:
getExportXMLUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for XML export
-
getPrintUrl
Description copied from interface:SearchUIModel
Get the URL for print results- Specified by:
getPrintUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for print results
-
getPrintUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for print results- Specified by:
getPrintUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for print results
-
getSummaryView
Description copied from interface:SearchUIModel
Get the name of the view to use for summary of the content.- Specified by:
getSummaryView
in interfaceSearchUIModel
- Returns:
- the name of the view to use for summary of the content. Can be null.
-
getIndexingFieldCriteriaConfiguration
protected Configuration getIndexingFieldCriteriaConfiguration(Set<String> baseContentTypeIds, String path, Query.Operator operator) throws ConfigurationException Get the configuration of a metadata criteria component.- Parameters:
baseContentTypeIds
- the "base" content type identifiers.path
- the field path.operator
- the criteria operator, can be null.- Returns:
- the configuration to provide to the metadata criteria component.
- Throws:
ConfigurationException
- if an error occurs.
-
getIndexingFieldCriteriaConfiguration
protected Configuration getIndexingFieldCriteriaConfiguration(Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) throws ConfigurationException Get the configuration of a metadata criteria component.- Parameters:
baseContentTypeIds
- the "base" content type identifiers.path
- the field path.operator
- the criteria operator, can be null.group
- The group. Can be null.- Returns:
- the configuration to provide to the metadata criteria component.
- Throws:
ConfigurationException
- if an error occurs.
-
getIndexingFieldCriteriaConfiguration
protected Configuration getIndexingFieldCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) throws ConfigurationException Get the configuration of a metadata criteria component.- Parameters:
originalConf
- the original criteria configuration.baseContentTypeIds
- the "base" content type identifiers.path
- the field path, separated by '/'.operator
- the criteria operator, can be null.group
- The group. Can be null.- Returns:
- the configuration to provide to the metadata criterion component.
- Throws:
ConfigurationException
- if an error occurs.
-
getSystemCriteriaConfiguration
protected Configuration getSystemCriteriaConfiguration(Set<String> baseContentTypeIds, String property) Get the configuration of a system criteria component.- Parameters:
baseContentTypeIds
- the "base" content type identifiers.property
- the system property.- Returns:
- the configuration to provide to the system criterion component.
-
getSystemCriteriaConfiguration
protected Configuration getSystemCriteriaConfiguration(Set<String> baseContentTypeIds, String property, I18nizableText group) Get the configuration of a system criteria component.- Parameters:
baseContentTypeIds
- the "base" content type identifiers.property
- the system property.group
- The group. Can be null.- Returns:
- the configuration to provide to the system criterion component.
-
getSystemCriteriaConfiguration
protected Configuration getSystemCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String property, I18nizableText group) throws ConfigurationException Get the configuration of a system criteria component.- Parameters:
originalConf
- the original column configuration.baseContentTypeIds
- the "base" content type identifiers.property
- the system property.group
- The group. Can be null.- Returns:
- the configuration to provide to the system criterion component.
- Throws:
ConfigurationException
- if an error occurs.
-
getCustomCriteriaConfiguration
protected Configuration getCustomCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String customCriterionId, I18nizableText group) throws ConfigurationException Get the configuration of a custom criteria component.- Parameters:
originalConf
- the original column configuration.baseContentTypeIds
- the "base" content type identifiers.customCriterionId
- the custom criterion idgroup
- The group. Can be null.- Returns:
- the configuration to provide to the custom criterion component.
- Throws:
ConfigurationException
- if an error occurs.
-
getMetadataColumnConfiguration
protected Configuration getMetadataColumnConfiguration(Set<String> baseContentTypeIds, String metadataPath) throws ConfigurationException Get the configuration of a metadata column component.- Parameters:
baseContentTypeIds
- the "base" content type identifiers.metadataPath
- the metadata path.- Returns:
- the configuration to provide to the metadata column component.
- Throws:
ConfigurationException
- if an error occurs.
-
getMetadataColumnConfiguration
protected Configuration getMetadataColumnConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String metadataPath) throws ConfigurationException Get the configuration of a metadata column component.- Parameters:
originalConf
- the original column configuration.baseContentTypeIds
- the base content type identifiers.metadataPath
- the metadata path.- Returns:
- the configuration to provide to the metadata column component.
- Throws:
ConfigurationException
- if an error occurs.
-
getSystemColumnConfiguration
protected Configuration getSystemColumnConfiguration(Set<String> baseContentTypeIds, String property) throws ConfigurationException Get the configuration of a system column component.- Parameters:
baseContentTypeIds
- the "base" content type identifiers.property
- the system property.- Returns:
- the configuration to provide to the system column component.
- Throws:
ConfigurationException
- if an error occurs.
-
getSystemColumnConfiguration
protected Configuration getSystemColumnConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String property) throws ConfigurationException Get the configuration of a system column component.- Parameters:
originalConf
- the original column configuration.baseContentTypeIds
- the "base" content type identifiers.property
- the system property.- Returns:
- the configuration to provide to the system column component.
- Throws:
ConfigurationException
- if an error occurs.
-
addContentTypesConfiguration
protected void addContentTypesConfiguration(DefaultConfiguration conf, Set<String> baseContentTypeIds) Add the content types configuration.- Parameters:
conf
- The configuration to write to.baseContentTypeIds
- The "base" content type identifiers.
-