Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mohit-singh4
Copy link
Contributor

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.

@@ -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

The method 'buildQueryString(String, RecordsManagementSearchParameters)' has a cognitive complexity of 32, current threshold is 27
@@ -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

The method 'buildQueryString(String, RecordsManagementSearchParameters)' has a cyclomatic complexity of 22.
@@ -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

The method 'buildQueryString(String, RecordsManagementSearchParameters)' has an NPath complexity of 48640, current threshold is 200
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

Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty()
}
else
{
query.append("keywords:\"" + queryTerm + "\"");

Check warning

Code scanning / PMD

Avoid concatenating nonliterals in a StringBuffer/StringBuilder constructor or append(). Warning

Avoid concatenating nonliterals in a StringBuffer/StringBuilder constructor or append().
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

Rather than using a lot of String arguments, consider using a container object for those values.
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

Explicit type arguments can be replaced by a diamond: new RunAsWork<>()
@@ -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

Explicit type arguments can be replaced by a diamond: new RunAsWork<>()
@@ -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

Explicit type arguments can be replaced by a diamond: new RunAsWork<>()
Copy link
Contributor

@SathishK-T SathishK-T left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@kavitshah-gl kavitshah-gl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested information.

Copy link
Contributor

@SathishK-T SathishK-T left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@purusothaman-mm purusothaman-mm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@kavitshah-gl kavitshah-gl left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants