}
if (currentPageNum > total) {
currentPageNum = total;
}
AtomicItem page = getPageItem(currentPageNum);
if (page == null) {
throw new DAOException("The page number is incorrect: " + pageNum);
}
/*
* page.setAltMessage(navigateObject.getDescription() + ": Page " +
* currentPageNum + " of " + total);
*/
NavigationBean bean = new NavigationBean();
bean.setNavigateObject(navigateObject);
bean.setCurrentPageItem(page);
bean.setPageDisplay(page.getDataStream(properties));
if (currentPageNum > 1) {
bean.setPreviousPage(printURL(currentPageNum - 1) + properties.print());
} else {
bean.setPreviousPage(printURL(currentPageNum) + properties.print());
}