Package org.geomajas.layer

Examples of org.geomajas.layer.LayerException


    public void setAttribute(String name, Object value) throws LayerException {
      try {
        BeanUtils.setProperty(bean, name, value);
      } catch (Exception e) {
        throw new LayerException();
      }
    }
View Full Code Here


    // Search for the WMS layer:
    String layerId = parseLayerId(request);
    WmsLayer layer = getLayer(layerId);
    if (layer == null) {
      throw new LayerException(ExceptionCode.LAYER_NOT_FOUND, layerId);
    }
    RasterLayerInfo layerInfo = layer.getLayerInfo();

    String url = layer.getBaseWmsUrl() + "?" + request.getQueryString();
    InputStream stream = null;
View Full Code Here

      this.url = url;
      Map<String, String> params = new HashMap<String, String>();
      params.put("url", url);
      DataStore store = DataStoreFactory.create(params);
      if (store == null) {
        throw new LayerException(ExceptionCode.INVALID_SHAPE_FILE_URL, url);
      }
      setDataStore(store);
    } catch (IOException ioe) {
      throw new LayerException(ExceptionCode.INVALID_SHAPE_FILE_URL, url);
    }
  }
View Full Code Here

  public Envelope getBounds(Filter filter) throws LayerException {
    try {
      FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureSource().getFeatures(filter);
      return fc.getBounds();
    } catch (IOException ioe) {
      throw new LayerException(ioe, ExceptionCode.FEATURE_MODEL_PROBLEM);
    }
  }
View Full Code Here

    return null;
  }

  public Object read(String featureId) throws LayerException {
    if (!features.containsKey(featureId)) {
      throw new LayerException(ExceptionCode.LAYER_MODEL_FEATURE_NOT_FOUND, featureId);
    } else {
      return features.get(featureId);
    }
  }
View Full Code Here

        }
      }
      iterator.close();
      ((ShapeInMemFeatureModel) featureModel).setNextId(++nextId);
    } catch (NumberFormatException nfe) {
      throw new LayerException(nfe, ExceptionCode.FEATURE_MODEL_PROBLEM, url);
    } catch (MalformedURLException e) {
      throw new LayerException(ExceptionCode.INVALID_SHAPE_FILE_URL, url);
    } catch (IOException ioe) {
      throw new LayerException(ioe, ExceptionCode.CANNOT_CREATE_LAYER_MODEL, url);
    } catch (GeomajasException ge) {
      throw new LayerException(ge, ExceptionCode.CANNOT_CREATE_LAYER_MODEL, url);
    }
  }
View Full Code Here

  }

  private Attribute convertAttribute(Object object, String name) throws LayerException {
    AttributeInfo attributeInfo = attributeInfoMap.get(name);
    if (null == attributeInfo) {
      throw new LayerException(ExceptionCode.ATTRIBUTE_UNKNOWN, name, attributeInfoMap.keySet());
    }
    try {
      return converterService.toDto(object, attributeInfo);
    } catch (GeomajasException e) {
      throw new LayerException(e);
    }
  }
View Full Code Here

    return srid;
  }

  public Object newInstance() throws LayerException {
    if (builder == null) {
      throw new LayerException(ExceptionCode.CREATE_FEATURE_NO_FEATURE_TYPE);
    }
    return builder.buildFeature(Long.toString(nextId++));
  }
View Full Code Here

    return builder.buildFeature(Long.toString(nextId++));
  }

  public Object newInstance(String id) throws LayerException {
    if (builder == null) {
      throw new LayerException(ExceptionCode.CREATE_FEATURE_NO_FEATURE_TYPE);
    }
    return builder.buildFeature(id);
  }
View Full Code Here

  public SimpleFeatureSource getFeatureSource() throws LayerException {
    if (featureSource == null) {
      try {
        featureSource = dataStore.getFeatureSource(featureSourceName);
      } catch (IOException e) {
        throw new LayerException(e, ExceptionCode.FEATURE_MODEL_PROBLEM, "Cannot find feature source "
            + featureSourceName);
      } catch (NullPointerException e) {
        throw new LayerException(e, ExceptionCode.FEATURE_MODEL_PROBLEM, "Cannot find feature source "
            + featureSourceName);
      }
    }
    return featureSource;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.layer.LayerException

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.