annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WMSLayerFacet.java @ 1774:092e1e5020bc

Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress). flys-artifacts/trunk@3095 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 28 Oct 2011 05:54:25 +0000
parents 1ea7eb72aaa6
children 68d0baa01c1b
rev   line source
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.List;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import org.apache.log4j.Logger;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7
943
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
8 import org.w3c.dom.Document;
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
9 import org.w3c.dom.Element;
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
10 import org.w3c.dom.Node;
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
11
1774
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
12 import com.vividsolutions.jts.geom.Envelope;
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
13
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import de.intevation.artifacts.Artifact;
943
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
15 import de.intevation.artifacts.ArtifactNamespaceContext;
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import de.intevation.artifacts.CallContext;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
943
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
18 import de.intevation.artifacts.common.utils.XMLUtils;
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
19 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
20
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 import de.intevation.artifactdatabase.state.DefaultFacet;
1061
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
22 import de.intevation.artifactdatabase.state.Facet;
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
1774
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
25 import de.intevation.flys.utils.GeometryUtils;
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
1098
1ea7eb72aaa6 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1061
diff changeset
28 public class WMSLayerFacet
1ea7eb72aaa6 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1061
diff changeset
29 extends DefaultFacet
1ea7eb72aaa6 Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1061
diff changeset
30 {
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 protected ComputeType type;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 protected List<String> layers;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 protected String stateId;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 protected String hash;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 protected String url;
1774
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
36 protected Envelope extent;
1052
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
37 protected String srid;
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 private static final Logger logger = Logger.getLogger(WMSLayerFacet.class);
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
1061
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
42 public WMSLayerFacet() {
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
43 }
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
44
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 public WMSLayerFacet(int index, String name, String description) {
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 this(index, name, description, ComputeType.FEED, null, null);
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 }
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 public WMSLayerFacet(
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 int index,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 String name,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 String description,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 ComputeType type,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 String stateId,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 String hash
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 ) {
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 super(index, name, description);
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 this.layers = new ArrayList<String>();
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 this.type = type;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 this.stateId = stateId;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 this.hash = hash;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 }
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 public WMSLayerFacet(
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 int index,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 String name,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 String description,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 ComputeType type,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 String stateId,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 String hash,
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 String url
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 ) {
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 this(index, name, description, type, stateId, hash);
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 this.url = url;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 }
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 public void addLayer(String name) {
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 if (name != null && name.length() > 0) {
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 layers.add(name);
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 }
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 }
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88
1774
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
89 public void setExtent(Envelope extent) {
953
6f8873fca927 WMSLayerFacets can have an extent now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 943
diff changeset
90 if (extent != null) {
6f8873fca927 WMSLayerFacets can have an extent now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 943
diff changeset
91 this.extent = extent;
6f8873fca927 WMSLayerFacets can have an extent now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 943
diff changeset
92 }
6f8873fca927 WMSLayerFacets can have an extent now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 943
diff changeset
93 }
6f8873fca927 WMSLayerFacets can have an extent now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 943
diff changeset
94
6f8873fca927 WMSLayerFacets can have an extent now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 943
diff changeset
95
1774
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
96 public Envelope getExtent() {
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
97 return extent;
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
98 }
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
99
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
100
1052
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
101 public void setSrid(String srid) {
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
102 if (srid != null) {
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
103 this.srid = srid;
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
104 }
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
105 }
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
106
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
107
1774
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
108 public String getSrid() {
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
109 return srid;
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
110 }
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
111
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
112
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 public Object getData(Artifact artifact, CallContext context) {
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 return null;
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 }
943
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
116
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
117
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
118 @Override
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
119 public Node toXML(Document doc) {
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
120 ElementCreator ec = new ElementCreator(
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
121 doc,
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
122 ArtifactNamespaceContext.NAMESPACE_URI,
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
123 ArtifactNamespaceContext.NAMESPACE_PREFIX);
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
124
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
125 Element facet = ec.create("facet");
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
126 ec.addAttr(facet, "description", description, true);
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
127 ec.addAttr(facet, "index", String.valueOf(index), true);
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
128 ec.addAttr(facet, "name", name, true);
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
129 ec.addAttr(facet, "url", url, true);
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
130 ec.addAttr(facet, "layers", layers.get(0), true);
1052
eeebf8514c7f The boundary (extent) for the river axis is determined based on its geometry - this extent is written into the wms facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 953
diff changeset
131 ec.addAttr(facet, "srid", srid != null ? srid : "", true);
1774
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
132 ec.addAttr(facet, "extent", extent != null
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
133 ? GeometryUtils.jtsBoundsToOLBounds(extent)
092e1e5020bc Added a new MapGenerator which only returns a map configuration document at the moment (work still in progress).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1098
diff changeset
134 : "", true);
943
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
135
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
136 return facet;
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
137 }
1061
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
138
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
139 @Override
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
140 public Facet deepCopy() {
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
141 WMSLayerFacet copy = new WMSLayerFacet();
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
142 copy.set(this);
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
143
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
144 copy.type = type;
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
145 copy.layers = new ArrayList<String>(layers);
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
146 copy.stateId = stateId;
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
147 copy.hash = hash;
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
148 copy.url = url;
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
149 copy.extent = extent;
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
150 copy.srid = srid;
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
151
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
152 return copy;
b1b0a0b61845 Made facets cloneable with the right type.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1052
diff changeset
153 }
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154 }
943
5de90b0cff8e The WMSLayerFacet now writes the WMS URL and layernames to its XML representation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
155 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org