Class ParticipantAttributeOptions
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.TableServletBase
-
- nzilbb.labbcat.server.api.admin.elicit.options.ParticipantAttributeOptions
-
@RequiredRole("admin") public class ParticipantAttributeOptions extends TableServletBase
/api/admin/elicit/options/participant/task_id/attribute[/value] : Administration of options for a participant attribute that is elicitated during a task.Allows administration (Create/Read/Update/Delete) of participant-facing options for a participant attribute that's elicited during a task. This allows restriction of available options, and also rewording or translation of the labels each option value shows. JSON-encoded objects have the following attributes:
- task_id
- The database key for the record.
- attribute
- The participant attribute.
- value
- The possible value presented to the participant, which must be one of the valid labels for the given attribute.
- description
- The participant-facing text describing the option.
The following operations, specified by the HTTP method, are supported:
- POST
- Create a new record.
- Request Body - a JSON-encoded object representing the new record.
- Response Body - the standard JSON envelope, with the model as an object representing the new record.
- Response Status
- 200 : The record was successfully created.
- 409 : The record could not be added because it was already there.
- GET
- Read the records.
- Request Path - /api/admin/elicit/options/participant/task_id/attribute where task_id identifies the task and attribute identifies the attribute for which options may be presented to participants.
- Parameters
- pageNumber (integer) : The (zero-based) page to return.
- pageLength (integer) : How many rows per page (default is 20).
- Accept (string) : Equivalent of the "Accept" request header (see below).
- "Accept" request header/parameter "text/csv" to return records as Comma Separated Values. If not specified, records are returned as a JSON-encoded array of objects.
- Response Body - the standard JSON envelope, with the model as a corresponding list of records.
- Response Status
- 200 : The records could be listed.
- PUT
- Update an existing record, specified by the
task_name given in the request body.
- Request Body - a JSON-encoded object representing the record.
- Response Body - the standard JSON envelope, with the model as an object representing the record.
- Response Status
- 200 : The record was successfully updated.
- 404 : The record was not found.
- DELETE
- Delete an existing record.
- Request Path - /api/admin/elicit/options/participant/task_id/attribute/value where task_id identifies the task, attribute identifies the attribute, and value is the value to remove from the options presented to participants.
- Response Body - the standard JSON envelope, including a message if the request succeeds or an error explaining the reason for failure.
- Response Status
- 200 : The record was successfully deleted.
- 400 : One of task_id , attribute or value was missing.
- 404 : The record was not found.
- Author:
- Robert Fromont robert@fromont.net.nz
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class nzilbb.labbcat.server.api.TableServletBase
TableServletBase.DeleteCheck
-
-
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 ParticipantAttributeOptions()
-
Method Summary
-
Methods inherited from class nzilbb.labbcat.server.api.TableServletBase
delete, get, post, put
-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
getContext, GetSystemAttribute, init, writeResponse
-
-