Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Bug 1158516 - Number of platforms retrieved using REST can't be modified
Browse files Browse the repository at this point in the history
using ps param and is always limited to 100

set @DefaultValue to 0 for page parameter. Without that paging was disabled
unless page query parameter was specified.

(cherry picked from commit 79a063c)
Signed-off-by: Libor Zoubek <lzoubek@redhat.com>
  • Loading branch information
Libor Zoubek committed Oct 29, 2014
1 parent 42a2d2f commit 73e845e
Showing 1 changed file with 2 additions and 8 deletions.
Expand Up @@ -277,16 +277,10 @@ public Response getResourcesByQuery(@ApiParam("Limit results to param in the res
@ApiOperation(value = "List all platforms in the system", multiValueResponse = true, responseClass = "ResourceWithType")
public Response getPlatforms(
@ApiParam("Page size for paging") @QueryParam("ps") @DefaultValue("20") int pageSize,
@ApiParam("Page for paging, 0-based") @QueryParam("page") Integer page,
@ApiParam("Page for paging, 0-based") @QueryParam("page") @DefaultValue("0") Integer page,
@Context HttpHeaders headers, @Context UriInfo uriInfo) {

PageControl pc;
if (page!=null) {
pc = new PageControl(page,pageSize);
}
else {
pc = PageControl.getUnlimitedInstance();
}
PageControl pc = new PageControl(page, pageSize);
pc.setPrimarySort("id",PageOrdering.ASC);

PageList<Resource> ret = resMgr.findResourcesByCategory(caller, ResourceCategory.PLATFORM,
Expand Down

0 comments on commit 73e845e

Please sign in to comment.