@RequestMapping(value = "/licensing/collection_element/list/{collectionId}", method = RequestMethod.GET)
@Secured(ConsoleSecurityRoles.ROLE_LICENSE_VIEW)
public ModelAndView listCollectionElements(
@RequestParam(defaultValue = DEFAULT_PAGE_NO) Integer pageNo,
@RequestParam(defaultValue = DEFAULT_PAGE_SIZE) Integer pageSize,
@PathVariable Long collectionId,
@RequestParam(defaultValue = "") String idQuery) {
ModelAndView results = new ModelAndView("container.platform.licensing.collectionElement.list");
CollectionElementQuery query = new CollectionElementQuery(collectionId);
query.setPageNo( pageNo);
query.setPageSize(pageSize);
if(!StringUtils.isEmpty(idQuery)){
query.setElementId(idQuery + "%");
results.addObject("query", idQuery);
}
Page<CollectionElement> collectionElementsList = licensingService.fetchCollectionElements(query);
Collection collection=licensingControllerHelper.getCollectionById(collectionId);
results.addObject("elements", collectionElementsList.getResult());
results.addObject("pageNo", collectionElementsList.getCurrentPage());
results.addObject("pageSize", collectionElementsList.getPageSize());
results.addObject("collection", collection);
results.addObject("totalPages", collectionElementsList.getTotalPages());
return results;
}