Package org.ametys.cms.search.ui.model
Class DynamicWrappedSearchUIModel
- java.lang.Object
-
- org.ametys.cms.search.ui.model.DynamicWrappedSearchUIModel
-
- All Implemented Interfaces:
SearchModel
,SearchUIModel
public class DynamicWrappedSearchUIModel extends Object implements SearchUIModel
Dynamic search model wrapping a search model with a restriction on content types
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DynamicWrappedSearchUIModel.WrappedSearchUICriterion
Search criteria wrapper.
-
Constructor Summary
Constructors Constructor Description DynamicWrappedSearchUIModel(SearchUIModel model, Collection<String> restrictedContentTypes, ContentTypeExtensionPoint cTypeEP, org.slf4j.Logger logger, Context context, ServiceManager manager)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,SearchUICriterion>
getAdvancedCriteria(Map<String,Object> contextualParameters)
Get the list of search criteria in advanced modeSet<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 modeSearchUICriterion
getCriterion(String id, Map<String,Object> contextualParameters)
Get a simple search criterion by its idSet<String>
getExcludedContentTypes(Map<String,Object> contextualParameters)
Get the list of excluded content types.String
getExportCSVUrl(Map<String,Object> contextualParameters)
Get the URL for CSV export of resultsString
getExportCSVUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for CSV export of resultsString
getExportDOCUrl(Map<String,Object> contextualParameters)
Get the URL for DOC export of resultsString
getExportDOCUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for DOC export of resultsString
getExportXMLUrl(Map<String,Object> contextualParameters)
Get the URL for XML export of resultsString
getExportXMLUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for XML export of resultsMap<String,SearchUICriterion>
getFacetedCriteria(Map<String,Object> contextualParameters)
Get the list of faceted search criteria.int
getPageSize(Map<String,Object> contextualParameters)
Get the page size.String
getPrintUrl(Map<String,Object> contextualParameters)
Get the URL for print resultsString
getPrintUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for print resultsSearchUIColumn
getResultField(String id, Map<String,Object> contextualParameters)
Get the column by its identifierMap<String,SearchUIColumn>
getResultFields(Map<String,Object> contextualParameters)
Get the column for resultsString
getSearchUrl(Map<String,Object> contextualParameters)
Get the URL for searchString
getSearchUrlPlugin(Map<String,Object> contextualParameters)
Get the plugin name for searchString
getSummaryView()
Get the name of the view to use for summary of the content.String
getWorkspace(Map<String,Object> contextualParameters)
Get the specific workspace to use.protected SearchUICriterion
wrap(SearchUICriterion criterion)
Wrap an existing search criterion.-
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, getFacetedCriterion
-
-
-
-
Constructor Detail
-
DynamicWrappedSearchUIModel
public DynamicWrappedSearchUIModel(SearchUIModel model, Collection<String> restrictedContentTypes, ContentTypeExtensionPoint cTypeEP, org.slf4j.Logger logger, Context context, ServiceManager manager)
Constructor- Parameters:
model
- The wrapped search modelrestrictedContentTypes
- The restricted content typescTypeEP
- The content type extension pointlogger
- The loggercontext
- The contextmanager
- The service manager
-
-
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.
-
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.
-
getSearchUrl
public String getSearchUrl(Map<String,Object> contextualParameters)
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
public String getSearchUrlPlugin(Map<String,Object> contextualParameters)
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
public String getExportCSVUrl(Map<String,Object> contextualParameters)
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
public String getExportCSVUrlPlugin(Map<String,Object> contextualParameters)
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
public String getExportDOCUrl(Map<String,Object> contextualParameters)
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
public String getExportDOCUrlPlugin(Map<String,Object> contextualParameters)
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
public String getExportXMLUrl(Map<String,Object> contextualParameters)
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
public String getExportXMLUrlPlugin(Map<String,Object> contextualParameters)
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
public String getPrintUrl(Map<String,Object> contextualParameters)
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
public String getPrintUrlPlugin(Map<String,Object> contextualParameters)
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
public String 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.
-
getCriteria
public Map<String,SearchUICriterion> getCriteria(Map<String,Object> contextualParameters)
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
-
getCriterion
public SearchUICriterion getCriterion(String id, Map<String,Object> contextualParameters)
Description copied from interface:SearchModel
Get a simple search criterion by its id- Specified by:
getCriterion
in interfaceSearchModel
- Specified by:
getCriterion
in interfaceSearchUIModel
- Parameters:
id
- The search criterion idcontextualParameters
- the contextual parameters- Returns:
- the criterion or
null
if not found
-
getFacetedCriteria
public Map<String,SearchUICriterion> getFacetedCriteria(Map<String,Object> contextualParameters)
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.
-
getAdvancedCriteria
public Map<String,SearchUICriterion> getAdvancedCriteria(Map<String,Object> contextualParameters)
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
-
getResultFields
public Map<String,SearchUIColumn> getResultFields(Map<String,Object> contextualParameters)
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
-
getResultField
public SearchUIColumn getResultField(String id, Map<String,Object> contextualParameters)
Description copied from interface:SearchModel
Get the column by its identifier- Specified by:
getResultField
in interfaceSearchModel
- Specified by:
getResultField
in interfaceSearchUIModel
- Parameters:
id
- The column idcontextualParameters
- the contextual parameters- Returns:
- the column
-
getPageSize
public int getPageSize(Map<String,Object> contextualParameters)
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
public String getWorkspace(Map<String,Object> contextualParameters)
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.
-
wrap
protected SearchUICriterion wrap(SearchUICriterion criterion)
Wrap an existing search criterion.- Parameters:
criterion
- the search criterion to wrap.- Returns:
- the wrapped search criterion.
-
-