Examples of PageConf


Examples of com.freewebsys.core.page.PageConf

      String hql = " select module from UserInfo module ";
      // 通用查询匹配
      Object[] values = CommonDaoUtil.commonQuery(map);
      hql += values[0].toString();
      // Object[]需要进行强制转换.
      PageConf pageConf = baseDao.findPage(start, limit, hql,
          (Object[]) values[1]);
      if (pageConf != null && pageConf.getData() != null) {
        List list = pageConf.getData();
        for (int i = 0; i < list.size(); i++) {
          UserInfo friendUser = (UserInfo) list.get(i);
          System.out.println(userInfo.getId() + "/"
              + friendUser.getId());
          String hql_2 = "select friend.status from Friend friend where friend.userId = ? and friend.friend.id = ? ";
View Full Code Here

Examples of com.freewebsys.core.page.PageConf

  @Override
  @Transactional
  public PageConf findFeedPiecePageList(int start, int limit,
      UserInfo userInfo, String type) throws FeedException {
    try {
      PageConf conf = null;
      if (type != null && !type.equals("all")) {
        String hql = " select module from FeedUser module left join fetch module.feed where module.userId = ? and module.feedType = ? ";
        // 通用查询匹配
        conf = baseDao.findPage(start, limit, hql, userInfo.getId(),
            type);
View Full Code Here

Examples of com.freewebsys.core.page.PageConf

      // 参数
      Map values = new HashMap();
      values.put("parameters", this);

      // 初始化参数.每次独立计算.否则分页有问题.
      PageConf pageConf = new PageConf(start, limit, total);
      values.put("pageConf", pageConf);
      String ctx = pageContext.getServletContext().getContextPath() + "/";
      ctx += action;
      if (action.indexOf("?") >= 0) {// 如果存在?号用&
        ctx += "&" + findOtherValue();
      } else {// 否则用?
        ctx += "?" + findOtherValue();
      }
      PageConf pageConfFirst = new PageConf(start, limit, total);
      String firstUrl = ctx;
      PageConf pageConfPrev = new PageConf(start, limit, total);
      String prevUrl = ctx;
      PageConf pageConfNext = new PageConf(start, limit, total);
      String nextUrl = ctx;
      PageConf pageConfLast = new PageConf(start, limit, total);
      String lastUrl = ctx;
      // pageContext.setAttribute("gridPanelWidth", width);
      // pageContext.setAttribute("gridPanelHeight", height);
      if (pageConf.hasPrevious()) {
        pageConfFirst.getFirst();
        firstUrl += "&start=" + pageConfFirst.getStart();
        pageConfPrev.getPrevious();
        prevUrl += "&start=" + pageConfPrev.getStart();
      }
      if (pageConf.hasNext()) {
        pageConfNext.getNext();
        nextUrl += "&start=" + pageConfNext.getStart();
        pageConfLast.getLast();
        lastUrl += "&start=" + pageConfLast.getStart();
      }
      // 设置分页url.
      values.put("baseUrl", ctx);
      values.put("firstUrl", firstUrl);
      values.put("prevUrl", prevUrl);
View Full Code Here

Examples of com.freewebsys.core.page.PageConf

      // 参数
      Map values = new HashMap();
      values.put("parameters", this);

      // 初始化参数.每次独立计算.否则分页有问题.
      PageConf pageConf = new PageConf(start, limit, total);
      values.put("pageConf", pageConf);
      String ctx = pageContext.getServletContext().getContextPath() + "/";
      ctx += action;
      if (action.indexOf("?") >= 0) {// 如果存在?号用&
        ctx += "&" + findOtherValue();
      } else {// 否则用?
        ctx += "?" + findOtherValue();
      }
      PageConf pageConfFirst = new PageConf(start, limit, total);
      String firstUrl = ctx;
      PageConf pageConfPrev = new PageConf(start, limit, total);
      String prevUrl = ctx;
      PageConf pageConfNext = new PageConf(start, limit, total);
      String nextUrl = ctx;
      PageConf pageConfLast = new PageConf(start, limit, total);
      String lastUrl = ctx;
      // pageContext.setAttribute("gridPanelWidth", width);
      // pageContext.setAttribute("gridPanelHeight", height);
      if (pageConf.hasPrevious()) {
        pageConfFirst.getFirst();
        firstUrl += "&start=" + pageConfFirst.getStart();
        pageConfPrev.getPrevious();
        prevUrl += "&start=" + pageConfPrev.getStart();
      }
      if (pageConf.hasNext()) {
        pageConfNext.getNext();
        nextUrl += "&start=" + pageConfNext.getStart();
        pageConfLast.getLast();
        lastUrl += "&start=" + pageConfLast.getStart();
      }
      // 设置分页url.
      values.put("baseUrl", ctx);
      values.put("firstUrl", firstUrl);
      values.put("prevUrl", prevUrl);
View Full Code Here

Examples of com.freewebsys.core.page.PageConf

  @Override
  public int doStartTag() throws JspException {
    try {
      // 初始化参数.每次独立计算.否则分页有问题.
      PageConf pageConf = new PageConf(start, limit, total);
      String ctx = pageContext.getServletContext().getContextPath() + "/";
      if (action.indexOf("?") >= 0) {// 如果存在?号用&
        ctx += action + "&" + findOtherValue();
      } else {// 否则用?
        ctx += action + "?" + findOtherValue();
      }
      boolean hasPrev = false;
      boolean hasNext = false;
      PageConf pageConfPrev = new PageConf(start, limit, total);
      String prevUrl = ctx;
      PageConf pageConfNext = new PageConf(start, limit, total);
      String nextUrl = ctx;

      if (pageConf.hasPrevious()) {
        hasPrev = true;
        pageConfPrev.getPrevious();
        prevUrl += "&start=" + pageConfPrev.getStart();
      }
      if (pageConf.hasNext()) {
        hasNext = true;
        pageConfNext.getNext();
        nextUrl += "&start=" + pageConfNext.getStart();
      }
      pageContext.setAttribute("hasPrev", hasPrev);
      pageContext.setAttribute("hasNext", hasNext);
      pageContext.setAttribute("prevUrl", prevUrl);
      pageContext.setAttribute("nextUrl", nextUrl);
View Full Code Here

Examples of com.freewebsys.core.page.PageConf

          + removeSelect(removeOrders(hql));
      // 查询总数
      int total = ((Long) findFirstOne(countQueryString, values))
          .intValue();
      // System.out.println("page size:" + total);
      PageConf pageConf = new PageConf(start, limit, total);
      if (start >= total) {// 如果跳转的页数超出总页数跳到最后一页
        pageConf.getLast();
      }
      if (start <= 0) {// 如果跳转的页数为负数或0,跳转到首页
        pageConf.getFirst();
      }
      Query query = createQuery(hql, values);
      List list = query.setFirstResult((int) pageConf.getStart())
          .setMaxResults((int) pageConf.getLimit()).list();
      // 将数据放到pageConf
      pageConf.setData(list);
      return pageConf;
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.