Class ExtWebApp


  • @RequiredRole("edit")
    public class ExtWebApp
    extends APIRequestHandler
    Server-side implementation of 'ext' web-apps.

    This servlet provides access to an annotator's 'ext' web-app, if there is one.

    If there's an 'ext' web-app, the first request should be to a path structured:
    /api/admin/annotator/ext/annotatorId/

    The resulting HTML document will then implement the web-app by requesting resources as required.

    'Ext' web-apps provide a mechanism for supplying extra information or data to the user (data visualizations, access to dictionary files, etc.) and are 'open-ended'; there's no final request that terminates the web-app, as there is with the 'config' and 'task' web-apps.

    Author:
    Robert Fromont robert@fromont.net.nz
    • Constructor Detail

      • ExtWebApp

        public ExtWebApp​(HashMap<String,​nzilbb.ag.automation.util.AnnotatorDescriptor> activeAnnotators)
        Constructor.
    • Method Detail

      • get

        public void get​(String method,
                        String requestURI,
                        String pathInfo,
                        String queryString,
                        UnaryOperator<String> requestHeaders,
                        InputStream requestBody,
                        OutputStream out,
                        Consumer<String> contentTypeConsumer,
                        Consumer<String> contentEncoding,
                        Consumer<Integer> httpStatus)
        GET handler.
        Parameters:
        method - HTTP method of the request.
        requestURI - The URL of the request, excluding the query string.
        pathInfo - The URL path.
        queryString - The URL's query string.
        requestHeaders - Access to HTTP request headers.
        requestBody - Access to the body of the request.
        out - Response body output stream.
        contentTypeConsumer - Receives the content type for specification in the response headers.
        contentEncoding - Receives the character encoding of the recponse.
        httpStatus - Receives the response status code, in case or error.