public void testSort3WithFilter() {
   Filter filter = Predicates.equal("name", "quux");
   StringBuilder build =
       QueryBuilder.forIds(dialect, WorkspaceInfo.class, dbMappings)
           .filter(filter)
           .sortOrder(Predicates.asc("foo"), Predicates.desc("bar"), Predicates.asc("baz"))
           .build();
 }
 public void testSort3() {
   Filter filter = Predicates.acceptAll();
   StringBuilder build =
       QueryBuilder.forIds(dialect, WorkspaceInfo.class, dbMappings)
           .filter(filter)
           .sortOrder(Predicates.asc("foo"), Predicates.desc("bar"), Predicates.asc("baz"))
           .build();
 }
Beispiel #3
0
 private Filter getFilter() {
   final String[] keywords = getKeywords();
   Filter filter = acceptAll();
   if (null != keywords) {
     for (String keyword : keywords) {
       Filter propContains = Predicates.fullTextSearch(keyword);
       // chain the filters together
       if (Filter.INCLUDE == filter) {
         filter = propContains;
       } else {
         filter = or(filter, propContains);
       }
     }
   }
   return filter;
 }
Beispiel #4
0
  public static List<DataStoreInfo> findGeogitStores(Request request) {
    List<DataStoreInfo> geogitStores;

    Catalog catalog = getCatalog(request);
    org.opengis.filter.Filter filter =
        Predicates.equal("type", GeoGitDataStoreFactory.DISPLAY_NAME);
    CloseableIterator<DataStoreInfo> stores = catalog.list(DataStoreInfo.class, filter);
    try {
      Predicate<DataStoreInfo> enabled =
          new Predicate<DataStoreInfo>() {
            @Override
            public boolean apply(@Nullable DataStoreInfo input) {
              return input.isEnabled();
            }
          };
      geogitStores = ImmutableList.copyOf(Iterators.filter(stores, enabled));
    } finally {
      stores.close();
    }

    return geogitStores;
  }
Beispiel #5
0
 private CloseableIterator<DataStoreInfo> getDataStores() {
   Catalog catalog = getGeoServer().getCatalog();
   Filter filter = Predicates.acceptAll();
   CloseableIterator<DataStoreInfo> stores = catalog.list(DataStoreInfo.class, filter);
   return stores;
 }
Beispiel #6
0
 @Override
 public int fullSize() {
   Filter filter = Predicates.acceptAll();
   int count = getCatalog().count(LayerInfo.class, filter);
   return count;
 }
 public void testQueryAll() {
   Filter filter = Predicates.equal("name", "ws1");
   StringBuilder build =
       QueryBuilder.forIds(dialect, WorkspaceInfo.class, dbMappings).filter(filter).build();
 }