Examples of Pagination


Examples of org.displaytag.pagination.Pagination

     * ToString() test.
     */
    @Test
    public void testPagination()
    {
        checkToString(new Pagination(null, null, null));
    }
View Full Code Here

Examples of org.gatein.api.common.Pagination

    @Override
    public List<Site> findSites(SiteQuery query) {
        Parameters.requireNonNull(query, "query");

        Pagination pagination = query.getPagination();
        if (pagination != null && query.getSiteTypes().size() > 1) {
            pagination = null; // set it to null so the internal DataStorage doesn't use it, and we manually page later
            log.warn("Pagination is not supported internally for SiteQuery's with multiple site types. Therefore this query has the possibility to perform poorly.");
        }
        boolean includeAll = query.isIncludeEmptySites();

        List<Site> sites = new ArrayList<Site>();
        for (SiteType type : query.getSiteTypes()) {
            List<Site> sitesFound;
            switch (type) {
                case SITE:
                    sitesFound = findSites(pagination, SITES, Comparators.site(query.getSorting()), includeAll);
                    break;
                case SPACE:
                    sitesFound = findSites(pagination, SPACES, Comparators.site(query.getSorting()), includeAll);
                    break;
                case DASHBOARD:
                    sitesFound = findSites(pagination, DASHBOARDS, Comparators.site(query.getSorting()), includeAll);
                    break;
                default:
                    throw new AssertionError();
            }

            sites.addAll(sitesFound);

            // No reason to fetch anymore
            if (pagination != null && sites.size() >= pagination.getLimit()) {
                break;
            }
        }

        filter(sites, query.getFilter());
View Full Code Here

Examples of org.jamwiki.utils.Pagination

   */
  public static Pagination loadPagination(HttpServletRequest request, ModelAndView next) {
    if (next == null) {
      throw new IllegalArgumentException("A non-null ModelAndView object must be specified when loading pagination values");
    }
    Pagination pagination = WikiUtil.buildPagination(request);
    next.addObject("num", pagination.getNumResults());
    next.addObject("offset", pagination.getOffset());
    return pagination;
  }
View Full Code Here

Examples of org.jrest4guice.client.Pagination

  }

  @Transactional(type = TransactionalType.READOLNY)
  public Page<${context.entityName}> list${context.entityName}s(int pageIndex, int pageSize)
      throws RuntimeException {
    return this.entityManager.pageByNamedQuery("list", new Pagination(
        pageIndex, pageSize));
  }
View Full Code Here

Examples of org.jrest4guice.client.Pagination

  }

  @Transactional(type = TransactionalType.READOLNY)
  @RolesAllowed("admin")
  public Page<Role> getAllRoles(int pageIndex, int pageSize) {
    return this.roleEntityManager.page("named:list", new Pagination(
        pageIndex, pageSize));
  }
View Full Code Here

Examples of org.jrest4guice.client.Pagination

  }

  @Transactional(type = TransactionalType.READOLNY)
  @RolesAllowed("admin")
  public Page<User> getAllUsers(int pageIndex, int pageSize) {
    return this.userEntityManager.page("named:list", new Pagination(
        pageIndex, pageSize));
  }
View Full Code Here

Examples of org.jrest4guice.client.Pagination

  @Transactional(type=TransactionalType.READOLNY)//覆盖类级别的事务类型为只读
  @Interceptor(ListContactsInterceptor.class)//覆盖类级别的拦截器
  public Page<Contact> listContacts(int pageIndex, int pageSize)
      throws RuntimeException {
    return this.entityManager.page("named:list",
        new Pagination(pageIndex, pageSize));
  }
View Full Code Here

Examples of org.multibit.mbm.client.common.pagination.Pagination

    final Representation representation;

    // Check for pagination links
    if (paginationOptional.isPresent()) {
      Pagination pagination = paginationOptional.get();

      // Build a self URI with pagination parameters
      URI paginatedSelf = UriBuilder
        .fromUri(self)
        .queryParam("pn", pagination.getCurrentPage())
        .queryParam("ps",pagination.getResultsPerPage())
        .build();

      representation = factory.newRepresentation(paginatedSelf);
      representation
        .withLink("first", UriBuilder
          .fromUri(self)
          .queryParam("pn", 1)
          .queryParam("ps", pagination.getResultsPerPage())
          .build())
        .withLink("previous", UriBuilder
          .fromUri(self)
          .queryParam("pn", pagination.getPreviousPage())
          .queryParam("ps", pagination.getResultsPerPage())
          .build())
        .withLink("current", UriBuilder
          .fromUri(self)
          .queryParam("pn", pagination.getPreviousPage())
          .queryParam("ps", pagination.getResultsPerPage())
          .build())
        .withLink("next", UriBuilder
          .fromUri(self)
          .queryParam("pn", pagination.getNextPage())
          .queryParam("ps", pagination.getResultsPerPage())
          .build())
        .withLink("last", UriBuilder
          .fromUri(self)
          .queryParam("pn", pagination.getTotalPages())
          .queryParam("ps", pagination.getResultsPerPage())
          .build());
    } else {
      representation = factory.newRepresentation(self);
    }
View Full Code Here

Examples of org.openbankdata.core.client.Pagination

  public AmericanExpressTransactionPaginationStrategy() {}

  @Override
  public Pagination parsePagination(BankResponse pBankResponse) {
    Pagination pagination = new Pagination();

    Document doc = Jsoup.parse(pBankResponse.body());
    Element element = doc.select("#viewPeriod option[selected]").first();

    Element previous = element.previousElementSibling();
    if (previous != null) {
      pagination.setPrev(Integer.parseInt(previous.val()));
    }

    Element next = element.nextElementSibling();
    if (next != null && isDateWithinRange(next)) {
      pagination.setNext(Integer.parseInt(next.val()));
    } else {
      pagination.setNext(-1);
    }
    pagination.setFirst(0);
    pagination.setLast(Integer.parseInt(element.lastElementSibling().val()));
    return pagination;
  }
View Full Code Here

Examples of org.opencustomer.framework.webapp.util.html.Pagination

        // ist dieses Tag in einem Formular?
        if (pageContext.getAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) == null)
            throw new JspException("element only allowed in forms");

        Pagination pagination = (Pagination) TagUtils.getInstance().lookup(pageContext, name, property, scope);

        long pages = 0;
        long pageNr = 0;

        if (pagination != null) {
            pages = pagination.getCount() / pagination.getPage().getStep();
            if ((pagination.getCount() % pagination.getPage().getStep()) > 0)
                pages++;
            pageNr = pagination.getPage().getPage();
        }

        if (pages > 1) {
            if("true".equalsIgnoreCase(properties.getProperty("simpleType"))) {
                for (int i = 1; i <= pages; i++) {
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.