Package org.ametys.cms.search
Class GetQueryFromJSONHelper
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.search.GetQueryFromJSONHelper
- All Implemented Interfaces:
Component,Contextualizable,LogEnabled,Serviceable
public class GetQueryFromJSONHelper
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable
Helper to get query infos from JSON object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) getColumnsFromSearchModel(SearchUIModel model, Map<String, Object> contextualParameters) Retrieves a list of column idsgetQueryFromModel(SearchUIModel model, Map<String, Object> parameters, List<String> contentTypes) Retrieves a Query object from the SearchUIModel and the JSON parametersgetSearchUIModel(Map<String, Object> parameters) Retrieves the search UI modelgetSearchUIModel(Map<String, Object> parameters, String modelKeyName) Retrieves the search UI modelRetrieves the sort criteria from a sort string.Retrieves the sort criteria from a sort string.voidservice(ServiceManager serviceManager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The Avalon role name
-
-
Constructor Details
-
GetQueryFromJSONHelper
public GetQueryFromJSONHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getSearchUIModel
Retrieves the search UI model- Parameters:
parameters- The JS parameters- Returns:
- the search UI model
-
getSearchUIModel
Retrieves the search UI model- Parameters:
parameters- The JS parametersmodelKeyName- key name of the model parameter- Returns:
- the search UI model
-
getQueryFromModel
public Query getQueryFromModel(SearchUIModel model, Map<String, Object> parameters, List<String> contentTypes) throws QuerySyntaxExceptionRetrieves a Query object from the SearchUIModel and the JSON parameters- Parameters:
model- Modelparameters- JSON parameterscontentTypes- List of content types to fill- Returns:
- the created Query object
- Throws:
QuerySyntaxException- If an error occurs during the query parsing
-
getColumnsFromSearchModel
public List<String> getColumnsFromSearchModel(SearchUIModel model, Map<String, Object> contextualParameters) Retrieves a list of column ids- Parameters:
model- search model containing result fieldscontextualParameters- JSON object containing the contextual parameters- Returns:
- a list of columns ids
-
getSort
Retrieves the sort criteria from a sort string.- Parameters:
parameters- The parameters (containing sort and optionally group keys)- Returns:
- the sort criteria as a List of
Sort.
-
getSort
Retrieves the sort criteria from a sort string.- Parameters:
sortString- The sort criteria as a JSON-encoded string.groupString- The group criteria as a JSON-encoded string (for server-side grouping feature). Can be null.- Returns:
- the sort criteria as a List of
Sort.
-