comparison 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
comparison
equal deleted inserted replaced
1773:9be01e2e6897 1774:092e1e5020bc
6 import org.apache.log4j.Logger; 6 import org.apache.log4j.Logger;
7 7
8 import org.w3c.dom.Document; 8 import org.w3c.dom.Document;
9 import org.w3c.dom.Element; 9 import org.w3c.dom.Element;
10 import org.w3c.dom.Node; 10 import org.w3c.dom.Node;
11
12 import com.vividsolutions.jts.geom.Envelope;
11 13
12 import de.intevation.artifacts.Artifact; 14 import de.intevation.artifacts.Artifact;
13 import de.intevation.artifacts.ArtifactNamespaceContext; 15 import de.intevation.artifacts.ArtifactNamespaceContext;
14 import de.intevation.artifacts.CallContext; 16 import de.intevation.artifacts.CallContext;
15 17
18 20
19 import de.intevation.artifactdatabase.state.DefaultFacet; 21 import de.intevation.artifactdatabase.state.DefaultFacet;
20 import de.intevation.artifactdatabase.state.Facet; 22 import de.intevation.artifactdatabase.state.Facet;
21 23
22 import de.intevation.flys.artifacts.states.DefaultState.ComputeType; 24 import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
25 import de.intevation.flys.utils.GeometryUtils;
23 26
24 27
25 public class WMSLayerFacet 28 public class WMSLayerFacet
26 extends DefaultFacet 29 extends DefaultFacet
27 { 30 {
28 protected ComputeType type; 31 protected ComputeType type;
29 protected List<String> layers; 32 protected List<String> layers;
30 protected String stateId; 33 protected String stateId;
31 protected String hash; 34 protected String hash;
32 protected String url; 35 protected String url;
33 protected String extent; 36 protected Envelope extent;
34 protected String srid; 37 protected String srid;
35 38
36 39
37 private static final Logger logger = Logger.getLogger(WMSLayerFacet.class); 40 private static final Logger logger = Logger.getLogger(WMSLayerFacet.class);
38 41
81 layers.add(name); 84 layers.add(name);
82 } 85 }
83 } 86 }
84 87
85 88
86 public void setExtent(String extent) { 89 public void setExtent(Envelope extent) {
87 if (extent != null) { 90 if (extent != null) {
88 this.extent = extent; 91 this.extent = extent;
89 } 92 }
93 }
94
95
96 public Envelope getExtent() {
97 return extent;
90 } 98 }
91 99
92 100
93 public void setSrid(String srid) { 101 public void setSrid(String srid) {
94 if (srid != null) { 102 if (srid != null) {
95 this.srid = srid; 103 this.srid = srid;
96 } 104 }
105 }
106
107
108 public String getSrid() {
109 return srid;
97 } 110 }
98 111
99 112
100 public Object getData(Artifact artifact, CallContext context) { 113 public Object getData(Artifact artifact, CallContext context) {
101 return null; 114 return null;
113 ec.addAttr(facet, "description", description, true); 126 ec.addAttr(facet, "description", description, true);
114 ec.addAttr(facet, "index", String.valueOf(index), true); 127 ec.addAttr(facet, "index", String.valueOf(index), true);
115 ec.addAttr(facet, "name", name, true); 128 ec.addAttr(facet, "name", name, true);
116 ec.addAttr(facet, "url", url, true); 129 ec.addAttr(facet, "url", url, true);
117 ec.addAttr(facet, "layers", layers.get(0), true); 130 ec.addAttr(facet, "layers", layers.get(0), true);
118 ec.addAttr(facet, "extent", extent != null ? extent : "", true);
119 ec.addAttr(facet, "srid", srid != null ? srid : "", true); 131 ec.addAttr(facet, "srid", srid != null ? srid : "", true);
132 ec.addAttr(facet, "extent", extent != null
133 ? GeometryUtils.jtsBoundsToOLBounds(extent)
134 : "", true);
120 135
121 return facet; 136 return facet;
122 } 137 }
123 138
124 @Override 139 @Override

http://dive4elements.wald.intevation.org