mirror of https://github.com/apache/archiva.git
[MRM-1836] Make search limit (maxCount) configurable via UI
This commit is contained in:
parent
10a0761768
commit
0312f52d7f
|
@ -144,6 +144,7 @@ public class DefaultSearchService
|
||||||
}
|
}
|
||||||
SearchFields searchField = getModelMapper().map( searchRequest, SearchFields.class );
|
SearchFields searchField = getModelMapper().map( searchRequest, SearchFields.class );
|
||||||
SearchResultLimits limits = new SearchResultLimits( 0 );
|
SearchResultLimits limits = new SearchResultLimits( 0 );
|
||||||
|
limits.setPageSize( searchRequest.getPageSize() );
|
||||||
|
|
||||||
// if no repos set we use ones available for the user
|
// if no repos set we use ones available for the user
|
||||||
if ( searchField.getRepositories() == null || searchField.getRepositories().isEmpty() )
|
if ( searchField.getRepositories() == null || searchField.getRepositories().isEmpty() )
|
||||||
|
|
|
@ -371,6 +371,7 @@ search.artifact.search.form.query.bundleExportPackage=Export Package
|
||||||
search.artifact.search.form.query.bundleExportService=Export Service
|
search.artifact.search.form.query.bundleExportService=Export Service
|
||||||
search.artifact.search.form.query.bundleImportPackage=Import Package
|
search.artifact.search.form.query.bundleImportPackage=Import Package
|
||||||
search.artifact.search.form.query.bundleRequireBundle=Require Bundle
|
search.artifact.search.form.query.bundleRequireBundle=Require Bundle
|
||||||
|
search.artifact.search.form.query.pageSize=Page Size
|
||||||
artifact.detail.tab.header.dependencies=Dependencies
|
artifact.detail.tab.header.dependencies=Dependencies
|
||||||
artifact.detail.tab.header.metadatas=Metadata
|
artifact.detail.tab.header.metadatas=Metadata
|
||||||
artifact.detail.tab.header.mailing.list=Mailing Lists
|
artifact.detail.tab.header.mailing.list=Mailing Lists
|
||||||
|
|
|
@ -346,6 +346,7 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa
|
||||||
var classifier= terms.length>3?terms[3]:"";
|
var classifier= terms.length>3?terms[3]:"";
|
||||||
var packaging= terms.length>4?terms[4]:"";
|
var packaging= terms.length>4?terms[4]:"";
|
||||||
var className= terms.length>5?terms[5]:"";
|
var className= terms.length>5?terms[5]:"";
|
||||||
|
var pageSize= terms.length>6?terms[6]:"";
|
||||||
$.log("groupId:artifactId:version:classifier:packaging:className="+groupId+':'+artifactId+':'+version+':'+classifier+':'+packaging+':'+className);
|
$.log("groupId:artifactId:version:classifier:packaging:className="+groupId+':'+artifactId+':'+version+':'+classifier+':'+packaging+':'+className);
|
||||||
var searchViewModel = new SearchViewModel();
|
var searchViewModel = new SearchViewModel();
|
||||||
var searchRequest = new SearchRequest();
|
var searchRequest = new SearchRequest();
|
||||||
|
@ -355,6 +356,7 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa
|
||||||
searchRequest.classifier(classifier);
|
searchRequest.classifier(classifier);
|
||||||
searchRequest.packaging(packaging);
|
searchRequest.packaging(packaging);
|
||||||
searchRequest.className(className);
|
searchRequest.className(className);
|
||||||
|
searchRequest.pageSize(pageSize);
|
||||||
//searchRequest.repositories=repos;
|
//searchRequest.repositories=repos;
|
||||||
//searchRequest.selectedRepoIds=repos;
|
//searchRequest.selectedRepoIds=repos;
|
||||||
searchViewModel.searchRequest(searchRequest);
|
searchViewModel.searchRequest(searchRequest);
|
||||||
|
|
|
@ -2081,6 +2081,9 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
|
||||||
this.includePomArtifacts=ko.observable(true);
|
this.includePomArtifacts=ko.observable(true);
|
||||||
|
|
||||||
this.classifier=ko.observable();
|
this.classifier=ko.observable();
|
||||||
|
|
||||||
|
// private int pageSize = 30;
|
||||||
|
this.pageSize = ko.observable( 30 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2293,9 +2296,7 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
|
||||||
location+="/";
|
location+="/";
|
||||||
if(self.searchRequest().groupId()){
|
if(self.searchRequest().groupId()){
|
||||||
location+=self.searchRequest().groupId();
|
location+=self.searchRequest().groupId();
|
||||||
}/*else{
|
}
|
||||||
location+='~';
|
|
||||||
}*/
|
|
||||||
if(self.searchRequest().artifactId()){
|
if(self.searchRequest().artifactId()){
|
||||||
location+='~'+self.searchRequest().artifactId();
|
location+='~'+self.searchRequest().artifactId();
|
||||||
}else{
|
}else{
|
||||||
|
@ -2321,6 +2322,11 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
|
||||||
}else{
|
}else{
|
||||||
location+='~';
|
location+='~';
|
||||||
}
|
}
|
||||||
|
if(self.searchRequest().pageSize()){
|
||||||
|
location+='~'+self.searchRequest().pageSize();
|
||||||
|
}else{
|
||||||
|
location+='~';
|
||||||
|
}
|
||||||
|
|
||||||
$.log("location:"+location);
|
$.log("location:"+location);
|
||||||
window.sammyArchivaApplication.setLocation(location);
|
window.sammyArchivaApplication.setLocation(location);
|
||||||
|
|
|
@ -333,6 +333,15 @@
|
||||||
data-bind="value: searchRequest().className"/>
|
data-bind="value: searchRequest().className"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label" for="pageSize">${$.i18n.prop('search.artifact.search.form.query.pageSize')}</label>
|
||||||
|
|
||||||
|
<div class="controls">
|
||||||
|
<input type="text" class="defaults" id="pageSize" name="pageSize" size="50"
|
||||||
|
placeholder="my.pageSize"
|
||||||
|
data-bind="value: searchRequest().pageSize"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<button type="submit" id="btn-advanced-search" class="btn btn-primary"
|
<button type="submit" id="btn-advanced-search" class="btn btn-primary"
|
||||||
|
|
Loading…
Reference in New Issue