Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/ExternalWMSArtifact.java @ 2671:055315495f8d
Modified floodmap specific datacage configuration and improved WMS catchment layer.
flys-artifacts/trunk@4359 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 08 May 2012 12:14:55 +0000 |
parents | 8afd6a9bb244 |
children | 6717b4725ddf |
rev | line source |
---|---|
1926
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifacts.Artifact; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.ArtifactFactory; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.CallMeta; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.common.utils.XMLUtils; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.artifactdatabase.state.DefaultOutput; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifactdatabase.state.Facet; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.artifactdatabase.state.State; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.artifacts.states.WMSBackgroundState; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 public class ExternalWMSArtifact extends StaticFLYSArtifact { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public static final String XPATH_IDS = "/art:action/art:ids/@value"; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 public static final String NAME = "external_wms"; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 private static final Logger logger = |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 Logger.getLogger(ExternalWMSArtifact.class); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 public String getName() { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 return NAME; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 public void setup( |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 String identifier, |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 ArtifactFactory factory, |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 Object context, |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 CallMeta callMeta, |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 Document data) |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 logger.info("ExternalWMSArtifact.setup"); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 super.setup(identifier, factory, context, callMeta, data); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 String ids = XMLUtils.xpathString( |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 data, XPATH_IDS, ArtifactNamespaceContext.INSTANCE); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 if (ids != null && ids.length() > 0) { |
1982
8afd6a9bb244
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1926
diff
changeset
|
56 addStringData("ids", ids); |
1926
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 else { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 throw new IllegalArgumentException("No attribute 'ids' found!"); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 List<Facet> fs = new ArrayList<Facet>(); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 WMSBackgroundState s = (WMSBackgroundState) getCurrentState(context); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 s.computeInit(this, hash(), context, callMeta, fs); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 if (!fs.isEmpty()) { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 facets.put(getCurrentStateId(), fs); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 protected void initialize( |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 Artifact artifact, |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 Object context, |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 CallMeta callMeta) |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 // do nothing |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 public State getCurrentState(Object cc) { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 State s = new ExternalWMSState(this); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 List<Facet> fs = facets.get(getCurrentStateId()); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 DefaultOutput o = new DefaultOutput( |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 "floodmap", |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 "floodmap", |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 "image/png", |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 fs, |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 "map"); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 s.getOutputs().add(o); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 return s; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 /** |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 * Get a list containing the one and only State. |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 * @param context ignored. |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 * @return list with one and only state. |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 */ |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 protected List<State> getStates(Object context) { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 ArrayList<State> states = new ArrayList<State>(); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 states.add(getCurrentState(context)); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 return states; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 public static class ExternalWMSState extends WMSBackgroundState { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 protected ExternalWMSArtifact artifact; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 protected String ids; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 public ExternalWMSState(ExternalWMSArtifact artifact) { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 super(); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 this.artifact = artifact; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 protected String getIds() { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 if (ids == null || ids.length() == 0) { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 ids = artifact.getDataAsString("ids"); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 return ids; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 protected String getFacetType() { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 return FLOODMAP_EXTERNAL_WMS; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 protected String getSrid() { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 return ""; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 protected String getUrl() { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 String ids = getIds(); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 String[] parts = ids.split(";"); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 return parts[0]; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 protected String getLayer() { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 String ids = getIds(); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 String[] parts = ids.split(";"); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 return parts[1]; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 @Override |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 protected String getTitle(CallMeta meta) { |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 String ids = getIds(); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 String[] parts = ids.split(";"); |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 return parts[2]; |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 } // end of class ExternalWMSState |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 } |
fde3db5e68e8
Added a new Artifact to enable users to add external WMS layers to floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |