public class ResourceWebScriptHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
KNOWN_PARAMS |
static String |
PARAM_FILTER_PROPS |
static String |
PARAM_ORDERBY |
static String |
PARAM_PAGING_MAX |
static String |
PARAM_PAGING_SKIP |
static String |
PARAM_RELATIONS |
static String |
PARAM_SELECT |
static String |
PARAM_WHERE |
| Constructor and Description |
|---|
ResourceWebScriptHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
extractJsonContent(org.springframework.extensions.webscripts.WebScriptRequest req,
JacksonHelper jsonHelper,
Class<T> requiredType)
Extracts the body contents from the request
|
static <T> List<T> |
extractJsonContentAsList(org.springframework.extensions.webscripts.WebScriptRequest req,
JacksonHelper jsonHelper,
Class<T> 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(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 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.
|
static Map<String,String[]> |
getRequestParameters(org.springframework.extensions.webscripts.WebScriptRequest req)
Finds all request parameters that aren't already know about (eg.
|
static List<String> |
getSelectClause(String selectParam)
Takes the "select" parameter and turns it into a List
|
static List<SortColumn> |
getSort(String sortParams)
Takes the Sort parameter as a String and parses it into a List of SortColumn objects.
|
static Query |
getWhereClause(String whereParam)
Takes the "where" parameter and turns it into a Java Object that can be used for querying
|
Object |
postProcessResponse(Api api,
String entityCollectionName,
Params params,
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(Object theObj,
String uniqueId)
Set the id of theObj to the uniqueId.
|
public static final String PARAM_RELATIONS
public static final String PARAM_FILTER_PROPS
public static final String PARAM_PAGING_SKIP
public static final String PARAM_PAGING_MAX
public static final String PARAM_ORDERBY
public static final String PARAM_WHERE
public static final String PARAM_SELECT
public static BeanPropertiesFilter getFilter(String filterParams)
req - public static Map<String,BeanPropertiesFilter> getRelationFilter(String filterParams)
req - public static List<String> getSelectClause(String selectParam) throws InvalidArgumentException
selectParam - InvalidArgumentExceptionpublic static Query getWhereClause(String whereParam) throws InvalidQueryException
whereParam - InvalidQueryExceptionpublic static List<SortColumn> getSort(String sortParams)
sortParams - - String passed in on the requestpublic static <T> T extractJsonContent(org.springframework.extensions.webscripts.WebScriptRequest req,
JacksonHelper jsonHelper,
Class<T> requiredType)
req - the requestjsonHelper - Jackson HelperrequiredType - the type to returnpublic static <T> List<T> extractJsonContentAsList(org.springframework.extensions.webscripts.WebScriptRequest req, JacksonHelper jsonHelper, Class<T> requiredType)
req - the requestjsonHelper - Jackson HelperrequiredType - the type to return (without the List param)public static void setUniqueId(Object theObj, String uniqueId)
theObj - uniqueId - public Object postProcessResponse(Api api, String entityCollectionName, Params params, Object objectToWrap)
objectToWrap - result - public static Map<String,String[]> 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–2014 Alfresco Software. All rights reserved.