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
|
58
|
17 public final String version = "AnnotationManagerN4J/Annotator 0.2.4";
|
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 }
|