annotate src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java @ 70:2b1e6df5e21a

added lgpl_v3 license information.
author casties
date Thu, 06 Mar 2014 15:09:04 +0100
parents 39bc52f9b102
children 4c2cea836bc0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
1 /**
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
2 *
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
3 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
4 package de.mpiwg.itgroup.annotations.restlet;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
5
70
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
6 /*
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
7 * #%L
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
8 * AnnotationManager
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
9 * %%
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
10 * Copyright (C) 2012 - 2014 MPIWG Berlin
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
11 * %%
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
12 * This program is free software: you can redistribute it and/or modify
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
13 * it under the terms of the GNU Lesser General Public License as
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
14 * published by the Free Software Foundation, either version 3 of the
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
15 * License, or (at your option) any later version.
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
16 *
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
17 * This program is distributed in the hope that it will be useful,
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
20 * GNU General Lesser Public License for more details.
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
21 *
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
22 * You should have received a copy of the GNU General Lesser Public
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
23 * License along with this program. If not, see
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
24 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
25 * #L%
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
26 */
2b1e6df5e21a added lgpl_v3 license information.
casties
parents: 68
diff changeset
27
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
28 import org.apache.log4j.Logger;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
29 import org.restlet.Context;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
30 import org.restlet.Restlet;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
31 import org.restlet.routing.Router;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
32
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
33 /**
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
34 * @author casties
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
35 *
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
36 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
37 public class AnnotatorRestlet extends BaseRestlet {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
38
68
39bc52f9b102 (hopefully) fixed issues with neo4j 2.0 transactions.
casties
parents: 63
diff changeset
39 public final String version = "AnnotationManagerN4J/Annotator 0.3.2";
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
40
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
41 public static Logger logger = Logger.getLogger(AnnotatorRestlet.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
42
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
43 /**
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
44 * @param context
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
45 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
46 public AnnotatorRestlet(Context context) {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
47 super(context);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
48 logger.debug("AnnotatorRestlet!");
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
49 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
50
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
51 /*
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
52 * (non-Javadoc)
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
53 *
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
54 * @see org.restlet.Application#createInboundRoot()
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
55 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
56 @Override
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
57 public Restlet createInboundRoot() {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
58 // this.authenticator = createAuthenticator();
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
59
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
60 Router router = new Router(getContext());
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
61
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
62 router.attach("/annotations", AnnotatorAnnotations.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
63 router.attach("/annotations/{id}", AnnotatorAnnotations.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
64 router.attach("/search", AnnotatorSearch.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
65 router.attach("/groups", AnnotatorGroups.class);
28
f4ed2ed33e5b Restinterface zur Anzeige von Tags hinzugefuegt-
dwinter
parents: 18
diff changeset
66 router.attach("/tags", AnnotatorTags.class);
f4ed2ed33e5b Restinterface zur Anzeige von Tags hinzugefuegt-
dwinter
parents: 18
diff changeset
67 router.attach("/tags/{id}", AnnotatorTags.class);
f4ed2ed33e5b Restinterface zur Anzeige von Tags hinzugefuegt-
dwinter
parents: 18
diff changeset
68 router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class);
44
5e9d90461929 rest interface for resources
dwinter
parents: 28
diff changeset
69 router.attach("/resources", AnnotatorResources.class);
5e9d90461929 rest interface for resources
dwinter
parents: 28
diff changeset
70 router.attach("/resources/{id}", AnnotatorResources.class);
5e9d90461929 rest interface for resources
dwinter
parents: 28
diff changeset
71 router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class);
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
72 router.attach("/", AnnotatorInfo.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
73 // authenticator.setNext(router);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
74 // return authenticator;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
75
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
76 return router;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
77 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
78
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
79 /* (non-Javadoc)
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
80 * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion()
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
81 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
82 @Override
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
83 public String getVersion() {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
84 return version;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
85 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
86
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
87 }