public class ResourceWebScriptHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.List |
KNOWN_PARAMS |
static java.lang.String |
PARAM_FILTER_PROPS |
static java.lang.String |
PARAM_ORDERBY |
static java.lang.String |
PARAM_PAGING_MAX |
static java.lang.String |
PARAM_PAGING_SKIP |
static java.lang.String |
PARAM_RELATIONS |
static java.lang.String |
PARAM_SELECT |
static java.lang.String |
PARAM_WHERE |
Constructor and Description |
---|
ResourceWebScriptHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
extractJsonContent(org.springframework.extensions.webscripts.WebScriptRequest req,
JacksonHelper jsonHelper,
java.lang.Class requiredType)
Extracts the body contents from the request
|
static java.util.List |
extractJsonContentAsList(org.springframework.extensions.webscripts.WebScriptRequest req,
JacksonHelper jsonHelper,
java.lang.Class requiredType)
Extracts the body contents from the request as a List, the JSON can be an array or just a single value without the [] symbols
|
static Paging |
findPaging(org.springframework.extensions.webscripts.WebScriptRequest req)
Find paging setings based on the request parameters.
|
static BeanPropertiesFilter |
getFilter(java.lang.String filterParams)
Takes the web request and looks for a "filter" parameter Parses the
parameter and produces a list of bean properties to use as a filter A
SimpleBeanPropertyFilter it returned that uses the properties If no
filter param is set then a default BeanFilter is returned that will never
filter properties (ie.
|
static 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
|
static java.util.Map |
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.
|
static java.util.Map |
getRequestParameters(org.springframework.extensions.webscripts.WebScriptRequest req)
Finds all request parameters that aren't already know about (eg.
|
static java.util.List |
getSelectClause(java.lang.String selectParam)
Takes the "select" parameter and turns it into a List
|
static java.util.List |
getSort(java.lang.String sortParams)
Takes the Sort parameter as a String and parses it into a List of SortColumn objects.
|
static Query |
getWhereClause(java.lang.String whereParam)
Takes the "where" parameter and turns it into a Java Object that can be used for querying
|
java.lang.Object |
postProcessResponse(Api api,
java.lang.String entityCollectionName,
Params params,
java.lang.Object objectToWrap)
Looks at the object passed in and recursively expands any @EmbeddedEntityResource annotations or related relationship.
|
void |
setExecutor(ActionExecutor executor) |
void |
setLocator(ResourceLocator locator) |
static void |
setUniqueId(java.lang.Object theObj,
java.lang.String uniqueId)
Set the id of theObj to the uniqueId.
|
public static final java.lang.String PARAM_RELATIONS
public static final java.lang.String PARAM_FILTER_PROPS
public static final java.lang.String PARAM_PAGING_SKIP
public static final java.lang.String PARAM_PAGING_MAX
public static final java.lang.String PARAM_ORDERBY
public static final java.lang.String PARAM_WHERE
public static final java.lang.String PARAM_SELECT
public static final java.util.List KNOWN_PARAMS
public static BeanPropertiesFilter getFilter(java.lang.String filterParams)
req
- public static java.util.Map getRelationFilter(java.lang.String filterParams)
req
- public static java.util.List getSelectClause(java.lang.String selectParam) throws InvalidArgumentException
selectParam
- InvalidArgumentException
public static Query getWhereClause(java.lang.String whereParam) throws InvalidQueryException
whereParam
- InvalidQueryException
public static java.util.List getSort(java.lang.String sortParams)
sortParams
- - String passed in on the requestpublic static java.lang.Object extractJsonContent(org.springframework.extensions.webscripts.WebScriptRequest req, JacksonHelper jsonHelper, java.lang.Class requiredType)
req
- the requestjsonHelper
- Jackson HelperrequiredType
- the type to returnpublic static java.util.List extractJsonContentAsList(org.springframework.extensions.webscripts.WebScriptRequest req, JacksonHelper jsonHelper, java.lang.Class requiredType)
req
- the requestjsonHelper
- Jackson HelperrequiredType
- the type to return (without the List param)public static void setUniqueId(java.lang.Object theObj, java.lang.String uniqueId)
theObj
- uniqueId
- public java.lang.Object postProcessResponse(Api api, java.lang.String entityCollectionName, Params params, java.lang.Object objectToWrap)
objectToWrap
- result
- public static java.util.Map getRequestParameters(org.springframework.extensions.webscripts.WebScriptRequest req)
req
- - the WebScriptRequest objectpublic static Params.RecognizedParams getRecognizedParams(org.springframework.extensions.webscripts.WebScriptRequest req)
req
- WebScriptRequestpublic static Paging findPaging(org.springframework.extensions.webscripts.WebScriptRequest req)
req
- public void setLocator(ResourceLocator locator)
public void setExecutor(ActionExecutor executor)
Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.