Mercurial > hg > AnnotationManagerN4J
annotate src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java @ 57:4efb21cf0ce0
new non-authorized mode without tokens. enabled by default. configured with annotationmanager.authorization=false property.
author | casties |
---|---|
date | Tue, 20 Nov 2012 17:56:35 +0100 |
parents | a52c597075dc |
children | f5c0e6df7e88 |
rev | line source |
---|---|
18 | 1 /** |
2 * | |
3 */ | |
4 package de.mpiwg.itgroup.annotations.restlet; | |
5 | |
6 import org.apache.log4j.Logger; | |
7 import org.restlet.Context; | |
8 import org.restlet.Restlet; | |
9 import org.restlet.routing.Router; | |
10 | |
11 /** | |
12 * @author casties | |
13 * | |
14 */ | |
15 public class AnnotatorRestlet extends BaseRestlet { | |
16 | |
57
4efb21cf0ce0
new non-authorized mode without tokens. enabled by default. configured with annotationmanager.authorization=false property.
casties
parents:
52
diff
changeset
|
17 public final String version = "AnnotationManagerN4J/Annotator 0.2.3"; |
18 | 18 |
19 public static Logger logger = Logger.getLogger(AnnotatorRestlet.class); | |
20 | |
21 /** | |
22 * @param context | |
23 */ | |
24 public AnnotatorRestlet(Context context) { | |
25 super(context); | |
26 logger.debug("AnnotatorRestlet!"); | |
27 } | |
28 | |
29 /* | |
30 * (non-Javadoc) | |
31 * | |
32 * @see org.restlet.Application#createInboundRoot() | |
33 */ | |
34 @Override | |
35 public Restlet createInboundRoot() { | |
36 // this.authenticator = createAuthenticator(); | |
37 | |
38 Router router = new Router(getContext()); | |
39 | |
40 router.attach("/annotations", AnnotatorAnnotations.class); | |
41 router.attach("/annotations/{id}", AnnotatorAnnotations.class); | |
42 router.attach("/search", AnnotatorSearch.class); | |
43 router.attach("/groups", AnnotatorGroups.class); | |
28 | 44 router.attach("/tags", AnnotatorTags.class); |
45 router.attach("/tags/{id}", AnnotatorTags.class); | |
46 router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class); | |
44 | 47 router.attach("/resources", AnnotatorResources.class); |
48 router.attach("/resources/{id}", AnnotatorResources.class); | |
49 router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class); | |
18 | 50 router.attach("/", AnnotatorInfo.class); |
51 // authenticator.setNext(router); | |
52 // return authenticator; | |
53 | |
54 return router; | |
55 } | |
56 | |
57 /* (non-Javadoc) | |
58 * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion() | |
59 */ | |
60 @Override | |
61 public String getVersion() { | |
62 return version; | |
63 } | |
64 | |
65 } |