Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java @ 5259:7a11271f5593
Merged
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Tue, 12 Mar 2013 19:16:05 +0100 |
parents | dc0d37715e16 |
children | e1cd77ddcbc4 |
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) { |
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
|
152 String ids = artifact.getDataAsString("ids"); |
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 String[] parts = ids.split(";"); |
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 |
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
|
155 try { |
3405
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3302
diff
changeset
|
156 riverId = Integer.parseInt(parts[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
|
157 } |
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
|
158 catch (NumberFormatException nfe) { |
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
|
159 logger.error("Cannot parse river id from '" + parts[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
|
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 |
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 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
|
164 } |
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
|
165 |
4864
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
166 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
|
167 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
|
168 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
|
169 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
|
170 } |
dc0d37715e16
Floodmap uses the static River-WMS instead of User-WMS via RiverAxisArtifact.
Christian Lins <christian.lins@intevation.de>
parents:
4843
diff
changeset
|
171 |
2672
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
172 /** |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
173 * 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
|
174 * 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
|
175 * 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
|
176 * |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
177 * @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
|
178 */ |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
179 public String getName() { |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
180 if (name == null) { |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
181 String ids = artifact.getDataAsString("ids"); |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
182 |
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
|
183 String parts[] = ids != null ? ids.split(";") : null; |
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
|
184 |
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
|
185 if (parts != null && parts.length >= 2) { |
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
|
186 name = parts[1]; |
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
|
187 } |
2672
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
188 } |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
189 |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
190 return name; |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
191 } |
5afccab9aac1
Modified floodmap specific datacage configuration and improved WMS hws layer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2089
diff
changeset
|
192 |
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
|
193 |
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
|
194 /** |
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
|
195 * 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
|
196 * 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
|
197 * 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
|
198 * |
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
|
199 * @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
|
200 * |
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
|
201 * @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
|
202 */ |
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
|
203 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
|
204 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
|
205 |
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
|
206 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
|
207 ? 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
|
208 : 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
|
209 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
|
210 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
|
211 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 |
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 |
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
|
215 @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
|
216 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
|
217 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
|
218 |
4656
442fbb290fa8
Introduce river mapfile generation (WARNING: Changes in config xml files required!).
Christian Lins <christian.lins@intevation.de>
parents:
4654
diff
changeset
|
219 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
|
220 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
|
221 |
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
|
222 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
|
223 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
|
224 |
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
|
225 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
|
226 } |
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
|
227 } |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
228 |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
229 /** |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
230 * 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
|
231 * database. |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
232 * |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
233 * @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
|
234 */ |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
235 protected Envelope getExtent() { |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
236 return getExtent(false); |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
237 } |
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
|
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 |
1805
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 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
|
241 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 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
|
243 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 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
|
245 |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
246 /** |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
247 * 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
|
248 * 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
|
249 * 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
|
250 * 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
|
251 * database is used. |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
252 * |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
253 * @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
|
254 * specified in the configuration. |
3923
9fac337192c9
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3918
diff
changeset
|
255 * |
3918
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
256 * @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
|
257 */ |
2fdbe78a8fc2
Fixed various projection issues during map creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3405
diff
changeset
|
258 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
|
259 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 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
|
261 |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 protected abstract String getDataString(); |
1816
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1805
diff
changeset
|
263 |
5364b86a0880
Improved styles of WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1805
diff
changeset
|
264 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
|
265 } // end of WMSDBState |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
266 } |
5e9696c32f04
Added datacage config and loaders for KM WMS layer in floodmaps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
267 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |