changeset 1487:ea2aae01e7c4

Improved CapabilitiesParser to test WMS using its main() method. flys-client/trunk@3565 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 02 Jan 2012 14:42:59 +0000 (2012-01-02)
parents efdb4fe5a69e
children 23ffee639f7c
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/server/CapabilitiesParser.java flys-client/src/main/java/de/intevation/flys/client/shared/model/Capabilities.java flys-client/src/main/java/de/intevation/flys/client/shared/model/WMSLayer.java
diffstat 4 files changed, 38 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Jan 02 10:23:29 2012 +0000
+++ b/flys-client/ChangeLog	Mon Jan 02 14:42:59 2012 +0000
@@ -1,3 +1,13 @@
+2012-01-02  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/server/CapabilitiesParser.java:
+	  The URL to a Capabilities document is determined by a string property
+	  "test.wms" in main().
+
+	* src/main/java/de/intevation/flys/client/shared/model/WMSLayer.java,
+	  src/main/java/de/intevation/flys/client/shared/model/Capabilities.java:
+	  Override toString().
+
 2012-01-02  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/server/CapabilitiesParser.java	Mon Jan 02 10:23:29 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/CapabilitiesParser.java	Mon Jan 02 14:42:59 2012 +0000
@@ -101,8 +101,9 @@
         LoggingConfigurator.init(log4jProperties);
 
         try {
-            Capabilities caps = getCapabilities(
-                "http://czech-republic.atlas.intevation.de/cgi-bin/saar-wms?REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0");
+            Capabilities caps = getCapabilities(System.getProperty("test.wms"));
+
+            logger.debug(caps.toString());
         }
         catch (ServerException se) {
             se.printStackTrace();
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/Capabilities.java	Mon Jan 02 10:23:29 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Capabilities.java	Mon Jan 02 14:42:59 2012 +0000
@@ -72,5 +72,24 @@
     public List<WMSLayer> getLayers() {
         return layers;
     }
+
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("--- Capabilities ---\n");
+        sb.append("Title:.............. " + title + "\n");
+        sb.append("Online Resource:.... " + onlineResource + "\n");
+        sb.append("Contact Information: " + contactInformation + "\n");
+        sb.append("Fees:............... " + fees + "\n");
+        sb.append("Access Constraints:. " + accessConstraints + "\n");
+        sb.append("Layers: ");
+
+        for (WMSLayer layer: layers) {
+            sb.append("   - " + layer + "\n");
+        }
+
+        return sb.toString();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/WMSLayer.java	Mon Jan 02 10:23:29 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/WMSLayer.java	Mon Jan 02 14:42:59 2012 +0000
@@ -77,5 +77,11 @@
 
         return this.srs.contains(srs);
     }
+
+
+    @Override
+    public String toString() {
+        return "WMS Layer: " + title + " (" + name + ") " + server;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org