Merged HEAD (5.2) to 5.2.N (5.2.1)

126452 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      122164 gjames: RA-823 adding "includeSource" param


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126797 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 11:22:50 +00:00
parent c7c51c4ec4
commit 89702bf9d0
5 changed files with 23 additions and 10 deletions

View File

@@ -58,7 +58,7 @@ public class Params implements Parameters
private final Status status;
//Constants
private static final RecognizedParams NULL_PARAMS = new RecognizedParams(null, null, null, null, null, null, null);
private static final RecognizedParams NULL_PARAMS = new RecognizedParams(null, null, null, null, null, null, null, false);
private static final BasicContentInfo DEFAULT_CONTENT_INFO = new ContentInfoImpl(MimetypeMap.MIMETYPE_BINARY, "UTF-8", -1, null);
protected Params(String entityId, String relationshipId, Object passedIn, InputStream stream, String addressedProperty, RecognizedParams recognizedParams, BasicContentInfo contentInfo)
@@ -76,7 +76,7 @@ public class Params implements Parameters
public static Params valueOf(BeanPropertiesFilter paramFilter, String entityId)
{
return new Params(entityId, null, null, null, null, new RecognizedParams(null, null, paramFilter, null, null, null, null), null);
return new Params(entityId, null, null, null, null, new RecognizedParams(null, null, paramFilter, null, null, null, null, false), null);
}
public static Params valueOf(String entityId, String relationshipId)
@@ -129,6 +129,11 @@ public class Params implements Parameters
return this.recognizedParams.filter;
}
public boolean includeSource()
{
return this.recognizedParams.includeSource;
}
public Map<String, BeanPropertiesFilter> getRelationsFilter()
{
return this.recognizedParams.relationshipFilter;
@@ -164,6 +169,8 @@ public class Params implements Parameters
builder.append(this.recognizedParams.filter);
builder.append(", relationshipFilter=");
builder.append(this.recognizedParams.relationshipFilter);
builder.append(", includeSource=");
builder.append(this.recognizedParams.includeSource);
builder.append(", addressedProperty=");
builder.append(this.addressedProperty);
builder.append("]");
@@ -247,10 +254,11 @@ public class Params implements Parameters
private final Query query;
private final List<String> select;
private final List<SortColumn> sorting;
private final boolean includeSource;
@SuppressWarnings("unchecked")
public RecognizedParams(Map<String, String[]> requestParameters, Paging paging, BeanPropertiesFilter filter, Map<String, BeanPropertiesFilter> relationshipFilter, List<String> select,
Query query, List<SortColumn> sorting)
Query query, List<SortColumn> sorting, boolean includeSource)
{
super();
this.requestParameters = requestParameters;
@@ -260,6 +268,7 @@ public class Params implements Parameters
this.relationshipFilter = (Map<String, BeanPropertiesFilter>) (relationshipFilter==null?Collections.emptyMap():relationshipFilter);
this.select = (List<String>) (select==null?Collections.emptyList():select);
this.sorting = (List<SortColumn>) (sorting==null?Collections.emptyList():sorting);
this.includeSource = includeSource;
}
}

View File

@@ -98,7 +98,8 @@ public class ResourceWebScriptHelper
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<String> KNOWN_PARAMS = Arrays.asList(PARAM_RELATIONS,PARAM_FILTER_PROPS,PARAM_PAGING_SKIP,PARAM_PAGING_MAX, PARAM_ORDERBY, PARAM_WHERE, PARAM_SELECT);
public static final String PARAM_INCLUDE_SOURCE_ENTITY = "includeSource";
public static final List<String> KNOWN_PARAMS = Arrays.asList(PARAM_RELATIONS,PARAM_FILTER_PROPS,PARAM_PAGING_SKIP,PARAM_PAGING_MAX, PARAM_ORDERBY, PARAM_WHERE, PARAM_SELECT, PARAM_INCLUDE_SOURCE_ENTITY);
private ResourceLocator locator;
@@ -695,13 +696,14 @@ public class ResourceWebScriptHelper
Map<String, BeanPropertiesFilter> relationFilter = getRelationFilter(req.getParameter(ResourceWebScriptHelper.PARAM_RELATIONS));
Query whereQuery = getWhereClause(req.getParameter(ResourceWebScriptHelper.PARAM_WHERE));
Map<String, String[]> requestParams = getRequestParameters(req);
boolean includeSource = Boolean.valueOf(req.getParameter(ResourceWebScriptHelper.PARAM_INCLUDE_SOURCE_ENTITY));
List<String> theSelect = getSelectClause(req.getParameter(ResourceWebScriptHelper.PARAM_SELECT));
BeanPropertiesFilter filter = getFilter(req.getParameter(ResourceWebScriptHelper.PARAM_FILTER_PROPS), theSelect);
return new RecognizedParams(requestParams, paging, filter, relationFilter, theSelect, whereQuery, sorting);
return new RecognizedParams(requestParams, paging, filter, relationFilter, theSelect, whereQuery, sorting, includeSource);
}
/**
* Find paging setings based on the request parameters.
*