1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package eu.ehri.extension;
21
22 import eu.ehri.extension.base.AbstractAccessibleResource;
23 import eu.ehri.extension.base.AbstractResource;
24 import eu.ehri.extension.base.GetResource;
25 import eu.ehri.project.definitions.Entities;
26 import eu.ehri.project.exceptions.ItemNotFound;
27 import eu.ehri.project.models.events.Version;
28 import org.neo4j.graphdb.GraphDatabaseService;
29
30 import javax.ws.rs.GET;
31 import javax.ws.rs.Path;
32 import javax.ws.rs.PathParam;
33 import javax.ws.rs.core.Context;
34 import javax.ws.rs.core.Response;
35
36
37
38
39 @Path(AbstractResource.RESOURCE_ENDPOINT_PREFIX + "/" + Entities.VERSION)
40 public class VersionResource extends AbstractAccessibleResource<Version> implements GetResource {
41
42 public VersionResource(@Context GraphDatabaseService database) {
43 super(database, Version.class);
44 }
45
46
47
48
49
50
51
52 @GET
53 @Path("{id:[^/]+}")
54 @Override
55 public Response get(@PathParam("id") String id) throws ItemNotFound {
56 return getItem(id);
57 }
58 }