Class 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.

    Author:
    Robert Fromont
    • Constructor Detail

      • Steps

        public Steps()
        Constructor
    • 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
      • setAttributeDefinition

        public void setAttributeDefinition​(javax.json.JsonObjectBuilder step,
                                           String attribute,
                                           int taskId,
                                           PreparedStatement sqlField,
                                           PreparedStatement sqlFieldOptions)
                                    throws Exception
        Sets the definition for the participant/transcript attribute for the given step, if any.
        Throws:
        Exception