public class CriteriaSearchUIModelWrapper extends AbstractSearchUIModel
Modifier and Type | Field and Description |
---|---|
private int |
_criteriaIndex |
private SearchUIModelExtensionPoint |
_searchModelEP |
protected ThreadSafeComponentManager<SearchUIColumn> |
_searchUIColumnManager
ComponentManager for
SearchUIColumn s. |
protected ThreadSafeComponentManager<SearchUICriterion> |
_searchUICriterionManager
ComponentManager for
SearchUICriterion s. |
private SystemPropertyExtensionPoint |
_sysPropEP |
private SearchUIModel |
_wrappedModel |
_advancedSearchCriteria, _columns, _context, _cTypeEP, _cTypes, _excludedCTypes, _facetedCriteria, _logger, _manager, _searchCriteria, _searchModelHelper
Constructor and Description |
---|
CriteriaSearchUIModelWrapper(SearchUIModel model,
ServiceManager manager,
Context context,
Logger logger)
Build a model wrapper.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addIndexingFieldCriteriaComponents(List<Object> searchToolCriterionRoles,
String contentTypeId,
String fieldRef)
Add a indexing field criteria component to the manager.
|
private Configuration |
addLabelInColumnConf(Configuration originalConf,
String label) |
protected void |
addMetadataColumnComponents(List<Object> columnsRolesToLookup,
String contentTypeId,
String metadataPath,
Optional<String> columnLabel)
Add a metadata column component to the manager.
|
protected void |
addSystemColumnComponent(List<Object> columnsRolesToLookup,
String contentTypeId,
String property,
Optional<String> columnLabel)
Add a system column component to the manager.
|
protected void |
addSystemCriteriaComponents(List<Object> searchToolCriterionRoles,
String contentTypeId,
String property)
Add a system criteria component to the manager.
|
boolean |
allowSortOnMultipleJoin()
|
protected void |
configureColumns(List<Object> columnRoles,
String contentTypeId,
Collection<ColumnHelper.Column> columnIds,
SearchUIModel referenceModel,
Map<String,Object> contextualParameters)
Configure the list of search columns.
|
protected Collection<String> |
configureFacets(List<Object> criteriaRoles,
String contentTypeId,
Collection<String> criteriaIds,
SearchUIModel referenceModel,
Map<String,Object> contextualParameters)
Configure the list of faceted criteria.
|
Map<String,SearchUICriterion> |
getAdvancedCriteria(Map<String,Object> contextualParameters)
Get the list of search criteria in advanced mode
|
protected SearchUIColumn |
getColumn(SearchUIModel searchModel,
String columnId,
Map<String,Object> contextualParameters)
Search a column in the reference model from its column identifier.
|
Set<String> |
getContentTypes(Map<String,Object> contextualParameters)
Get the list of content types.
|
Map<String,SearchUICriterion> |
getCriteria(Map<String,Object> contextualParameters)
Get the list of search criteria in simple mode
|
protected SearchUICriterion |
getCriterion(SearchUIModel searchModel,
String criterionId,
Map<String,Object> contextualParameters)
Search a criterion in the reference model from its criterion identifier.
|
SearchUICriterion |
getCriterion(String id,
Map<String,Object> contextualParameters)
Get a simple search criterion by its id
|
Set<String> |
getExcludedContentTypes(Map<String,Object> contextualParameters)
Get the list of excluded content types.
|
String |
getExportCSVUrl(Map<String,Object> contextualParameters)
Get the URL for CVS export of results
|
String |
getExportCSVUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for CVS export of results
|
String |
getExportDOCUrl(Map<String,Object> contextualParameters)
Get the URL for DOC export of results
|
String |
getExportDOCUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for DOC export of results
|
String |
getExportXMLUrl(Map<String,Object> contextualParameters)
Get the URL for XML export of results
|
String |
getExportXMLUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for XML export of results
|
Map<String,SearchUICriterion> |
getFacetedCriteria(Map<String,Object> contextualParameters)
Get the list of faceted search criteria.
|
String |
getPrintUrl(Map<String,Object> contextualParameters)
Get the URL for print results
|
String |
getPrintUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for print results
|
SearchUIColumn |
getResultField(String id,
Map<String,Object> contextualParameters)
Get the column by its identifier
|
Map<String,SearchUIColumn> |
getResultFields(Map<String,Object> contextualParameters)
Get the column for results
|
String |
getSearchUrl(Map<String,Object> contextualParameters)
Get the URL for search
|
String |
getSearchUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for search
|
void |
service(ServiceManager manager) |
Collection<String> |
setFacetedCriteria(String contentTypeId,
Collection<String> criteriaIds,
Map<String,Object> contextualParameters)
Set the custom faceted criteria.
|
void |
setResultColumns(String contentTypeId,
Collection<ColumnHelper.Column> columns,
Map<String,Object> contextualParameters)
Set the custom columns.
|
addContentTypesConfiguration, contextualize, getCustomCriteriaConfiguration, getIndexingFieldCriteriaConfiguration, getIndexingFieldCriteriaConfiguration, getIndexingFieldCriteriaConfiguration, getLogger, getMetadataColumnConfiguration, getMetadataColumnConfiguration, getPageSize, getSummaryView, getSystemColumnConfiguration, getSystemColumnConfiguration, getSystemCriteriaConfiguration, getSystemCriteriaConfiguration, getSystemCriteriaConfiguration, getWorkspace, setAdvancedCriteria, setContentTypes, setCriteria, setExcludedContentTypes, setFacetedCriteria, setLogger, setResultFields
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdvancedCriterion, getFacetedCriterion
protected ThreadSafeComponentManager<SearchUICriterion> _searchUICriterionManager
SearchUICriterion
s.protected ThreadSafeComponentManager<SearchUIColumn> _searchUIColumnManager
SearchUIColumn
s.private SearchUIModelExtensionPoint _searchModelEP
private SystemPropertyExtensionPoint _sysPropEP
private SearchUIModel _wrappedModel
private int _criteriaIndex
public CriteriaSearchUIModelWrapper(SearchUIModel model, ServiceManager manager, Context context, Logger logger)
model
- the search model to wrap.manager
- the service manager.context
- the component context.logger
- the logger.public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractSearchUIModel
ServiceException
public Collection<String> setFacetedCriteria(String contentTypeId, Collection<String> criteriaIds, Map<String,Object> contextualParameters) throws Exception
contentTypeId
- the reference content type ID, can be null.criteriaIds
- the criteria IDscontextualParameters
- the contextual parametersException
- if an error occurs initializing criteria.public void setResultColumns(String contentTypeId, Collection<ColumnHelper.Column> columns, Map<String,Object> contextualParameters) throws Exception
contentTypeId
- the reference content type ID, can be null.columns
- The columnscontextualParameters
- the contextual parametersException
- if an error occurs initializing columns.protected Collection<String> configureFacets(List<Object> criteriaRoles, String contentTypeId, Collection<String> criteriaIds, SearchUIModel referenceModel, Map<String,Object> contextualParameters) throws ConfigurationException
criteriaRoles
- the roles of criteria to lookup (or the already existing SearchUICriterion objects).contentTypeId
- The reference content type ID.criteriaIds
- the criteria IDs.referenceModel
- the reference model.contextualParameters
- the contextual parametersConfigurationException
- if an error occurs creating a component configuration.protected SearchUICriterion getCriterion(SearchUIModel searchModel, String criterionId, Map<String,Object> contextualParameters)
searchModel
- the reference search model.criterionId
- the criterion identifier.contextualParameters
- the contextual parametersprotected void configureColumns(List<Object> columnRoles, String contentTypeId, Collection<ColumnHelper.Column> columnIds, SearchUIModel referenceModel, Map<String,Object> contextualParameters) throws ConfigurationException
columnRoles
- the roles of columns to lookup (or the already existing SearchUIColumn objects).contentTypeId
- The reference content type ID.columnIds
- The columnsreferenceModel
- the reference model.contextualParameters
- the contextual parametersConfigurationException
- if an error occurs creating a component configuration.protected SearchUIColumn getColumn(SearchUIModel searchModel, String columnId, Map<String,Object> contextualParameters)
searchModel
- the reference search model.columnId
- the column identifier.contextualParameters
- the contextual parametersprotected void addIndexingFieldCriteriaComponents(List<Object> searchToolCriterionRoles, String contentTypeId, String fieldRef) throws ConfigurationException
searchToolCriterionRoles
- the criteria role list to fill.contentTypeId
- the reference content type ID, can be null.fieldRef
- the field path.ConfigurationException
- if an error occurs.protected void addSystemCriteriaComponents(List<Object> searchToolCriterionRoles, String contentTypeId, String property) throws ConfigurationException
searchToolCriterionRoles
- the criteria role list to fill.contentTypeId
- the reference content type ID, can be null.property
- the system property id.ConfigurationException
- if an error occurs.private Configuration addLabelInColumnConf(Configuration originalConf, String label) throws ConfigurationException
ConfigurationException
protected void addMetadataColumnComponents(List<Object> columnsRolesToLookup, String contentTypeId, String metadataPath, Optional<String> columnLabel) throws ConfigurationException
columnsRolesToLookup
- the columns rolescontentTypeId
- the reference content type ID, can be null.metadataPath
- the metadata path.columnLabel
- The (optional) label of the column. If not present, the column label will be the metadata one.ConfigurationException
- if an error occurs.protected void addSystemColumnComponent(List<Object> columnsRolesToLookup, String contentTypeId, String property, Optional<String> columnLabel) throws ConfigurationException
columnsRolesToLookup
- the columns rolescontentTypeId
- the reference content type ID, can be null.property
- the system property.columnLabel
- The (optional) label of the column. If not present, the column label will be the metadata one.ConfigurationException
- if an error occurs.public Map<String,SearchUICriterion> getFacetedCriteria(Map<String,Object> contextualParameters)
SearchModel
getFacetedCriteria
in interface SearchModel
getFacetedCriteria
in interface SearchUIModel
getFacetedCriteria
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic Map<String,SearchUIColumn> getResultFields(Map<String,Object> contextualParameters)
SearchModel
getResultFields
in interface SearchModel
getResultFields
in interface SearchUIModel
getResultFields
in class AbstractSearchUIModel
contextualParameters
- the contextual parameters. Can be null.public SearchUIColumn getResultField(String id, Map<String,Object> contextualParameters)
SearchModel
id
- The column idcontextualParameters
- the contextual parameterspublic Set<String> getContentTypes(Map<String,Object> contextualParameters)
SearchModel
getContentTypes
in interface SearchModel
getContentTypes
in class AbstractSearchUIModel
contextualParameters
- the contextual parameters.public Set<String> getExcludedContentTypes(Map<String,Object> contextualParameters)
SearchModel
getExcludedContentTypes
in interface SearchModel
getExcludedContentTypes
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getSearchUrl(Map<String,Object> contextualParameters)
SearchUIModel
getSearchUrl
in interface SearchUIModel
getSearchUrl
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getSearchUrlPlugin(Map<String,Object> contextualParameters)
SearchUIModel
getSearchUrlPlugin
in interface SearchUIModel
getSearchUrlPlugin
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getExportCSVUrl(Map<String,Object> contextualParameters)
SearchUIModel
getExportCSVUrl
in interface SearchUIModel
getExportCSVUrl
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getExportCSVUrlPlugin(Map<String,Object> contextualParameters)
SearchUIModel
getExportCSVUrlPlugin
in interface SearchUIModel
getExportCSVUrlPlugin
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getExportDOCUrl(Map<String,Object> contextualParameters)
SearchUIModel
getExportDOCUrl
in interface SearchUIModel
getExportDOCUrl
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getExportDOCUrlPlugin(Map<String,Object> contextualParameters)
SearchUIModel
getExportDOCUrlPlugin
in interface SearchUIModel
getExportDOCUrlPlugin
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getExportXMLUrl(Map<String,Object> contextualParameters)
SearchUIModel
getExportXMLUrl
in interface SearchUIModel
getExportXMLUrl
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getExportXMLUrlPlugin(Map<String,Object> contextualParameters)
SearchUIModel
getExportXMLUrlPlugin
in interface SearchUIModel
getExportXMLUrlPlugin
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getPrintUrl(Map<String,Object> contextualParameters)
SearchUIModel
getPrintUrl
in interface SearchUIModel
getPrintUrl
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic String getPrintUrlPlugin(Map<String,Object> contextualParameters)
SearchUIModel
getPrintUrlPlugin
in interface SearchUIModel
getPrintUrlPlugin
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic boolean allowSortOnMultipleJoin()
SearchUIModel
multiple
metadata
in its path (intermediate ones only) must be allowed.
public Map<String,SearchUICriterion> getCriteria(Map<String,Object> contextualParameters)
SearchModel
getCriteria
in interface SearchModel
getCriteria
in interface SearchUIModel
getCriteria
in class AbstractSearchUIModel
contextualParameters
- the contextual parameterspublic SearchUICriterion getCriterion(String id, Map<String,Object> contextualParameters)
SearchModel
id
- The search criterion idcontextualParameters
- the contextual parametersnull
if not foundpublic Map<String,SearchUICriterion> getAdvancedCriteria(Map<String,Object> contextualParameters)
SearchUIModel
getAdvancedCriteria
in interface SearchUIModel
getAdvancedCriteria
in class AbstractSearchUIModel
contextualParameters
- the contextual parameters