Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/MetaDataServiceImpl.java @ 276:f4c8ce11df33
UI stub for data cage
flys-client/trunk@1902 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 11 May 2011 14:34:15 +0000 |
parents | 44a340c9becc |
children | f33af25b7490 |
comparison
equal
deleted
inserted
replaced
275:8264b02091ef | 276:f4c8ce11df33 |
---|---|
1 package de.intevation.flys.client.server; | 1 package de.intevation.flys.client.server; |
2 | 2 |
3 import java.util.List; | 3 import java.util.List; |
4 import java.util.ArrayList; | |
5 | |
6 import org.w3c.dom.Document; | |
7 import org.w3c.dom.Element; | |
8 import org.w3c.dom.Node; | |
9 import org.w3c.dom.NodeList; | |
4 | 10 |
5 import com.google.gwt.user.server.rpc.RemoteServiceServlet; | 11 import com.google.gwt.user.server.rpc.RemoteServiceServlet; |
12 | |
13 import de.intevation.artifacts.common.ArtifactNamespaceContext; | |
14 | |
15 import de.intevation.artifacts.common.utils.XMLUtils; | |
6 | 16 |
7 import de.intevation.flys.client.shared.exceptions.ServerException; | 17 import de.intevation.flys.client.shared.exceptions.ServerException; |
8 | 18 |
9 import de.intevation.flys.client.client.services.MetaDataService; | 19 import de.intevation.flys.client.client.services.MetaDataService; |
10 | 20 |
21 import de.intevation.artifacts.httpclient.exceptions.ConnectionException; | |
22 | |
23 import de.intevation.artifacts.httpclient.http.HttpClient; | |
24 import de.intevation.artifacts.httpclient.http.HttpClientImpl; | |
25 | |
11 public class MetaDataServiceImpl | 26 public class MetaDataServiceImpl |
12 extends RemoteServiceServlet | 27 extends RemoteServiceServlet |
13 implements MetaDataService | 28 implements MetaDataService |
14 { | 29 { |
15 public List getMetaData(String url, String name) | 30 public static final String ERROR_NO_META_DATA_FOUND = |
31 "error_no_meta_data_found"; | |
32 | |
33 public List getMetaData(String url, String locale, String river) | |
16 throws ServerException | 34 throws ServerException |
17 { | 35 { |
18 return null; | 36 System.out.println("MetaDataService.getDistanceInfo"); |
37 | |
38 Document doc = XMLUtils.newDocument(); | |
39 | |
40 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( | |
41 doc, | |
42 ArtifactNamespaceContext.NAMESPACE_URI, | |
43 ArtifactNamespaceContext.NAMESPACE_PREFIX); | |
44 | |
45 Element riverEl = ec.create("river"); | |
46 | |
47 riverEl.setTextContent(river); | |
48 | |
49 doc.appendChild(riverEl); | |
50 | |
51 HttpClient client = new HttpClientImpl(url, locale); | |
52 | |
53 try { | |
54 Document result = client.callService(url, "metadata", doc); | |
55 | |
56 return new ArrayList(); | |
57 } | |
58 catch (ConnectionException ce) { | |
59 System.err.println(ce.getLocalizedMessage()); | |
60 } | |
61 | |
62 throw new ServerException(ERROR_NO_META_DATA_FOUND); | |
19 } | 63 } |
20 } | 64 } |
21 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 65 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |