Package org.geomajas.global

Examples of org.geomajas.global.GeomajasException


            response.getErrors().add(throwable);
          }
        } else {
          response = new CommandResponse();
          response.setId(id);
          response.getErrors().add(new GeomajasException(ExceptionCode.COMMAND_NOT_FOUND, commandName));
        }

      } else {
        // not authorized
        response = new CommandResponse();
View Full Code Here


  public void execute(final SaveSearchFavouriteRequest request, final SaveSearchFavouriteResponse response)
      throws Exception {
    SearchFavourite sf = request.getSearchFavourite();
    if (null == sf) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "SearchFavourite");
    }
    if (null == sf.getCriterion()) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "Criterion missing.");
    }

    String user = securityContext.getUserName();
    boolean anonymous = false;
    if (user == null || "".equals(user)) {
View Full Code Here

    InternalFeature oldFeature = context.getOptional(PipelineCode.OLD_FEATURE_KEY, InternalFeature.class);
    if (null != oldFeature) {
      InternalFeature newFeature = context.get(PipelineCode.FEATURE_KEY, InternalFeature.class);
      if (null == oldFeature.getId() || !oldFeature.getId().equals(newFeature.getId())) {
        int index = context.get(PipelineCode.INDEX_KEY, Integer.class);
        throw new GeomajasException(ExceptionCode.FEATURE_ID_MISMATCH, index);
      }
    }
  }
View Full Code Here

    if (!securityContext.isLayerVisible(layerId)) {
      throw new GeomajasSecurityException(ExceptionCode.LAYER_NOT_VISIBLE, layerId, securityContext.getUserId());
    }
    RasterLayer layer = configurationService.getRasterLayer(layerId);
    if (null == layer) {
      throw new GeomajasException(ExceptionCode.RASTER_LAYER_NOT_FOUND, layerId);
    }
    return layer;
  }
View Full Code Here

  public void refresh(String[] configLocations) throws GeomajasException {
    try {
      setConfigLocations(configLocations);
      refresh();
    } catch (Exception e) {
      throw new GeomajasException(e, ExceptionCode.REFRESH_CONFIGURATION_FAILED);
    }
  }
View Full Code Here

  public void rollback() throws GeomajasException {
    try {
      setConfigLocations(previousConfigLocations);
      refresh();
    } catch (Exception e) {
      throw new GeomajasException(e, ExceptionCode.REFRESH_CONFIGURATION_FAILED);
    }
  }
View Full Code Here

  public void execute(SearchByPointRequest request, SearchByPointResponse response)
      throws Exception {
    String[] layerIds = request.getLayerIds();
    if (null == layerIds) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layerIds");
    }
    String crsCode = request.getCrs();
    if (null == crsCode) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "crs");
    }
    org.geomajas.geometry.Coordinate requestLocation = request.getLocation();
    if (null == requestLocation) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "location");
    }
    Bbox mapBounds = request.getMapBounds();
    if (null == mapBounds) {
      throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "mapBounds");
    }

    Coordinate coordinate = new Coordinate(requestLocation.getX(), requestLocation.getY());
    Crs crs = geoService.getCrs2(request.getCrs());
    boolean searchFirstLayerOnly;
View Full Code Here

        // Translate the map coordinates to layer coordinates, assumes equal x-y orientation
        Bbox layerBounds = geoService.transform(mapBounds, mapCrs, layerCrs);
        layerScale = mapBounds.getWidth() * mapScale / layerBounds.getWidth();
      }
    } catch (MismatchedDimensionException e) {
      throw new GeomajasException(e, ExceptionCode.RENDER_DIMENSION_MISMATCH);
    }
    return layerScale;
  }
View Full Code Here

    if (!securityContext.isLayerVisible(layerId)) {
      throw new GeomajasSecurityException(ExceptionCode.LAYER_NOT_VISIBLE, layerId, securityContext.getUserId());
    }
    VectorLayer layer = configurationService.getVectorLayer(layerId);
    if (null == layer) {
      throw new GeomajasException(ExceptionCode.VECTOR_LAYER_NOT_FOUND, layerId);
    }
    return layer;
  }
View Full Code Here

  }
 
  public Object get(String key) throws GeomajasException {
    Object res = getOptional(key);
    if (null == res) {
      throw new GeomajasException(ExceptionCode.PIPELINE_CONTEXT_MISSING, key);
    }
    return res;
  }
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.