mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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/BRANCHES/DEV/5.2.N/root@130183 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -77,13 +77,23 @@ public class SearchMapper
|
|||||||
ParameterCheck.mandatory("query", searchQuery.getQuery());
|
ParameterCheck.mandatory("query", searchQuery.getQuery());
|
||||||
|
|
||||||
SearchParameters sp = new SearchParameters();
|
SearchParameters sp = new SearchParameters();
|
||||||
|
setDefaults(sp);
|
||||||
|
|
||||||
fromQuery(sp, searchQuery.getQuery());
|
fromQuery(sp, searchQuery.getQuery());
|
||||||
fromPaging(sp, searchQuery.getPaging());
|
fromPaging(sp, searchQuery.getPaging());
|
||||||
validateInclude(searchQuery.getInclude());
|
validateInclude(searchQuery.getInclude());
|
||||||
|
|
||||||
|
return sp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the API defaults
|
||||||
|
* @param sp
|
||||||
|
*/
|
||||||
|
protected void setDefaults(SearchParameters sp)
|
||||||
|
{
|
||||||
//Hardcode workspace store
|
//Hardcode workspace store
|
||||||
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
|
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
|
||||||
return sp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -134,8 +144,7 @@ public class SearchMapper
|
|||||||
{
|
{
|
||||||
if (!PERMITTED_INCLUDES.contains(inc))
|
if (!PERMITTED_INCLUDES.contains(inc))
|
||||||
{
|
{
|
||||||
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
|
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[] { inc });
|
||||||
new Object[] { inc });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user