Package com.onpositive.commons.ui.tableeditor

Examples of com.onpositive.commons.ui.tableeditor.Sort


            .startsWith("com.google.appengine.api.datastore.DatastoreNeedIndexException")) {
          // let's attempt to remove sorting first
          if (query.sort != null && query.sort.property != null
              && query.sort.property.length() > 0) {
            callback.removeSort();
            query.sort = new Sort("", false);
            Thread thread = new Thread() {
              public void run() {
                query(query, callback);
              }
            };
View Full Code Here


        } else {
          otherFilters.add(a);
        }
      }
      Query simpleQuery = new Query(
          eqFilters.toArray(new Filter[eqFilters.size()]), new Sort(
              "", true), limit, 0);
      ArrayList<IComplexQueryRequest> s = new ArrayList<IComplexQueryRequest>();
      SimpleRequest simpleRequest = new SimpleRequest(kind, simpleQuery,
          limit);
      s.add(simpleRequest);
View Full Code Here

        final ComplexFilter filter = (ComplexFilter) f.value;
        final Filter[] parseValue = filter.field.parseValue(filter);
        if (parseValue != null) {
          return new ReificationRequest(new SimpleRequest(
              filter.field.keyKind, new Query(parseValue,
                  new Sort("", false), limit, 0), limit),
              limit) {

            protected IComplexQueryRequest toQuery(Object object) {
              Entity e = (Entity) object;
              Key key = e.getKey();
              return new SimpleRequest(kind, new Query(
                  new Filter[] { new Filter(
                      filter.field.name, Filter.EQUAL,
                      key) }, new Sort("", true), 100,
                  100), 100);
            }

            public void filter(HashSet<Object> r) {
              waitWhileNotDone();
              HashSet<Object> toREtain = new HashSet<Object>();
              for (Object o : r) {
                Entity e = (Entity) o;
                String fName = filter.field.name;

                Object property = e.getProperty(fName);
                if (fName.equals(Entity.KEY_RESERVED_PROPERTY)) {
                  property = e.getKey();
                }

                if (property instanceof Collection) {
                  Collection c = (Collection) property;
                  for (Object o1 : c) {
                    if (matching.contains(property)) {
                      toREtain.add(o1);
                      break;
                    }
                  }
                } else {
                  if (matching.contains(property)) {
                    toREtain.add(o);
                  }
                }
              }
              r.retainAll(toREtain);
            }
          };
        }
        return null;
      }
      return new SimpleRequest(kind, new Query(new Filter[] { f },
          new Sort("", false), limit, 0), limit);
    }
View Full Code Here

            }
          }
          if (filters.size() > 0) {
            ArrayList<Key> keys = new ArrayList<Key>();
            Query c = new Query(filters.toArray(new Filter[filters
                .size()]), new Sort("", false), 100, 0);
            c.keysOnly = true;
            BaseDataFacade createFacade = field
                .createFacade(field.keyKind);
            Entity[] query2 = createFacade.query(c, monitor);
            for (Entity e : query2) {
View Full Code Here

      callback.failed(e);
    }
  }

  public Query getDefaultQuery() {
    return new Query(new Filter[0], new Sort("", false), 1000, 0);
  }
View Full Code Here

      return Status.OK_STATUS;
    }

    private void findAllChildren(Entity[] entities) {
      Request r = new Request();
      Sort s = new Sort("", false);

      for (int i = 0; i < entities.length; i++) {
        if (entities[i].getKey() != null) {
          Filter f = new Filter("ONPOSITIVE_FILTER_FOR_PARENT_KEY",
              Filter.EQUAL, entities[i].getKey());// "ONPOSITIVE_FILTER_FOR_PARENT_KEY"
View Full Code Here

        } else {
          allEntities = 0;
          progressSize = 1;
        }
        writer.beginWriting(parameters.outPut, allEntities);
        Sort sort = new Sort(Entity.KEY_RESERVED_PROPERTY, true);

        CallBackForImportDataImpl cb = new CallBackForImportDataImpl();
        int returningCode = -1;
        currentSize = currFacade.getLimit();
        while (callBackErrorsCount < NUMBER_OF_CALLBACK_ERRORS) {
View Full Code Here

            .startsWith("com.google.appengine.api.datastore.DatastoreNeedIndexException")) {
          // let's attempt to remove sorting first
          if (query.sort != null && query.sort.property != null
              && query.sort.property.length() > 0) {
            callback.removeSort();
            query.sort = new Sort("", false);
            Thread thread = new Thread() {
              public void run() {
                query(query, callback);
              }
            };
View Full Code Here

        final ComplexFilter filter = (ComplexFilter) f.value;
        final Filter[] parseValue = filter.field.parseValue(filter);
        if (parseValue != null) {
          return new ReificationRequest(new SimpleRequest(
              filter.field.keyKind, new Query(parseValue,
                  new Sort("", false), limit, 0), limit),
              limit) {

            protected IComplexQueryRequest toQuery(Object object) {
              Entity e = (Entity) object;
              Key key = e.getKey();
              return new SimpleRequest(kind, new Query(
                  new Filter[] { new Filter(
                      filter.field.name, Filter.EQUAL,
                      key) }, new Sort("", true), 100,
                  100), 100);
            }

            public void filter(HashSet<Object> r) {
              waitWhileNotDone();
              HashSet<Object> toREtain = new HashSet<Object>();
              for (Object o : r) {
                Entity e = (Entity) o;
                Object property = e
                    .getProperty(filter.field.name);
                if (property instanceof Collection) {
                  Collection c = (Collection) property;
                  for (Object o1 : c) {
                    if (matching.contains(property)) {
                      toREtain.add(o1);
                      break;
                    }
                  }
                } else {
                  if (matching.contains(property)) {
                    toREtain.add(o);
                  }
                }
              }
              r.retainAll(toREtain);
            }
          };
        }
        return null;
      }
      return new SimpleRequest(kind, new Query(new Filter[] { f },
          new Sort("", false), limit, 0), limit);
    }
View Full Code Here

TOP

Related Classes of com.onpositive.commons.ui.tableeditor.Sort

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.