Package org.ametys.cms.search.ui.model
Class SearchUIModelHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.search.ui.model.SearchUIModelHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
public class SearchUIModelHelper
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable
Client interaction helper for
SearchUIModel
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) getAdvancedCriteriaListInfo
(Map<String, ? extends SearchUICriterion> criteria) Return information on a list of advancedSearchUICriterion
, serialized as a Map.getAllContentTypes
(SearchModel model, Map<String, Object> contextualParameters) Get all the real content types that a model works on (the included content types, minus the excluded types).getColumnConfigurations
(String modelId, List<String> restrictedContentTypes, Map<String, Object> contextualParameters) Get the column configurations of search model as JSON objectgetColumnInfo
(SearchUIColumn column) Return information on aSearchUIColumn
, serialized as a Map.getColumnListInfo
(Map<String, ? extends SearchUIColumn> columns) Return information on a list ofSearchUIColumn
, serialized as a Map.getCriteriaListInfo
(Map<String, ? extends SearchUICriterion> criteria) Return information on a list ofSearchUICriterion
, serialized as a Map.getCriterionInfo
(SearchUICriterion criterion) Return information on aSearchUICriterion
, serialized as a Map.getSearchModelConfiguration
(String modelId, List<String> restrictedContentTypes, Map<String, Object> contextualParameters) Get the search model configuration as JSON objectgetSearchModelInfo
(SearchUIModel model, Map<String, Object> contextualParameters) Return information on aSearchUIModel
object serialized in a Map.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role.
-
-
Constructor Details
-
SearchUIModelHelper
public SearchUIModelHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getAllContentTypes
Get all the real content types that a model works on (the included content types, minus the excluded types).- Parameters:
model
- the search model.contextualParameters
- the contextual parameters.- Returns:
- a Set of the content type IDs.
-
getSearchModelConfiguration
public Map<String,Object> getSearchModelConfiguration(String modelId, List<String> restrictedContentTypes, Map<String, Object> contextualParameters) throws ProcessingExceptionGet the search model configuration as JSON object- Parameters:
modelId
- The id of search modelrestrictedContentTypes
- The restricted content types. Can be null.contextualParameters
- the contextual parameters- Returns:
- The search model configuration in a Map
- Throws:
ProcessingException
- if an error occurred
-
getColumnConfigurations
public List<Object> getColumnConfigurations(String modelId, List<String> restrictedContentTypes, Map<String, Object> contextualParameters) throws ProcessingExceptionGet the column configurations of search model as JSON object- Parameters:
modelId
- The id of search modelrestrictedContentTypes
- The restricted content types. Can be null.contextualParameters
- the contextual parameters- Returns:
- The column configurations in a List
- Throws:
ProcessingException
- if an error occurred
-
getSearchModelInfo
public Map<String,Object> getSearchModelInfo(SearchUIModel model, Map<String, Object> contextualParameters) throws ProcessingExceptionReturn information on aSearchUIModel
object serialized in a Map.- Parameters:
model
- The search model.contextualParameters
- The contextual parameters- Returns:
- the detailed information serialized in a Map.
- Throws:
ProcessingException
- if an error occurs.
-
getColumnListInfo
public List<Object> getColumnListInfo(Map<String, ? extends SearchUIColumn> columns) throws ProcessingExceptionReturn information on a list ofSearchUIColumn
, serialized as a Map.- Parameters:
columns
- the list of search columns.- Returns:
- the detailed information serialized in a Map.
- Throws:
ProcessingException
- if an error occurs.
-
getColumnInfo
Return information on aSearchUIColumn
, serialized as a Map.- Parameters:
column
- the search column.- Returns:
- the detailed information serialized in a Map.
- Throws:
ProcessingException
- if an error occurs.
-
getCriteriaListInfo
public Map<String,Object> getCriteriaListInfo(Map<String, ? extends SearchUICriterion> criteria) throws ProcessingExceptionReturn information on a list ofSearchUICriterion
, serialized as a Map.- Parameters:
criteria
- a map of search criteria.- Returns:
- the detailed information serialized in a Map.
- Throws:
ProcessingException
- if an error occurs.
-
getAdvancedCriteriaListInfo
public Map<String,Object> getAdvancedCriteriaListInfo(Map<String, ? extends SearchUICriterion> criteria) throws ProcessingExceptionReturn information on a list of advancedSearchUICriterion
, serialized as a Map.- Parameters:
criteria
- A map of advanced search criteria.- Returns:
- the detailed information serialized in a Map.
- Throws:
ProcessingException
- if an error occurs.
-
getCriterionInfo
Return information on aSearchUICriterion
, serialized as a Map.- Parameters:
criterion
- a search criterion.- Returns:
- the detailed information serialized in a Map.
- Throws:
ProcessingException
- if an error occurs.
-