Examples of Sorting


Examples of com.gentics.api.lib.datasource.Datasource.Sorting

        // second is the direction
        String[] sort = sortingArray[i].split(":");

        if (sort[0] != null) {
          if ("asc".equals(sort[1].toLowerCase())) {
            sortingColl.add(new Sorting(sort[0], Datasource.SORTORDER_ASC));
          } else if ("desc".equals(sort[1].toLowerCase())) {
            sortingColl.add(new Sorting(sort[0], Datasource.SORTORDER_DESC));
          } else {
            sortingColl.add(new Sorting(sort[0], Datasource.SORTORDER_NONE));
          }
        }
      }
    }
View Full Code Here

Examples of com.gentics.api.lib.datasource.Datasource.Sorting

        // second is the direction
        String[] sort = sortingArray[i].split(":");

        if (sort[0] != null) {
          if ("asc".equals(sort[1].toLowerCase())) {
            sortingColl.add(new Sorting(sort[0], Datasource.SORTORDER_ASC));
          } else if ("desc".equals(sort[1].toLowerCase())) {
            sortingColl.add(new Sorting(sort[0], Datasource.SORTORDER_DESC));
          } else {
            sortingColl.add(new Sorting(sort[0], Datasource.SORTORDER_NONE));
          }
        }
      }
    }
    return sortingColl.toArray(ret);
View Full Code Here

Examples of com.stratio.cassandra.index.query.Sorting

     * {@inheritDoc}
     */
    @Override
    public Sorting build()
    {
        return new Sorting(sortingFields);
    }
View Full Code Here

Examples of com.tll.dao.Sorting

  public final void onListingEvent(ListingEvent<R> event) {
    if(event.getListingOp().isQuery()) {
      removeBodyRows();
      if(event.getPageElements() != null) {
        addBodyRows(event.getPageElements(), event.getOffset());
        final Sorting sorting = event.getSorting();
        if(sortlinks != null && sorting != null) applySorting(sorting);
        crntPage = event.getPageNum() + 1;
        numPages = event.getNumPages();
        actvRowIndex = crntRowIndex = -1; // reset
      }
View Full Code Here

Examples of com.tll.dao.Sorting

      if(event.getSource() == lnk) {
        final SortColumn sc =
          new SortColumn(column.getPropertyName(), column.getParentAlias(), direction == SortDir.ASC ? SortDir.DESC
              : SortDir.ASC,
              ignoreCaseWhenSorting);
        listingOperator.sort(new Sorting(sc));
      }
    }
View Full Code Here

Examples of com.tll.dao.Sorting

   * @return A new {@link RemoteListingDefinition} instance.
   */
  RemoteListingDefinition<TestAddressSearch> getListingDef() {
    final RemoteListingDefinition<TestAddressSearch> def =
      new RemoteListingDefinition<TestAddressSearch>(ListHandlerType.PAGE, new TestAddressSearch(), null, 2,
          new Sorting("lastName"));
    return def;
  }
View Full Code Here

Examples of com.tll.dao.Sorting

      if(sessionId == null) {
        status.addMsg("No session id specified.", MsgLevel.ERROR, MsgAttr.STATUS.flag);
      }
      else {
        Integer offset = request.getOffset();
        Sorting sorting = request.getSorting();

        // get listing state (if cached)
        final ListingState state = ListingCache.getState(sessionId, listingId);
        if(state != null) {
          if(log.isDebugEnabled())
            log.debug("Found cached state for listing '" + listingId + "': " + state.toString());
          if(offset == null) {
            offset = state.getOffset();
            assert offset != null;
            if(log.isDebugEnabled())
              log.debug("Setting offset (" + offset + ") from cache for listing:" + listingId);
          }
          if(sorting == null) {
            sorting = state.getSorting();
            assert sorting != null;
            if(log.isDebugEnabled())
              log.debug("Setting sorting (" + sorting.toString() + ") from cache for listing:" + listingId);
          }
        }

        handler = ListingCache.getHandler(sessionId, listingId);
        listingStatus = (handler == null ? ListingStatus.NOT_CACHED : ListingStatus.CACHED);
View Full Code Here

Examples of com.tll.dao.Sorting

    assert elements.size() >= 10 : "At least 10 list elements must be present for this test";
    final int pageSize = 3;

    final IListingDataProvider<Address> dataProvider = getTestEntityService();
    final Criteria<Address> criteria = new Criteria<Address>(Address.class);
    final Sorting sorting = new Sorting(new SortColumn("emailAddress"));
    final IListHandler<SearchResult> listHandler =
        ListHandlerFactory.create(criteria, sorting, ListHandlerType.PAGE, dataProvider);

    List<SearchResult> list;
View Full Code Here

Examples of com.tll.dao.Sorting

    final IListingDataProvider<AccountHistory> dataProvider = accountService.getAccountHistoryDataProvider();

    final Criteria<AccountHistory> criteria = new Criteria<AccountHistory>(AccountHistory.class);
    criteria.getPrimaryGroup().addCriterion("account", Account.class, account.getId());

    final Sorting sorting = new Sorting("transDate");

    final IListHandler<SearchResult> lh =
      ListHandlerFactory.create(criteria, sorting, ListHandlerType.PAGE, dataProvider);
    final List<SearchResult> chunk = lh.getElements(0, 25, sorting);
    Assert.assertTrue(chunk != null && chunk.size() == 1);
View Full Code Here

Examples of com.tll.dao.Sorting

   * @param nq the named query def
   * @return newly created query params to employ
   */
  private CriteriaAndSorting createCriteriaAndSorting(SelectNamedQueries nq) {
    final ArrayList<IQueryParam> list = new ArrayList<IQueryParam>();
    Sorting sorting;
    switch(nq) {
    case ISP_LISTING:
      sorting = new Sorting("dateCreated");
      break;
    case MERCHANT_LISTING: {
      sorting = new Sorting("dateCreated");
      // find an isp..
      final Isp anIsp = getEntityDao().loadAll(Isp.class).get(0);
      final QueryParam qp = new QueryParam("ispId", PropertyType.STRING, anIsp.getId());
      list.add(qp);
      break;
    }
    case CUSTOMER_LISTING: {
      sorting = new Sorting(new SortColumn("dateCreated", "c"));

      // get the asp (to serve as the parent account)..
      final Asp asp = getEntityDao().loadAll(Asp.class).get(0);
      final QueryParam qp = new QueryParam("accountId", PropertyType.STRING, asp.getId());
      list.add(qp);
      break;
    }
    case INTERFACE_SUMMARY_LISTING:
      sorting = new Sorting(new SortColumn("code", "intf"));
      break;
    case ACCOUNT_INTERFACE_SUMMARY_LISTING: {
      sorting = new Sorting(new SortColumn("code", "intf"));

      list.add(new QueryParam("", PropertyType.STRING, "asp"));
      break;
    }

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.