Package controllers.publix
Class Publix
- java.lang.Object
-
- play.mvc.Results
-
- play.mvc.Controller
-
- controllers.publix.Publix
-
- All Implemented Interfaces:
IPublix,play.mvc.Http.HeaderNames,play.mvc.Http.Status
- Direct Known Subclasses:
GeneralMultiplePublix,GeneralSinglePublix,JatosPublix,MTPublix,PersonalMultiplePublix,PersonalSinglePublix
@Singleton public abstract class Publix extends play.mvc.Controller implements IPublix
Abstract parent controller class for all worker type Publix classes
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentResultDaocomponentResultDaoprotected PublixErrorMessageserrorMessagesprotected group.GroupAdministrationgroupAdministrationprotected IdCookieServiceidCookieServiceprotected IOUtilsioUtilsprotected play.db.jpa.JPAApijpaprotected JsonUtilsjsonUtilsprotected PublixUtilspublixUtilsprotected controllers.publix.StudyAssetsstudyAssetsprotected StudyAuthorisationstudyAuthorisationprotected StudyLoggerstudyLoggerprotected StudyResultDaostudyResultDao-
Fields inherited from interface play.mvc.Http.HeaderNames
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_RANGES, ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, ACCESS_CONTROL_REQUEST_HEADERS, ACCESS_CONTROL_REQUEST_METHOD, AGE, ALLOW, AUTHORIZATION, CACHE_CONTROL, CONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_SECURITY_POLICY, CONTENT_SECURITY_POLICY_REPORT_ONLY, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPECT, EXPIRES, FORWARDED, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, REFERRER_POLICY, RETRY_AFTER, SERVER, SET_COOKIE, SET_COOKIE2, STRICT_TRANSPORT_SECURITY, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, WARNING, WWW_AUTHENTICATE, X_CONTENT_SECURITY_POLICY_NONCE_HEADER, X_CONTENT_TYPE_OPTIONS, X_FORWARDED_FOR, X_FORWARDED_HOST, X_FORWARDED_PORT, X_FORWARDED_PROTO, X_FRAME_OPTIONS, X_PERMITTED_CROSS_DOMAIN_POLICIES, X_REQUESTED_WITH, X_XSS_PROTECTION
-
Fields inherited from interface play.mvc.Http.Status
ACCEPTED, BAD_GATEWAY, BAD_REQUEST, CONFLICT, CONTINUE, CREATED, EXPECTATION_FAILED, FAILED_DEPENDENCY, FORBIDDEN, FOUND, GATEWAY_TIMEOUT, GONE, HTTP_VERSION_NOT_SUPPORTED, IM_A_TEAPOT, INSUFFICIENT_STORAGE, INTERNAL_SERVER_ERROR, LENGTH_REQUIRED, LOCKED, METHOD_NOT_ALLOWED, MOVED_PERMANENTLY, MULTI_STATUS, MULTIPLE_CHOICES, NETWORK_AUTHENTICATION_REQUIRED, NO_CONTENT, NON_AUTHORITATIVE_INFORMATION, NOT_ACCEPTABLE, NOT_FOUND, NOT_IMPLEMENTED, NOT_MODIFIED, OK, PARTIAL_CONTENT, PAYMENT_REQUIRED, PERMANENT_REDIRECT, PRECONDITION_FAILED, PRECONDITION_REQUIRED, PROXY_AUTHENTICATION_REQUIRED, REQUEST_ENTITY_TOO_LARGE, REQUEST_HEADER_FIELDS_TOO_LARGE, REQUEST_TIMEOUT, REQUEST_URI_TOO_LONG, REQUESTED_RANGE_NOT_SATISFIABLE, RESET_CONTENT, SEE_OTHER, SERVICE_UNAVAILABLE, SWITCHING_PROTOCOLS, TEMPORARY_REDIRECT, TOO_MANY_REQUESTS, UNAUTHORIZED, UNPROCESSABLE_ENTITY, UNSUPPORTED_MEDIA_TYPE, UPGRADE_REQUIRED, USE_PROXY
-
-
Constructor Summary
Constructors Constructor Description Publix(play.db.jpa.JPAApi jpa, PublixUtils publixUtils, StudyAuthorisation studyAuthorisation, group.GroupAdministration groupAdministration, IdCookieService idCookieService, PublixErrorMessages errorMessages, controllers.publix.StudyAssets studyAssets, JsonUtils jsonUtils, ComponentResultDao componentResultDao, StudyResultDao studyResultDao, StudyLogger studyLogger, IOUtils ioUtils)
-
Method Summary
All Methods Instance Methods Concrete 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.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-
Methods inherited from class play.mvc.Controller
changeLang, changeLang, clearLang, ctx, flash, flash, flash, lang, request, response, session, session, session, TODO, TODO
-
Methods inherited from class play.mvc.Results
badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, badRequest, contentDispositionHeader, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, created, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, forbidden, found, found, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, internalServerError, movedPermanently, movedPermanently, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, networkAuthenticationRequired, noContent, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notAcceptable, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, notFound, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, ok, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, paymentRequired, permanentRedirect, permanentRedirect, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, preconditionRequired, redirect, redirect, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, requestHeaderFieldsTooLarge, seeOther, seeOther, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, status, temporaryRedirect, temporaryRedirect, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, tooManyRequests, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unauthorized, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType, unsupportedMediaType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface controllers.publix.IPublix
startStudy
-
-
-
-
Field Detail
-
jpa
protected final play.db.jpa.JPAApi jpa
-
publixUtils
protected final PublixUtils publixUtils
-
studyAuthorisation
protected final StudyAuthorisation studyAuthorisation
-
groupAdministration
protected final group.GroupAdministration groupAdministration
-
idCookieService
protected final IdCookieService idCookieService
-
errorMessages
protected final PublixErrorMessages errorMessages
-
studyAssets
protected final controllers.publix.StudyAssets studyAssets
-
jsonUtils
protected final JsonUtils jsonUtils
-
componentResultDao
protected final ComponentResultDao componentResultDao
-
studyResultDao
protected final StudyResultDao studyResultDao
-
studyLogger
protected final StudyLogger studyLogger
-
ioUtils
protected final IOUtils ioUtils
-
-
Constructor Detail
-
Publix
public Publix(play.db.jpa.JPAApi jpa, PublixUtils publixUtils, StudyAuthorisation studyAuthorisation, group.GroupAdministration groupAdministration, IdCookieService idCookieService, PublixErrorMessages errorMessages, controllers.publix.StudyAssets studyAssets, JsonUtils jsonUtils, ComponentResultDao componentResultDao, StudyResultDao studyResultDao, StudyLogger studyLogger, IOUtils ioUtils)
-
-
Method Detail
-
startComponent
public play.mvc.Result startComponent(play.mvc.Http.Request request, StudyResult studyResult, Component component, java.lang.String message) throws PublixExceptionDescription copied from interface:IPublixHTTP type: GET request Starts the component- Specified by:
startComponentin interfaceIPublix- Throws:
PublixException
-
getInitData
public play.mvc.Result getInitData(play.mvc.Http.Request request, StudyResult studyResult, Component component) throws PublixException, java.io.IOExceptionDescription copied from interface:IPublixHTTP 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.- Specified by:
getInitDatain interfaceIPublix- Throws:
PublixExceptionjava.io.IOException
-
setStudySessionData
public play.mvc.Result setStudySessionData(play.mvc.Http.Request request, StudyResult studyResult) throws PublixExceptionDescription copied from interface:IPublixHTTP 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.- Specified by:
setStudySessionDatain interfaceIPublix- Throws:
PublixException
-
heartbeat
public play.mvc.Result heartbeat(play.mvc.Http.Request request, StudyResult studyResult)Description copied from interface:IPublixHTTP 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.
-
submitOrAppendResultData
public play.mvc.Result submitOrAppendResultData(play.mvc.Http.Request request, StudyResult studyResult, Component component, boolean append) throws PublixExceptionDescription copied from interface:IPublixHTTP 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.- Specified by:
submitOrAppendResultDatain interfaceIPublix- Throws:
PublixException
-
uploadResultFile
public play.mvc.Result uploadResultFile(play.mvc.Http.Request request, StudyResult studyResult, Component component, java.lang.String filename) throws PublixExceptionDescription copied from interface:IPublixHTTP type: POST request Uploads a result file- Specified by:
uploadResultFilein interfaceIPublix- Throws:
PublixException
-
downloadResultFile
public play.mvc.Result downloadResultFile(play.mvc.Http.Request request, StudyResult studyResult, java.lang.String filename, java.lang.String componentId) throws PublixExceptionDescription copied from interface:IPublixHTTP 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.- Specified by:
downloadResultFilein interfaceIPublix- Throws:
PublixException
-
abortStudy
public play.mvc.Result abortStudy(play.mvc.Http.Request request, StudyResult studyResult, java.lang.String message) throws PublixExceptionDescription copied from interface:IPublixHTTP type: GET request Aborts the study run (StudyResult state will be ABORTED). Optionally a message can be given describing the reasons for the abortion.- Specified by:
abortStudyin interfaceIPublix- Throws:
PublixException
-
finishStudy
public play.mvc.Result finishStudy(play.mvc.Http.Request request, StudyResult studyResult, java.lang.Boolean successful, java.lang.String message) throws PublixExceptionDescription copied from interface:IPublixHTTP 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.- Specified by:
finishStudyin interfaceIPublix- Throws:
PublixException
-
log
public play.mvc.Result log(play.mvc.Http.Request request, StudyResult studyResult, Component component) throws PublixExceptionDescription copied from interface:IPublixHTTP type: POST request With this method the client side can log into the server's log.- Specified by:
login interfaceIPublix- Throws:
PublixException
-
-