Ignore:
Timestamp:
Feb 10, 2015, 4:45:56 PM (9 years ago)
Author:
casties
Branch:
default
Message:

added config option for webapp URL prefix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationsUiRestlet.java

    r75 r94  
    3535
    3636import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
     37import de.mpiwg.itgroup.annotations.restlet.utils.UrlPrefixFilter;
    3738
    3839/**
     
    5455    public Restlet createInboundRoot() {
    5556        // this.authenticator = createAuthenticator();
    56 
     57        Restlet root = null;
     58       
    5759        Router router = new Router(getContext());
    58 
    5960        router.attach("/groups", GroupsResource.class);
    6061        router.attach("/groups/", GroupsResource.class);
     
    7071        router.attach("/annotations/{id}", AnnotationResource.class);
    7172        router.attach("/annotations/{id}/", AnnotationResource.class);
    72 
    7373        router.attach("/", InfoResource.class);
     74        root = router;
     75       
     76        if (this.webappUriPrefix != null) {
     77                // add prefix path to url
     78                UrlPrefixFilter prefixFilter = new UrlPrefixFilter();
     79                prefixFilter.setPrefix(this.webappUriPrefix);;
     80                prefixFilter.setNext(root);
     81                root = prefixFilter;
     82        }
    7483
    7584        // use simple password verifier
     
    8796        guard.setVerifier(verifier);
    8897        // put everything through guard
    89         guard.setNext(router);
    90         return guard;
     98        guard.setNext(root);
     99        root = guard;
     100       
     101        return root;
    91102    }
    92103
Note: See TracChangeset for help on using the changeset viewer.