changeset 6199:734ba3732bb6

CapabilitiesParse parses the "queryable" attribute of a WMSLayer now (#1253).
author Christian Lins <christian.lins@intevation.de>
date Wed, 05 Jun 2013 13:13:20 +0200
parents 809c91beee54
children 743eab7acfdb
files gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WMSLayer.java
diffstat 2 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java	Wed Jun 05 12:56:24 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java	Wed Jun 05 13:13:20 2013 +0200
@@ -344,6 +344,12 @@
 
         logger.debug("Found layer: " + title + "(" + name + ")");
 
+        boolean queryable = true;
+        Node queryableAttr = layerNode.getAttributes().getNamedItem("queryable");
+        if (queryableAttr != null && queryableAttr.getNodeValue().equals("0")) {
+            queryable = false;
+        }
+
         List<String> srs = parseSRS(layerNode);
 
         NodeList layersNodes = (NodeList) XMLUtils.xpath(
@@ -353,7 +359,7 @@
 
         List<WMSLayer> layers = parseLayers(layersNodes, onlineResource);
 
-        return new WMSLayer(onlineResource, title, name, srs, layers);
+        return new WMSLayer(onlineResource, title, name, srs, layers, queryable);
     }
 
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WMSLayer.java	Wed Jun 05 12:56:24 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WMSLayer.java	Wed Jun 05 13:13:20 2013 +0200
@@ -22,6 +22,8 @@
     protected List<String>   srs;
     protected List<WMSLayer> layers;
 
+    protected boolean queryable = true;
+
 
     public WMSLayer() {
         layers = new ArrayList<WMSLayer>();
@@ -39,13 +41,15 @@
         String         title,
         String         name,
         List<String>   srs,
-        List<WMSLayer> layers
+        List<WMSLayer> layers,
+        boolean        queryable
     ) {
-        this.server = server;
-        this.title  = title;
-        this.name   = name;
-        this.srs    = srs;
-        this.layers = layers;
+        this.server    = server;
+        this.title     = title;
+        this.name      = name;
+        this.srs       = srs;
+        this.layers    = layers;
+        this.queryable = queryable;
     }
 
 
@@ -74,6 +78,11 @@
     }
 
 
+    public boolean isQueryable() {
+        return queryable;
+    }
+
+
     public boolean supportsSrs(String srs) {
         if (this.srs == null || this.srs.size() == 0) {
             return true;

http://dive4elements.wald.intevation.org