Class TaskWebApp
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.admin.annotator.TaskWebApp
-
@RequiredRole("admin") public class TaskWebApp extends APIRequestHandler
Server-side implementation of 'task' web-apps.This servlet manages configuration of annotator tasks, by presenting the given annotator's 'task' web-app, if there is one, and accepting a
setTaskParameters
request to finalize task configuration (whether there's a 'task' web-app or not).If there's a 'task' web-app, the first request should be to a path structured:
/api/admin/annotator/task/annotatorId/?taskIdThe resulting HTML document will then implement the web-app by requesting resources as required.
Once ready (or if the annotator implements no 'task' web-app) a request to
/api/admin/annotator/task/annotatorId/setTaskParameters
... with the body of the request representing the task parameters, if any.The response to the setTaskParameters request will be an HTML document for display to the user. However, no further interaction with the user is expected.
- 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 TaskWebApp(HashMap<String,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.
-
-