Package controllers.publix
Interface IPublix
-
- All Known Implementing Classes:
GeneralMultiplePublix,GeneralSinglePublix,JatosPublix,MTPublix,PersonalMultiplePublix,PersonalSinglePublix,Publix
public interface IPublixInterface to all Publix classes. With these API methods studies and components (running in the browser) can communicate (e.g. start, finish components/studies, retrieve/persist data, join a group) with the JATOS server. Group and batch channel are handled by the ChannelInterceptor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description play.mvc.ResultabortStudy(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.ResultdownloadResultFile(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.ResultfinishStudy(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.ResultgetInitData(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.Resultheartbeat(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.Resultlog(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.ResultsetStudySessionData(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.ResultstartComponent(play.mvc.Http.Request request, StudyResult studyResult, Component component, java.lang.String message)HTTP type: GET request Starts the componentplay.mvc.ResultstartStudy(play.mvc.Http.Request request, StudyLink studyLink)HTTP type: GET request Starts the study.play.mvc.ResultsubmitOrAppendResultData(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.ResultuploadResultFile(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 PublixExceptionHTTP type: GET request Starts the study. Then redirects to start the first component.- Throws:
PublixException
-
startComponent
play.mvc.Result startComponent(play.mvc.Http.Request request, StudyResult studyResult, Component component, java.lang.String message) throws PublixExceptionHTTP type: GET request Starts the component- Throws:
PublixException
-
getInitData
play.mvc.Result getInitData(play.mvc.Http.Request request, StudyResult studyResult, Component component) throws PublixException, java.io.IOExceptionHTTP 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:
PublixExceptionjava.io.IOException
-
setStudySessionData
play.mvc.Result setStudySessionData(play.mvc.Http.Request request, StudyResult studyResult) throws PublixExceptionHTTP 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 PublixExceptionHTTP 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 PublixExceptionHTTP 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 PublixExceptionHTTP 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 PublixExceptionHTTP 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 PublixExceptionHTTP 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 PublixExceptionHTTP 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
-
log
play.mvc.Result log(play.mvc.Http.Request request, StudyResult studyResult, Component component) throws PublixExceptionHTTP type: POST request With this method the client side can log into the server's log.- Throws:
PublixException
-
-