Skip to content

Commit

Permalink
[MNT-24310] Fix AGS Rest API returning non RM objects
Browse files Browse the repository at this point in the history
  • Loading branch information
suneet-gupta committed Jul 17, 2024
1 parent 7c5d221 commit 6b84d11
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ public Set<QName> buildSearchTypesForUnfiledEndpoint(Parameters parameters, Set<
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) || (isRecord != null && !isRecord))
if (checkIncludeUnfiledRecordFolders(isUnfiledRecordFolder, isRecord))
{
includeUnfiledRecordFolders = true;
}
else if (isRecord != null)
else if (checkIncludeRecords(isUnfiledRecordFolder, isRecord))
{
includeRecords = true;
}
Expand Down Expand Up @@ -199,11 +199,11 @@ public Set<QName> buildSearchTypesCategoriesEndpoint(Parameters parameters, Set<
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 (checkIncludeUnifiedRecordFolders(isRecordFolder, isRecordCategory))
{
includeRecordFolders = true;
}
else if ((isRecordFolder != null && !isRecordFolder.booleanValue()) || (isRecordCategory != null && isRecordCategory.booleanValue()))
else if (checkIncludeRecords(isRecordFolder, isRecordCategory))
{
includeRecordCategories = true;
}
Expand Down Expand Up @@ -291,4 +291,16 @@ private Pair<QName, Boolean> parseNodeTypeFilter(String nodeTypeStr)

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());
}
}

0 comments on commit 6b84d11

Please sign in to comment.