Interface IPublix

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      play.mvc.Result abortStudy​(play.mvc.Http.Request request, StudyResult studyResult, java.lang.String message)
      HTTP type: GET request Aborts the study run (StudyResult state will be ABORTED).
      play.mvc.Result downloadResultFile​(play.mvc.Http.Request request, StudyResult studyResult, java.lang.String filename, java.lang.String componentId)
      HTTP type: GET request Downloads a result file that was previously uploded.
      play.mvc.Result finishStudy​(play.mvc.Http.Request request, StudyResult studyResult, java.lang.Boolean successful, java.lang.String message)
      HTTP type: GET request Finishes the study run (StudyResult state will be FINISHED or FAIL).
      play.mvc.Result getInitData​(play.mvc.Http.Request request, StudyResult studyResult, Component component)
      HTTP type: GET request Returns the init data provided by jatos.js to the experimenters code: study's properties, component's properties, and study's session data.
      play.mvc.Result heartbeat​(play.mvc.Http.Request request, StudyResult studyResult)
      HTTP type: POST request Heartbeat of a study result: used to give the user an idea of when the study run was last seen.
      play.mvc.Result log​(play.mvc.Http.Request request, StudyResult studyResult, Component component)
      HTTP type: POST request With this method the client side can log into the server's log.
      play.mvc.Result setStudySessionData​(play.mvc.Http.Request request, StudyResult studyResult)
      HTTP type: POST request Expects the study's session data in JSON format and sets them in the study result that belong to the specified study.
      play.mvc.Result startComponent​(play.mvc.Http.Request request, StudyResult studyResult, Component component, java.lang.String message)
      HTTP type: GET request Starts the component
      play.mvc.Result startStudy​(play.mvc.Http.Request request, StudyLink studyLink)
      HTTP type: GET request Starts the study.
      play.mvc.Result submitOrAppendResultData​(play.mvc.Http.Request request, StudyResult studyResult, Component component, boolean append)
      HTTP type: PUT/POST request Persists the submitted data in the ComponentResult specified by the given study and component ID.
      play.mvc.Result uploadResultFile​(play.mvc.Http.Request request, StudyResult studyResult, Component component, java.lang.String filename)
      HTTP type: POST request Uploads a result file
    • Method Detail

      • startStudy

        play.mvc.Result startStudy​(play.mvc.Http.Request request,
                                   StudyLink studyLink)
                            throws PublixException
        HTTP type: GET request Starts the study. Then redirects to start the first component.
        Throws:
        PublixException
      • getInitData

        play.mvc.Result getInitData​(play.mvc.Http.Request request,
                                    StudyResult studyResult,
                                    Component component)
                             throws PublixException,
                                    java.io.IOException
        HTTP type: GET request Returns the init data provided by jatos.js to the experimenters code: study's properties, component's properties, and study's session data.
        Throws:
        PublixException
        java.io.IOException
      • setStudySessionData

        play.mvc.Result setStudySessionData​(play.mvc.Http.Request request,
                                            StudyResult studyResult)
                                     throws PublixException
        HTTP type: POST request Expects the study's session data in JSON format and sets them in the study result that belong to the specified study. Study session data are individual for each study run and determined by the study running in the browser. The study session data are different from Play's session and stored within the study results.
        Throws:
        PublixException
      • heartbeat

        play.mvc.Result heartbeat​(play.mvc.Http.Request request,
                                  StudyResult studyResult)
                           throws PublixException
        HTTP type: POST request Heartbeat of a study result: used to give the user an idea of when the study run was last seen. jatos.js periodically sends a request to this endpoint. The time when this request arrives is stored in StudyResult's lastSeenDate field.
        Throws:
        PublixException
      • submitOrAppendResultData

        play.mvc.Result submitOrAppendResultData​(play.mvc.Http.Request request,
                                                 StudyResult studyResult,
                                                 Component component,
                                                 boolean append)
                                          throws PublixException
        HTTP type: PUT/POST request Persists the submitted data in the ComponentResult specified by the given study and component ID. PUT: Already submitted data will be overwritten. POST: Keeps the current data and appends the new data to the end.
        Throws:
        PublixException
      • uploadResultFile

        play.mvc.Result uploadResultFile​(play.mvc.Http.Request request,
                                         StudyResult studyResult,
                                         Component component,
                                         java.lang.String filename)
                                  throws PublixException
        HTTP type: POST request Uploads a result file
        Throws:
        PublixException
      • downloadResultFile

        play.mvc.Result downloadResultFile​(play.mvc.Http.Request request,
                                           StudyResult studyResult,
                                           java.lang.String filename,
                                           java.lang.String componentId)
                                    throws PublixException
        HTTP type: GET request Downloads a result file that was previously uploded. One can limit the search to a specific componentId which is useful if the same filename was used by different components.
        Throws:
        PublixException
      • abortStudy

        play.mvc.Result abortStudy​(play.mvc.Http.Request request,
                                   StudyResult studyResult,
                                   java.lang.String message)
                            throws PublixException
        HTTP type: GET request Aborts the study run (StudyResult state will be ABORTED). Optionally a message can be given describing the reasons for the abortion.
        Throws:
        PublixException
      • finishStudy

        play.mvc.Result finishStudy​(play.mvc.Http.Request request,
                                    StudyResult studyResult,
                                    java.lang.Boolean successful,
                                    java.lang.String message)
                             throws PublixException
        HTTP type: GET request Finishes the study run (StudyResult state will be FINISHED or FAIL). Optionally, it can be specified whether the study run was successful and a message can be logged.
        Throws:
        PublixException