18
|
1 /**
|
|
2 *
|
|
3 */
|
|
4 package de.mpiwg.itgroup.annotations.restlet;
|
|
5
|
70
|
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
|
18
|
28 import org.restlet.Restlet;
|
|
29 import org.restlet.routing.Router;
|
|
30
|
|
31 /**
|
|
32 * @author casties
|
|
33 *
|
|
34 */
|
|
35 public class AnnotatorRestlet extends BaseRestlet {
|
|
36
|
88
|
37 public final String version = "AnnotationManagerN4J/Annotator 0.5.0";
|
18
|
38
|
|
39 /*
|
|
40 * (non-Javadoc)
|
|
41 *
|
|
42 * @see org.restlet.Application#createInboundRoot()
|
|
43 */
|
|
44 @Override
|
|
45 public Restlet createInboundRoot() {
|
|
46 // this.authenticator = createAuthenticator();
|
|
47
|
|
48 Router router = new Router(getContext());
|
|
49
|
|
50 router.attach("/annotations", AnnotatorAnnotations.class);
|
|
51 router.attach("/annotations/{id}", AnnotatorAnnotations.class);
|
|
52 router.attach("/search", AnnotatorSearch.class);
|
|
53 router.attach("/groups", AnnotatorGroups.class);
|
28
|
54 router.attach("/tags", AnnotatorTags.class);
|
|
55 router.attach("/tags/{id}", AnnotatorTags.class);
|
|
56 router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class);
|
44
|
57 router.attach("/resources", AnnotatorResources.class);
|
|
58 router.attach("/resources/{id}", AnnotatorResources.class);
|
|
59 router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class);
|
18
|
60 router.attach("/", AnnotatorInfo.class);
|
|
61 // authenticator.setNext(router);
|
|
62 // return authenticator;
|
|
63
|
|
64 return router;
|
|
65 }
|
|
66
|
|
67 /* (non-Javadoc)
|
|
68 * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion()
|
|
69 */
|
|
70 @Override
|
|
71 public String getVersion() {
|
|
72 return version;
|
|
73 }
|
|
74
|
|
75 }
|