Package nzilbb.labbcat.server.api.elicit
Class Steps
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.elicit.Steps
-
public class Steps extends APIRequestHandler
/api/elicit/steps : Elicitation task definition.Provides the definition of the given elicitation task.
Only the GET HTTP method is supported:
- GET
-
- URL parameters :
- task
- The name of the task to provide the definition of.
- Response Body - the standard JSON envelope, with the model as an object defining the structure of the elicitation task.
- Response Status
- 200 : Success.
- 400 : Task not specified.
- 404 : Task not found.
- URL parameters :
- Author:
- Robert Fromont
-
-
Field Summary
-
Fields inherited from class nzilbb.labbcat.server.api.APIRequestHandler
SC_BAD_REQUEST, SC_CONFLICT, SC_CREATED, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_METHOD_NOT_ALLOWED, SC_NOT_FOUND, SC_OK, SC_UNAUTHORIZED, SC_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description Steps()Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.json.JsonArrayBuilderArrayFromResultSet(ResultSet rs)Constructs a JSON array of object, one for each row returned by the given ResultSet, each object having a value set for each field in the ResultSet.javax.json.JsonObjectget(String remoteUser, RequestParameters requestParameters, Consumer<String> fileName, Consumer<Integer> httpStatus)The GET method for the servlet.javax.json.JsonArrayBuildergetChildSteps(int taskId, int parentId, PreparedStatement sqlChildSteps, PreparedStatement sqlField, PreparedStatement sqlFieldOptions)Gets the child steps of the given step.static javax.json.JsonObjectBuilderObjectFromResultSet(ResultSet row)Constructs a JSON object with all the fields for a given ResultSet RowvoidsetAttributeDefinition(javax.json.JsonObjectBuilder step, String attribute, int taskId, PreparedStatement sqlField, PreparedStatement sqlFieldOptions)Sets the definition for the participant/transcript attribute for the given step, if any.-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
getContext, GetSystemAttribute, init, writeResponse
-
-
-
-
Method Detail
-
get
public javax.json.JsonObject get(String remoteUser, RequestParameters requestParameters, Consumer<String> fileName, Consumer<Integer> httpStatus)
The GET method for the servlet.- Parameters:
remoteUser- The user's ID if any.requestParameters- Request parameter map.fileName- Receives the filename for specification in the response headers.httpStatus- Receives the response status code, in case of error.- Returns:
- JSON-encoded object representing the response
-
ObjectFromResultSet
public static javax.json.JsonObjectBuilder ObjectFromResultSet(ResultSet row) throws Exception
Constructs a JSON object with all the fields for a given ResultSet Row- Parameters:
row-- Returns:
- A JsonObjectBuilder with a value set for each of the ResultSet fields
- Throws:
Exception
-
ArrayFromResultSet
public static javax.json.JsonArrayBuilder ArrayFromResultSet(ResultSet rs) throws Exception
Constructs a JSON array of object, one for each row returned by the given ResultSet, each object having a value set for each field in the ResultSet.- Parameters:
rs-- Returns:
- A Vector of Hashtable objects
- Throws:
Exception
-
getChildSteps
public javax.json.JsonArrayBuilder getChildSteps(int taskId, int parentId, PreparedStatement sqlChildSteps, PreparedStatement sqlField, PreparedStatement sqlFieldOptions) throws ExceptionGets the child steps of the given step.- Throws:
Exception
-
setAttributeDefinition
public void setAttributeDefinition(javax.json.JsonObjectBuilder step, String attribute, int taskId, PreparedStatement sqlField, PreparedStatement sqlFieldOptions) throws ExceptionSets the definition for the participant/transcript attribute for the given step, if any.- Throws:
Exception
-
-