Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java @ 5698:74ebef99772d
Switch back to example url and correct background wms url
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 15 Apr 2013 11:06:31 +0200 |
parents | e1cd77ddcbc4 |
children |
rev | line source |
---|---|
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.vividsolutions.jts.geom.Envelope; |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import de.intevation.artifactdatabase.data.DefaultStateData; |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import de.intevation.artifactdatabase.state.Facet; |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.artifactdatabase.state.State; |
4654
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
8 import de.intevation.artifacts.Artifact; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
9 import de.intevation.artifacts.ArtifactFactory; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
10 import de.intevation.artifacts.CallMeta; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
11 import de.intevation.artifacts.common.utils.FileTools; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
12 import de.intevation.flys.artifacts.model.map.WMSDBLayerFacet; |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
13 import de.intevation.flys.artifacts.resources.Resources; |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.flys.artifacts.states.DefaultState; |
1854
e372934f0c42
Replaced the dbconnection.include used by Mapserver - these information are provided by LayerInfo objects now, which reduces config overhead.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1816
diff
changeset
|
15 import de.intevation.flys.utils.FLYSUtils; |
4841
ad0990a82ab8
Insert db connection into riveraxis map files.
Raimund Renkert <rrenkert@intevation.de>
parents:
4656
diff
changeset
|
16 import de.intevation.flys.utils.MapUtils; |
4654
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
17 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
18 import java.io.File; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
19 import java.util.ArrayList; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
20 import java.util.List; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
21 |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
22 import org.apache.log4j.Logger; |
861c47e0a8a0
Refactor Mapserver mapfile generation.
Christian Lins <christian.lins@intevation.de>
parents:
4497
diff
changeset
|
23 import org.w3c.dom.Document; |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public abstract class WMSDBArtifact extends StaticFLYSArtifact { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 private static final Logger logger = Logger.getLogger(WMSDBArtifact.class); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 @Override |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 public void setup( |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 String identifier, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 ArtifactFactory factory, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 Object context, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 CallMeta callMeta, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 Document data) |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 logger.debug("WMSDBArtifact.setup"); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 super.setup(identifier, factory, context, callMeta, data); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
2741
0251393f037c
Refactor usage of now static xpath, other artifacts will follow in later commits.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2740
diff
changeset
|
42 String ids = getDatacageIDValue(data); |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 if (ids != null && ids.length() > 0) { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 addData("ids", new DefaultStateData("ids", null, null, ids)); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 else { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 throw new IllegalArgumentException("No attribute 'ids' found!"); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 List<Facet> fs = new ArrayList<Facet>(); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 WMSDBState state = (WMSDBState) getCurrentState(context); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 state.computeInit(this, hash(), context, callMeta, fs); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 if (!fs.isEmpty()) { |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3923
diff
changeset
|
57 addFacets(getCurrentStateId(), fs); |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 @Override |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 protected void initialize( |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 Artifact artifact, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 Object context, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 CallMeta callMeta) |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 // do nothing |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
3019
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
72 @Override |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
73 protected State getState(Object context, String stateID) { |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
74 return getCurrentState(context); |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
75 } |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
76 |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
77 |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 /** |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 * Get a list containing the one and only State. |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 * @param context ignored. |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 * @return list with one and only state. |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 */ |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 @Override |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 protected List<State> getStates(Object context) { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 ArrayList<State> states = new ArrayList<State>(); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 states.add(getCurrentState(context)); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 return states; |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 public static abstract class WMSDBState extends DefaultState { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 private static final Logger logger = Logger.getLogger(WMSDBState.class); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
2089
0da8874bd378
Added initial state to map artifact to be able to advance and step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2082
diff
changeset
|
96 protected FLYSArtifact artifact; |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
2672
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
98 protected String name; |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
99 protected int riverId; |
2672
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
100 |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
101 |
2082
007a8f5ed9f1
Implemented new module "new map".
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1917
diff
changeset
|
102 public WMSDBState() {} |
007a8f5ed9f1
Implemented new module "new map".
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1917
diff
changeset
|
103 |
2089
0da8874bd378
Added initial state to map artifact to be able to advance and step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2082
diff
changeset
|
104 public WMSDBState(FLYSArtifact artifact) { |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 this.artifact = artifact; |
2672
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
106 this.name = null; |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
107 this.riverId = 0; |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 @Override |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 public Object computeInit( |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 FLYSArtifact artifact, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 String hash, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 Object context, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 CallMeta meta, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 List<Facet> facets |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 ) { |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 logger.debug("WMSDBState.computeInit"); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 String type = getFacetType(); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 WMSDBLayerFacet facet = new WMSDBLayerFacet( |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 0, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 type, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 getTitle(meta), |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 ComputeType.INIT, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 getID(), hash, |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 getUrl()); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 |
4864
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
130 facet.addLayer(getLayer()); |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 facet.setExtent(getExtent()); |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
132 facet.setOriginalExtent(getExtent(true)); |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 facet.setSrid(getSrid()); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 facet.setData(getDataString()); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 facet.setFilter(getFilter()); |
1816
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1805
diff
changeset
|
136 facet.setGeometryType(getGeometryType()); |
4841
ad0990a82ab8
Insert db connection into riveraxis map files.
Raimund Renkert <rrenkert@intevation.de>
parents:
4656
diff
changeset
|
137 facet.setConnection(MapUtils.getConnection()); |
ad0990a82ab8
Insert db connection into riveraxis map files.
Raimund Renkert <rrenkert@intevation.de>
parents:
4656
diff
changeset
|
138 facet.setConnectionType(MapUtils.getConnectionType()); |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1854
diff
changeset
|
139 facet.setLabelItem(getLabelItem()); |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 facets.add(facet); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 return null; |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 |
1876
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1854
diff
changeset
|
146 protected String getLabelItem() { |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1854
diff
changeset
|
147 return null; |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1854
diff
changeset
|
148 } |
dd467951335c
Added support for labels in Mapserver layers and options to modify its style.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1854
diff
changeset
|
149 |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
150 public int getRiverId() { |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
151 if (riverId == 0) { |
5403
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
152 String rid = getIdPart(0); |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
153 |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
154 try { |
5403
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
155 riverId = Integer.parseInt(rid); |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
156 } |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
157 catch (NumberFormatException nfe) { |
5403
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
158 logger.error("Cannot parse river id from '" + |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
159 artifact.getDataAsString("ids") + "'"); |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
160 } |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
161 } |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
162 return riverId; |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
163 } |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
164 |
4864
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
165 protected String getLayer() { |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
166 String type = getFacetType(); |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
167 String name = type + "-" + artifact.identifier(); |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
168 return name; |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
169 } |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
170 |
2672
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
171 /** |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
172 * Returns the name of the WMS layer. This method extracts the name |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
173 * from 'ids' data string. It is expected, that the 'ids' string is |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
174 * seperated by ';' and that the name is placed at index 1. |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
175 * |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
176 * @return the name of the WMS layer. |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
177 */ |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
178 public String getName() { |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
179 if (name == null) { |
5403
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
180 name = getIdPart(1); |
2672
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
181 } |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
182 |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
183 return name; |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
184 } |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
185 |
5403
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
186 /** |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
187 * Returns a part of the ID string. This method splits the |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
188 * 'ids' data string. It is expected, that the 'ids' string is |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
189 * seperated by ';'. |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
190 * |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
191 * @param number the position of the id data string |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
192 * |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
193 * @return the part of the id string at position number. |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
194 * Null if number was out of bounds. |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
195 */ |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
196 public String getIdPart(int number) { |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
197 String ids = artifact.getDataAsString("ids"); |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
198 |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
199 String parts[] = ids != null ? ids.split(";") : null; |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
200 |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
201 if (parts != null && parts.length >= number + 1) { |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
202 return parts[number]; |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
203 } |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
204 return null; |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
205 } |
e1cd77ddcbc4
Generalize parsing of ids data string
Andre Heinecke <aheinecke@intevation.de>
parents:
4864
diff
changeset
|
206 |
2683
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
207 |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
208 /** |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
209 * Returns the name of the layer (returned by getName()) or the layer |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
210 * type if the name is empty. The layer type is created by an i18n |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
211 * string of getFacetType(). |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
212 * |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
213 * @param meta A CallMeta used for i18n. |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
214 * |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
215 * @return the name of the layer or its type if name is empty. |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
216 */ |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
217 protected String getTitle(CallMeta meta) { |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
218 String name = getName(); |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
219 |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
220 return name != null && name.length() > 0 |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
221 ? name |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
222 : Resources.getMsg( |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
223 meta, |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
224 getFacetType(), |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
225 getFacetType()); |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
226 } |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
227 |
f5af3adb3b95
Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2672
diff
changeset
|
228 |
3019
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
229 @Override |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
230 public void endOfLife(Artifact owner, Object context) { |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
231 logger.info("Destroy WMSDBState: " + getID()); |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
232 |
4656
442fbb290fa8
Introduce river mapfile generation (WARNING: Changes in config xml files required!).
Christian Lins <christian.lins@intevation.de>
parents:
4654
diff
changeset
|
233 String p = FLYSUtils.getXPathString(FLYSUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); |
3019
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
234 File dir = new File(p, owner.identifier()); |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
235 |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
236 if (dir != null && dir.exists()) { |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
237 logger.debug("Try to delete directory '" + dir + "'"); |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
238 |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
239 FileTools.deleteRecursive(dir); |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
240 } |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
241 } |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
242 |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
243 /** |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
244 * This method returns the extent of a DB layer in the projection of the |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
245 * database. |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
246 * |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
247 * @return the extent of the DB layer in the projection of the database. |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
248 */ |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
249 protected Envelope getExtent() { |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
250 return getExtent(false); |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
251 } |
3019
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
252 |
484f3dad4bfd
Let Artifacts of type WMSDBArtifact remove produced files and directories when endOfLife() is called.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2763
diff
changeset
|
253 |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 protected abstract String getFacetType(); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
255 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 protected abstract String getUrl(); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 protected abstract String getSrid(); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
260 /** |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
261 * This method returns the extent of the DB layer. The projection of the |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
262 * extent depends on the <i>reproject</i> parameter. If reproject is set, |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
263 * the extent is reprojected into the original projection which is |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
264 * specified in the configuration. Otherwise, the projection of the |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
265 * database is used. |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
266 * |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
267 * @param reproject True, to reproject the extent into the projection |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
268 * specified in the configuration. |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
269 * |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
270 * @return the extent of the database layer. |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
271 */ |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
272 protected abstract Envelope getExtent(boolean reproject); |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
274 protected abstract String getFilter(); |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
275 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
276 protected abstract String getDataString(); |
1816
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1805
diff
changeset
|
277 |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1805
diff
changeset
|
278 protected abstract String getGeometryType(); |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
279 } // end of WMSDBState |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
280 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
281 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |