mirror of https://github.com/apache/archiva.git
[MRM-1720] make pageSize and selectedPage configurable tru the REST request.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1423550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
481baa6ffb
commit
d15b737723
|
@ -117,6 +117,15 @@ public class SearchRequest
|
||||||
*/
|
*/
|
||||||
private boolean includePomArtifacts = false;
|
private boolean includePomArtifacts = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.4-M4
|
||||||
|
*/
|
||||||
|
private int pageSize = 30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.4-M4
|
||||||
|
*/
|
||||||
|
private int selectedPage = 0;
|
||||||
|
|
||||||
|
|
||||||
public SearchRequest()
|
public SearchRequest()
|
||||||
|
@ -286,6 +295,26 @@ public class SearchRequest
|
||||||
this.bundleRequireBundle = bundleRequireBundle;
|
this.bundleRequireBundle = bundleRequireBundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPageSize()
|
||||||
|
{
|
||||||
|
return pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPageSize( int pageSize )
|
||||||
|
{
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSelectedPage()
|
||||||
|
{
|
||||||
|
return selectedPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedPage( int selectedPage )
|
||||||
|
{
|
||||||
|
this.selectedPage = selectedPage;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -306,6 +335,8 @@ public class SearchRequest
|
||||||
sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
|
sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
|
||||||
sb.append( ", classifier='" ).append( classifier ).append( '\'' );
|
sb.append( ", classifier='" ).append( classifier ).append( '\'' );
|
||||||
sb.append( ", includePomArtifacts=" ).append( includePomArtifacts );
|
sb.append( ", includePomArtifacts=" ).append( includePomArtifacts );
|
||||||
|
sb.append( ", pageSize=" ).append( pageSize );
|
||||||
|
sb.append( ", selectedPage=" ).append( selectedPage );
|
||||||
sb.append( '}' );
|
sb.append( '}' );
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,8 @@ public class DefaultSearchService
|
||||||
{
|
{
|
||||||
repositories = getObservableRepos();
|
repositories = getObservableRepos();
|
||||||
}
|
}
|
||||||
SearchResultLimits limits = new SearchResultLimits( 0 );
|
SearchResultLimits limits =
|
||||||
|
new SearchResultLimits( searchRequest.getPageSize(), searchRequest.getSelectedPage() );
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SearchResults searchResults = repositorySearch.search( getPrincipal(), repositories, queryString, limits,
|
SearchResults searchResults = repositorySearch.search( getPrincipal(), repositories, queryString, limits,
|
||||||
|
|
Loading…
Reference in New Issue