Interface RecognizedParamsExtractor
-
- All Known Implementing Classes:
DeletedNodesImpl,DiscoveryApiWebscript,NetworksWebScriptGet,QuickShareLinksImpl,ResourceWebScriptDelete,ResourceWebScriptGet,ResourceWebScriptPost,ResourceWebScriptPut,SearchApiWebscript,SearchSQLApiWebscript
public interface RecognizedParamsExtractor
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<java.lang.String>KNOWN_PARAMSstatic java.lang.StringPARAM_FILTER_FIELDSstatic java.lang.StringPARAM_FILTER_PROPERTIESDeprecated.static java.lang.StringPARAM_INCLUDEstatic java.lang.StringPARAM_INCLUDE_SOURCE_ENTITYstatic java.lang.StringPARAM_ORDERBYstatic java.lang.StringPARAM_PAGING_MAXstatic java.lang.StringPARAM_PAGING_SKIPstatic java.lang.StringPARAM_RELATIONSstatic java.lang.StringPARAM_SELECTstatic java.lang.StringPARAM_WHERE
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default PagingfindPaging(org.springframework.extensions.webscripts.WebScriptRequest req)Find paging setings based on the request parameters.default java.util.List<java.lang.String>getClause(java.lang.String param, java.lang.String paramName)Gets the clause specificed in paramNamedefault BeanPropertiesFiltergetFilter(java.lang.String filterParams)Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter).default BeanPropertiesFiltergetFilter(java.lang.String filterParams, java.util.List<java.lang.String> selectList)Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter).default java.util.List<java.lang.String>getIncludeClause(java.lang.String includeParam)Takes the "include" parameter and turns it into a Listproperty names default PaginggetPaging(java.lang.String skip, java.lang.String maxItems)Gets the default paging objectdefault Params.RecognizedParamsgetRecognizedParams(org.springframework.extensions.webscripts.WebScriptRequest req)Finds the formal set of params that any rest service could potentially have passed in as request paramsdefault java.util.Map<java.lang.String,BeanPropertiesFilter>getRelationFilter(java.lang.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.default java.util.Map<java.lang.String,java.lang.String[]>getRequestParameters(org.springframework.extensions.webscripts.WebScriptRequest req)Finds all request parameters that aren't already know about (eg.default java.util.List<java.lang.String>getSelectClause(java.lang.String selectParam)Deprecated.default java.util.List<SortColumn>getSort(java.lang.String sortParams)Takes the Sort parameter as a String and parses it into a List of SortColumn objects.default QuerygetWhereClause(java.lang.String whereParam)Takes the "where" parameter and turns it into a Java Object that can be used for queryingdefault org.apache.commons.logging.LogrpeLogger()
-
-
-
Field Detail
-
PARAM_RELATIONS
static final java.lang.String PARAM_RELATIONS
- See Also:
- Constant Field Values
-
PARAM_FILTER_FIELDS
static final java.lang.String PARAM_FILTER_FIELDS
- See Also:
- Constant Field Values
-
PARAM_FILTER_PROPERTIES
@Deprecated static final java.lang.String PARAM_FILTER_PROPERTIES
Deprecated.- See Also:
- Constant Field Values
-
PARAM_PAGING_SKIP
static final java.lang.String PARAM_PAGING_SKIP
- See Also:
- Constant Field Values
-
PARAM_PAGING_MAX
static final java.lang.String PARAM_PAGING_MAX
- See Also:
- Constant Field Values
-
PARAM_ORDERBY
static final java.lang.String PARAM_ORDERBY
- See Also:
- Constant Field Values
-
PARAM_WHERE
static final java.lang.String PARAM_WHERE
- See Also:
- Constant Field Values
-
PARAM_SELECT
static final java.lang.String PARAM_SELECT
- See Also:
- Constant Field Values
-
PARAM_INCLUDE
static final java.lang.String PARAM_INCLUDE
- See Also:
- Constant Field Values
-
PARAM_INCLUDE_SOURCE_ENTITY
static final java.lang.String PARAM_INCLUDE_SOURCE_ENTITY
- See Also:
- Constant Field Values
-
KNOWN_PARAMS
static final java.util.List<java.lang.String> KNOWN_PARAMS
-
-
Method Detail
-
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
default BeanPropertiesFilter getFilter(java.lang.String filterParams, java.util.List<java.lang.String> selectList)
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 java.util.List<java.lang.String> getSelectClause(java.lang.String selectParam) throws InvalidArgumentExceptionDeprecated.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
default java.util.List<java.lang.String> getIncludeClause(java.lang.String includeParam) throws InvalidArgumentExceptionTakes 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
default java.util.List<java.lang.String> getClause(java.lang.String param, java.lang.String paramName)Gets the clause specificed in paramName- Parameters:
param-paramName-- Returns:
- bean property names potentially using JSON Pointer syntax
-
getWhereClause
default Query getWhereClause(java.lang.String whereParam) throws InvalidQueryException
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
default java.util.List<SortColumn> getSort(java.lang.String sortParams)
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
default Paging findPaging(org.springframework.extensions.webscripts.WebScriptRequest req)
Find paging setings based on the request parameters.- Parameters:
req-- Returns:
- Paging
-
getPaging
default Paging getPaging(java.lang.String skip, java.lang.String maxItems)
Gets the default paging object- Parameters:
skip-maxItems-- Returns:
-
getFilter
default BeanPropertiesFilter getFilter(java.lang.String filterParams)
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
default java.util.Map<java.lang.String,BeanPropertiesFilter> getRelationFilter(java.lang.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. Returns all bean properties).- Parameters:
filterParams- String- Returns:
- BeanPropertiesFilter - if no parameter then returns a new ReturnAllBeanProperties class
-
getRequestParameters
default java.util.Map<java.lang.String,java.lang.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
-
-