-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix/MNT-23559-FixForRecordsManagementSearch] Fix for limited 500 items in RecordManagement Search #3165
base: master
Are you sure you want to change the base?
Conversation
…ms in Records Management Search
@@ -263,98 +273,98 @@ | |||
* @param types | |||
* @return | |||
*/ | |||
/*package*/ String buildQueryString(String queryTerm, RecordsManagementSearchParameters searchParameters) | |||
/* package */ String buildQueryString(String queryTerm, RecordsManagementSearchParameters searchParameters) |
Check warning
Code scanning / PMD
The method 'buildQueryString(String, RecordsManagementSearchParameters)' has a cognitive complexity of 32, current threshold is 27 Warning
@@ -263,98 +273,98 @@ | |||
* @param types | |||
* @return | |||
*/ | |||
/*package*/ String buildQueryString(String queryTerm, RecordsManagementSearchParameters searchParameters) | |||
/* package */ String buildQueryString(String queryTerm, RecordsManagementSearchParameters searchParameters) |
Check warning
Code scanning / PMD
The method 'buildQueryString(String, RecordsManagementSearchParameters)' has a cyclomatic complexity of 22. Warning
@@ -263,98 +273,98 @@ | |||
* @param types | |||
* @return | |||
*/ | |||
/*package*/ String buildQueryString(String queryTerm, RecordsManagementSearchParameters searchParameters) | |||
/* package */ String buildQueryString(String queryTerm, RecordsManagementSearchParameters searchParameters) |
Check warning
Code scanning / PMD
The method 'buildQueryString(String, RecordsManagementSearchParameters)' has an NPath complexity of 48640, current threshold is 200 Warning
appendType(typeQuery, "rma:recordFolder"); | ||
} | ||
List<QName> includedContainerTypes = searchParameters.getIncludedContainerTypes(); | ||
if (includedContainerTypes != null && includedContainerTypes.size() != 0) |
Check warning
Code scanning / PMD
Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() Warning
} | ||
else | ||
{ | ||
query.append("keywords:\"" + queryTerm + "\""); |
Check warning
Code scanning / PMD
Avoid concatenating nonliterals in a StringBuffer/StringBuilder constructor or append(). Warning
ParameterCheck.mandatory("query", query); | ||
ParameterCheck.mandatory("searchParameters", searchParameters); | ||
@Override | ||
public SavedSearchDetails saveSearch(String siteId, String name, String description, String query, RecordsManagementSearchParameters searchParameters, boolean isPublic) |
Check warning
Code scanning / PMD
Rather than using a lot of String arguments, consider using a container object for those values. Warning
if (container == null) | ||
{ | ||
container = AuthenticationUtil.runAs(new RunAsWork<NodeRef>() | ||
{ | ||
container = AuthenticationUtil.runAs(new RunAsWork<NodeRef>() { |
Check warning
Code scanning / PMD
Explicit type arguments can be replaced by a diamond: `new RunAsWork<>()` Warning
@@ -530,8 +542,7 @@ | |||
if (userContainer == null) | |||
{ | |||
final NodeRef parentContainer = container; | |||
userContainer = AuthenticationUtil.runAs(new RunAsWork<NodeRef>() | |||
{ | |||
userContainer = AuthenticationUtil.runAs(new RunAsWork<NodeRef>() { |
Check warning
Code scanning / PMD
Explicit type arguments can be replaced by a diamond: `new RunAsWork<>()` Warning
@@ -547,8 +558,7 @@ | |||
if (searchNode == null) | |||
{ | |||
final NodeRef searchContainer = container; | |||
searchNode = AuthenticationUtil.runAs(new RunAsWork<NodeRef>() | |||
{ | |||
searchNode = AuthenticationUtil.runAs(new RunAsWork<NodeRef>() { |
Check warning
Code scanning / PMD
Explicit type arguments can be replaced by a diamond: `new RunAsWork<>()` Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested information.
...va/org/alfresco/module/org_alfresco_module_rm/search/RecordsManagementSearchServiceImpl.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Lets get it reviewed with ACS Lead as well once.
https://hyland.atlassian.net/browse/MNT-23559
[Concern] When performing a records search on the RM site, the number of results returned is limited to a maximum of 500 items.
[Solution] As per the implementation, it retrieves a static value from the property file, which is why it is restricted to 500 items. However, upon reviewing the code, I noticed that the same method is being called from RMSearchGet, where we have the privilege to set a custom maximum number of items. Therefore, instead of using the default value from the property file, we are now setting the value from the caller method's arguments.