@Singleton
public class StudyService
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addAllUserMembers(Study study)
Adds all users as members to the given study.
|
StudyProperties |
bindToProperties(Study study)
Fills a new StudyProperties with values from the given Study.
|
void |
bindToStudyWithoutDirName(Study study,
StudyProperties studyProperties)
Update properties of study with properties of updatedStudy (excluding study's dir name).
|
void |
changeComponentPosition(java.lang.String newPosition,
Study study,
Component component)
Changes the position of the given component within the given study to the new position given in newPosition.
|
void |
changeUserMember(Study study,
User userToChange,
boolean isMember)
Changes the member user in the study.
|
Study |
clone(Study study)
Clones the given Study.
|
Study |
createAndPersistStudy(User signedinUser,
Study study)
Persists the given Study.
|
Study |
createAndPersistStudy(User signedinUser,
StudyProperties studyProperties)
Create and persist a Study with given properties.
|
Study |
getStudyFromIdOrUuid(java.lang.String id) |
void |
removeAllUserMembers(Study study)
Removes all member users from the given study except the signed-in user.
|
void |
removeStudyInclAssets(Study study,
User signedinUser)
Removes the given study, its components, component results, study results, group results and batches and persists
the changes to the database.
|
void |
renameStudyAssetsDir(Study study,
java.lang.String newDirName,
boolean dirRename)
Renames the directory in the file system and persists the study's property.
|
void |
updateDescription(Study study,
java.lang.String description,
User signedinUser)
Update Study's description and store new description hash in the study log
|
void |
updateStudy(Study study,
StudyProperties studyProperties,
User signedinUser)
Update Study with given properties and persist.
|
void |
updateStudy(Study study,
Study updatedStudy,
User signedinUser)
Update properties of study with properties of updatedStudy.
|
void |
updateStudyWithoutDirName(Study study,
Study updatedStudy,
User signedinUser)
Update properties of study with properties of updatedStudy but not Study's field dirName.
|
void |
validate(Study study)
Validates the study by converting it to StudyProperties and uses its validate method.
|
public Study clone(Study study) throws java.io.IOException
java.io.IOException
public void changeUserMember(Study study, User userToChange, boolean isMember) throws ForbiddenException
ForbiddenException
public void addAllUserMembers(Study study)
public void removeAllUserMembers(Study study)
public void changeComponentPosition(java.lang.String newPosition, Study study, Component component) throws BadRequestException
BadRequestException
public Study createAndPersistStudy(User signedinUser, StudyProperties studyProperties)
public Study createAndPersistStudy(User signedinUser, Study study)
public void updateStudy(Study study, Study updatedStudy, User signedinUser)
public void updateStudyWithoutDirName(Study study, Study updatedStudy, User signedinUser)
public void updateStudy(Study study, StudyProperties studyProperties, User signedinUser)
public void updateDescription(Study study, java.lang.String description, User signedinUser)
public void bindToStudyWithoutDirName(Study study, StudyProperties studyProperties)
public void renameStudyAssetsDir(Study study, java.lang.String newDirName, boolean dirRename) throws java.io.IOException
java.io.IOException
public StudyProperties bindToProperties(Study study)
public void validate(Study study) throws javax.validation.ValidationException
javax.validation.ValidationException
public void removeStudyInclAssets(Study study, User signedinUser) throws java.io.IOException
java.io.IOException
public Study getStudyFromIdOrUuid(java.lang.String id) throws NotFoundException, ForbiddenException
NotFoundException
ForbiddenException