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

130183 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1)
      129823 gjames: SEARCH-113: Clearer default parameters


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130334 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 22:05:13 +00:00
parent 150c78cf09
commit cd362c3c75

View File

@@ -77,13 +77,23 @@ public class SearchMapper
ParameterCheck.mandatory("query", searchQuery.getQuery());
SearchParameters sp = new SearchParameters();
setDefaults(sp);
fromQuery(sp, searchQuery.getQuery());
fromPaging(sp, searchQuery.getPaging());
validateInclude(searchQuery.getInclude());
return sp;
}
/**
* Sets the API defaults
* @param sp
*/
protected void setDefaults(SearchParameters sp)
{
//Hardcode workspace store
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
return sp;
}
/**
@@ -134,8 +144,7 @@ public class SearchMapper
{
if (!PERMITTED_INCLUDES.contains(inc))
{
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
new Object[] { inc });
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] { inc });
}
}