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

Last change on this file since 72:4c2cea836bc0 was 72:4c2cea836bc0, checked in by casties, 10 years ago

restlet 2.1 works now. (it's the start() method, stupid!)

File size: 2.4 KB
Line 
1/**
2 *
3 */
4package de.mpiwg.itgroup.annotations.restlet;
5
6/*
7 * #%L
8 * AnnotationManager
9 * %%
10 * Copyright (C) 2012 - 2014 MPIWG Berlin
11 * %%
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as
14 * published by the Free Software Foundation, either version 3 of the
15 * License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 * GNU General Lesser Public License for more details.
21 *
22 * You should have received a copy of the GNU General Lesser Public
23 * License along with this program.  If not, see
24 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
25 * #L%
26 */
27
28import org.apache.log4j.Logger;
29import org.restlet.Restlet;
30import org.restlet.routing.Router;
31
32/**
33 * @author casties
34 *
35 */
36public class AnnotatorRestlet extends BaseRestlet {
37
38    public final String version = "AnnotationManagerN4J/Annotator 0.3.2";
39
40    public static Logger logger = Logger.getLogger(AnnotatorRestlet.class);
41
42    /*
43     * (non-Javadoc)
44     *
45     * @see org.restlet.Application#createInboundRoot()
46     */
47    @Override
48    public Restlet createInboundRoot() {
49        // this.authenticator = createAuthenticator();
50
51        Router router = new Router(getContext());
52
53        router.attach("/annotations", AnnotatorAnnotations.class);
54        router.attach("/annotations/{id}", AnnotatorAnnotations.class);
55        router.attach("/search", AnnotatorSearch.class);
56        router.attach("/groups", AnnotatorGroups.class);
57        router.attach("/tags", AnnotatorTags.class);
58        router.attach("/tags/{id}", AnnotatorTags.class);
59        router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class);
60        router.attach("/resources", AnnotatorResources.class);
61        router.attach("/resources/{id}", AnnotatorResources.class);
62        router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class);
63        router.attach("/", AnnotatorInfo.class);
64        // authenticator.setNext(router);
65        // return authenticator;
66
67        return router;
68    }
69
70    /* (non-Javadoc)
71     * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion()
72     */
73    @Override
74    public String getVersion() {
75        return version;
76    }
77
78}
Note: See TracBrowser for help on using the repository browser.