diff --git a/source/java/org/alfresco/rest/framework/resource/parameters/Parameters.java b/source/java/org/alfresco/rest/framework/resource/parameters/Parameters.java index 5eaaad9a66..2161fe0ac0 100644 --- a/source/java/org/alfresco/rest/framework/resource/parameters/Parameters.java +++ b/source/java/org/alfresco/rest/framework/resource/parameters/Parameters.java @@ -44,6 +44,13 @@ public interface Parameters */ public Paging getPaging(); + /** + * Returns a List of {@link SortColumn} for sorting properties. + * Specified by the "orderBy" request parameter. + * @return List of {@link SortColumn} + */ + public List getSorting(); + /** * Returns a {@link BeanPropertiesFilter} for filtering out properties. * Specified by the "properties" request parameter. diff --git a/source/java/org/alfresco/rest/framework/resource/parameters/Params.java b/source/java/org/alfresco/rest/framework/resource/parameters/Params.java index bd6a7d0046..dc20e9fca2 100644 --- a/source/java/org/alfresco/rest/framework/resource/parameters/Params.java +++ b/source/java/org/alfresco/rest/framework/resource/parameters/Params.java @@ -177,6 +177,12 @@ public class Params implements Parameters return (addressedProperty != null && addressedProperty.equals(propertyName)); } + @Override + public List getSorting() + { + return recognizedParams.sorting; + } + @Override public String getBinaryProperty() { @@ -207,6 +213,7 @@ public class Params implements Parameters private final List select; private final List sorting; + @SuppressWarnings("unchecked") public RecognizedParams(Map requestParameters, Paging paging, BeanPropertiesFilter filter, Map relationshipFilter, List select, Query query, List sorting) { diff --git a/source/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptHelper.java b/source/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptHelper.java index 963c07b414..f51d597f51 100644 --- a/source/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptHelper.java +++ b/source/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptHelper.java @@ -70,10 +70,10 @@ public class ResourceWebScriptHelper public static final String PARAM_FILTER_PROPS = "properties"; public static final String PARAM_PAGING_SKIP = "skipCount"; public static final String PARAM_PAGING_MAX = "maxItems"; - public static final String PARAM_SORT = "sort"; + public static final String PARAM_ORDERBY = "orderBy"; public static final String PARAM_WHERE = "where"; public static final String PARAM_SELECT = "select"; - public static final List KNOWN_PARAMS = Arrays.asList(PARAM_RELATIONS,PARAM_FILTER_PROPS,PARAM_PAGING_SKIP,PARAM_PAGING_MAX, PARAM_SORT, PARAM_WHERE, PARAM_SELECT); + public static final List KNOWN_PARAMS = Arrays.asList(PARAM_RELATIONS,PARAM_FILTER_PROPS,PARAM_PAGING_SKIP,PARAM_PAGING_MAX, PARAM_ORDERBY, PARAM_WHERE, PARAM_SELECT); private ResourceLocator locator; @@ -605,7 +605,7 @@ public class ResourceWebScriptHelper public static RecognizedParams getRecognizedParams(WebScriptRequest req) { Paging paging = findPaging(req); - List sorting = getSort(req.getParameter(ResourceWebScriptHelper.PARAM_SORT)); + List sorting = getSort(req.getParameter(ResourceWebScriptHelper.PARAM_ORDERBY)); Map relationFilter = getRelationFilter(req.getParameter(ResourceWebScriptHelper.PARAM_RELATIONS)); BeanPropertiesFilter filter = getFilter(req.getParameter(ResourceWebScriptHelper.PARAM_FILTER_PROPS)); Query whereQuery = getWhereClause(req.getParameter(ResourceWebScriptHelper.PARAM_WHERE));