source: AnnotationManagerN4J/src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java @ 57:4efb21cf0ce0

Last change on this file since 57:4efb21cf0ce0 was 57:4efb21cf0ce0, checked in by casties, 11 years ago

new non-authorized mode without tokens. enabled by default. configured with annotationmanager.authorization=false property.

File size: 1.8 KB
Line 
1/**
2 *
3 */
4package de.mpiwg.itgroup.annotations.restlet;
5
6import org.apache.log4j.Logger;
7import org.restlet.Context;
8import org.restlet.Restlet;
9import org.restlet.routing.Router;
10
11/**
12 * @author casties
13 *
14 */
15public class AnnotatorRestlet extends BaseRestlet {
16
17    public final String version = "AnnotationManagerN4J/Annotator 0.2.3";
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);
44        router.attach("/tags", AnnotatorTags.class);
45        router.attach("/tags/{id}", AnnotatorTags.class);
46        router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class);
47        router.attach("/resources", AnnotatorResources.class);
48        router.attach("/resources/{id}", AnnotatorResources.class);
49        router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class);
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}
Note: See TracBrowser for help on using the repository browser.