Mercurial > dive4elements > gnv-client
annotate gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java @ 700:89ade245ca7a
Using unix line endings only.
gnv/trunk@940 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 18 Apr 2010 09:27:11 +0000 |
parents | af22fa5567a6 |
children | 21ad44ccdb84 |
rev | line source |
---|---|
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.artifactdatabase.client; |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
4 import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; |
683
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
5 |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
6 import de.intevation.gnv.artifactdatabase.objects.Artifact; |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
7 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
10 import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
11 import de.intevation.gnv.artifactdatabase.objects.DefaultArtifactStatisticValue; |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
12 import de.intevation.gnv.artifactdatabase.objects.DefaultArtifactStatisticsSet; |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
13 import de.intevation.gnv.artifactdatabase.objects.DefaultExportMode; |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
14 import de.intevation.gnv.artifactdatabase.objects.DefaultOutputMode; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
15 import de.intevation.gnv.artifactdatabase.objects.DefaultOutputParameter; |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
16 import de.intevation.gnv.artifactdatabase.objects.ExportMode; |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
17 import de.intevation.gnv.artifactdatabase.objects.InputParameter; |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
18 import de.intevation.gnv.artifactdatabase.objects.OutputMode; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
19 import de.intevation.gnv.artifactdatabase.objects.OutputParameter; |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
20 import de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactFactory; |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
21 import de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactObject; |
683
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
22 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
23 import de.intevation.gnv.artifactdatabase.objects.map.Layer; |
402
b88e881e8e94
Added the first Implementation (not complete and not ready to use) for the Interface from the MapViewer to the GNV
Tim Englich <tim.englich@intevation.de>
parents:
394
diff
changeset
|
24 import de.intevation.gnv.artifactdatabase.objects.map.MapService; |
683
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
25 |
23
b11f941f7eb2
Made ArtifactDatabase URL configurable
Tim Englich <tim.englich@intevation.de>
parents:
19
diff
changeset
|
26 import de.intevation.gnv.propertiesreader.PropertiesReader; |
b11f941f7eb2
Made ArtifactDatabase URL configurable
Tim Englich <tim.englich@intevation.de>
parents:
19
diff
changeset
|
27 import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; |
683
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
28 |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 import de.intevation.gnv.util.XMLUtils; |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 |
683
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
31 import java.io.IOException; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
32 import java.io.InputStream; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
33 import java.io.InputStreamReader; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
34 import java.io.OutputStream; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
35 import java.io.OutputStreamWriter; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
36 |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
37 import java.util.ArrayList; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
38 import java.util.Collection; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
39 import java.util.HashMap; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
40 import java.util.Iterator; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
41 import java.util.List; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
42 import java.util.Locale; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
43 import java.util.Map; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
44 |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
45 import org.apache.log4j.Logger; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
46 |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
47 import org.restlet.Client; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
48 |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
49 import org.restlet.data.ClientInfo; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
50 import org.restlet.data.Language; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
51 import org.restlet.data.Method; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
52 import org.restlet.data.Preference; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
53 import org.restlet.data.Protocol; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
54 import org.restlet.data.Request; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
55 import org.restlet.data.Response; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
56 |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
57 import org.restlet.representation.Representation; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
58 import org.restlet.representation.StringRepresentation; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
59 |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
60 import org.w3c.dom.Document; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
61 import org.w3c.dom.Element; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
62 import org.w3c.dom.Node; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
63 import org.w3c.dom.NodeList; |
d49e8695786c
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
681
diff
changeset
|
64 |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
66 * The default implementation of <code>ArtifactDatabaseClient</code> which |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
67 * implements methods to communicate via HTTP protocol with the artifact server. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
68 * |
684
57fa8019fbdc
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
683
diff
changeset
|
69 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
57fa8019fbdc
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
683
diff
changeset
|
70 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 */ |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 public class DefaultArtifactDatabaseClient implements ArtifactDatabaseClient { |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 /** |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
74 * The URI of the namespace of the artifacts. |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
75 */ |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
76 public final static String NAMESPACE_URI = "http://www.intevation.de/2009/artifacts"; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
77 |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
78 /** |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
79 * The XML prefix for the artifacts namespace. |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
80 */ |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
81 public final static String NAMESPACE_PREFIX = "art"; |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
82 |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
83 /** |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
84 * Xpath expression to get general exception messages related to server |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
85 * errors. |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
86 */ |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
87 public static final String EXCEPTION_GENERAL = |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
88 "/art:exceptionreport/art:exception/text()"; |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
89 |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
90 /** |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
91 * Xpath expression to get exception messages related to invalid user input. |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
92 */ |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
93 public static final String EXCEPTION_USER_INPUT = |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
94 "/art:exceptionreport/art:exception/art:input/text()"; |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
95 |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
96 /** |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 * the logger, used to log exceptions and additonaly information |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 */ |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
99 private static Logger log = Logger |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
100 .getLogger(DefaultArtifactDatabaseClient.class); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
101 |
25 | 102 /** |
103 * The Databases which could be used | |
104 */ | |
105 private static Collection<String> artifactDatabases = null; | |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
106 |
25 | 107 /** |
108 * Is the Class initialized? | |
109 */ | |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 private static boolean initialized = false; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
111 |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 /** |
40
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
113 * Request locale |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
114 */ |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
115 private Locale locale; |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
116 |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
117 |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
118 /** |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 * Constructor |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
120 */ |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
121 public DefaultArtifactDatabaseClient() { |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
122 |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
123 } |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
124 |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
125 public Collection<ArtifactObject> getArtifactFactories() |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
126 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
127 Collection<ArtifactObject> resultValues = null; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
128 if (!initialized) { |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
129 this.initialize(); |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
130 } |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
131 try { |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
132 log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); |
25 | 133 Iterator<String> it = artifactDatabases.iterator(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
134 while (it.hasNext()) { |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 String server = it.next(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
136 String url = server + "/factories"; |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
137 Document document = this.doGetRequest(url); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
138 if (resultValues == null) { |
565
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
139 resultValues = this.getArtifactFactories(document, server,null); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
140 } else { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
141 resultValues.addAll(this.getArtifactFactories(document, |
565
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
142 server,null)); |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
143 } |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
144 } |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
145 } catch (IOException e) { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
146 log.error(e, e); |
47
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
147 throw new ArtifactDatabaseClientException(e); |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
148 } |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
149 return resultValues; |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 } |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
151 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
152 |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
153 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
154 * Returns a collection of artifact factories retrieved by <i>server</i>. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
155 * |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
156 * @param document |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
157 * @param server |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
158 * @param geometry |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
159 * @return a collection of factories. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
160 */ |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
161 private Collection<ArtifactObject> getArtifactFactories(Document document, |
565
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
162 String server, |
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
163 String geometry) { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
164 NodeList artifactFactories = XMLUtils.getNodeSetXPath(document, |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
165 "/art:result/art:factories/art:factory"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
166 Collection<ArtifactObject> resultValues = new ArrayList<ArtifactObject>( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
167 artifactFactories.getLength()); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
168 if (artifactFactories != null) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
169 for (int i = 0; i < artifactFactories.getLength(); i++) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
170 Node artifactFactoryNode = artifactFactories.item(i); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
171 String name = XMLUtils.getStringXPath(artifactFactoryNode, |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
172 "@art:name"); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
173 String description = XMLUtils.getStringXPath( |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
174 artifactFactoryNode, "@art:description"); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
175 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
176 NodeList parameterNodeList = XMLUtils.getNodeSetXPath( |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
177 artifactFactoryNode, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
178 "art:parameter"); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
179 |
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
180 if ((parameterNodeList != null && |
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
181 parameterNodeList.getLength() > 0) || |
565
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
182 geometry != null){ |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
183 Collection<String> parameters = |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
184 new ArrayList<String>(parameterNodeList.getLength()); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
185 for (int j = 0; j < parameterNodeList.getLength(); j++){ |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
186 Element parameterNode = (Element)parameterNodeList.item(j); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
187 parameters.add(parameterNode.getAttribute("id")); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
188 } |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
189 ParametrizedArtifactObject pao = |
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
190 new ParametrizedArtifactFactory(name, |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
191 description, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
192 server); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
193 pao.addParameters("parameter", parameters); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
194 resultValues.add(pao); |
565
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
195 if (geometry != null){ |
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
196 Collection<String> geometryList = new ArrayList<String>(1); |
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
197 geometryList.add(geometry); |
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
198 pao.addParameters("geometry",geometryList); |
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
199 } |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
200 }else{ |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
201 ArtifactObject artifactFactory = new ArtifactFactory(name, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
202 description, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
203 server); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
204 resultValues.add(artifactFactory); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
205 } |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
206 } |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
207 } |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
208 log.debug("Artifact Factories: " + resultValues.size()); |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
209 return resultValues; |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
210 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
211 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
212 |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
213 private Document doGetRequest(String requestUrl) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
214 throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
215 return this.doGetRequest(requestUrl, null); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
216 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
217 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
218 |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
219 private Document doGetRequest(String requestUrl, Document requestBody) |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
220 throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
25 | 221 XMLUtils xmlUtils = new XMLUtils(); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
222 Representation output = doGetRequestInternal(requestUrl, requestBody); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
223 Document document = XMLUtils.readDocument(output.getStream()); |
25 | 224 this.check4ExceptionReport(document); |
225 return document; | |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
226 } |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
227 |
40
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
228 protected Request initialize(Request request) { |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
229 return initialize(request, locale); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
230 } |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
231 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
232 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
233 * Initialize the <code>ClientInfo</code> object of <i>request</i> with the |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
234 * given <i>locale</i>. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
235 * |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
236 * @param request The request object. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
237 * @param locale The locale. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
238 * @return the prepared request object. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
239 */ |
40
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
240 protected Request initialize(Request request, Locale locale) { |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
241 if (locale != null) { |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
242 ClientInfo clientInfo = request.getClientInfo(); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
243 String lang = locale.getLanguage(); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
244 Language language = new Language(lang); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
245 List<Preference<Language>> acceptedLanguages = |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
246 new ArrayList<Preference<Language>>(2); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
247 acceptedLanguages.add(new Preference(language, 1.0f)); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
248 acceptedLanguages.add(new Preference(Language.ALL, 0.5f)); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
249 clientInfo.setAcceptedLanguages(acceptedLanguages); |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
250 } |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
251 return request; |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
252 } |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
253 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
254 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
255 private Representation doGetRequestInternal(String requestUrl, |
47
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
256 Document requestBody) throws IOException { |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
257 Client client = new Client(Protocol.HTTP); |
40
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
258 Request request = initialize(new Request(Method.GET, requestUrl)); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
259 if (requestBody != null) { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
260 String documentBody = XMLUtils |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
261 .writeDocument2String(requestBody); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
262 Representation representation = new StringRepresentation( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
263 documentBody); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
264 request.setEntity(representation); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
265 } |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
266 Response response = client.handle(request); |
47
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
267 if (response.getStatus().getCode() != 200){ |
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
268 throw new IOException(response.getStatus().getDescription()); |
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
269 } |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
270 Representation output = response.getEntity(); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
271 return output; |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
272 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
273 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
274 |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
275 private InputStream doPostRequest(String requestUrl, Document requestBody) |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
276 throws IOException { |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
277 Client client = new Client(Protocol.HTTP); |
40
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
278 Request request = initialize(new Request(Method.POST, requestUrl)); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
279 String documentBody = XMLUtils.writeDocument2String(requestBody); |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
280 Representation representation = new StringRepresentation(documentBody); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
281 request.setEntity(representation); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
282 Response response = client.handle(request); |
47
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
283 if (response.getStatus().getCode() != 200){ |
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
284 throw new IOException(response.getStatus().getDescription()); |
f35b7d7a04d6
Read the Status-Code from the Response and throw an Exception which Message will be visualized in the GUI. gnv/issue18
Tim Englich <tim.englich@intevation.de>
parents:
40
diff
changeset
|
285 } |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
286 Representation output = response.getEntity(); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
287 return output.getStream(); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
288 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
289 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
290 private synchronized void initialize() { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
291 if (!initialized) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
292 PropertiesReader pr = PropertiesReaderFactory.getInstance() |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
293 .getPropertiesReader(); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
294 int count = Integer.parseInt(pr.getPropertieValue( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
295 ARTIFACTDATABASE_COUNT_ID, "0")); |
25 | 296 artifactDatabases = new ArrayList<String>(count); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
297 for (int i = 0; i < count; i++) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
298 artifactDatabases.add(pr.getPropertieValue( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
299 ARTIFACTDATABASE_URL_ID + "." + (i + 1), "N/N")); |
23
b11f941f7eb2
Made ArtifactDatabase URL configurable
Tim Englich <tim.englich@intevation.de>
parents:
19
diff
changeset
|
300 } |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
301 initialized = true; |
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
302 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
303 |
2
5e94403971af
infrastructur for Communicationg with the ArtifactDatabase added.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
304 } |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
305 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
306 |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
307 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
308 * Creates a new artifact with the given <i>artifactFactory</i>. A POST call |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
309 * is sent to the artifact server which creates a new artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
310 * |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
311 * @param artifactFactory The artifact factory used to create a new |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
312 * artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
313 * @return the created artifact of the artifact server. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
314 * @throws ArtifactDatabaseClientException |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
315 * @throws ArtifactDatabaseInputException |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
316 */ |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
317 public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
318 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
319 |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
320 try { |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
321 Document request = this.createCreateRequestBody(artifactFactory); |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
322 Document result = doPostRequest(artifactFactory, request, "create"); |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
323 return this.getArtifact(result); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
324 } catch (IOException e) { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
325 log.error(e, e); |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
326 throw new ArtifactDatabaseClientException(e); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
327 } |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
328 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
329 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
330 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
331 * Returns a new artifact defined by uuid and hash values of the document |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
332 * returned by the artifact server after creating a new artifact. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
333 * |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
334 * @param document Contains information about the server-side created |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
335 * artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
336 * @return a new artifact object. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
337 */ |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
338 private ArtifactObject getArtifact(Document document) { |
35 | 339 XMLUtils xmlUtils = new XMLUtils(); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
340 String uuid = XMLUtils.getStringXPath(document, "/art:result/art:uuid/@value"); |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
341 String hash = XMLUtils.getStringXPath(document, "/art:result/art:hash/@value"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
342 log.info("NEW Artifact: " + uuid + " / " + hash); |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
343 return new Artifact(uuid, hash); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
344 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
345 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
346 private Document createCreateRequestBody(ArtifactObject artifactFactory) { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
347 Document document = XMLUtils.newDocument(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
348 Node rootNode = this.createRootNode(document); |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
349 Element typeNode = this.createArtifactElement(document, "type"); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
350 typeNode.setAttribute("name", "create"); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
351 rootNode.appendChild(typeNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
352 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
353 Element factoryNode = this.createArtifactElement(document, "factory"); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
354 factoryNode.setAttribute("name", artifactFactory.getId()); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
355 rootNode.appendChild(factoryNode); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
356 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
357 if (artifactFactory instanceof ParametrizedArtifactObject){ |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
358 Map<String, Collection<String>> parameterMap = |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
359 ((ParametrizedArtifactObject)artifactFactory).getParameters(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
360 if (parameterMap != null && !parameterMap.isEmpty() ){ |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
361 Iterator<String> keyIt = parameterMap.keySet().iterator(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
362 while (keyIt.hasNext()){ |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
363 String key = keyIt.next(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
364 Iterator<String> valueIt = parameterMap.get(key).iterator(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
365 while (valueIt.hasNext()){ |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
366 String value = valueIt.next(); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
367 Element parameterNode = |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
368 this.createArtifactElement(document, "parameter"); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
369 parameterNode.setAttribute("name", key); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
370 parameterNode.setAttribute("value", value); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
371 factoryNode.appendChild(parameterNode); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
372 } |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
373 } |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
374 } |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
375 } |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
376 return document; |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
377 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
378 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
379 private Element createRootNode(Document document) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
380 Element rootNode = this.createArtifactElement(document, "action"); |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
381 document.appendChild(rootNode); |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
382 return rootNode; |
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
383 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
384 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
385 |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
386 private Element createArtifactElement(Document document, String name) { |
391
ee8003fffc71
Use XMLUtils.ElementCreator to create new nodes in xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
387 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
ee8003fffc71
Use XMLUtils.ElementCreator to create new nodes in xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
388 document, |
ee8003fffc71
Use XMLUtils.ElementCreator to create new nodes in xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
389 NAMESPACE_URI, |
ee8003fffc71
Use XMLUtils.ElementCreator to create new nodes in xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
390 NAMESPACE_PREFIX |
ee8003fffc71
Use XMLUtils.ElementCreator to create new nodes in xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
391 ); |
ee8003fffc71
Use XMLUtils.ElementCreator to create new nodes in xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
392 |
ee8003fffc71
Use XMLUtils.ElementCreator to create new nodes in xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
389
diff
changeset
|
393 return creator.create(name); |
7
fe6a64545552
Support for creating an Artifact integrated
Tim Englich <tim.englich@intevation.de>
parents:
2
diff
changeset
|
394 } |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
395 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
396 |
25 | 397 private Document doPostRequest(ArtifactObject artifactFactory, |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
398 Document request, String suburl) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
399 throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
25 | 400 XMLUtils xmlUtils = new XMLUtils(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
401 String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl(); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
402 InputStream is = this.doPostRequest(url + "/" + suburl, request); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
403 Document result = XMLUtils.readDocument(is); |
25 | 404 this.check4ExceptionReport(result); |
405 return result; | |
406 } | |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
407 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
408 |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
409 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
410 * Retrieve the current artifact description after calling the describe |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
411 * operation of the artifact server. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
412 * |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
413 * @param artifactFactory |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
414 * @param currentArtifact |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
415 * @param includeUI Set this option to true, if the user interface |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
416 * description is required. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
417 * @return the artifact description. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
418 * @throws ArtifactDatabaseClientException |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
419 * @throws ArtifactDatabaseInputException |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
420 */ |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
421 public ArtifactDescription getCurrentStepDescription( |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
422 ArtifactObject artifactFactory, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
423 ArtifactObject currentArtifact, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
424 boolean includeUI) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
425 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
426 try { |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
427 String url = this.getArtifactUrl(artifactFactory, currentArtifact); |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
428 Document request = this.createDescribeRequestBody(currentArtifact, |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
429 includeUI); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
430 InputStream describeResult = this.doPostRequest(url, request); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
431 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
432 return this.readDescription(XMLUtils.readDocument(describeResult), |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
433 currentArtifact); |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
434 } catch (IOException e) { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
435 log.error(e, e); |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
436 throw new ArtifactDatabaseClientException(e); |
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
437 } |
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
438 } |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
439 |
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
440 |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
441 private Document createDescribeRequestBody(ArtifactObject currentArtifact, |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
442 boolean includeUI){ |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
443 Document document = XMLUtils.newDocument(); |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
444 Node rootNode = this.createRootNode(document); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
445 |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
446 Element typeNode = this.createArtifactElement(document, "type"); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
447 typeNode.setAttribute("name", "describe"); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
448 rootNode.appendChild(typeNode); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
449 |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
450 Element uuidNode = this.createArtifactElement(document, "uuid"); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
451 uuidNode.setAttribute("value", currentArtifact.getId()); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
452 rootNode.appendChild(uuidNode); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
453 |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
454 Element hashNode = this.createArtifactElement(document, "hash"); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
455 hashNode.setAttribute("value", currentArtifact.getHash()); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
456 rootNode.appendChild(hashNode); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
457 Element includeUINode = this.createArtifactElement(document, "include-ui"); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
458 includeUINode.appendChild(document.createTextNode(""+includeUI)); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
459 rootNode.appendChild(includeUINode); |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
460 return document; |
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
461 } |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
462 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
463 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
464 private String getArtifactUrl(ArtifactObject artifactFactory, |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
465 ArtifactObject currentArtifact) { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
466 String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl() |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
467 + "/artifact/" + currentArtifact.getId(); |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
468 return url; |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
469 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
470 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
471 private ArtifactDescription readDescription(Document document, |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
472 ArtifactObject artifact) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
473 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
474 // Check if there was an Error or Exception reported from the |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
475 // ArtifactDatabase |
25 | 476 this.check4ExceptionReport(document); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
477 if (artifact instanceof ArtifactDescription) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
478 ArtifactDescription ad = (ArtifactDescription) artifact; |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
479 Node uiNode = XMLUtils.getNodeXPath(document, "/art:result/art:ui"); |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
480 Node outputNode = XMLUtils |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
481 .getNodeXPath(document, "/art:result/art:outputs"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
482 |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
483 Map<String, OutputMode> outputModes = null; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
484 if (outputNode != null) { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
485 NodeList outputModesNodes = XMLUtils.getNodeSetXPath( |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
486 outputNode, "art:output"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
487 if (outputModesNodes != null) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
488 outputModes = new HashMap<String, OutputMode>( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
489 outputModesNodes.getLength()); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
490 for (int i = 0; i < outputModesNodes.getLength(); i++) { |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
491 Node outputModeNode = outputModesNodes.item(i); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
492 String name = XMLUtils.getStringXPath(outputModeNode, |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
493 "@name"); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
494 String mimeType = XMLUtils.getStringXPath( |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
495 outputModeNode, "@mime-type"); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
496 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
497 NodeList parameterNodes = XMLUtils.getNodeSetXPath( |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
498 outputModeNode, "art:parameter/art:parameter"); |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
499 Collection<OutputParameter> parameter = null; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
500 if (parameterNodes != null) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
501 parameter = new ArrayList<OutputParameter>( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
502 parameterNodes.getLength()); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
503 for (int j = 0; j < parameterNodes.getLength(); j++) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
504 Node outputParameterNode = parameterNodes |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
505 .item(j); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
506 parameter.add(new DefaultOutputParameter( |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
507 XMLUtils.getStringXPath( |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
508 outputParameterNode, "@name"), |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
509 XMLUtils.getStringXPath( |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
510 outputParameterNode, "@value"), |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
511 XMLUtils.getStringXPath( |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
512 outputParameterNode, "@name"), |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
513 XMLUtils.getStringXPath( |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
514 outputParameterNode, "@type"))); |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
515 } |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
516 } |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
517 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
518 NodeList exportNodes = XMLUtils.getNodeSetXPath( |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
519 outputModeNode, "art:exports/art:export"); |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
520 Map exports = null; |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
521 |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
522 if (exportNodes != null) { |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
523 int size = exportNodes.getLength(); |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
524 exports = new HashMap<String, ExportMode>(size); |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
525 |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
526 for (int k = 0; k < size; k++) { |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
527 Node export = exportNodes.item(k); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
528 String expName = XMLUtils.getStringXPath( |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
529 export, "@name"); |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
530 exports.put(expName, new DefaultExportMode( |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
531 expName, |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
532 XMLUtils.getStringXPath(export, "@description"), |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
533 XMLUtils.getStringXPath(export, "@mime-type"))); |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
534 } |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
535 } |
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
536 |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
537 outputModes.put(name, new DefaultOutputMode(name, |
573
bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
570
diff
changeset
|
538 mimeType, parameter, exports)); |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
539 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
540 |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
541 } |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
542 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
543 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
544 String currentState = XMLUtils.getStringXPath(document, |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
545 "/art:result/art:state/@name"); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
546 NodeList statesList = XMLUtils.getNodeSetXPath(document, |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
547 "/art:result/art:reachable-states/art:state/@name"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
548 Collection<String> reachableStates = new ArrayList<String>( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
549 statesList.getLength()); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
550 for (int i = 0; i < statesList.getLength(); i++) { |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
551 reachableStates.add(statesList.item(i).getNodeValue()); |
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
552 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
553 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
554 NodeList inputNodes = XMLUtils.getNodeSetXPath(document, |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
555 "/art:result/art:model/art:input"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
556 if (inputNodes != null) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
557 Collection<String> inputParameter = new ArrayList<String>( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
558 inputNodes.getLength()); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
559 for (int i = 0; i < inputNodes.getLength(); i++) { |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
560 Node inputNode = inputNodes.item(i); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
561 String name = XMLUtils.getStringXPath(inputNode, "@name"); |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
562 inputParameter.add(name); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
563 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
564 ad.setInputParameter(inputParameter); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
565 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
566 |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
25
diff
changeset
|
567 ad.setOutputModes(outputModes); |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
568 ad.setCurrentOut(outputNode); |
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
569 ad.setCurrentUI(uiNode); |
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
570 ad.setCurrentState(currentState); |
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
571 ad.setReachableStates(reachableStates); |
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
572 return ad; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
573 } else { |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
574 log.error("Artifact must be Instance of ArtifactDescription"); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
575 throw new ArtifactDatabaseClientException( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
576 "Artifact must be Instance of ArtifactDescription"); |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
577 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
578 |
9
a4cb6d175a6e
Support for Initial DescribeCall to ArtifactDatabase implemented
Tim Englich <tim.englich@intevation.de>
parents:
7
diff
changeset
|
579 } |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
580 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
581 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
582 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
583 * Feed, advance and describe in one single method. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
584 * |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
585 * @param artifactFactory The factory which created the current artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
586 * @param currentArtifact The current artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
587 * @param target The target state for advance. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
588 * @param inputParameter Input data for feed. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
589 * @return the artifact description after calling feed and advance. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
590 * @throws ArtifactDatabaseClientException if a general error occured in |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
591 * the artifact server. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
592 * @throws ArtifactDatabaseInputException if the input data was invalid used |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
593 * for feed. |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
594 */ |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
595 public ArtifactDescription doNextStep( |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
596 ArtifactObject artifactFactory, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
597 ArtifactObject currentArtifact, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
598 String target, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
599 Collection<InputParameter> inputParameter) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
600 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
601 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
602 try { |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
603 // 1 Feed |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
604 this.doFeed(artifactFactory, currentArtifact, inputParameter); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
605 |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
606 // 2. Noch einmal Describe um das jetzt zu erreichende Ziel zu ermitteln |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
607 ArtifactDescription ad = getCurrentStepDescription( |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
608 artifactFactory, |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
609 new Artifact(currentArtifact.getId(), |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
610 currentArtifact.getHash()), |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
611 false |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
612 ); |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
613 |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
614 target = ad.getReachableStates().iterator().next(); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
615 |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
616 // 3 Advance |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
617 doAdvance(artifactFactory, currentArtifact, target); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
618 |
25 | 619 // 3 Describe |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
620 return this.getCurrentStepDescription(artifactFactory, |
157
013d47662161
Switched the Communication for Describe-Calls to the artifact-database from get to post.
Tim Englich <tim.englich@intevation.de>
parents:
154
diff
changeset
|
621 currentArtifact,true); |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
622 } catch (IOException e) { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
623 log.error(e, e); |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
624 throw new ArtifactDatabaseClientException(e); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
625 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
626 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
627 |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
628 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
629 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
630 * Call the advance operation of the artifact server to step to the next |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
631 * step of the parameterization. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
632 * |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
633 * @param factory The artifact factory which created the current artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
634 * @param artifact The current artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
635 * @param target The target state. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
636 * @throws IOException if an error occured while reading/writing from/to |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
637 * stream. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
638 * @throws ArtifactDatabaseClientException if a general error occured in |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
639 * the artifact server. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
640 * @throws ArtifactDatabaseInputException if the input data was invalid. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
641 */ |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
642 public void doAdvance( |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
643 ArtifactObject factory, |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
644 ArtifactObject artifact, |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
645 String target) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
646 throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
647 String url = getArtifactUrl(factory, artifact); |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
648 Document advanceDocument = createAdvanceRequestBody(artifact, target); |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
649 InputStream advanceResult = doPostRequest(url, advanceDocument); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
650 check4ExceptionReport(XMLUtils.readDocument(advanceResult)); |
394
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
651 } |
14eecfde4607
Render links to step back to previous states into gui. Added controller to advance back to these states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
652 |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
653 private Document createFeedRequestBody( |
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
654 ArtifactObject currentArtifact, |
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
655 Collection<InputParameter> inputParameter) { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
656 Document document = XMLUtils.newDocument(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
657 Node rootNode = this.createRootNode(document); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
658 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
659 Element typeNode = this.createArtifactElement(document, "type"); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
660 typeNode.setAttribute("name", "feed"); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
661 rootNode.appendChild(typeNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
662 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
663 Element uuidNode = this.createArtifactElement(document, "uuid"); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
664 uuidNode.setAttribute("value", currentArtifact.getId()); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
665 rootNode.appendChild(uuidNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
666 |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
667 Element hashNode = this.createArtifactElement(document, "hash"); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
668 hashNode.setAttribute("value", currentArtifact.getHash()); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
669 rootNode.appendChild(hashNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
670 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
671 Node dataNode = this.createParameterNodes(inputParameter, document, |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
672 "data"); |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
673 rootNode.appendChild(dataNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
674 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
675 return document; |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
676 } |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
677 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
678 |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
679 private Node createParameterNodes( |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
680 Collection<InputParameter> inputParameter, |
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
681 Document document, String nodeName) { |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
682 Element dataNode = this.createArtifactElement(document, nodeName); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
683 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
684 if (inputParameter != null) { |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
685 Iterator<InputParameter> it = inputParameter.iterator(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
686 while (it.hasNext()) { |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
687 InputParameter ip = it.next(); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
688 String name = ip.getName(); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
689 String[] values = ip.getValues(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
690 if (values != null) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
691 for (int i = 0; i < values.length; i++) { |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
692 String value = values[i]; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
693 Element inputNode = this.createArtifactElement( |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
694 document, "input"); |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
695 inputNode.setAttribute("name", name); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
696 inputNode.setAttribute("value", value); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
697 dataNode.appendChild(inputNode); |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
698 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
699 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
700 } |
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
701 } |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
702 return dataNode; |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
703 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
704 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
705 |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
706 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
707 * Creates the xml body for the advance request. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
708 * |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
709 * @param currentArtifact |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
710 * @param target |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
711 * @return the advance xml document. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
712 */ |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
713 private Document createAdvanceRequestBody(ArtifactObject currentArtifact, |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
714 String target) { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
715 Document document = XMLUtils.newDocument(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
716 Node rootNode = this.createRootNode(document); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
717 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
718 Element typeNode = this.createArtifactElement(document, "type"); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
719 typeNode.setAttribute("name", "advance"); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
720 rootNode.appendChild(typeNode); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
721 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
722 Element uuidNode = this.createArtifactElement(document, "uuid"); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
723 uuidNode.setAttribute("value", currentArtifact.getId()); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
724 rootNode.appendChild(uuidNode); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
725 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
726 Element hashNode = this.createArtifactElement(document, "hash"); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
727 hashNode.setAttribute("value", currentArtifact.getHash()); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
728 rootNode.appendChild(hashNode); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
729 Element targetNode = this.createArtifactElement(document, "target"); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
730 targetNode.setAttribute("name", target); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
731 rootNode.appendChild(targetNode); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
732 return document; |
12
4ebe57b170d3
Integration of moving through the Artifact-States and rendering the UI.
Tim Englich <tim.englich@intevation.de>
parents:
11
diff
changeset
|
733 } |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
734 |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
735 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
736 * Call the out operation of the artifact server and writes the result to |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
737 * <i>stream</i>. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
738 * |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
739 * @param exportMode |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
740 * @param inputParameter |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
741 */ |
583
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
742 public void doOutput( |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
743 ArtifactObject artifactFactory, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
744 ArtifactObject currentArtifact, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
745 OutputStream stream, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
746 String targetName, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
747 String exportMode, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
748 String mimeType, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
749 Collection<InputParameter> inputParameter) |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
750 throws ArtifactDatabaseClientException |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
751 { |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
752 try { |
583
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
753 Document requestBody = this.createOutRequestBody( |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
754 currentArtifact, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
755 targetName, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
756 exportMode, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
757 mimeType, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
758 inputParameter); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
759 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
760 String requestUrl = this.getArtifactUrl(artifactFactory, |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
761 currentArtifact) |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
762 + "/" + targetName; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
763 InputStream is = this.doPostRequest(requestUrl, requestBody); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
764 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
765 byte[] b = new byte[4096]; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
766 int i = -1; |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
767 while ((i = is.read(b)) > 0) { |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
768 stream.write(b, 0, i); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
769 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
770 } catch (IOException e) { |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
771 log.error(e, e); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
772 throw new ArtifactDatabaseClientException(e); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
773 } |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
774 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
775 |
670
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
776 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
777 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
778 * Call the out method of the artifact server with a specific export mode. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
779 * |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
780 * @param artifactFactory |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
781 * @param currentArtifact |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
782 * @param out |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
783 * @throws ArtifactDatabaseClientException if an error occured while |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
784 * reading/writing from/to stream. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
785 */ |
670
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
786 public void doExport( |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
787 ArtifactObject artifactFactory, |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
788 ArtifactObject currentArtifact, |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
789 OutputStream out) |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
790 throws ArtifactDatabaseClientException |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
791 { |
678
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
792 InputStreamReader reader = null; |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
793 OutputStreamWriter writer = null; |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
794 |
670
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
795 try { |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
796 String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl(); |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
797 url += "/export/" + currentArtifact.getId(); |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
798 |
678
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
799 Representation response = doGetRequestInternal(url, null); |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
800 InputStream in = response.getStream(); |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
801 |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
802 reader = new InputStreamReader(in); |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
803 writer = new OutputStreamWriter(out); |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
804 |
679
4eccd03394ac
Improved the copying of input stream to output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
678
diff
changeset
|
805 int c; |
4eccd03394ac
Improved the copying of input stream to output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
678
diff
changeset
|
806 char[] buffer = new char[512]; |
4eccd03394ac
Improved the copying of input stream to output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
678
diff
changeset
|
807 while ((c = reader.read(buffer)) > 0) { |
4eccd03394ac
Improved the copying of input stream to output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
678
diff
changeset
|
808 writer.write(buffer, 0, c); |
678
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
809 } |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
810 |
670
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
811 } |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
812 catch (Exception e) { |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
813 log.error(e, e); |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
814 throw new ArtifactDatabaseClientException(e); |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
815 } |
678
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
816 finally { |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
817 try { |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
818 reader.close(); |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
819 } catch (IOException ioe) {} |
670
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
820 |
678
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
821 try { |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
822 writer.flush(); |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
823 } catch (IOException ioe) {} |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
824 |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
825 try { |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
826 writer.close(); |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
827 } catch (IOException ioe) {} |
2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
676
diff
changeset
|
828 } |
670
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
829 } |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
830 |
b89b31293772
Implemented first things to store/load projects.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
668
diff
changeset
|
831 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
832 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
833 * Start to import an artifact from xml document. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
834 * |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
835 * @param factory |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
836 * @param document The artifact as xml document. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
837 * @return A status description of the operation (success or failure). |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
838 * @throws ArtifactDatabaseClientException |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
839 * @throws IOException |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
840 */ |
673
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
841 public Document doImport( |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
842 ArtifactFactory factory, |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
843 Document document) |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
844 throws ArtifactDatabaseClientException, IOException |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
845 { |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
846 String url = factory.getDataBaseUrl() + "/import"; |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
847 InputStream response = doPostRequest(url, document); |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
848 |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
849 return XMLUtils.readDocument(response); |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
850 } |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
851 |
93b4dedc4e37
Implemented a mechanism to import artifacts from xml structured documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
670
diff
changeset
|
852 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
853 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
854 * Creates the xml request body used for an out-call of the artifact server. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
855 * |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
856 * @param currentArtifact |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
857 * @param target |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
858 * @param exportMode |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
859 * @param mimeType |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
860 * @param inputParameter |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
861 * @return the request body. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
862 */ |
38
fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
Tim Englich <tim.englich@intevation.de>
parents:
36
diff
changeset
|
863 private Document createOutRequestBody( |
583
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
864 ArtifactObject currentArtifact, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
865 String target, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
866 String exportMode, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
867 String mimeType, |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
868 Collection<InputParameter> inputParameter) |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
869 { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
870 Document document = XMLUtils.newDocument(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
871 Node rootNode = this.createRootNode(document); |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
872 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
873 Element typeNode = this.createArtifactElement(document, "type"); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
874 typeNode.setAttribute("name", "out"); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
875 rootNode.appendChild(typeNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
876 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
877 Element uuidNode = this.createArtifactElement(document, "uuid"); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
878 uuidNode.setAttribute("value", currentArtifact.getId()); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
879 rootNode.appendChild(uuidNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
880 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
881 Element hashNode = this.createArtifactElement(document, "hash"); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
882 hashNode.setAttribute("value", currentArtifact.getHash()); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
883 rootNode.appendChild(hashNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
884 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
885 Element outNode = this.createArtifactElement(document, "out"); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
886 outNode.setAttribute("name", target); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
887 rootNode.appendChild(outNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
888 |
583
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
889 Element exportNode = this.createArtifactElement(document, "export"); |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
890 exportNode.setAttribute("name", exportMode); |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
891 outNode.appendChild(exportNode); |
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
892 |
281
4ec95d586f31
Removed mistake in xml structure of the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
165
diff
changeset
|
893 Element mimeTypeNode = this.createArtifactElement(document, "mime-type"); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
894 mimeTypeNode.setAttribute("value", mimeType); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
895 outNode.appendChild(mimeTypeNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
896 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
897 Node parameterNode = this.createParameterNodes(inputParameter, |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
898 document, "params"); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
899 outNode.appendChild(parameterNode); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
900 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
901 return document; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
902 } |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
903 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
904 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
905 /** |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
906 * Calls the feed operation of the artifact server. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
907 * |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
908 * @param artifactFactory The artifact factory which created the current |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
909 * artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
910 * @param currentArtifact The current artifact. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
911 * @param inputParameter The user input. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
912 * @throws ArtifactDatabaseClientException |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
913 * @throws ArtifactDatabaseInputException |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
914 */ |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
915 public void doFeed( |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
916 ArtifactObject artifactFactory, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
917 ArtifactObject currentArtifact, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
918 Collection<InputParameter> inputParameter) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
919 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
920 |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
921 try { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
922 Document feedDocument = this.createFeedRequestBody(currentArtifact, |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
923 inputParameter); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
924 String url = this.getArtifactUrl(artifactFactory, currentArtifact); |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
925 InputStream feedResult = this.doPostRequest(url, feedDocument); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
926 Document feedResultDocument = XMLUtils |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
927 .readDocument(feedResult); |
25 | 928 this.check4ExceptionReport(feedResultDocument); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
929 } catch (IOException e) { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
930 log.error(e, e); |
25 | 931 throw new ArtifactDatabaseClientException(e); |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
932 } |
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
933 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
934 |
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
935 private void check4ExceptionReport(Document document) |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
936 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
937 String message = XMLUtils.getStringXPath(document, |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
938 EXCEPTION_GENERAL); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
939 if (message != null) { |
25 | 940 throw new ArtifactDatabaseClientException(message); |
941 } | |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
942 |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
943 String input = XMLUtils.getStringXPath(document, EXCEPTION_USER_INPUT); |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
944 if (input != null) { |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
945 throw new ArtifactDatabaseInputException(input); |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
946 } |
25 | 947 } |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
948 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
949 |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
950 /** |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
951 * Call the specific wms export mode of the out operation of the artifact |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
952 * server. |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
953 * |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
954 * @param factory |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
955 * @param artifact |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
956 * @param inputParameter |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
957 * @return a document that contains information about the wms service and |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
958 * the created layer. |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
959 * @throws ArtifactDatabaseClientException |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
960 * @throws ArtifactDatabaseInputException |
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
961 */ |
668
ccd47d9887ec
Added an options panel for wms customization (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
665
diff
changeset
|
962 public Document publishWMS( |
ccd47d9887ec
Added an options panel for wms customization (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
665
diff
changeset
|
963 ArtifactObject factory, |
ccd47d9887ec
Added an options panel for wms customization (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
665
diff
changeset
|
964 ArtifactObject artifact, |
ccd47d9887ec
Added an options panel for wms customization (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
665
diff
changeset
|
965 Collection<InputParameter> inputParameter |
676
707e142e7d44
Improved ExceptionHandling during WMS-Publishing.
Tim Englich <tim.englich@intevation.de>
parents:
673
diff
changeset
|
966 ) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException{ |
570
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
967 log.debug("Start wms publishing..."); |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
968 |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
969 String target = "wms"; |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
970 String requestURL = getArtifactUrl(factory, artifact) + "/" + target; |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
971 Document request = createOutRequestBody( |
668
ccd47d9887ec
Added an options panel for wms customization (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
665
diff
changeset
|
972 artifact, target, "", "text/xml", inputParameter); |
570
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
973 try { |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
974 InputStream input = doPostRequest(requestURL, request); |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
975 Document result = XMLUtils.readDocument(input); |
676
707e142e7d44
Improved ExceptionHandling during WMS-Publishing.
Tim Englich <tim.englich@intevation.de>
parents:
673
diff
changeset
|
976 this.check4ExceptionReport(result); |
585
2e690cb2247c
Show information about MapServer path and layer name after publishing calculated shapefiles as wms. Use MapServer settings configured in conf.xml to feed OpenLayers client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
583
diff
changeset
|
977 return result; |
570
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
978 } |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
979 catch (IOException ioe) { |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
980 log.error(ioe, ioe); |
676
707e142e7d44
Improved ExceptionHandling during WMS-Publishing.
Tim Englich <tim.englich@intevation.de>
parents:
673
diff
changeset
|
981 throw new ArtifactDatabaseClientException(ioe); |
570
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
982 } |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
983 } |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
984 |
699
af22fa5567a6
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
690
diff
changeset
|
985 |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
986 public Collection<ArtifactStatisticsSet> calculateStatistics( |
570
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
987 ArtifactObject artifactFactory, |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
988 ArtifactObject currentArtifact) |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
989 throws ArtifactDatabaseClientException |
cbd397712ecf
Render an OpenLayers map with the layer even published after triggering shapefile and mapfile creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
565
diff
changeset
|
990 { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
991 log.debug("DefaultArtifactDatabaseClient.calculateStatistics"); |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
992 Collection<ArtifactStatisticsSet> resultValues = null; |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
993 |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
994 try { |
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
995 String targetName = "statistics"; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
996 String requestUrl = this.getArtifactUrl(artifactFactory, |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
997 currentArtifact) + "/" + targetName; |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
998 Document requestBody = this.createOutRequestBody(currentArtifact, |
583
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
573
diff
changeset
|
999 targetName, "", "text/xml", null); |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
1000 XMLUtils xmlUtils = new XMLUtils(); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
1001 InputStream is = this.doPostRequest(requestUrl, requestBody); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
1002 Document resultDocument = XMLUtils.readDocument(is); |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
1003 if (resultDocument != null) { |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1004 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
1005 NodeList statisticSetNodes = XMLUtils.getNodeSetXPath(resultDocument, |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
1006 "/art:statistics/art:statistic"); |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1007 resultValues = new ArrayList<ArtifactStatisticsSet> |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1008 (statisticSetNodes.getLength()); |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1009 for (int i = 0; i < statisticSetNodes.getLength(); i++) { |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1010 Element statisticSetNode = (Element)statisticSetNodes.item(i); |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1011 String name = statisticSetNode.getAttribute("name"); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1012 ArtifactStatisticsSet set = |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1013 new DefaultArtifactStatisticsSet(name); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
1014 NodeList resultNodes = XMLUtils.getNodeSetXPath(statisticSetNode, |
389
416ff31f6273
Removed local-name() method from xsl stylesheet and adjusted xpathes while reading xml documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
281
diff
changeset
|
1015 "art:statistic-value"); |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1016 if (resultNodes != null) { |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1017 for (int j = 0; j < resultNodes.getLength(); j++) { |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1018 Element statisticNode = (Element)resultNodes.item(j); |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1019 String statisticName = statisticNode. |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1020 getAttribute("name"); |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1021 String statisticValue = statisticNode. |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1022 getAttribute("value"); |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1023 set.addStatisticValues( |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1024 new DefaultArtifactStatisticValue |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1025 (statisticName,statisticValue)); |
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1026 } |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
1027 } |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1028 resultValues.add(set); |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
1029 } |
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
1030 } |
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
1031 } catch (IOException e) { |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
1032 log.error(e, e); |
35 | 1033 throw new ArtifactDatabaseClientException(e); |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
1034 } |
36
ad381cc47217
Format Code to max 80 Chars per Row
Tim Englich <tim.englich@intevation.de>
parents:
35
diff
changeset
|
1035 |
164
5570d9b3282f
Implemented a better GUI-Structure for displaying the Statisticdata. issue83
Tim Englich <tim.englich@intevation.de>
parents:
157
diff
changeset
|
1036 return resultValues; |
32
0f4362d75e9e
Adding StatisticsOutput to the GUI
Tim Englich <tim.englich@intevation.de>
parents:
30
diff
changeset
|
1037 } |
40
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
1038 |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
1039 public void setLocale(Locale locale) { |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
1040 this.locale = locale; |
23a4f196d7d6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
38
diff
changeset
|
1041 } |
402
b88e881e8e94
Added the first Implementation (not complete and not ready to use) for the Interface from the MapViewer to the GNV
Tim Englich <tim.englich@intevation.de>
parents:
394
diff
changeset
|
1042 |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
1043 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1044 public Collection<ArtifactObject> getArtifactFactoryMetaInformation( |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
1045 Collection<MapService> mapServices, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
1046 String geometry, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
1047 String srs) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
1048 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1049 log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1050 Collection<ArtifactObject> resultValues = null; |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1051 try { |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1052 this.initialize(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1053 Iterator<String> it = artifactDatabases.iterator(); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1054 Document requestBody = this.createMetaDataRequestBody(mapServices, |
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1055 geometry, |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1056 srs); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1057 while (it.hasNext()) { |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1058 String server = it.next(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1059 String url = server + "/service/metadata/"; |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1060 log.debug(url); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1061 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1062 InputStream resultStream = this.doPostRequest(url, requestBody); |
565
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
1063 resultValues = this.parseMetaDataResult(resultStream, server,geometry); |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1064 } |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1065 } catch (IOException e) { |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1066 log.error(e,e); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1067 } |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1068 return resultValues; |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1069 } |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1070 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1071 private Collection<ArtifactObject> parseMetaDataResult( |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1072 InputStream inputStream, |
665
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
1073 String server, |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
1074 String geometry) |
27f25b9ae9af
Improved exception handling. Display error messages after invalid user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
590
diff
changeset
|
1075 throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1076 XMLUtils xmlUtils = new XMLUtils(); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
1077 Document document = XMLUtils.readDocument(inputStream); |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1078 this.check4ExceptionReport(document); |
565
8355d7cacd09
Modified the Create-Artifact-Request-Body that a Geometry will be put into
Tim Englich <tim.englich@intevation.de>
parents:
561
diff
changeset
|
1079 return this.getArtifactFactories(document, server,geometry); |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1080 } |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1081 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1082 private Document createMetaDataRequestBody(Collection<MapService> mapServices, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1083 String geometry, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1084 String srs){ |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1085 log.debug("DefaultArtifactDatabaseClient.createMetaDataRequestBody"); |
690
254f062e334b
Added JavaDoc.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
684
diff
changeset
|
1086 Document document = XMLUtils.newDocument(); |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1087 Node rootNode = this.createArtifactElement(document, "GetMetaData"); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1088 document.appendChild(rootNode); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1089 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1090 Element locationNode = this.createArtifactElement(document, "location"); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1091 locationNode.setAttribute("srs", srs); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1092 locationNode.appendChild(document.createTextNode(geometry)); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1093 rootNode.appendChild(locationNode); |
681
15ac78a91d1b
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
679
diff
changeset
|
1094 |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1095 Element mapServicesNode = this.createArtifactElement(document, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1096 "mapservices"); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1097 Iterator<MapService> it = mapServices.iterator(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1098 while (it.hasNext()){ |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1099 MapService mapService = it.next(); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1100 Element mapServiceNode = this.createArtifactElement(document, |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1101 "mapservice"); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1102 mapServiceNode.setAttribute("id", mapService.getID()); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1103 mapServiceNode.setAttribute("type", mapService.getType()); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1104 mapServiceNode.setAttribute("url", mapService.getURL()); |
561
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1105 if (mapService.getLayer() != null){ |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1106 Iterator<Layer> layer = mapService.getLayer().iterator(); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1107 while (layer.hasNext()){ |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1108 Layer tmpLayer = layer.next(); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1109 Element layerNode = this.createArtifactElement(document, |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1110 "layer"); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1111 layerNode.setAttribute("id", tmpLayer.getID()); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1112 layerNode.setAttribute("name", tmpLayer.getName()); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1113 layerNode.setAttribute("isgrouplayer", |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1114 ""+tmpLayer.isGroupLayer()); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1115 layerNode.setAttribute("parentid", tmpLayer.parentID()); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1116 mapServiceNode.appendChild(layerNode); |
3f39756e0c8a
Fixed a NPE. Now it is possible to put an Mapservice without an Layer into
Tim Englich <tim.englich@intevation.de>
parents:
558
diff
changeset
|
1117 } |
558
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1118 } |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1119 mapServicesNode.appendChild(mapServiceNode); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1120 } |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1121 rootNode.appendChild(mapServicesNode); |
8032da9e8b70
Added further business logic for the MapViewer-Interface
Tim Englich <tim.englich@intevation.de>
parents:
402
diff
changeset
|
1122 return document; |
402
b88e881e8e94
Added the first Implementation (not complete and not ready to use) for the Interface from the MapViewer to the GNV
Tim Englich <tim.englich@intevation.de>
parents:
394
diff
changeset
|
1123 } |
13
2535158e2687
Chartoutput Added to the View
Tim Englich <tim.englich@intevation.de>
parents:
12
diff
changeset
|
1124 } |
700
89ade245ca7a
Using unix line endings only.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
699
diff
changeset
|
1125 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |