Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/server/FeedServiceImpl.java @ 1513:f43862cc1e6e
Added new artifact 'MapArtifact' for module 'new map'. This allows to open an
existing map project.
flys-client/trunk@3658 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 Jan 2012 10:46:44 +0000 |
parents | bc06a671ef60 |
children | e8706fec0ee9 |
rev | line source |
---|---|
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.server; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 import org.w3c.dom.Document; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
5 import org.apache.log4j.Logger; |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
6 |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import com.google.gwt.user.server.rpc.RemoteServiceServlet; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifacts.common.utils.ClientProtocolUtils; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.common.utils.XMLUtils; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.httpclient.exceptions.ConnectionException; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.httpclient.http.HttpClient; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.httpclient.http.HttpClientImpl; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.httpclient.http.response.DocumentResponseHandler; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.client.shared.exceptions.ServerException; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.client.shared.model.Artifact; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.client.shared.model.Data; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.client.shared.model.DataItem; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.client.client.services.FeedService; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 /** |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 * This interface provides a method that bundles the artifact specific |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 * operation FEED. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 */ |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 public class FeedServiceImpl |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 extends RemoteServiceServlet |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 implements FeedService |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
32 private static final Logger logger = Logger.getLogger(FeedServiceImpl.class); |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
33 |
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
34 |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 /** XPath that points to the result type of a feed or advance operation.*/ |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 public static final String XPATH_RESULT = "/art:result/@art:type"; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 /** XPath that points to the result type of a feed or advance operation.*/ |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 public static final String XPATH_RESULT_MSG = "/art:result/text()"; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 /** A constant that marks errors.*/ |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 public static final String OPERATION_FAILURE = "FAILURE"; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 /** The error message key that is thrown if an error occured while feeding |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 * new data.*/ |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 public static final String ERROR_FEED_DATA = "error_feed_data"; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 /** |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 * This method triggers the FEED operation. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 * |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 * @param artifact The artifact that needs to be fed. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 * @param data An array of Data objects that contain the information that |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 * are used for the FEED operation. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 * |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 * @return a new artifact parsed from the description of FEED. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 */ |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 public Artifact feed( |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 String locale, |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 Artifact artifact, |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 Data[] data) |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 throws ServerException |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
64 logger.info("StepForwardServiceImpl.feed"); |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1367
diff
changeset
|
66 String url = getServletContext().getInitParameter("server-url"); |
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1367
diff
changeset
|
67 |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 Document feed = ClientProtocolUtils.newFeedDocument( |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 artifact.getUuid(), |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 artifact.getHash(), |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 createKVP(data)); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 HttpClient client = new HttpClientImpl(url, locale); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 try { |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 Document description = (Document) client.feed( |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 new de.intevation.artifacts.httpclient.objects.Artifact( |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
78 artifact.getUuid(), |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 artifact.getHash()), |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 feed, |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 new DocumentResponseHandler()); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 if (description == null) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
84 logger.warn("StepForwardService.feed() - FAILED"); |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 throw new ServerException(ERROR_FEED_DATA); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
88 String result = XMLUtils.xpathString( |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 description, |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 XPATH_RESULT, |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 ArtifactNamespaceContext.INSTANCE); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 if (result == null || !result.equals(OPERATION_FAILURE)) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
94 logger.debug("StepForwardService.feed() - SUCCESS"); |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 return (Artifact) new FLYSArtifactCreator().create(description); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 else if (result != null && result.equals(OPERATION_FAILURE)) { |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 String msg = XMLUtils.xpathString( |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 description, |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 XPATH_RESULT_MSG, |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 ArtifactNamespaceContext.INSTANCE); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 throw new ServerException(msg); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 catch (ConnectionException ce) { |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
106 logger.error(ce, ce); |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 |
1367
ab8eb2f544f2
Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
853
diff
changeset
|
109 logger.warn("StepForwardService.feed() - FAILED"); |
851
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 throw new ServerException(ERROR_FEED_DATA); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 /** |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 * This method creates an array of key/value pairs from an array of Data |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
116 * objects. The string array is used as parameter for the feed() operation. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
117 * |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 * @param data The data that should be transformed into the string array. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 * |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
120 * @return a string array that contains key/value pairs. |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 */ |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 protected String[][] createKVP(Data[] data) { |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 String[][] kvp = new String[data.length][]; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 int i = 0; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 for (Data d: data) { |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 DataItem[] items = d.getItems(); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 String key = d.getLabel(); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 String value = items[0].getStringValue(); |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 kvp[i++] = new String[] { key, value }; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
135 return kvp; |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 } |
aa83a6a864b4
Added FeedService Implementation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |