Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/rest/CollectionOutResource.java @ 473:d0ac790a6c89 dive4elements-move
Moved directories to org.dive4elements
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 10:57:18 +0200 |
parents | artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionOutResource.java@d9a99b28a847 |
children | 415df0fc4fa1 |
comparison
equal
deleted
inserted
replaced
472:783cc1b6b615 | 473:d0ac790a6c89 |
---|---|
1 /* | |
2 * Copyright (c) 2011 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 package de.intevation.artifactdatabase.rest; | |
9 | |
10 import de.intevation.artifacts.ArtifactDatabase; | |
11 import de.intevation.artifacts.ArtifactDatabaseException; | |
12 import de.intevation.artifacts.CallMeta; | |
13 | |
14 import org.apache.log4j.Logger; | |
15 | |
16 import org.restlet.Request; | |
17 | |
18 import org.w3c.dom.Document; | |
19 | |
20 | |
21 /** | |
22 * Resource to serve the out()-outputs of collections. | |
23 * | |
24 * @author <a href="mailto:ingo.weinzierl@intevation">Ingo Weinzierl</a> | |
25 */ | |
26 public class CollectionOutResource | |
27 extends BaseOutResource | |
28 { | |
29 /** The logger used in this class.*/ | |
30 private static Logger logger = Logger.getLogger(CollectionOutResource.class); | |
31 | |
32 /** server URL where to find the resource.*/ | |
33 public static final String PATH = "/collection/{uuid}/{type}"; | |
34 | |
35 | |
36 /** | |
37 * Returns the identifier of the collection. | |
38 * | |
39 * @return the identifier of the collection. | |
40 */ | |
41 protected String getIdentifier() { | |
42 Request request = getRequest(); | |
43 | |
44 return (String) request.getAttributes().get("uuid"); | |
45 } | |
46 | |
47 | |
48 protected String getType() { | |
49 Request request = getRequest(); | |
50 | |
51 return (String) request.getAttributes().get("type"); | |
52 } | |
53 | |
54 | |
55 /** | |
56 * Call the ArtifactDatabase.outCollection method. | |
57 */ | |
58 protected ArtifactDatabase.DeferredOutput doOut( | |
59 String identifier, | |
60 String type, | |
61 Document input, | |
62 ArtifactDatabase db, | |
63 CallMeta meta) | |
64 throws ArtifactDatabaseException | |
65 { | |
66 logger.debug("CollectionOutResource.doOut"); | |
67 | |
68 return db.outCollection(identifier, type, input, meta); | |
69 } | |
70 } | |
71 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |