Class ConfigWebApp
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.admin.annotator.ConfigWebApp
-
@RequiredRole("admin") public class ConfigWebApp extends APIRequestHandler
Server-side implementation of 'config' web-apps.This servlet manages post-installation configuration of annotators, by presenting the given annotator's 'config' web-app, if there is one, and accepting a
setConfig
request to finalize installation (whether there's a 'config' web-app or not).If there's a 'config' web-app, the first request should be to a path structured:
/api/admin/annotator/config/annotatorId/The resulting HTML document will then implement the web-app by requesting resources as required.
Once ready (or if the annotator implements no 'config' web-app) a request to
/api/admin/annotator/config/annotatorId/setConfig
... with the body of the request representing the annotator configuration, if any.The response to the setConfig request will be an HTML document that renders a progress bar, and manages updating progress as the annotator completes its configuration.
- Author:
- Robert Fromont robert@fromont.net.nz
-
-
Field Summary
-
Fields inherited from class nzilbb.labbcat.server.api.APIRequestHandler
SC_BAD_REQUEST, SC_CONFLICT, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_METHOD_NOT_ALLOWED, SC_NOT_FOUND, SC_OK, SC_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description ConfigWebApp(HashMap<String,nzilbb.ag.automation.util.AnnotatorDescriptor> activeAnnotators)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
GetSystemAttribute, init, writeResponse
-
-
-
-
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.
-
-