use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project BookShop by Eins51.
the class GoodsService method getSearchGoodsPage.
public Page getSearchGoodsPage(String keyword, int pageNumber) {
Page p = new Page();
p.setPageNumber(pageNumber);
int totalCount = 0;
try {
// totalCount = gDao.getGoodsCount(typeId);
totalCount = gDao.getSearchCount(keyword);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
p.SetPageSizeAndTotalCount(8, totalCount);
List list = null;
try {
// list = gDao.selectGoods(keyword, pageNo, 8);
list = gDao.selectSearchGoods(keyword, pageNumber, 8);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
p.setList(list);
return p;
}
use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project BookShop by Eins51.
the class GoodsService method getGoodsRecommendPage.
public Page getGoodsRecommendPage(int type, int pageNumber) {
Page p = new Page();
p.setPageNumber(pageNumber);
int totalCount = 0;
try {
totalCount = gDao.getRecommendCountOfGoodsByTypeID(type);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
p.SetPageSizeAndTotalCount(8, totalCount);
List list = null;
try {
list = gDao.selectGoodsbyRecommend(type, pageNumber, 8);
for (Goods g : (List<Goods>) list) {
g.setScroll(gDao.isScroll(g));
g.setHot(gDao.isHot(g));
g.setNew(gDao.isNew(g));
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
p.setList(list);
return p;
}
use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project BookShop by Eins51.
the class AdminUserListServlet method doGet.
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int pageNumber = 1;
if (request.getParameter("pageNumber") != null) {
try {
pageNumber = Integer.parseInt(request.getParameter("pageNumber"));
} catch (Exception e) {
}
}
if (pageNumber <= 0)
pageNumber = 1;
Page p = uService.getUserPage(pageNumber);
if (p.getTotalPage() == 0) {
p.setTotalPage(1);
p.setPageNumber(1);
} else {
if (pageNumber >= p.getTotalPage() + 1) {
p = uService.getUserPage(pageNumber);
}
}
request.setAttribute("p", p);
request.getRequestDispatcher("/admin/user_list.jsp").forward(request, response);
}
use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project BookShop by Eins51.
the class GoodRecommendListServlet method doGet.
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int type = Integer.parseInt(request.getParameter("type"));
int pageNumber = 1;
if (request.getParameter("pageNumber") != null) {
try {
pageNumber = Integer.parseInt(request.getParameter("pageNumber"));
} catch (Exception e) {
}
}
if (pageNumber <= 0)
pageNumber = 1;
Page p = gService.getGoodsRecommendPage(type, pageNumber);
if (p.getTotalPage() == 0) {
p.setTotalPage(1);
p.setPageNumber(1);
} else {
if (pageNumber >= p.getTotalPage() + 1) {
p = gService.getGoodsRecommendPage(type, p.getTotalPage());
}
}
request.setAttribute("p", p);
request.setAttribute("t", type);
request.getRequestDispatcher("goodsrecommend_list.jsp").forward(request, response);
}
use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project BookShop by Eins51.
the class AdminOrderListServlet method doGet.
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int status = 0;
if (request.getParameter("status") != null) {
status = Integer.parseInt(request.getParameter("status"));
}
request.setAttribute("status", status);
int pageNumber = 1;
if (request.getParameter("pageNumber") != null) {
try {
pageNumber = Integer.parseInt(request.getParameter("pageNumber"));
} catch (Exception e) {
}
}
if (pageNumber <= 0)
pageNumber = 1;
Page p = oService.getOrderPage(status, pageNumber);
if (p.getTotalPage() == 0) {
p.setTotalPage(1);
p.setPageNumber(1);
} else {
if (pageNumber >= p.getTotalPage() + 1) {
p = oService.getOrderPage(status, pageNumber);
}
}
request.setAttribute("p", p);
request.getRequestDispatcher("/admin/order_list.jsp").forward(request, response);
}
Aggregations