Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java @ 796:cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
flys-client/trunk@2312 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 08 Jul 2011 08:54:08 +0000 |
parents | 942bd0e7e332 |
children | 374712890b94 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java Thu Jul 07 15:04:45 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java Fri Jul 08 08:54:08 2011 +0000 @@ -28,9 +28,10 @@ import de.intevation.flys.client.shared.model.DefaultCollection; import de.intevation.flys.client.shared.model.DefaultCollectionItem; import de.intevation.flys.client.shared.model.DefaultFacet; -import de.intevation.flys.client.shared.model.DefaultOutputMode; import de.intevation.flys.client.shared.model.DefaultTheme; +import de.intevation.flys.client.shared.model.ChartMode; import de.intevation.flys.client.shared.model.ExportMode; +import de.intevation.flys.client.shared.model.MapMode; import de.intevation.flys.client.shared.model.ReportMode; import de.intevation.flys.client.shared.model.Facet; import de.intevation.flys.client.shared.model.OutputMode; @@ -329,6 +330,7 @@ String name = tmp.getAttributeNS(uri, "name"); String desc = tmp.getAttributeNS(uri, "description"); String mime = tmp.getAttributeNS(uri, "mime-type"); + String type = tmp.getAttributeNS(uri, "type"); if (name.length() == 0) { System.err.println("Found an invalid output mode."); @@ -338,14 +340,21 @@ OutputMode outmode = null; List<Facet> fs = extractFacets(tmp); - if (name.indexOf("export") > -1) { + if (type.equals("export")) { outmode = new ExportMode(name, desc, mime, fs); } - else if (name.indexOf("report") > -1) { + else if (type.equals("report")) { outmode = new ReportMode(name, desc, mime, fs); } + else if (type.equals("chart")){ + outmode = new ChartMode(name, desc, mime, fs); + } + else if (type.equals("map")){ + outmode = new MapMode(name, desc, mime, fs); + } else { - outmode = new DefaultOutputMode(name, desc, mime, fs); + System.err.println("Broken Output mode without type found."); + continue; } modes.add(outmode);