mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
[MNT-24310] Fix AGS Rest API returning non RM objects (#2787)
* [MNT-24310] Fix AGS Rest API returning non RM objects * [MNT-24310] Fix AGS Rest API returning non RM objects * [MNT-24310] Fix AGS Rest API returning non RM objects * [MNT-24310] Fix AGS Rest API returning non RM objects * [MNT-24310] Fix AGS Rest API returning non RM objects
This commit is contained in:
@@ -92,7 +92,7 @@ public class SearchTypesFactory
|
||||
boolean includeRecords = false;
|
||||
boolean includeSubTypes = false;
|
||||
|
||||
if (q != null)
|
||||
if (q != null && q.getTree() != null)
|
||||
{
|
||||
// filtering via "where" clause
|
||||
MapBasedQueryWalker propertyWalker = new MapBasedQueryWalker(listFolderChildrenEqualsQueryProperties, null);
|
||||
@@ -101,11 +101,11 @@ public class SearchTypesFactory
|
||||
Boolean isUnfiledRecordFolder = propertyWalker.getProperty(UnfiledChild.PARAM_IS_UNFILED_RECORD_FOLDER,
|
||||
WhereClauseParser.EQUALS, Boolean.class);
|
||||
Boolean isRecord = propertyWalker.getProperty(UnfiledChild.PARAM_IS_RECORD, WhereClauseParser.EQUALS, Boolean.class);
|
||||
if ((isUnfiledRecordFolder != null && isUnfiledRecordFolder.booleanValue()) || (isRecord != null && !isRecord.booleanValue()))
|
||||
if (checkIncludeUnfiledRecordFolders(isUnfiledRecordFolder, isRecord))
|
||||
{
|
||||
includeUnfiledRecordFolders = true;
|
||||
}
|
||||
else if ((isUnfiledRecordFolder != null && !isUnfiledRecordFolder.booleanValue()) || (isRecord != null && isRecord.booleanValue()))
|
||||
else if (checkIncludeRecords(isUnfiledRecordFolder, isRecord))
|
||||
{
|
||||
includeRecords = true;
|
||||
}
|
||||
@@ -199,11 +199,11 @@ public class SearchTypesFactory
|
||||
WhereClauseParser.EQUALS, Boolean.class);
|
||||
Boolean isRecordCategory = propertyWalker.getProperty(RecordCategoryChild.PARAM_IS_RECORD_CATEGORY, WhereClauseParser.EQUALS, Boolean.class);
|
||||
|
||||
if ((isRecordFolder != null && isRecordFolder.booleanValue()) || (isRecordCategory != null && !isRecordCategory.booleanValue()))
|
||||
if (checkIncludeUnfiledRecordFolders(isRecordFolder, isRecordCategory))
|
||||
{
|
||||
includeRecordFolders = true;
|
||||
}
|
||||
else if ((isRecordFolder != null && !isRecordFolder.booleanValue()) || (isRecordCategory != null && isRecordCategory.booleanValue()))
|
||||
else if (checkIncludeRecords(isRecordFolder, isRecordCategory))
|
||||
{
|
||||
includeRecordCategories = true;
|
||||
}
|
||||
@@ -291,4 +291,16 @@ public class SearchTypesFactory
|
||||
|
||||
return new Pair<>(filterNodeTypeQName, filterIncludeSubTypes);
|
||||
}
|
||||
|
||||
private static boolean checkIncludeRecords(Boolean isUnfiledRecordFolder, Boolean isRecord)
|
||||
{
|
||||
return (isUnfiledRecordFolder != null && !isUnfiledRecordFolder.booleanValue()) || (isRecord != null
|
||||
&& isRecord.booleanValue());
|
||||
}
|
||||
|
||||
private static boolean checkIncludeUnfiledRecordFolders(Boolean isUnfiledRecordFolder, Boolean isRecord)
|
||||
{
|
||||
return (isUnfiledRecordFolder != null && isUnfiledRecordFolder.booleanValue()) || (isRecord != null
|
||||
&& !isRecord.booleanValue());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user