Package org.ametys.cms.search.model
Class SearchModelHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.search.model.SearchModelHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
public class SearchModelHelper
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable
Helper for
SearchModel
.-
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.getColumnConfigurations
(String modelId, List<String> restrictedContentTypes, Map<String, Object> contextualParameters) Get the column configurations of search model as JSON objectgetColumnsInfo
(ViewItemAccessor viewItemAccessor) Return information of columns in the given view item accessor, 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.getSearchUIModel
(String modelId, List<String> restrictedContentTypes, Map<String, Object> contextualParameters) Retrieves theSearchUIModel
with the given model identifier, with restrictions on content typesvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role.
-
-
Constructor Details
-
SearchModelHelper
public SearchModelHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
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
-
getSearchUIModel
public SearchUIModel getSearchUIModel(String modelId, List<String> restrictedContentTypes, Map<String, Object> contextualParameters) Retrieves theSearchUIModel
with the given model identifier, with restrictions on content types- Parameters:
modelId
- the model identifierrestrictedContentTypes
- the restricted content typescontextualParameters
- the contextual parameters- Returns:
- the
SearchUIModel
-
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.
-
getColumnsInfo
Return information of columns in the given view item accessor, serialized as a Map.- Parameters:
viewItemAccessor
- the view item accessor containing the columns.- 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.
-