Package com.jeecms.common.page

Examples of com.jeecms.common.page.Pagination


    try {
      Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_30);
      Query query = LuceneContent.createQuery(queryString, siteId,
          channelId, startDate, endDate, analyzer);
      TopDocs docs = searcher.search(query, pageNo * pageSize);
      Pagination p = LuceneContent.getResultPage(searcher, docs, pageNo,
          pageSize);
      List<?> ids = p.getList();
      List<Content> contents = new ArrayList<Content>(ids.size());
      for (Object id : ids) {
        contents.add(contentMng.findById((Integer) id));
      }
      p.setList(contents);
      return p;
    } finally {
      searcher.close();
    }
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  @RequestMapping("/flow_refererWebSite/v_list.do")
  public String refererWebSite(HttpServletRequest request, Integer pageNo,
      ModelMap model) {
    Integer siteId = CmsUtils.getSiteId(request);
    Pagination pagination = cmsStatisticSvc.flowAnalysisPage(
        REFERER_WEBSITE, siteId, cpn(pageNo), CookieUtils
            .getPageSize(request));
    model.addAttribute("pagination", pagination);
    model.addAttribute("total", getTotal((List<CmsStatistic>) pagination
        .getList()));
    return "statistic/refererWebSite/list";
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @RequestMapping("/flow_refererPage/v_list.do")
  public String refererPage(HttpServletRequest request, Integer pageNo,
      ModelMap model) {
    Integer siteId = CmsUtils.getSiteId(request);
    Pagination pagination = cmsStatisticSvc.flowAnalysisPage(REFERER_PAGE,
        siteId, cpn(pageNo), CookieUtils.getPageSize(request));
    model.addAttribute("pagination", pagination);
    model.addAttribute("total", getTotal((List<CmsStatistic>) pagination
        .getList()));
    return "statistic/refererPage/list";
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @RequestMapping("/flow_accessPage/v_list.do")
  public String accessPage(HttpServletRequest request, Integer pageNo,
      ModelMap model) {
    Integer siteId = CmsUtils.getSiteId(request);
    Pagination pagination = cmsStatisticSvc.flowAnalysisPage(ACCESS_PAGE,
        siteId, cpn(pageNo), CookieUtils.getPageSize(request));
    model.addAttribute("pagination", pagination);
    model.addAttribute("total", getTotal((List<CmsStatistic>) pagination
        .getList()));
    return "statistic/accessPage/list";
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @RequestMapping("/flow_area/v_list.do")
  public String area(HttpServletRequest request, Integer pageNo,
      ModelMap model) {
    Integer siteId = CmsUtils.getSiteId(request);
    Pagination pagination = cmsStatisticSvc.flowAnalysisPage(AREA, siteId,
        cpn(pageNo), CookieUtils.getPageSize(request));
    model.addAttribute("pagination", pagination);
    model.addAttribute("total", getTotal((List<CmsStatistic>) pagination
        .getList()));
    return "statistic/area/list";
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @RequestMapping("/flow_refererKeyword/v_list.do")
  public String refererKeyword(HttpServletRequest request, Integer pageNo,
      ModelMap model) {
    Integer siteId = CmsUtils.getSiteId(request);
    Pagination pagination = cmsStatisticSvc.flowAnalysisPage(
        REFERER_KEYWORD, siteId, cpn(pageNo), CookieUtils
            .getPageSize(request));
    model.addAttribute("pagination", pagination);
    model.addAttribute("total", getTotal((List<CmsStatistic>) pagination
        .getList()));
    return "statistic/refererKeyword/list";
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public Pagination flowAnalysisPage(String groupCondition, Integer siteId,
      Integer pageNo, Integer pageSize) {
    List<CmsStatistic> list = new ArrayList<CmsStatistic>();
    Pagination pagination = dao.flowAnalysisPage(groupCondition, siteId,
        pageNo, pageSize);
    long total = dao.flowAnalysisTotal(siteId);
    for (Object[] objArr : (List<Object[]>) pagination.getList()) {
      CmsStatistic cmsStatistic = new CmsStatistic((String) objArr[1],
          (Long) objArr[0], total);
      list.add(cmsStatistic);
    }
    pagination.setList(list);
    return pagination;
  }
View Full Code Here

        + " from CmsSiteFlow bean where bean.site.id=:siteId group by bean."
        + groupCondition + " order by count(*) desc");
    f.setParam("siteId", siteId);
    f.setMaxResults(pageSize);
    f.setFirstResult((pageNo - 1) * pageSize);
    return new Pagination(pageNo, pageSize, getTotalCount(f.getOrigHql(),
        siteId), find(f));
  }
View Full Code Here

    String query = getQuery(params);
    Integer siteId = getSiteId(params);
    Integer channelId = getChannelId(params);
    Date startDate = getStartDate(params);
    Date endDate = getEndDate(params);
    Pagination page;
    try {
      String path = realPathResolver.get(Constants.LUCENE_PATH);
      page = luceneContentSvc.searchPage(path, query, siteId, channelId,
          startDate, endDate, pageNo, count);
    } catch (ParseException e) {
      throw new RuntimeException(e);
    }

    Map<String, TemplateModel> paramWrap = new HashMap<String, TemplateModel>(
        params);
    paramWrap.put(OUT_PAGINATION, DEFAULT_WRAPPER.wrap(page));
    paramWrap.put(OUT_LIST, DEFAULT_WRAPPER.wrap(page.getList()));
    Map<String, TemplateModel> origMap = DirectiveUtils
        .addParamsToVariable(env, paramWrap);
    InvokeType type = DirectiveUtils.getInvokeType(params);
    String listStyle = DirectiveUtils.getString(PARAM_STYLE_LIST, params);
    if (InvokeType.sysDefined == type) {
View Full Code Here

    }
    for (int i = (pageNo - 1) * pageSize; i < endIndex; i++) {
      Document d = searcher.doc(hits[i].doc);
      list.add(Integer.valueOf(d.getField(ID).stringValue()));
    }
    return new Pagination(pageNo, pageSize, docs.totalHits, list);
  }
View Full Code Here

TOP

Related Classes of com.jeecms.common.page.Pagination

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.