annotate src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotationStoreRestlet.java @ 22:b1fb0d117877

adding and listing groups via html works now. no editing of group membership yet. no authentication yet.
author casties
date Thu, 20 Sep 2012 17:42:26 +0200
parents aafa3884b2c4
children
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 AnnotationStoreRestlet extends BaseRestlet {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
16
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
17 public final String version = "AnnotationManagerN4J/AnnotationStore 0.1";
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(AnnotationStoreRestlet.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 public AnnotationStoreRestlet(Context context) {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
22 super(context);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
23 logger.debug("StoreRestlet!");
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
24 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
25
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
26 /*
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
27 * (non-Javadoc)
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
28 *
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
29 * @see org.restlet.Application#createInboundRoot()
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
30 */
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
31 @Override
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
32 public Restlet createInboundRoot() {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
33 // this.authenticator = createAuthenticator();
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
34
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
35 Router router = new Router(getContext());
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
36
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
37 router.attach("/groups", AnnotationStoreGroups.class);
22
b1fb0d117877 adding and listing groups via html works now.
casties
parents: 18
diff changeset
38 router.attach("/groups/", AnnotationStoreGroups.class);
18
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
39 router.attach("/groups/{id}", AnnotationStoreGroups.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
40
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
41 router.attach("/", AnnotationStoreInfo.class);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
42 // authenticator.setNext(router);
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
43 // return authenticator;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
44
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
45 return router;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
46 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
47
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
48
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
49 @Override
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
50 public String getVersion() {
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
51 return version;
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
52 }
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
53
aafa3884b2c4 new AnnotationStore restlet for HTML-UI.
casties
parents:
diff changeset
54 }