Package org.geotools.styling

Examples of org.geotools.styling.RemoteOWS


        request.setStyles(styles);
    }

    private static void addRemoteLayersFromUserLayer(GetMapRequest request, UserLayer ul,
            List layers, List styles) throws WmsException, IOException {
        RemoteOWS service = ul.getRemoteOWS();
        if (!service.getService().equalsIgnoreCase("WFS"))
            throw new WmsException("GeoServer only supports WFS as remoteOWS service");
        if (service.getOnlineResource() == null)
            throw new WmsException("OnlineResource for remote WFS not specified in SLD");
        final FeatureTypeConstraint[] featureConstraints = ul.getLayerFeatureConstraints();
        if (featureConstraints == null || featureConstraints.length == 0)
            throw new WmsException(
                    "No FeatureTypeConstraint specified, no layer can be loaded for this UserStyle");

        DataStore remoteWFS = null;
        List remoteTypeNames = null;
        try {
            URL url = new URL(service.getOnlineResource());
            remoteWFS = connectRemoteWFS(url);
            remoteTypeNames = new ArrayList(Arrays.asList(remoteWFS.getTypeNames()));
            Collections.sort(remoteTypeNames);
        } catch (MalformedURLException e) {
            throw new WmsException("Invalid online resource url: '" + service.getOnlineResource()
                    + "'");
        }

        Style[] layerStyles = ul.getUserStyles();
        if (request.getFilter() == null)
            request.setFilter(new ArrayList());
        for (int i = 0; i < featureConstraints.length; i++) {
            // make sure the layer is there
            String name = featureConstraints[i].getFeatureTypeName();
            if (Collections.binarySearch(remoteTypeNames, name) < 0) {
                throw new WmsException("Could not find layer feature type '" + name
                        + "' on remote WFS '" + service.getOnlineResource());
            }

            // grab the filter
            Filter filter = featureConstraints[i].getFilter();
            if (filter == null)
View Full Code Here


    public RemoteOWS build() {
        if (unset) {
            return null;
        }
        RemoteOWS remote = sf.createRemoteOWS(service, onlineResource);
        return remote;
    }
View Full Code Here

        request.setStyles(styles);
    }

    private static void addRemoteLayersFromUserLayer(GetMapRequest request, UserLayer ul,
            List layers, List styles) throws ServiceException, IOException {
        RemoteOWS service = ul.getRemoteOWS();
        if (!service.getService().equalsIgnoreCase("WFS"))
            throw new ServiceException("GeoServer only supports WFS as remoteOWS service");
        if (service.getOnlineResource() == null)
            throw new ServiceException("OnlineResource for remote WFS not specified in SLD");
        final FeatureTypeConstraint[] featureConstraints = ul.getLayerFeatureConstraints();
        if (featureConstraints == null || featureConstraints.length == 0)
            throw new ServiceException(
                    "No FeatureTypeConstraint specified, no layer can be loaded for this UserStyle");

        DataStore remoteWFS = null;
        List remoteTypeNames = null;
        try {
            URL url = new URL(service.getOnlineResource());
            remoteWFS = connectRemoteWFS(url);
            remoteTypeNames = new ArrayList(Arrays.asList(remoteWFS.getTypeNames()));
            Collections.sort(remoteTypeNames);
        } catch (MalformedURLException e) {
            throw new ServiceException("Invalid online resource url: '"
                    + service.getOnlineResource() + "'");
        }

        Style[] layerStyles = ul.getUserStyles();
        if (request.getFilter() == null)
            request.setFilter(new ArrayList());
        for (int i = 0; i < featureConstraints.length; i++) {
            // make sure the layer is there
            String name = featureConstraints[i].getFeatureTypeName();
            if (Collections.binarySearch(remoteTypeNames, name) < 0) {
                throw new ServiceException("Could not find layer feature type '" + name
                        + "' on remote WFS '" + service.getOnlineResource());
            }

            // grab the filter
            Filter filter = featureConstraints[i].getFilter();
            if (filter == null)
View Full Code Here

        String layerName = getFirstChildValue(child);
        layer.setName(layerName);
        if (LOGGER.isLoggable(Level.INFO))
          LOGGER.info("layer name: " + layer.getName());
      } else if (childName.equalsIgnoreCase("RemoteOWS")) {
        RemoteOWS remoteOws = parseRemoteOWS(child);
        layer.setRemoteOWS(remoteOws);
      } else if (childName.equalsIgnoreCase("LayerFeatureConstraints")) {
        layer.setLayerFeatureConstraints(parseLayerFeatureConstraints(child));
      }
View Full Code Here

    else
      return ftc;
  }

  protected RemoteOWS parseRemoteOWS(Node root) {
    RemoteOWS ows = new RemoteOWSImpl();

    NodeList children = root.getChildNodes();
    final int length = children.getLength();
    for (int i = 0; i < length; i++) {
      Node child = children.item(i);
      if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)) {
        continue;
      }
      String childName = child.getLocalName();

      if (childName.equalsIgnoreCase("Service")) {
        ows.setService(getFirstChildValue(child));
      } else if (childName.equalsIgnoreCase("OnlineResource")) {
        ows.setOnlineResource(parseOnlineResource(child));
      }
    }
    return ows;
  }
View Full Code Here

        request.setStyles(styles);
    }

    private static void addRemoteLayersFromUserLayer(GetMapRequest request, UserLayer ul,
            List layers, List styles) throws ServiceException, IOException {
        RemoteOWS service = ul.getRemoteOWS();
        if (!service.getService().equalsIgnoreCase("WFS"))
            throw new ServiceException("GeoServer only supports WFS as remoteOWS service");
        if (service.getOnlineResource() == null)
            throw new ServiceException("OnlineResource for remote WFS not specified in SLD");
        final FeatureTypeConstraint[] featureConstraints = ul.getLayerFeatureConstraints();
        if (featureConstraints == null || featureConstraints.length == 0)
            throw new ServiceException(
                    "No FeatureTypeConstraint specified, no layer can be loaded for this UserStyle");

        DataStore remoteWFS = null;
        List remoteTypeNames = null;
        try {
            URL url = new URL(service.getOnlineResource());
            remoteWFS = connectRemoteWFS(url);
            remoteTypeNames = new ArrayList(Arrays.asList(remoteWFS.getTypeNames()));
            Collections.sort(remoteTypeNames);
        } catch (MalformedURLException e) {
            throw new ServiceException("Invalid online resource url: '"
                    + service.getOnlineResource() + "'");
        }

        Style[] layerStyles = ul.getUserStyles();
        if (request.getFilter() == null)
            request.setFilter(new ArrayList());
        for (int i = 0; i < featureConstraints.length; i++) {
            // make sure the layer is there
            String name = featureConstraints[i].getFeatureTypeName();
            if (Collections.binarySearch(remoteTypeNames, name) < 0) {
                throw new ServiceException("Could not find layer feature type '" + name
                        + "' on remote WFS '" + service.getOnlineResource());
            }

            // grab the filter
            Filter filter = featureConstraints[i].getFilter();
            if (filter == null)
View Full Code Here

TOP

Related Classes of org.geotools.styling.RemoteOWS

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.