Examples of LayerRequest


Examples of org.OpenGeoPortal.Download.Types.LayerRequest

  private Map <String, List<LayerRequest>> createDownloadRequestMap (Map<String, String> layerMap, String[] bounds) throws Exception {
    this.layerInfo = this.layerInfoRetriever.fetchAllLayerInfo(layerMap.keySet());
    Map <String, List<LayerRequest>> downloadMap = new HashMap<String, List<LayerRequest>>();
    for (SolrRecord record: this.layerInfo){
      logger.debug("Requested format: " + layerMap.get(record.getLayerId()));
      LayerRequest layerRequest = this.createLayerRequest(record, layerMap.get(record.getLayerId()), bounds);
      if (!isAuthorizedToDownload(record)){
        layerRequest.setStatus(Status.FAILED);
        logger.info("User is not authorized to download: '" + record.getLayerId() +"'");
        continue
      }
      String currentClassKey = null;
      try {
        currentClassKey = this.downloadConfigRetriever.getClassKey(layerRequest);
        if (currentClassKey == null){
          throw new Exception();
        }
        logger.info("DownloadKey: " + currentClassKey);
      } catch(Exception e) {
        e.printStackTrace();
        layerRequest.setStatus(Status.FAILED);
        logger.info("No download method found for: '" + record.getLayerId() +"'");
        continue;
      }
      if (downloadMap.containsKey(currentClassKey)){
        List<LayerRequest> currentLayerList = downloadMap.get(currentClassKey);
View Full Code Here

Examples of org.OpenGeoPortal.Download.Types.LayerRequest

    return downloadMap;
   
  }
 
  private LayerRequest createLayerRequest(SolrRecord solrRecord, String requestedFormat, String[] bounds){
    LayerRequest layer = new LayerRequest(solrRecord, requestedFormat);
    layer.setRequestedBounds(new BoundingBox(bounds[0], bounds[1], bounds[2], bounds[3]));
    layer.setEmailAddress(this.emailAddress);
    layer.setTargetDirectory(this.directoryRetriever.getDownloadDirectory());
    return layer;
  }
View Full Code Here

Examples of org.OpenGeoPortal.Download.Types.LayerRequest

  }
 
 
  @Override
  public String createDownloadRequest() {
    LayerRequest representativeLayer = this.layerList.get(0);
    try {
      this.validate(representativeLayer);
    } catch (Exception e){
      //die gracefully
      this.setAllLayerStatus(Status.FAILED);
      return null;
    }
    BoundingBox bounds = representativeLayer.getRequestedBounds();
    String userEmail = representativeLayer.getEmailAddress();

    String layerQuery = "";
    for (LayerRequest currentLayer: this.layerList){
      layerQuery += "LayerName=" + currentLayer.getLayerInfo().getName() + "&";
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.