Package com.onpositive.gae.baseviewer.requests

Examples of com.onpositive.gae.baseviewer.requests.SimpleRequest


      }
      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);
      for (Filter f : otherFilters) {
        IComplexQueryRequest m = toRequest(f);
        if (m == null) {
View Full Code Here


    private IComplexQueryRequest toRequest(Filter f) {
      if (f.kind == Filter.COMPLEX_FILTER) {
        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

    protected IStatus run(IProgressMonitor monitor) {
      try {
        if (parameters == null || writer == null || currFacade == null) {
          return Status.CANCEL_STATUS;
        }
        SimpleRequest req = null;
        if (parameters.filterColumns && parameters.selectedEntitiesOf) {
          Query query = currFacade.getCurrentQuery();
          int limit = currFacade.getLimit();
          String kind = currFacade.getKind();
          req = new SimpleRequest(kind, query, limit);
        }

        // Initialization of progress bar:
        BaseStatistics stats = null;
        if (!facade.isDebug()) {
View Full Code Here

    private IComplexQueryRequest toRequest(Filter f) {
      if (f.kind == Filter.COMPLEX_FILTER) {
        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.gae.baseviewer.requests.SimpleRequest

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.