annotate src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java @ 58:f5c0e6df7e88

made uri prefixes in store configurable.
author casties
date Tue, 20 Nov 2012 18:23:52 +0100
parents 4efb21cf0ce0
children 15569aa35d62
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
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
6 import org.apache.log4j.Logger;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
7 import org.restlet.Context;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
8 import org.restlet.Restlet;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
9 import org.restlet.routing.Router;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
10
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
11 /**
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
12 * @author casties
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
13 *
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
14 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
15 public class AnnotatorRestlet extends BaseRestlet {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
16
58
f5c0e6df7e88 made uri prefixes in store configurable.
casties
parents: 57
diff changeset
17 public final String version = "AnnotationManagerN4J/Annotator 0.2.4";
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
19 public static Logger logger = Logger.getLogger(AnnotatorRestlet.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
20
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
21 /**
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
22 * @param context
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
23 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
24 public AnnotatorRestlet(Context context) {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
25 super(context);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
26 logger.debug("AnnotatorRestlet!");
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
27 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
28
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
29 /*
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
30 * (non-Javadoc)
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
31 *
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
32 * @see org.restlet.Application#createInboundRoot()
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
33 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
34 @Override
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
35 public Restlet createInboundRoot() {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
36 // this.authenticator = createAuthenticator();
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
37
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
38 Router router = new Router(getContext());
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
39
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
40 router.attach("/annotations", AnnotatorAnnotations.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
41 router.attach("/annotations/{id}", AnnotatorAnnotations.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
42 router.attach("/search", AnnotatorSearch.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
43 router.attach("/groups", AnnotatorGroups.class);
28
f4ed2ed33e5b Restinterface zur Anzeige von Tags hinzugefuegt-
dwinter
parents: 18
diff changeset
44 router.attach("/tags", AnnotatorTags.class);
f4ed2ed33e5b Restinterface zur Anzeige von Tags hinzugefuegt-
dwinter
parents: 18
diff changeset
45 router.attach("/tags/{id}", AnnotatorTags.class);
f4ed2ed33e5b Restinterface zur Anzeige von Tags hinzugefuegt-
dwinter
parents: 18
diff changeset
46 router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class);
44
5e9d90461929 rest interface for resources
dwinter
parents: 28
diff changeset
47 router.attach("/resources", AnnotatorResources.class);
5e9d90461929 rest interface for resources
dwinter
parents: 28
diff changeset
48 router.attach("/resources/{id}", AnnotatorResources.class);
5e9d90461929 rest interface for resources
dwinter
parents: 28
diff changeset
49 router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class);
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
50 router.attach("/", AnnotatorInfo.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
51 // authenticator.setNext(router);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
52 // return authenticator;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
53
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
54 return router;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
55 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
56
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
57 /* (non-Javadoc)
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
58 * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion()
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
59 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
60 @Override
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
61 public String getVersion() {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
62 return version;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
63 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
64
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
65 }