@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 loggedInUser,
Study study)
Persists the given Study.
|
Study |
createAndPersistStudy(User loggedInUser,
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 logged-in user.
|
void |
removeStudyInclAssets(Study study,
User loggedInUser)
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 |
updateStudy(Study study,
StudyProperties studyProperties,
User loggedInUser)
Update Study with given properties and persist.
|
void |
updateStudy(Study study,
Study updatedStudy,
User loggedInUser)
Update properties of study with properties of updatedStudy.
|
void |
updateStudyWithoutDirName(Study study,
Study updatedStudy,
User loggedInUser)
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 loggedInUser, StudyProperties studyProperties)
public Study createAndPersistStudy(User loggedInUser, Study study)
public void updateStudy(Study study, Study updatedStudy, User loggedInUser)
public void updateStudyWithoutDirName(Study study, Study updatedStudy, User loggedInUser)
public void updateStudy(Study study, StudyProperties studyProperties, User loggedInUser)
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 loggedInUser) throws java.io.IOException
java.io.IOException
public Study getStudyFromIdOrUuid(java.lang.String id) throws NotFoundException, ForbiddenException
NotFoundException
ForbiddenException