Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataService.java @ 817:3f447e92024a
Added JavaDoc package descriptions.
gnv-artifacts/trunk@902 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 12 Apr 2010 09:37:30 +0000 |
parents | 22c18083225e |
children | 8288f4a0d7e6 |
rev | line source |
---|---|
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.artifacts.services; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
3 import com.vividsolutions.jts.geom.Geometry; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
4 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
5 import com.vividsolutions.jts.io.ParseException; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
6 import com.vividsolutions.jts.io.WKTReader; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
7 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
8 import de.intevation.artifactdatabase.DefaultService; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
9 import de.intevation.artifactdatabase.XMLUtils; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
10 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
11 import de.intevation.artifacts.ArtifactNamespaceContext; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
12 import de.intevation.artifacts.CallMeta; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
13 import de.intevation.artifacts.ServiceFactory; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
14 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
15 import de.intevation.gnv.artifacts.services.requestobjects.DefaultFIS; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
16 import de.intevation.gnv.artifacts.services.requestobjects.DefaultLayer; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
17 import de.intevation.gnv.artifacts.services.requestobjects.DefaultMapService; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
18 import de.intevation.gnv.artifacts.services.requestobjects.DefaultParameter; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
19 import de.intevation.gnv.artifacts.services.requestobjects.FIS; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
20 import de.intevation.gnv.artifacts.services.requestobjects.Layer; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
21 import de.intevation.gnv.artifacts.services.requestobjects.MapService; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
22 import de.intevation.gnv.artifacts.services.requestobjects.Parameter; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
23 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
24 import de.intevation.gnv.geobackend.base.Result; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
25 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
26 import de.intevation.gnv.geobackend.base.query.QueryExecutor; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
27 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
28 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
29 import de.intevation.gnv.geobackend.base.query.exception.QueryException; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
30 |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
31 import de.intevation.gnv.utils.ArtifactXMLUtilities; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
32 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 import java.util.ArrayList; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 import java.util.Collection; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 import java.util.Iterator; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 import javax.xml.xpath.XPathConstants; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 import org.apache.log4j.Logger; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
40 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 import org.w3c.dom.Document; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 import org.w3c.dom.Element; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 import org.w3c.dom.Node; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 import org.w3c.dom.NodeList; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 /** |
780
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
47 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 * |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 */ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 public class MetaDataService extends DefaultService { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 /** |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
53 * the logger, used to log exceptions and additionally information |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 */ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 private static Logger log = Logger.getLogger(MetaDataService.class); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
57 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
58 private final static String FIS_REGION_QUERY_ID = |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
59 "mapviewer_interface_fis_region"; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
60 private final static String MAPSERVICES_HAS_FIS_QUERY_ID = |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
61 "mapviewer_interface_mapservices_has_fis"; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
62 private final static String MAPSERVICES_HAS_PARAMETER_QUERY_ID = |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
63 "mapviewer_interface_mapservices_has_parameter"; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
64 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
65 private final static String MAPSERVICES_HAS_PARAMETER_USING_LAYER_QUERY_ID = |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
66 "mapviewer_interface_mapservices_has_parameter_using_layer"; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
67 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
68 private static String ATTRIBUTE_ID = "id"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
69 private static String ATTRIBUTE_NAME = "name"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
70 private static String ATTRIBUTE_TYPE = "type"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 private static String ATTRIBUTE_URL = "url"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 private static String ATTRIBUTE_GROUPLAYER = "isgrouplayer"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 private static String ATTRIBUTE_PARENTID = "parentid"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
74 private static String ATTRIBUTE_SRS = "srs"; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
75 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
76 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
77 private static String XPATH_LOACTION_NODE = "art:GetMetaData/art:location"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
78 private static String XPATH_MAPSERVICES_NODESET = "art:GetMetaData/" + |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
79 "art:mapservices/" + |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
80 "art:mapservice"; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
81 private static String XPATH_LAYER_NODESET = "art:layer"; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
82 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
83 /** |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 * The UID of this Class. |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
85 */ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
86 private static final long serialVersionUID = -8446483887497236372L; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
87 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
88 /** |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
89 * Constructor |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
90 */ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
91 public MetaDataService() { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
92 super(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
93 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 @Override |
792
9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
96 @SuppressWarnings({"static-access", "static-access"}) |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 public Document process(Document data, Object globalContext, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 CallMeta callMeta) { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
99 log.debug("MetaDataService.process"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
100 Document document = null; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
101 try { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
102 Geometry g = this.parseGeometry(data); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
103 Collection<MapService> mapServices = this.parseMapServices(data); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
104 Collection<FIS> resultFIS = this.unionFIS(this.getFIS(g), |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 this.getFIS(mapServices)); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 document = XMLUtils.newDocument(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 this.writeFIS2Document(document, resultFIS); |
792
9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
108 log.debug(ArtifactXMLUtilities.writeDocument2String(document)); |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 } catch (MetaDataServiceException e) { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 log.error(e,e); |
792
9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
111 document = ArtifactXMLUtilities |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 .createExceptionReport(e.getMessage(), document); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 return document; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
116 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
117 private Geometry parseGeometry(Document data) |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 throws MetaDataServiceException{ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 log.debug("MetaDataService.parseGeometry"); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
120 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
121 Element locationNode = (Element) XMLUtils.xpath( |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
122 data, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
123 XPATH_LOACTION_NODE, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
124 XPathConstants.NODE, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
125 ArtifactNamespaceContext.INSTANCE |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
126 ); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
127 Geometry returnValue = null; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
128 if (locationNode != null) { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
129 String srs = locationNode.getAttribute(ATTRIBUTE_SRS); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
130 // TODO: use SRS to transform the Geometry to target-System. |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
131 String geometryValue = locationNode.getTextContent(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
132 if (geometryValue != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
133 try { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
134 returnValue = new WKTReader().read(geometryValue); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 } catch (ParseException e) { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 log.error(e,e); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 throw new MetaDataServiceException("The given Geometry" + |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
138 "String is not a " + |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
139 "valid WKT."); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
140 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
141 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
142 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
143 return returnValue; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
144 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
145 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
146 private Collection<MapService> parseMapServices(Document data){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
147 log.debug("MetaDataService.parseMapServices"); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
148 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
149 NodeList mapServices = (NodeList) XMLUtils.xpath(data, |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 XPATH_MAPSERVICES_NODESET, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
151 XPathConstants.NODESET, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
152 ArtifactNamespaceContext.INSTANCE); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
153 Collection<MapService> returnValue = null; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
154 if (mapServices != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
155 returnValue = new ArrayList<MapService>(mapServices.getLength()); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
156 for (int i = 0; i < mapServices.getLength(); i++){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
157 Element mapServiceNode = (Element)mapServices.item(i); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
158 String id = mapServiceNode.getAttribute(ATTRIBUTE_ID); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
159 String type = mapServiceNode.getAttribute(ATTRIBUTE_TYPE); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
160 String url = mapServiceNode.getAttribute(ATTRIBUTE_URL); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
161 Collection<Layer> layer = null; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
162 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
163 NodeList layerNodes = (NodeList) XMLUtils.xpath(mapServiceNode, |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
164 XPATH_LAYER_NODESET, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
165 XPathConstants.NODESET, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
166 ArtifactNamespaceContext.INSTANCE); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
167 if (layerNodes != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
168 layer = new ArrayList<Layer>(layerNodes.getLength()); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
169 for (int j = 0; j < layerNodes.getLength(); j++){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
170 Element layerNode = (Element)layerNodes.item(j); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
171 String layerId = layerNode.getAttribute(ATTRIBUTE_ID); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
172 String layerName = layerNode.getAttribute(ATTRIBUTE_NAME); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
173 boolean isGroupLayer = |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
174 Boolean.parseBoolean(layerNode |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
175 .getAttribute( |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
176 ATTRIBUTE_GROUPLAYER)); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
177 String parentId = layerNode |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
178 .getAttribute(ATTRIBUTE_PARENTID); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
179 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
180 layer.add(new DefaultLayer(layerId, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
181 layerName, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
182 isGroupLayer, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
183 parentId)); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
184 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
185 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
186 MapService mapService = new DefaultMapService(id, layer, |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
187 type, url); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
188 returnValue.add(mapService); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
189 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
190 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
191 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
192 return returnValue; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
193 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
194 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
195 private Collection<FIS> unionFIS(Collection<FIS> fromGeometry, |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
196 Collection<FIS> fromMapservices){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
197 log.debug("MetaDataService.unionFIS"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
198 Collection<FIS> returnValue = null; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
199 if (fromGeometry == null || fromGeometry.isEmpty()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
200 returnValue = fromMapservices; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
201 }else if (fromMapservices == null || fromMapservices.isEmpty()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
202 returnValue = fromGeometry; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
203 }else{ |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
204 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
205 returnValue = new ArrayList<FIS>(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
206 Iterator<FIS> it = fromMapservices.iterator(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
207 while (it.hasNext()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
208 FIS fis = it.next(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
209 if (fromGeometry.contains(fis)){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
210 returnValue.add(fis); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
211 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
212 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
213 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
214 return returnValue; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
215 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
216 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
217 /** |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
218 * Puts the retrieved FIS into the given XML-Document. |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
219 * @param document the Document where the FIS should be put in. |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
220 * @param fis the retrieved FIS which should be written into |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
221 * the XML-Document. |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
222 */ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
223 private void writeFIS2Document(Document document, Collection<FIS> fis){ |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
224 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
225 if (fis != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
226 Iterator<FIS> it = fis.iterator(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
227 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
228 document, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
229 ArtifactNamespaceContext.NAMESPACE_URI, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
230 ArtifactNamespaceContext.NAMESPACE_PREFIX |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
231 ); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
232 Node rootNode = creator.create("result"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
233 document.appendChild(rootNode); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
234 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
235 Node factoriesNode = creator.create("factories"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
236 rootNode.appendChild(factoriesNode); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
237 while (it.hasNext()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
238 FIS tmpFIS = it.next(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
239 Element fisNode = creator.create("factory"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
240 fisNode.setAttribute("art:name",tmpFIS.getID()); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
241 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
242 Collection<Parameter> parameter = tmpFIS.getParameter(); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
243 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
244 if(parameter != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
245 Iterator<Parameter> pit = parameter.iterator(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
246 while (pit.hasNext()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
247 Parameter p = pit.next(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
248 Element parameterNode = creator.create("parameter"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
249 parameterNode.setAttribute(ATTRIBUTE_ID, p.getID()); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
250 parameterNode.setAttribute(ATTRIBUTE_NAME, p.getName()); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
251 fisNode.appendChild(parameterNode); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
252 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
253 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
254 factoriesNode.appendChild(fisNode); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
255 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
256 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
257 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
258 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
259 /** |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
260 * Returns all FIS which Areas is intersected by this given Geometry |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
261 * @param g the Geometry which should be used to determine the FIS. |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
262 * @return all FIS which Areas is intersected by this given Geometry |
792
9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
263 * @throws MetaDataServiceException |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
264 */ |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
265 protected Collection<FIS> getFIS(Geometry g) |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
266 throws MetaDataServiceException{ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
267 log.debug("MetaDataService.getFIS ==> Geometry"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
268 Collection<FIS> resultValue = null; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
269 if (g != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
270 try { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
271 QueryExecutor queryExecutor = QueryExecutorFactory |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
272 .getInstance() |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
273 .getQueryExecutor(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
274 Collection<Result> result = queryExecutor.executeQuery(FIS_REGION_QUERY_ID, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
275 new String[]{g.toString()}); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
276 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
277 if (result != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
278 resultValue = new ArrayList<FIS>(result.size()); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
279 Iterator<Result> it = result.iterator(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
280 while (it.hasNext()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
281 Result value = it.next(); |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
282 String fis_id = value.getString(0).trim(); |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
283 resultValue.add(new DefaultFIS(fis_id)); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
284 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
285 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
286 } catch (QueryException e) { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
287 log.error(e,e); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
288 throw new MetaDataServiceException("Cannot Query FIS from DB."); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
289 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
290 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
291 return resultValue; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
292 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
293 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
294 /** |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
295 * Returns all FIS which were represented by the given Mapservices |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
296 * @param mapServices the Mapservices which should determine the FIS. |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
297 * @return all FIS which where represented my the given Mapservices. |
792
9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
298 * @throws MetaDataServiceException |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
299 */ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
300 protected Collection<FIS> getFIS(Collection<MapService> mapServices) |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
301 throws MetaDataServiceException{ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
302 log.debug("MetaDataService.getFIS ==> MapServices"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
303 Collection<FIS> resultValue = null; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
304 if (mapServices != null && !mapServices.isEmpty()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
305 try { |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
306 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
307 String mapServiceNames = ""; |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
308 Iterator<MapService> mit = mapServices.iterator(); |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
309 while(mit.hasNext()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
310 if (mapServiceNames.length() > 0){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
311 mapServiceNames += " , "; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
312 } |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
313 mapServiceNames += "'"+mit.next().getID()+"'"; |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
314 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
315 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
316 QueryExecutor queryExecutor = QueryExecutorFactory |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
317 .getInstance() |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
318 .getQueryExecutor(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
319 Collection<Result> result = queryExecutor.executeQuery( |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
320 MAPSERVICES_HAS_FIS_QUERY_ID, |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
321 new String[]{mapServiceNames}); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
322 if (result != null){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
323 resultValue = new ArrayList<FIS>(result.size()); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
324 Iterator<Result> it = result.iterator(); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
325 while (it.hasNext()){ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
326 Result value = it.next(); |
606
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
327 String fisId = value.getString(0).trim(); |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
328 String mapServiceID = value.getString(1).trim(); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
329 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
330 // FIRST LOOK IF ONE MAPSERVICE REPRESENTS ONLY ONE PARAM |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
331 Collection<Result> result2 = queryExecutor.executeQuery( |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
332 MAPSERVICES_HAS_PARAMETER_QUERY_ID, |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
333 new String[]{"'"+mapServiceID+"'"}); |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
334 Collection<Parameter> parameter = null; |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
335 if (result2 != null && result2.size() == 1){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
336 Iterator<Result> it2 = result2.iterator(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
337 parameter = new ArrayList<Parameter>(1); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
338 while (it2.hasNext()){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
339 Result parameterValue = it2.next(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
340 String parameterID = parameterValue.getString(0) |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
341 .trim(); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
342 parameter.add(new DefaultParameter(parameterID, |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
343 parameterID)); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
344 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
345 }else{ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
346 // IF FALSE LOOK IF THE GIVEN LAYERs TO AN MAPSERVICE |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
347 // REPRESENTS DIFFERENT PARAMS |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
348 MapService service = this.getMapService(mapServices, |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
349 mapServiceID); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
350 Collection<Layer> layer = service.getLayer(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
351 if (layer != null && !layer.isEmpty()){ |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
352 String layerQueryString = |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
353 this.createLayerQueryString(layer); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
354 Collection<Result> parameterResult = |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
355 queryExecutor.executeQuery( |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
356 MAPSERVICES_HAS_PARAMETER_USING_LAYER_QUERY_ID, |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
357 new String[]{"'"+mapServiceID+"'", |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
358 layerQueryString}); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
359 if (parameterResult != null && |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
360 !parameterResult.isEmpty()){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
361 Iterator<Result> it2 = parameterResult.iterator(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
362 parameter = new ArrayList<Parameter>(parameterResult.size()); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
363 while (it2.hasNext()){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
364 Result parameterValue = it2.next(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
365 String parameterID = parameterValue.getString(0) |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
366 .trim(); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
367 parameter.add(new DefaultParameter(parameterID, |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
368 parameterID)); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
369 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
370 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
371 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
372 |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
373 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
374 |
606
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
375 FIS fis = this.getFIS(resultValue, fisId); |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
376 if (fis != null){ |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
377 if (parameter != null){ |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
378 fis.addParameter(parameter); |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
379 } |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
380 }else{ |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
381 resultValue.add(new DefaultFIS(fisId, parameter)); |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
382 } |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
383 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
384 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
385 } catch (QueryException e) { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
386 log.error(e,e); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
387 throw new MetaDataServiceException("Cannot Query FIS from DB."); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
388 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
389 |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
390 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
391 return resultValue; |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
392 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
393 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
394 |
606
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
395 private FIS getFIS (Collection<FIS> fis, String fisId){ |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
396 |
606
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
397 Iterator<FIS> it = fis.iterator(); |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
398 while(it.hasNext()){ |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
399 FIS tmpFIS = it.next(); |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
400 if (tmpFIS.getID().equals(fisId)){ |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
401 return tmpFIS; |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
402 } |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
403 } |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
404 return null; |
9efc1c256dbb
Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents:
604
diff
changeset
|
405 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
406 |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
407 private MapService getMapService(Collection<MapService> mapServices, |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
408 String mapServiceID){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
409 log.debug("MetaDataService.getMapService"); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
410 Iterator<MapService> it = mapServices.iterator(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
411 while (it.hasNext()){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
412 MapService service = it.next(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
413 if (service.getID().equals(mapServiceID)){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
414 return service; |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
415 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
416 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
417 return null; |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
418 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
419 |
792
9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
420 @SuppressWarnings("empty-statement") |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
421 private String createLayerQueryString(Collection<Layer> layer){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
422 log.debug("MetaDataService.createLayerQueryString"); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
423 StringBuffer sb = new StringBuffer();; |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
424 Iterator<Layer> it = layer.iterator(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
425 synchronized (sb) { |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
426 while (it.hasNext()){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
427 Layer l = it.next(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
428 if (!l.isGroupLayer()){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
429 sb.append(l.getID()); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
430 if (it.hasNext()){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
431 sb.append(" , "); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
432 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
433 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
606
diff
changeset
|
434 |
604
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
435 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
436 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
437 String returnValue = sb.toString(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
438 if (returnValue.endsWith(" , ")){ |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
439 returnValue = returnValue.substring(0,returnValue |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
440 .lastIndexOf(",")) |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
441 .trim(); |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
442 } |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
443 return returnValue; |
938ce81a6bd0
Integrated Database-Support for the Mapviewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
597
diff
changeset
|
444 } |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
445 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
446 /** |
803
feae2f9d6c6f
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
792
diff
changeset
|
447 * @param factory |
792
9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
448 * @param globalContext |
597
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
449 * @see de.intevation.artifactdatabase.DefaultService#setup(de.intevation.artifacts.ServiceFactory, java.lang.Object) |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
450 */ |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
451 @Override |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
452 public void setup(ServiceFactory factory, Object globalContext) { |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
453 log.debug("MetaDataService.setup"); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
454 super.setup(factory, globalContext); |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
455 // TODO: Perhaps it is necessary to init the QueryIds here. |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
456 } |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
457 |
cf38b983d1f3
Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
458 } |