Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/XMLService.java @ 380:9798e4d83681
Services are now able to return more than just XML documents.
artifacts/trunk@4188 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 03 Apr 2012 11:15:10 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
379:95ff5a25a339 | 380:9798e4d83681 |
---|---|
1 /* | |
2 * Copyright (c) 2010 by Intevation GmbH | |
3 * | |
4 * This program is free software under the LGPL (>=v2.1) | |
5 * Read the file LGPL.txt coming with the software for details | |
6 * or visit http://www.gnu.org/licenses/ if it does not exist. | |
7 */ | |
8 | |
9 package de.intevation.artifactdatabase; | |
10 | |
11 import de.intevation.artifacts.CallMeta; | |
12 import de.intevation.artifacts.Service; | |
13 import de.intevation.artifacts.GlobalContext; | |
14 | |
15 import de.intevation.artifacts.common.utils.XMLUtils; | |
16 | |
17 import org.apache.log4j.Logger; | |
18 | |
19 import org.w3c.dom.Document; | |
20 | |
21 /** | |
22 * Trivial implementation of an artifact database service. Useful to | |
23 * be subclassed. | |
24 * | |
25 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | |
26 */ | |
27 public class XMLService | |
28 extends DefaultService | |
29 { | |
30 private static Logger logger = Logger.getLogger(XMLService.class); | |
31 | |
32 @Override | |
33 public Service.Output process( | |
34 Document data, | |
35 GlobalContext globalContext, | |
36 CallMeta callMeta | |
37 ) { | |
38 return new Output( | |
39 processXML(data, globalContext, callMeta), | |
40 "application/xml"); | |
41 } | |
42 | |
43 public Document processXML( | |
44 Document data, | |
45 GlobalContext globalContext, | |
46 CallMeta callMeta | |
47 ) { | |
48 return XMLUtils.newDocument(); | |
49 } | |
50 } | |
51 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |