本文整理汇总了Java中org.springframework.beans.support.PagedListHolder.setPage方法的典型用法代码示例。如果您正苦于以下问题:Java PagedListHolder.setPage方法的具体用法?Java PagedListHolder.setPage怎么用?Java PagedListHolder.setPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.beans.support.PagedListHolder
的用法示例。
在下文中一共展示了PagedListHolder.setPage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPhotoBook
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public PagedListHolder<SpacePhoto> getPhotoBook(List<SpacePhoto> photos, String pageString) {
PagedListHolder<SpacePhoto> book = new PagedListHolder<>(photos);
book.setPageSize(PHOTOS_IN_PAGE);
int page = 0;
if (Strings.isNullOrEmpty(pageString)) {
page = 0;
} else {
try {
page = Integer.parseInt(pageString);
} catch (NumberFormatException nfe) {
if ("f".equals(pageString)) {
page = 0;
} else if ("l".equals(pageString)) {
page = book.getPageCount();
}
}
}
book.setPage(page == 0 ? 0 : page - 1);
return book;
}
示例2: getSubmissionBook
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public PagedListHolder<SpacePhotoSubmission> getSubmissionBook(List<SpacePhotoSubmission> submissions, String pageString) {
PagedListHolder<SpacePhotoSubmission> book = new PagedListHolder<>(submissions);
book.setPageSize(PHOTOS_IN_PAGE);
int page = 0;
if (Strings.isNullOrEmpty(pageString)) {
page = 0;
} else {
try {
page = Integer.parseInt(pageString);
} catch (NumberFormatException nfe) {
if ("f".equals(pageString)) {
page = 0;
} else if ("l".equals(pageString)) {
page = book.getPageCount();
}
}
}
book.setPage(page == 0 ? 0 : page - 1);
return book;
}
示例3: getBook
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
public PagedListHolder<OccupationRequest> getBook(List<OccupationRequest> requests, String pageString) {
PagedListHolder<OccupationRequest> book = new PagedListHolder<>(requests);
book.setPageSize(30);
int page = 0;
if (Strings.isNullOrEmpty(pageString)) {
page = 0;
} else {
try {
page = Integer.parseInt(pageString);
} catch (NumberFormatException nfe) {
if ("f".equals(pageString)) {
page = 0;
} else if ("l".equals(pageString)) {
page = book.getPageCount();
}
}
}
book.setPage(page == 0 ? 0 : page - 1);
return book;
}
示例4: handleRequestInternal
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
logger.debug("start: reload reporting configuration files");
// TODO indigo: We have to solve this problem on DAO level
synchronized (m_reportListService) {
m_reportListService.reloadConfigurationFiles();
}
logger.debug("stop : reload reporting configuration files");
Map<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>> repositoryList = new LinkedHashMap<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>>();
for (ReportRepositoryDescription reportRepositoryDescription : m_reportListService.getActiveRepositories()) {
PagedListHolder<DatabaseReportDescription> pageListholder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getReportsByRepositoryId(reportRepositoryDescription.getId()));
pageListholder.setPageSize(m_pageSize);
int page = ServletRequestUtils.getIntParameter(request, "p_" + reportRepositoryDescription.getId(), 0);
pageListholder.setPage(page);
repositoryList.put(reportRepositoryDescription, pageListholder);
}
return new ModelAndView("report/database/reportList", "repositoryList", repositoryList);
}
示例5: handleRequestInternal
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
Map<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>> repositoryList = new LinkedHashMap<ReportRepositoryDescription, PagedListHolder <DatabaseReportDescription>>();
// Go through all active repositories and get all reports for each repository
for (ReportRepositoryDescription reportRepositoryDescription : m_reportListService.getActiveRepositories()) {
PagedListHolder<DatabaseReportDescription> pageListholder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getReportsByRepositoryId(reportRepositoryDescription.getId()));
pageListholder.setPageSize(m_pageSize);
int page = ServletRequestUtils.getIntParameter(request,"p_" + reportRepositoryDescription.getId(),0);
pageListholder.setPage(page);
repositoryList.put(reportRepositoryDescription, pageListholder);
}
return new ModelAndView("report/database/batchList","repositoryList", repositoryList);
}
示例6: pagedListImpl
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
@Override
public PagedListHolder pagedListImpl(int size, HttpServletRequest request, List pageSource) {
pagedListHolder = new PagedListHolder(pageSource);
pagedListHolder.setPage(ServletRequestUtils.getIntParameter(request, "page", 0));
pagedListHolder.setPageSize(size);
return pagedListHolder;
}
示例7: pagedProductsPage
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@RequestMapping(value = "/products/page/{pageNumber}", method = RequestMethod.GET)
public String pagedProductsPage(HttpServletRequest request, @PathVariable Integer pageNumber, Model uiModel) {
logger.debug("Showing paged products page # {}", pageNumber);
PagedListHolder<Product> pagedListHolder = (PagedListHolder<Product>) request.getSession()
.getAttribute(SESSION_ATTRIBUTE_PRODUCTLIST);
if (pagedListHolder == null) {
pagedListHolder = new PagedListHolder<Product>(productService.getProducts());
pagedListHolder.setPageSize(PRODUCT_LIST_PAGE_SIZE);
} else {
final int goToPage = pageNumber - 1;
if (goToPage <= pagedListHolder.getPageCount() && goToPage >= 0) {
pagedListHolder.setPage(goToPage);
}
}
request.getSession().setAttribute(SESSION_ATTRIBUTE_PRODUCTLIST, pagedListHolder);
uiModel.addAttribute(MODEL_ATTRIBUTE_PAGER, currentPage(pagedListHolder));
uiModel.addAttribute(MODEL_ATTRIBUTE_PRODUCTS, pagedListHolder);
return PRODUCT_LIST_VIEW;
}
示例8: referenceData
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected Map<String, Object> referenceData(HttpServletRequest req) throws Exception {
Map<String, Object> data = new HashMap<String, Object>();
PagedListHolder<TriggerDescription> pagedListHolder = new PagedListHolder<TriggerDescription>(m_reportSchedulerService.getTriggerDescriptions());
pagedListHolder.setPageSize(m_pageSize);
int page = ServletRequestUtils.getIntParameter(req, "p", 0);
pagedListHolder.setPage(page);
data.put("pagedListHolder", pagedListHolder);
return data;
}
示例9: handleRequestInternal
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
Map<ReportRepositoryDescription, PagedListHolder<DatabaseReportDescription>> repositoryList = new LinkedHashMap<ReportRepositoryDescription, PagedListHolder <DatabaseReportDescription>>();
for (ReportRepositoryDescription reportRepositoryDescription : m_reportListService.getActiveRepositories()) {
PagedListHolder<DatabaseReportDescription> pageListholder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getOnlineReportsByRepositoryId(reportRepositoryDescription.getId()));
pageListholder.setPageSize(m_pageSize);
int page = ServletRequestUtils.getIntParameter(request,"p_" + reportRepositoryDescription.getId(),0);
pageListholder.setPage(page);
repositoryList.put(reportRepositoryDescription, pageListholder);
}
return new ModelAndView("report/database/onlineList","repositoryList", repositoryList);
}
示例10: referenceData
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected Map<String, Object> referenceData(HttpServletRequest req) throws Exception {
Map<String, Object> data = new HashMap<String, Object>();
List<ReportCatalogEntry> reportCatalog = m_reportStoreService.getAll();
Map<String, Object> formatMap = m_reportStoreService.getFormatMap();
PagedListHolder<ReportCatalogEntry> pagedListHolder = new PagedListHolder<ReportCatalogEntry>(reportCatalog);
pagedListHolder.setPageSize(m_pageSize);
int page = ServletRequestUtils.getIntParameter(req, "p", 0);
pagedListHolder.setPage(page);
data.put("formatMap", formatMap);
data.put("pagedListHolder", pagedListHolder);
return data;
}
示例11: handleRequestInternal
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
ModelAndView modelAndView = new ModelAndView("report/database/list");
//TODO Tak: insert logic to build "sub-model" for each repository
PagedListHolder<DatabaseReportDescription> pagedListHolder = new PagedListHolder<DatabaseReportDescription>(m_reportListService.getAll());
pagedListHolder.setPageSize(m_pageSize);
int page = ServletRequestUtils.getIntParameter(request, "p", 0);
pagedListHolder.setPage(page);
modelAndView.addObject("pagedListHolder", pagedListHolder);
return modelAndView;
}
示例12: viewFinalReport
import org.springframework.beans.support.PagedListHolder; //导入方法依赖的package包/类
/**
* Retrieves a list of stored {@link ConfigurationReport} objects for a given
* configuration and displays it.
*
* @param id the report id
* @param timestamp the timestamp of a specific report (used for paging)
* @param page the page number to display
* @param showSuccesses
* @param showWarnings
* @param showFailures
* @param model
*
* @return
* @throws IOException
*/
@RequestMapping(value = CONFIG_LOADER_PROGRESS_FINAL_REPORT_URL + "{id}", method = { RequestMethod.GET })
public String viewFinalReport(@PathVariable(value = "id") final String id,
@RequestParam(value = "ts", required = false) Timestamp timestamp,
@RequestParam(value = "page", required = false, defaultValue = "0") Integer page,
@RequestParam(value = "s", required = false, defaultValue = "true") boolean showSuccesses,
@RequestParam(value = "w", required = false, defaultValue = "true") boolean showWarnings,
@RequestParam(value = "f", required = false, defaultValue = "true") boolean showFailures,
final Model model) throws IOException {
logger.debug(CONFIG_LOADER_PROGRESS_FINAL_REPORT_URL + "/{id} " + id);
List<ConfigurationReport> reports = service.getConfigurationReports(id);
ConfigurationReport report = null;
if (timestamp == null) {
report = reports.get(reports.size() - 1);
}
for (ConfigurationReport r : reports) {
if (r.getTimestamp().equals(timestamp)) {
report = r;
}
}
if (report == null) {
throw new RuntimeException("Report id " + id + " with timestamp " + timestamp + " was not found.");
}
List<ConfigurationElementReport> elementReports = new ArrayList<>();
for (ConfigurationElementReport elementReport : report.getElementReports()) {
if (elementReport.getStatus() == ConfigConstants.Status.OK && showSuccesses) elementReports.add(elementReport);
if (elementReport.getStatus() == ConfigConstants.Status.WARNING && showWarnings) elementReports.add(elementReport);
if (elementReport.getStatus() == ConfigConstants.Status.FAILURE && showFailures) elementReports.add(elementReport);
}
PagedListHolder<ConfigurationElementReport> pagedListHolder = new PagedListHolder<>(elementReports);
pagedListHolder.setPage(page);
pagedListHolder.setPageSize(50);
logger.debug(reports.toString());
model.addAttribute("report", report);
model.addAttribute("allReports", reports);
model.addAttribute("pagedListHolder", pagedListHolder);
model.addAttribute("showSuccesses", showSuccesses);
model.addAttribute("showWarnings", showWarnings);
model.addAttribute("showFailures", showFailures);
model.addAttribute("title", "Configuration Report: " + id);
return "config/configReport";
}