view src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.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 f4ed2ed33e5b
line wrap: on
line source

/**
 * 
 */
package de.mpiwg.itgroup.annotations.restlet;

import org.apache.log4j.Logger;
import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;

/**
 * @author casties
 *
 */
public class AnnotatorRestlet extends BaseRestlet {

    public final String version = "AnnotationManagerN4J/Annotator 0.2.1";

    public static Logger logger = Logger.getLogger(AnnotatorRestlet.class);

    /**
     * @param context
     */
    public AnnotatorRestlet(Context context) {
        super(context);
        logger.debug("AnnotatorRestlet!");
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.restlet.Application#createInboundRoot()
     */
    @Override
    public Restlet createInboundRoot() {
        // this.authenticator = createAuthenticator();

        Router router = new Router(getContext());

        router.attach("/annotations", AnnotatorAnnotations.class);
        router.attach("/annotations/{id}", AnnotatorAnnotations.class);
        router.attach("/search", AnnotatorSearch.class);
        router.attach("/groups", AnnotatorGroups.class);

        router.attach("/", AnnotatorInfo.class);
        // authenticator.setNext(router);
        // return authenticator;

        return router;
    }

    /* (non-Javadoc)
     * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion()
     */
    @Override
    public String getVersion() {
        return version;
    }

}