use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project BookShop by Eins51.
the class GoodsListServlet method doGet.
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int id = 0;
if (request.getParameter("typeid") != null) {
id = Integer.parseInt(request.getParameter("typeid"));
}
int pageNumber = 1;
if (request.getParameter("pageNumber") != null) {
try {
pageNumber = Integer.parseInt(request.getParameter("pageNumber"));
} catch (Exception e) {
}
}
Type t = null;
if (id != 0) {
t = tService.selectTypeNameByID(id);
}
request.setAttribute("t", t);
if (pageNumber <= 0)
pageNumber = 1;
Page p = gService.selectPageByTypeID(id, pageNumber);
if (p.getTotalPage() == 0) {
p.setTotalPage(1);
p.setPageNumber(1);
} else {
if (pageNumber >= p.getTotalPage() + 1) {
p = gService.selectPageByTypeID(id, p.getTotalPage());
}
}
request.setAttribute("p", p);
request.setAttribute("id", String.valueOf(id));
request.getRequestDispatcher("/goods_list.jsp").forward(request, response);
}
use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project BookShop by Eins51.
the class GoodsService method selectPageByTypeID.
public Page selectPageByTypeID(int typeID, int pageNumber) {
Page p = new Page();
p.setPageNumber(pageNumber);
int totalCount = 0;
try {
totalCount = gDao.getCountOfGoodsByTypeID(typeID);
} catch (SQLException e) {
e.printStackTrace();
}
p.SetPageSizeAndTotalCount(8, totalCount);
List list = null;
try {
list = gDao.selectGoodsByTypeID(typeID, pageNumber, 8);
} catch (SQLException e) {
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 UserService method getUserPage.
public Page getUserPage(int pageNumber) {
Page p = new Page();
p.setPageNumber(pageNumber);
int pageSize = 7;
int totalCount = 0;
try {
totalCount = uDao.selectUserCount();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
p.SetPageSizeAndTotalCount(pageSize, totalCount);
List list = null;
try {
list = uDao.selectUserList(pageNumber, pageSize);
} 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 AdminGoodsListServlet method doGet.
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 推荐类型
int type = 0;
if (request.getParameter("type") != null) {
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, pageNumber);
}
}
request.setAttribute("p", p);
request.setAttribute("type", type);
request.getRequestDispatcher("/admin/goods_list.jsp").forward(request, response);
}
use of org.apache.manifoldcf.crawler.connectors.confluence.v6.model.Page in project manifoldcf by apache.
the class ConfluenceRepositoryConnector method processPageAsAttachment.
/**
* <p>
* Process the specific attachment
* </p>
*
* @param activeSecurity Security enabled/disabled
* @param documentIdentifier The original documentIdentifier
* @param parentRestrictions The list of parent restrictions
* @param pageId The pageId being an attachment
* @param version The version of the page
* @param activities
* @param doLog
* @throws IOException
* @throws ServiceInterruption
*/
private ProcessResult processPageAsAttachment(final boolean activeSecurity, final String documentIdentifier, final List<String> parentRestrictions, final String pageId, final String version, final IProcessActivity activities, final boolean doLog) throws ManifoldCFException, ServiceInterruption, IOException {
final String[] ids = ConfluenceUtil.getAttachmentAndPageId(pageId);
Attachment attachment = new Attachment();
try {
attachment = confluenceClient.getAttachment(ids[0]);
} catch (final Exception e) {
handlePageException(e, "attachment processing");
}
final Map<String, String> extraProperties = Maps.newHashMap();
extraProperties.put("attachedBy", ids[1]);
return processPageInternal(activeSecurity, parentRestrictions, attachment, documentIdentifier, version, activities, doLog, extraProperties);
}
Aggregations