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

129199 mmuller: Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
      129059 adavis: REPO-243 People Live Search
         - Use id (in fields and orderBy) rather than userName as it is an id that is returned in the Person entity
         - Added tests to test id can be used in fields and orderBy
         - Added 'wildcard' tests created by Alexandru-Eusebiu Epure


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129373 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 14:17:31 +00:00
parent e82b481e97
commit 3ff6c66203
3 changed files with 104 additions and 21 deletions

View File

@@ -57,7 +57,7 @@ public interface Queries
static int MIN_TERM_LENGTH_NODES = 3;
// People query
static String PARAM_USERNAME = ContentModel.PROP_USERNAME.getLocalName();
static String PARAM_PERSON_ID = "id";
static String PARAM_FIRSTNAME = ContentModel.PROP_FIRSTNAME.getLocalName();
static String PARAM_LASTNAME = ContentModel.PROP_LASTNAME.getLocalName();
static int MIN_TERM_LENGTH_PEOPLE = 2;

View File

@@ -94,7 +94,7 @@ public class QueriesImpl implements Queries, InitializingBean
PARAM_MODIFIEDAT, ContentModel.PROP_MODIFIED);
private final static Map<String, QName> PEOPLE_SORT_PARAMS_TO_QNAMES = sortParamsToQNames(
ContentModel.PROP_USERNAME,
PARAM_PERSON_ID, ContentModel.PROP_USERNAME,
ContentModel.PROP_FIRSTNAME,
ContentModel.PROP_LASTNAME);
@@ -447,6 +447,15 @@ public class QueriesImpl implements Queries, InitializingBean
T t = convert(nodeRef, includeParam);
collection.add(t);
}
if (sort == POST_QUERY_SORT)
{
return listPage(collection, paging);
}
else
{
return CollectionWithPagingInfo.asPaged(paging, collection, queryResults.hasMore(), new Long(queryResults.getNumberFound()).intValue());
}
}
finally
{
@@ -455,15 +464,6 @@ public class QueriesImpl implements Queries, InitializingBean
queryResults.close();
}
}
if (sort == POST_QUERY_SORT)
{
return listPage(collection, paging);
}
else
{
return CollectionWithPagingInfo.asPaged(paging, collection, queryResults.hasMore(), new Long(queryResults.getNumberFound()).intValue());
}
}
/**