Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/ExternalWMSArtifact.java @ 2783:cbb513a8f548
FixA: km indexed datastructure for delta w/t results.
flys-artifacts/trunk@4522 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 25 May 2012 13:49:27 +0000 |
parents | 6717b4725ddf |
children | 063b784b60b4 |
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 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
|
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 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
|
29 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
|
30 |
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 |
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 @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
|
33 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
|
34 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
|
35 } |
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 |
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 @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
|
39 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
|
40 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
|
41 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
|
42 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
|
43 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
|
44 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
|
45 { |
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 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
|
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 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
|
49 |
2748
6717b4725ddf
Take advantage of refactorisation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1982
diff
changeset
|
50 String ids = getDatacageIDValue(data); |
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
|
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 if (ids != null && ids.length() > 0) { |
1982
8afd6a9bb244
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1926
diff
changeset
|
53 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
|
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 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
|
56 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
|
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 |
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 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
|
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 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
|
62 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
|
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 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
|
65 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
|
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 } |
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 |
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 @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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 { |
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 // 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
|
77 } |
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 |
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 @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
|
81 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
|
82 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
|
83 |
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 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
|
85 |
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 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
|
87 "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
|
88 "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
|
89 "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
|
90 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
|
91 "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
|
92 |
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 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
|
94 |
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 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
|
96 } |
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 |
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 * 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
|
101 * @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
|
102 * @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
|
103 */ |
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 @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
|
105 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
|
106 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
|
107 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
|
108 |
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 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
|
110 } |
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 |
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 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
|
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 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
|
116 |
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 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
|
118 |
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 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
|
121 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
|
122 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
|
123 } |
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 |
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 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
|
126 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
|
127 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
|
128 } |
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 |
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 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
|
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 @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
|
134 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
|
135 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
|
136 } |
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 |
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 @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
|
139 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
|
140 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
|
141 } |
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 |
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 @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
|
144 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
|
145 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
|
146 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
|
147 |
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 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
|
149 } |
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 @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
|
152 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
|
153 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
|
154 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
|
155 |
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 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
|
157 } |
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 @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
|
160 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
|
161 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
|
162 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
|
163 |
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 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
|
165 } |
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 } // 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
|
167 } |
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |