Package org.geomajas.rest.server

Examples of org.geomajas.rest.server.RestException


    List<InternalFeature> features;
    try {
      features = vectorLayerService.getFeatures(layerId, null, filterService
          .createFidFilter(new String[] { featureId }), null, getIncludes(noGeom));
    } catch (GeomajasException e) {
      throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
    }
    if (features.size() != 1) {
      throw new RestException(RestException.FEATURE_NOT_FOUND, featureId, layerId);
    }
    model.addAttribute(FEATURE_COLLECTION, features.get(0));
    model.addAttribute(VECTOR_LAYER_INFO, features.get(0).getLayer().getLayerInfo());
    model.addAttribute(ATTRIBUTES, attrs);
    return VIEW;
View Full Code Here


        crs = geoService.getCrs2("EPSG:" + epsg);
      }
      features = vectorLayerService.getFeatures(layerId, crs, and(filters), null, getIncludes(noGeom),
          getOffset(offset), getLimit(maxFeatures, limit));
    } catch (Exception e) {
      throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
    }
    if (features.size() > 0) {
      VectorLayerInfo info = features.get(0).getLayer().getLayerInfo();
      model.addAttribute(VECTOR_LAYER_INFO, info);
      VectorLayer layer = configurationService.getVectorLayer(layerId);
View Full Code Here

      if (envelope != null) {
        try {
          return filterService.createBboxFilter(layer.getLayerInfo().getCrs(), envelope, layer
              .getFeatureModel().getGeometryAttributeName());
        } catch (LayerException e) {
          throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
        }
      }
    }
    return filterService.createTrueFilter();
  }
View Full Code Here

    } else if ("gte".equalsIgnoreCase(operation)) {
      return filterService.createCompareFilter(attributeName, ">=", value);
    } else if ("like".equalsIgnoreCase(operation)) {
      return filterService.createLikeFilter(attributeName, value);
    } else {
      throw new RestException(RestException.UNSUPPORTED_QUERY_OPERATION, operation);
    }
  }
View Full Code Here

      if (attributeInfo.getName().equalsIgnoreCase(attributeName)) {
        info = attributeInfo;
      }
    }
    if (info == null) {
      throw new RestException(RestException.NO_SUCH_ATTRIBUTE, attributeName, layer.getId());
    }
    return new InternalFeatureComparator(order, attributeName);
  }
View Full Code Here

TOP

Related Classes of org.geomajas.rest.server.RestException

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.