Interface RecognizedParamsExtractor
- All Known Implementing Classes:
DeletedNodesImpl
,DiscoveryApiWebscript
,NetworksWebScriptGet
,QuickShareLinksImpl
,ResourceWebScriptDelete
,ResourceWebScriptGet
,ResourceWebScriptPost
,ResourceWebScriptPut
,SearchApiWebscript
,SearchSQLApiWebscript
public interface RecognizedParamsExtractor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault Paging
findPaging
(org.springframework.extensions.webscripts.WebScriptRequest req) Find paging setings based on the request parameters.Gets the clause specificed in paramNamedefault BeanPropertiesFilter
Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter).default BeanPropertiesFilter
Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter).getIncludeClause
(String includeParam) Takes the "include" parameter and turns it into a Listproperty names default Paging
Gets the default paging objectdefault Params.RecognizedParams
getRecognizedParams
(org.springframework.extensions.webscripts.WebScriptRequest req) Finds the formal set of params that any rest service could potentially have passed in as request paramsdefault Map<String,
BeanPropertiesFilter> getRelationFilter
(String filterParams) Takes the web request and looks for a "relations" parameter Parses the parameter and produces a list of bean properties to use as a filter A SimpleBeanPropertiesFilter it returned that uses the properties If no filter param is set then a default BeanFilter is returned that will never filter properties (ie.getRequestParameters
(org.springframework.extensions.webscripts.WebScriptRequest req) Finds all request parameters that aren't already know about (eg.getSelectClause
(String selectParam) Deprecated.default List<SortColumn>
Takes the Sort parameter as a String and parses it into a List of SortColumn objects.default Query
getWhereClause
(String whereParam) Takes the "where" parameter and turns it into a Java Object that can be used for queryingdefault org.apache.commons.logging.Log
-
Field Details
-
PARAM_RELATIONS
- See Also:
-
PARAM_FILTER_FIELDS
- See Also:
-
PARAM_FILTER_PROPERTIES
Deprecated.- See Also:
-
PARAM_PAGING_SKIP
- See Also:
-
PARAM_PAGING_MAX
- See Also:
-
PARAM_ORDERBY
- See Also:
-
PARAM_WHERE
- See Also:
-
PARAM_SELECT
- See Also:
-
PARAM_INCLUDE
- See Also:
-
PARAM_INCLUDE_SOURCE_ENTITY
- See Also:
-
KNOWN_PARAMS
-
-
Method Details
-
rpeLogger
default org.apache.commons.logging.Log rpeLogger() -
getRecognizedParams
default Params.RecognizedParams getRecognizedParams(org.springframework.extensions.webscripts.WebScriptRequest req) Finds the formal set of params that any rest service could potentially have passed in as request params- Parameters:
req
- WebScriptRequest- Returns:
- RecognizedParams a POJO containing the params for use with the Params objects
-
getFilter
Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter). Parses the parameter and produces a list of bean properties to use as a filter A SimpleBeanPropertyFilter it returned that uses the bean properties. If no filter param is set then a default BeanFilter is returned that will never filter fields (ie. Returns all bean properties). If selectList is provided then it will take precedence (ie. be included) over the fields/properties filter for top-level entries (bean properties). For example, this will return entries from both select & properties, eg. select=abc,def&properties=id,name,ghi Note: it should be noted that API-generic "fields" clause does not currently work for sub-entries. Hence, even if the API-specific "select" clause allows selection of a sub-entries this cannot be used with "fields" filtering. For example, an API-specific method may implement and return "abc/blah", eg. select=abc/blah However the following will not return "abc/blah" if used with fields filtering, eg. select=abc/blah&fields=id,name,ghi If fields filtering is desired then it would require "abc" to be selected and returned as a whole, eg. select=abc&fields=id,name,ghi- Parameters:
filterParams
-selectList
-- Returns:
-
getSelectClause
@Deprecated default List<String> getSelectClause(String selectParam) throws InvalidArgumentException Deprecated.Takes the "select" parameter and turns it into a Listproperty names - Parameters:
selectParam
- String- Returns:
- bean property names potentially using JSON Pointer syntax
- Throws:
InvalidArgumentException
-
getIncludeClause
Takes the "include" parameter and turns it into a Listproperty names - Parameters:
includeParam
- String- Returns:
- bean property names potentially using JSON Pointer syntax
- Throws:
InvalidArgumentException
-
getClause
Gets the clause specificed in paramName- Parameters:
param
-paramName
-- Returns:
- bean property names potentially using JSON Pointer syntax
-
getWhereClause
Takes the "where" parameter and turns it into a Java Object that can be used for querying- Parameters:
whereParam
- String- Returns:
- Query a parsed version of the where clause, represented in Java
- Throws:
InvalidQueryException
-
getSort
Takes the Sort parameter as a String and parses it into a List of SortColumn objects. The format is a comma seperated list of "columnName sortDirection", e.g. "name DESC, age ASC". It is not case sensitive and the sort direction is optional It default to sort ASCENDING.- Parameters:
sortParams
- - String passed in on the request- Returns:
- - the sort columns or an empty list if the params were invalid.
-
findPaging
Find paging setings based on the request parameters.- Parameters:
req
-- Returns:
- Paging
-
getPaging
Gets the default paging object- Parameters:
skip
-maxItems
-- Returns:
-
getFilter
Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter). Parses the parameter and produces a list of bean properties to use as a filter A SimpleBeanPropertyFilter it returned that uses the bean properties. If no filter param is set then a default BeanFilter is returned that will never filter fields (ie. Returns all bean properties).- Parameters:
filterParams
- String- Returns:
- BeanPropertyFilter - if no parameter then returns a new ReturnAllBeanProperties class
-
getRelationFilter
Takes the web request and looks for a "relations" parameter Parses the parameter and produces a list of bean properties to use as a filter A SimpleBeanPropertiesFilter it returned that uses the properties If no filter param is set then a default BeanFilter is returned that will never filter properties (ie. Returns all bean properties).- Parameters:
filterParams
- String- Returns:
- BeanPropertiesFilter - if no parameter then returns a new ReturnAllBeanProperties class
-
getRequestParameters
default Map<String,String[]> getRequestParameters(org.springframework.extensions.webscripts.WebScriptRequest req) Finds all request parameters that aren't already know about (eg. not paging or filter params) and returns them for use.- Parameters:
req
- - the WebScriptRequest object- Returns:
- the request parameters
-