Package org.geomajas.global

Examples of org.geomajas.global.GeomajasException


  Filter createFilter(SearchFeatureRequest request, String layerId) throws GeomajasException {
    Filter f = null;
    VectorLayer layer = configurationService.getVectorLayer(layerId);
    if (layer == null) {
      throw new  GeomajasException(ExceptionCode.LAYER_NOT_FOUND, layerId);
    }
    String idName = layer.getLayerInfo().getFeatureInfo().getIdentifier().getName();
    if (null != request.getCriteria()) {
      for (SearchCriterion criterion : request.getCriteria()) {
        Filter temp;
View Full Code Here


  }

  public void execute(SearchAttributesRequest request, SearchAttributesResponse response) throws Exception {
    String layerId = request.getLayerId();
    if (null == layerId) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer");
    }

    Filter filter = Filter.INCLUDE;
    if (request.getFilter() != null) {
      filter = filterService.parseFilter(request.getFilter());
View Full Code Here

    return new GetConfigurationResponse();
  }

  public void execute(GetConfigurationRequest request, GetConfigurationResponse response) throws Exception {
    if (null == request.getApplicationId()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "applicationId");
    }

    // the data is explicitly copied as this assures the security is considered when copying.
    ClientApplicationInfo original = context.getBean(request.getApplicationId(), ClientApplicationInfo.class);
    if (original == null) {
      throw new GeomajasException(ExceptionCode.APPLICATION_NOT_FOUND, request.getApplicationId());
    }
    ClientApplicationInfo client = new ClientApplicationInfo();
    client.setId(original.getId());
    client.setUserData(original.getUserData());
    client.setWidgetInfo(original.getWidgetInfo());
View Full Code Here

    return new PersistTransactionResponse();
  }

  public void execute(PersistTransactionRequest request, PersistTransactionResponse response) throws Exception {
    if (null == request.getFeatureTransaction()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "featureTransaction");
    }
    if (null == request.getFeatureTransaction().getLayerId()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "featureTransaction.layerId");
    }
    if (null == request.getCrs()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "crs");
    }
    FeatureTransaction featureTransaction = request.getFeatureTransaction();
    if (featureTransaction == null) {
      return;
    }
View Full Code Here

        }
        response.setApplicationNames(context.getBeanNamesForType(ClientApplicationInfo.class));
      }
    } else {
      response.setApplicationNames(context.getBeanNamesForType(ClientApplicationInfo.class));
      throw new GeomajasException(ExceptionCode.REFRESH_CONFIGURATION_FAILED);
    }
  }
View Full Code Here

  public void execute(GetRasterTilesRequest request, GetRasterTilesResponse response) throws Exception {
    log.debug("request start layer {}, crs {}", request.getLayerId(), request.getCrs());
    String layerId = request.getLayerId();
    if (null == layerId) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer");
    }
    if (null == request.getCrs()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "crs");
    }
    if (!securityContext.isLayerVisible(layerId)) {
      throw new GeomajasSecurityException(ExceptionCode.LAYER_NOT_VISIBLE, layerId, securityContext.getUserId());
    }
View Full Code Here

  public void execute(GetVectorTileRequest request, GetVectorTileResponse response) throws Exception {
    String layerId = request.getLayerId();
    log.info("request start layer {}, crs {}", layerId, request.getCrs());
    if (null == layerId) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer");
    }
    if (null == request.getCrs()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "crs");
    }

    response.setTile(converter.toDto(layerService.getTile(request)));
  }
View Full Code Here

  public void execute(SplitPolygonRequest request, SplitPolygonResponse response) throws Exception {
    // convert to most accurate precision model
    com.vividsolutions.jts.geom.Geometry jtsGeometry = converter.toInternal(request.getGeometry());
    if (!(jtsGeometry instanceof Polygon)) {
      throw new GeomajasException(ExceptionCode.UNEXPECTED_PROBLEM, "geometry has to be a Polygon");
    }
    Polygon polygon = (Polygon) converter.toInternal(request.getGeometry());

    // Convert to the polygons precision model:
    jtsGeometry = converter.toInternal(request.getSplitter());
    if (!(jtsGeometry instanceof LineString)) {
      throw new GeomajasException(ExceptionCode.UNEXPECTED_PROBLEM, "splitter has to be a LineString");
    }
    LineString preciseLine = (LineString) jtsGeometry;
    int precision = polygon.getPrecisionModel().getMaximumSignificantDigits() - 1;
    com.vividsolutions.jts.geom.Geometry bufferedLine = preciseLine.buffer(Math.pow(10.0, -precision));
    com.vividsolutions.jts.geom.Geometry diff = polygon.difference(bufferedLine);
View Full Code Here

    return new GetMapConfigurationResponse();
  }

  public void execute(GetMapConfigurationRequest request, GetMapConfigurationResponse response) throws Exception {
    if (null == request.getApplicationId()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "applicationId");
    }
    String mapId = request.getMapId();
    if (null == mapId) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "mapId");
    }

    ClientApplicationInfo application = context.getBean(request.getApplicationId(), ClientApplicationInfo.class);
    for (ClientMapInfo map : application.getMaps()) {
      if (mapId.equals(map.getId())) {
        response.setMapInfo(securityClone(map));
      }
    }
    if (response.getMapInfo() == null) {
      throw new GeomajasException(ExceptionCode.MAP_NOT_FOUND, request.getMapId(), request.getApplicationId());
    }
  }
View Full Code Here

        if (!securityContext.isLayerVisible(layerId)) {
          throw new GeomajasSecurityException(ExceptionCode.LAYER_NOT_VISIBLE, layerId);
        }
        Layer<?> l = configurationService.getLayer(layerId);
        if (null == l) {
          throw new GeomajasException(ExceptionCode.LAYER_NOT_FOUND, layerId);
        }
        if (!excludeRasterLayers || l.getLayerInfo().getLayerType() != LayerType.RASTER) {
          tempLayers.add(l.getId());
        }
      }
View Full Code Here

TOP

Related Classes of org.geomajas.global.GeomajasException

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.